:root {
  --bg: #0b0b0b;
  --panel: #0b0b0b;
  --line: rgba(233, 228, 214, 0.14);
  --text: #e9e4d6;
  --muted: #a49e91;
  --faint: #6f6a60;
  --sand: #d5cbb3;
  --sand-deep: #a89d84;
  --accent: #e0612a;
  --accent-soft: rgba(224, 97, 42, 0.14);
  --room-bg: #1b2030;
  --serif: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", serif;
  --sans: "Lato", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  overflow: hidden;
}

.screen {
  display: grid;
  grid-template-columns: minmax(360px, 30%) 1fr;
  height: 100vh;
}

/* ---------- left panel ----------
   The same system as the AlpineX slides: near-black ground, cream serif
   titles, thin sans text, sand hairlines, orange only in the mark. */

.panel {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1.6vh;
  padding: 2.8vh 2.8vw 2.6vh;
  background: var(--panel);
  border-right: 1px solid var(--line);
  min-height: 0;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 0.4vh;
  color: var(--text);
}

.brand-word {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(13px, 1.05vw, 18px);
  letter-spacing: 0.34em;
  line-height: 1;
}

.brand-x {
  width: clamp(11px, 0.85vw, 15px);
  height: auto;
  margin-left: -0.1em;
  display: block;
}

.eyebrow {
  margin: 0 0 1vh;
  font-family: var(--sans);
  font-size: clamp(11px, 0.85vw, 14px);
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sand-deep);
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(24px, 2.2vw, 44px);
  font-weight: 500;
  line-height: 1.02;
  overflow-wrap: normal;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--text);
}

.qr-card {
  background: #e9e6dd;
  border-radius: 3px;
  padding: 2.2vh 2.2vh 1.4vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1vh;
  border: 1px solid rgba(233, 228, 214, 0.25);
}

.qr-card img {
  width: 100%;
  max-width: min(340px, 27vh);
  aspect-ratio: 1;
  image-rendering: pixelated;
  display: block;
}

.qr-hint {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(11px, 0.8vw, 14px);
  font-weight: 400;
  letter-spacing: 0.02em;
  color: #6b675d;
  word-break: break-all;
  text-align: center;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.steps li {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 1.1vh 0;
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(14px, 1.1vw, 20px);
  color: var(--muted);
}

.steps b { color: var(--text); font-weight: 400; }

.num {
  flex: none;
  min-width: 2.2em;
  font-family: var(--serif);
  font-size: clamp(17px, 1.35vw, 25px);
  font-weight: 500;
  font-variant-numeric: lining-nums;
  color: var(--sand);
  line-height: 1;
}

/* ---------- the unlock meter ----------
   How many more people until the next thing happens, and a shelf of the
   ten stages: the ones already unlocked show their emoji, the rest a "?". */

.unlock {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.7vh;
  padding: 1.2vh 0 0;
  border-top: 1px solid var(--line);
}

.unlock-head, .unlock-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.unlock-label {
  font-family: var(--sans);
  font-size: clamp(10px, 0.8vw, 13px);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sand-deep);
}

.unlock-count {
  font-family: var(--serif);
  font-size: clamp(16px, 1.4vw, 26px);
  font-weight: 500;
  font-variant-numeric: lining-nums;
  color: var(--text);
}

.unlock-bar {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: rgba(233, 228, 214, 0.1);
  overflow: hidden;
}

.unlock-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sand-deep), var(--sand) 60%, #fff3d6);
  box-shadow: 0 0 14px rgba(213, 203, 179, 0.55);
  transition: width 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.unlock-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: translateX(-100%);
  animation: sweep 2.6s ease-in-out infinite;
}

@keyframes sweep {
  0%, 30% { transform: translateX(-100%); }
  70%, 100% { transform: translateX(100%); }
}

.unlock.full .unlock-fill { animation: fill-pulse 1.4s ease-in-out infinite; }

@keyframes fill-pulse {
  0%, 100% { box-shadow: 0 0 10px rgba(213, 203, 179, 0.4); }
  50% { box-shadow: 0 0 22px rgba(255, 243, 214, 0.9); }
}

.unlock-hint {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(11px, 0.9vw, 15px);
  color: var(--muted);
}

.unlock-to {
  font-family: var(--serif);
  font-size: clamp(13px, 1.05vw, 18px);
  font-variant-numeric: lining-nums;
  color: var(--sand);
}

.unlock-shelf {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 5px;
  margin-top: 0.4vh;
}

.slot {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: rgba(233, 228, 214, 0.04);
  font-size: clamp(12px, 1.05vw, 19px);
  line-height: 1;
  color: var(--faint);
  font-family: var(--serif);
}

.slot.done {
  background: rgba(213, 203, 179, 0.14);
  border-color: rgba(213, 203, 179, 0.35);
  color: var(--text);
}

.slot.next {
  border-color: var(--sand);
  color: var(--sand);
  animation: slot-pulse 1.6s ease-in-out infinite;
}

@keyframes slot-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(213, 203, 179, 0); }
  50% { box-shadow: 0 0 0 4px rgba(213, 203, 179, 0.22); }
}

.slot.just {
  animation: slot-pop 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slot-pop {
  0% { transform: scale(0.6); background: #fff3d6; }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.counter-value.bump { animation: bump 700ms cubic-bezier(0.22, 1, 0.36, 1); }

@keyframes bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.22); color: #fff3d6; }
  100% { transform: scale(1); }
}

.counter {
  margin-top: 0;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 2.4vh;
  border-top: 1px solid var(--line);
}

.counter-value {
  font-family: var(--serif);
  font-size: clamp(44px, 4.4vw, 84px);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.01em;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--text);
}

.counter-word {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(12px, 1vw, 18px);
  letter-spacing: 0.04em;
  color: var(--muted);
}

.status {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
}

.status.live::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--sand);
  box-shadow: 0 0 0 3px rgba(213, 203, 179, 0.18);
  animation: live-pulse 2.2s ease-in-out infinite;
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(213, 203, 179, 0.18); }
  50% { box-shadow: 0 0 0 6px rgba(213, 203, 179, 0.05); }
}

/* ---------- room stage ---------- */

.stage {
  position: relative;
  background: #2b6fc4;
  overflow: hidden;
}

/* The panel casts a little shadow onto the scene, so the two read as one surface. */
.stage::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 48px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.28), transparent);
}

#room { width: 100%; height: 100%; display: block; }

.banner {
  position: absolute;
  top: 4vh;
  left: 50%;
  transform: translate(-50%, -20px);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 22px 12px 12px;
  border-radius: 4px;
  background: rgba(11, 11, 11, 0.92);
  border: 1px solid rgba(233, 228, 214, 0.22);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 320ms ease, transform 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

.banner.show { opacity: 1; transform: translate(-50%, 0); }

.banner-face {
  width: 64px;
  height: 64px;
  border-radius: 3px;
  background: #1a1a1a;
  image-rendering: pixelated;
}

.banner-text { display: flex; flex-direction: column; gap: 2px; }

.banner-name {
  font-family: var(--serif);
  font-size: clamp(22px, 1.9vw, 36px);
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text);
}

.banner-sub {
  font-size: clamp(11px, 0.9vw, 15px);
  color: var(--muted);
}

.toast {
  position: absolute;
  bottom: 4vh;
  left: 50%;
  transform: translate(-50%, 12px);
  padding: 12px 26px;
  border-radius: 3px;
  background: var(--sand);
  color: #0b0b0b;
  font-family: var(--serif);
  font-size: clamp(16px, 1.4vw, 26px);
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity 320ms ease, transform 320ms ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* On a phone the room comes first and fills the top of the screen; below it a
   button to join replaces the QR code, since you cannot scan your own phone. */
.join-link, .steps li.phone-only { display: none; }

@media (max-width: 900px) {
  html, body { overflow: auto; height: auto; }
  .screen { grid-template-columns: 1fr; grid-template-rows: 58vh auto; height: auto; min-height: 100vh; }
  .stage { order: -1; height: 58vh; }
  .stage::before { display: none; }
  .panel { border-right: 0; border-top: 1px solid var(--line); padding: 3vh 6vw 4vh; gap: 2.2vh; overflow: visible; }
  .brand { display: none; }
  .qr-card, .steps li.wide-only { display: none; }
  .steps li.phone-only { display: flex; }
  .join-link {
    display: block;
    padding: 16px 20px;
    border-radius: 4px;
    background: var(--sand);
    color: #0b0b0b;
    text-align: center;
    text-decoration: none;
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 0.02em;
  }
  h1 { font-size: 30px; }
  .steps li { font-size: 16px; padding: 12px 0; }
  .unlock { margin-top: 0; }
  .counter { margin-top: 0; }
  .counter-value { font-size: 64px; }
  .banner { top: 2vh; padding: 8px 14px 8px 8px; gap: 10px; }
  .banner-face { width: 44px; height: 44px; }
  .pop-card { padding: 16px 22px 18px; }
  .pop-rays { width: 80vw; height: 80vw; }
  .dev { display: none; }
}

/* ---------- rehearsal panel ----------
   Hidden at the event. Shown with ?dev=1 in the address, or with the D key. */

.dev {
  position: absolute;
  z-index: 2;
  left: 20px;
  bottom: 20px;
  width: 246px;
  padding: 12px 14px 10px;
  border-radius: 14px;
  background: rgba(16, 18, 25, 0.92);
  border: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(6px);
}

.dev-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.dev-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.dev-close:hover { color: var(--text); }

.dev-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dev-label {
  margin: 12px 0 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #59617a;
}

.dev button.chip {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #1d212c;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.dev button.chip:hover { background: #262b38; border-color: #39415a; }
.dev button.chip.primary { background: var(--accent); border-color: transparent; font-weight: 600; }
.dev button.chip.primary:hover { filter: brightness(1.1); }

.dev-note { margin: 10px 0 0; font-size: 10px; color: #4a5166; }

/* ---------- the unlock reveal ----------
   A flash, then a card with rays behind it, in the middle of the room. */

.flash {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: #fff3d6;
  animation: flash 900ms ease-out forwards;
}

@keyframes flash {
  0% { opacity: 0.85; }
  100% { opacity: 0; }
}

.pop[hidden], .flash[hidden] { display: none; }

.pop {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 44%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: grid;
  place-items: center;
}

.pop-rays {
  position: absolute;
  width: 62vmin;
  height: 62vmin;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 243, 214, 0.34) 0deg 9deg, transparent 9deg 24deg);
  -webkit-mask: radial-gradient(circle, rgba(0, 0, 0, 1) 20%, transparent 70%);
  mask: radial-gradient(circle, rgba(0, 0, 0, 1) 20%, transparent 70%);
  animation: spin 14s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.pop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 26px 48px 30px;
  border-radius: 6px;
  background: rgba(11, 11, 11, 0.9);
  border: 1px solid rgba(233, 228, 214, 0.3);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 60px rgba(213, 203, 179, 0.18);
  text-align: center;
}

.pop.show .pop-card { animation: pop-in 700ms cubic-bezier(0.22, 1.4, 0.36, 1) both; }
.pop.hide .pop-card { animation: pop-out 420ms ease-in both; }
.pop.hide .pop-rays { animation: spin 14s linear infinite, fade-out 420ms ease-in both; }

@keyframes pop-in {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes pop-out {
  to { transform: scale(0.92) translateY(12px); opacity: 0; }
}
@keyframes fade-out { to { opacity: 0; } }

.pop-kicker {
  font-family: var(--sans);
  font-size: clamp(11px, 0.9vw, 15px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sand-deep);
}

.pop-emoji {
  font-size: clamp(64px, 7vw, 120px);
  line-height: 1.1;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.5));
  animation: emoji-bounce 900ms cubic-bezier(0.22, 1.4, 0.36, 1) 150ms both;
}

@keyframes emoji-bounce {
  0% { transform: scale(0.3) rotate(-12deg); opacity: 0; }
  60% { transform: scale(1.15) rotate(4deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}

.pop-title {
  font-family: var(--serif);
  font-size: clamp(34px, 3.4vw, 64px);
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
  color: var(--text);
}

.pop-sub {
  margin-top: 6px;
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(13px, 1.1vw, 20px);
  color: var(--muted);
}
