/* LOUNGE-1: the lodge prototype. The engine draws the canvas, and this
   overlay sits over it. */

:root {
  --ink: #fff7ec;
  --ink-soft: rgb(255 247 236 / 72%);
  --glass: rgb(24 14 8 / 58%);
  --glass-line: rgb(255 226 190 / 22%);
  --cta: #ff7a2f;
  --cta-ink: #1c0d04;
  --cta-glow: rgb(255 122 47 / 45%);
  --chosen: #4fd1a5;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #120c08;
  color: var(--ink);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}

.overlay { position: fixed; inset: 0; pointer-events: none; }
.overlay[hidden] { display: none; }
.overlay > * { pointer-events: auto; }

.bar {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 16px;
  right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.bar > * { pointer-events: auto; }

.eyebrow {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.24em;
  font-weight: 700;
  color: var(--ink-soft);
  text-shadow: 0 1px 3px rgb(0 0 0 / 60%);
}
.bar .eyebrow {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink);
  backdrop-filter: blur(8px);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--glass);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  backdrop-filter: blur(8px);
  cursor: pointer;
}
.chip.icon { width: 44px; padding: 0; justify-content: center; }
.chip svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chip svg .speaker { fill: currentColor; }
.chip svg .cross { display: none; }
.chip[aria-pressed="true"] svg .waves { display: none; }
.chip[aria-pressed="true"] svg .cross { display: inline; }

.arrow {
  position: absolute;
  top: 50%;
  width: 56px;
  height: 56px;
  margin-top: -28px;
  border: 1px solid var(--glass-line);
  border-radius: 50%;
  background: var(--glass);
  color: var(--ink);
  backdrop-filter: blur(8px);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.arrow svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.arrow.previous { left: max(16px, env(safe-area-inset-left)); }
.arrow.next { right: max(16px, env(safe-area-inset-right)); }
.arrow:active { transform: scale(0.94); }

.card {
  position: absolute;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  width: min(620px, calc(100% - 32px));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 18px;
  padding: 12px 14px 12px 20px;
  border: 1px solid var(--glass-line);
  border-radius: 18px;
  background: var(--glass);
  backdrop-filter: blur(10px);
  transition: opacity 180ms ease;
}
.card.moving { opacity: 0.55; }
.who { min-width: 0; }
.act { display: grid; justify-items: center; gap: 8px; }

.spot { margin: 0; font-size: 11px; letter-spacing: 0.18em; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; }
.name { margin: 0; font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: 0.01em; }
.kit { margin: 0; color: var(--ink-soft); font-size: 15px; }

.dots { display: flex; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.dots li { width: 8px; height: 8px; border-radius: 50%; background: rgb(255 247 236 / 32%); }
.dots li.here { background: var(--ink); }
.dots li.chosen { box-shadow: 0 0 0 2px var(--chosen); }

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  min-width: 200px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--cta);
  color: var(--cta-ink);
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 6px 22px var(--cta-glow);
  cursor: pointer;
}
.cta[aria-disabled="true"] { background: var(--chosen); box-shadow: none; cursor: default; }
.note { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--ink-soft); }
.note:empty { display: none; }

.sound-hint {
  position: absolute;
  top: calc(max(12px, env(safe-area-inset-top)) + 52px);
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: 13px;
  color: var(--ink);
  text-shadow: 0 1px 3px rgb(0 0 0 / 70%);
  pointer-events: none;
}
.sound-hint span {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(8px);
}
.sound-hint[hidden] { display: none; }

.loading {
  position: fixed;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 10px;
  text-align: center;
  background: radial-gradient(circle at 50% 60%, #3a2210, #120c08 70%);
}
.loading[hidden] { display: none; }
.meter { width: 220px; height: 4px; margin: 0 auto; border-radius: 2px; background: rgb(255 247 236 / 18%); overflow: hidden; }
.meter span { display: block; width: 0; height: 100%; background: var(--cta); transition: width 160ms ease; }

@media (max-width: 600px) {
  .card { grid-template-columns: 1fr; text-align: center; padding: 10px 14px 12px; }
  .name { font-size: 26px; }
  .cta { min-width: 0; width: 100%; }
  .arrow { width: 48px; height: 48px; margin-top: -24px; }
  .arrow.previous, .arrow.next { top: 40%; }
}

@media (prefers-reduced-motion: reduce) {
  .card, .meter span { transition: none; }
}

/* LOUNGE-3: the Back arrow points back in right-to-left languages too. */
:root[dir="rtl"] #back > span[aria-hidden="true"] { display: inline-block; transform: scaleX(-1); }
