/* Booth: a dark, quiet studio so the strips are the brightest thing on screen. */
:root {
  --bg: #141217;
  --surface: #1e1b22;
  --line: #2e2a35;
  --text: #efeaf2;
  --muted: #a49cae;
  --accent: #a9c4e8;
  --accent-ink: #141217;
  --radius: 14px;
  --panel-w: 360px;
  color-scheme: dark;
  font-family: "DM Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
button, input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.booth { display: grid; grid-template-columns: minmax(0, 1fr) var(--panel-w); height: 100dvh; }

/* Stage */
.stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px; min-width: 0; min-height: 0; }
.stage__view { position: relative; width: 100%; max-width: 960px; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; }
.stage__video { width: 100%; max-height: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); background: #000; transform: scaleX(-1); }
.stage__result { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.stage__result canvas { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.stage__count { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(80px, 14vw, 180px); font-weight: 600; color: #fff; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5); pointer-events: none; opacity: 0; }
.stage__count.is-on { animation: pop 0.9s ease-out; }
.stage__flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; border-radius: var(--radius); }
.stage__flash.is-on { animation: flash 0.45s ease-out; }
.stage__msg { position: absolute; left: 24px; right: 24px; bottom: 24px; margin: 0; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; text-align: center; }
.stage__dots { display: flex; gap: 8px; min-height: 10px; }
.stage__dots span { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--muted); }
.stage__dots span.is-taken { background: var(--accent); border-color: var(--accent); }
.stage__actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.stage__upload { position: relative; color: var(--muted); font-size: 14px; text-decoration: underline; cursor: pointer; }

@keyframes pop { 0% { opacity: 0; transform: scale(1.3); } 20% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(0.9); } }
@keyframes flash { 0% { opacity: 0.85; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .stage__count.is-on { animation: none; opacity: 1; }
  .stage__flash.is-on { animation: none; }
}

.btn { padding: 12px 22px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn:focus-visible, .chip:focus-visible, .card:focus-visible, .panel input:focus-visible, .panel__tabs button:focus-visible, .stage__upload:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Panel */
.panel { background: var(--surface); border-left: 1px solid var(--line); overflow-y: auto; padding: 8px 20px 20px; }
.panel__tabs { display: none; }
.panel__sec { padding: 16px 0; border-bottom: 1px solid var(--line); }
.panel__sec:last-child { border-bottom: 0; }
.panel h2 { margin: 0 0 12px; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; background: transparent; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; font-size: 13px; }
.card canvas { width: 100%; height: 110px; object-fit: contain; }
.card[aria-pressed="true"], .chip[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.field input { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 16px; }

/* Phones: camera on top, panel as tabs below */
@media (max-width: 820px) {
  .booth { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 100dvh; }
  .stage { padding: 16px; }
  .stage__view { flex: none; }
  .stage__result { position: static; }
  .stage__result canvas { max-height: 70vh; }
  .panel { border-left: 0; border-top: 1px solid var(--line); padding: 0 16px 24px; overflow: visible; }
  .panel__tabs { display: flex; position: sticky; top: 0; z-index: 1; gap: 4px; padding: 12px 0; background: var(--surface); }
  .panel__tabs button { flex: 1; padding: 10px 6px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; }
  .panel__tabs button[aria-selected="true"] { background: var(--bg); color: var(--text); }
  .panel__sec { display: none; border-bottom: 0; padding-top: 4px; }
  .panel__sec.is-active { display: block; }
}
