:root {
  --ink: #f3e6d3;
  --muted: #bfa88f;
  --accent: #d9a55a;
  --velvet: #5a0a0d;
  --bg: #0b0605;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  touch-action: none;
  user-select: none;
}

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

/* ---------- Intro / pause ---------- */
#intro {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(ellipse at center, rgba(20, 8, 6, 0.35) 0%, rgba(8, 3, 2, 0.88) 70%),
    linear-gradient(90deg, rgba(70, 6, 10, 0.55), transparent 30%, transparent 70%, rgba(70, 6, 10, 0.55));
  backdrop-filter: blur(3px);
  transition: opacity 0.6s ease;
  z-index: 10;
}
#intro.gone { opacity: 0; pointer-events: none; }

.card { max-width: 520px; text-align: center; }
.kicker {
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-size: 12px;
  color: var(--accent);
  margin: 0 0 8px;
}
h1 {
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-size: clamp(56px, 12vw, 104px);
  line-height: 1;
  margin: 0;
  text-shadow: 0 0 40px rgba(255, 150, 70, 0.35);
}
h1 em { font-style: italic; font-weight: 500; color: var(--accent); }
.sub {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  color: var(--muted);
  font-size: 18px;
  margin: 16px 0 28px;
  line-height: 1.5;
}
#enter {
  font: 600 14px Inter, sans-serif;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #1a0b06;
  background: linear-gradient(180deg, #f0c27a, #c98f42);
  border: 0;
  border-radius: 999px;
  padding: 16px 44px;
  cursor: pointer;
  box-shadow: 0 10px 40px rgba(217, 140, 60, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
}
#enter:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 50px rgba(217, 140, 60, 0.5); }
#enter:disabled { opacity: 0.5; cursor: wait; }

.keys {
  margin-top: 30px;
  display: grid;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}
.keys span { margin: 0 4px; }
kbd {
  display: inline-block;
  min-width: 22px;
  padding: 2px 6px;
  margin: 0 1px;
  border: 1px solid rgba(243, 230, 211, 0.25);
  border-bottom-width: 2px;
  border-radius: 5px;
  font: 500 11px Inter, sans-serif;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}
.touch-hint { display: none; color: var(--muted); font-size: 13px; margin-top: 24px; }
@media (hover: none) and (pointer: coarse) {
  .keys { display: none; }
  .touch-hint { display: block; }
}

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#crosshair {
  position: absolute;
  left: 50%; top: 50%;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: rgba(255, 236, 210, 0.85);
  box-shadow: 0 0 8px rgba(255, 200, 140, 0.8);
  transition: transform 0.2s ease;
}
#hud.aim #crosshair { transform: scale(2.2); background: var(--accent); }

#tip {
  position: absolute;
  left: 50%;
  bottom: 96px;
  transform: translateX(-50%);
  width: min(420px, calc(100vw - 32px));
  padding: 14px 18px;
  text-align: center;
  background: rgba(14, 7, 5, 0.72);
  border: 1px solid rgba(217, 165, 90, 0.25);
  border-radius: 14px;
  backdrop-filter: blur(8px);
}
#tip h3 { margin: 0 0 4px; font: italic 500 20px "Playfair Display", Georgia, serif; color: var(--accent); }
#tip p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink); opacity: 0.85; }
#tip .act:not(:empty) {
  display: inline-block;
  margin-top: 10px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #1a0b06;
  background: var(--accent);
  padding: 4px 10px;
  border-radius: 999px;
}

#spots {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  width: calc(100vw - 32px);
  pointer-events: auto;
}
#spots button {
  font: 500 12px Inter, sans-serif;
  color: var(--ink);
  background: rgba(14, 7, 5, 0.6);
  border: 1px solid rgba(243, 230, 211, 0.18);
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}
#spots button b { color: var(--accent); margin-right: 6px; font-weight: 600; }
#spots button:hover { border-color: var(--accent); }

/* ---------- Joystick mobile ---------- */
#joy {
  position: fixed;
  width: 120px; height: 120px;
  margin: -60px 0 0 -60px;
  border-radius: 50%;
  border: 1px solid rgba(243, 230, 211, 0.3);
  background: rgba(14, 7, 5, 0.3);
  pointer-events: none;
  z-index: 6;
}
#joy .knob {
  position: absolute;
  left: 50%; top: 50%;
  width: 48px; height: 48px;
  margin: -24px 0 0 -24px;
  border-radius: 50%;
  background: rgba(217, 165, 90, 0.7);
}
