:root {
  --bg: #0c0d0f;
  --surface: #17181b;
  --surface-hi: #1d1f23;
  --text: #f4f5f7;
  --muted: #c5c8ce;
  --plex: #ebaf00;
  --hair: rgba(255, 255, 255, 0.14);
  --pad: 24px;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: #0c0d0f;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 20px;
  line-height: 1.35;
  padding: var(--pad);
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

h1 { font-size: 30px; font-weight: 600; margin: 0; }

h2 { font-size: 24px; font-weight: 600; margin: 0 0 12px; }

section {
  background: var(--surface);
  border-radius: 18px;
  padding: 20px;
  margin: 0 0 16px;
}

a { color: inherit; }

.lede, .help, .summary, .label, .banner { margin: 0 0 12px; }

.banner {
  background: #2a2412;
  color: var(--plex);
  border-radius: 14px;
  padding: 16px 18px;
}

.summary { white-space: pre-wrap; overflow-wrap: anywhere; }

.choice {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn {
  min-height: 72px;
  min-width: 72px;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  background: var(--surface-hi);
  box-shadow: inset 0 0 0 1px var(--hair);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.btn:active { transform: scale(0.97); }

.btn:focus-visible { outline: 3px solid var(--plex); outline-offset: 3px; }

.btn:disabled { opacity: 0.55; }

.btn[aria-pressed="true"] {
  background: var(--plex);
  color: #1a1400;
  box-shadow: none;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 16px;
  margin-bottom: 8px;
}

.tile {
  min-height: 200px;
  min-width: 0;
  border-radius: 18px;
  background: var(--surface-hi);
  box-shadow: inset 0 0 0 1px var(--hair);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 16px;
  font-size: 22px;
  font-weight: 600;
  text-decoration: none;
  touch-action: manipulation;
}

.tile:active { transform: scale(0.98); }

@media (min-width: 700px) {
  .tile { aspect-ratio: 1; }
}

.row { margin: 0 0 18px; }

.note {
  width: 100%;
  min-height: 72px;
  margin: 0 0 12px;
  padding: 12px 16px;
  border: 0;
  border-radius: 14px;
  background: #101114;
  box-shadow: inset 0 0 0 1px var(--hair);
  color: var(--text);
  font: inherit;
  font-size: 20px;
}

.state { color: var(--plex); font-weight: 600; }

.code {
  font-size: clamp(40px, 8vw, 64px);
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 0 0 12px;
  overflow-wrap: anywhere;
}

.player-block { margin: 0 0 12px; }

.stage { min-width: 0; }

video,
.embed {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(70vh, 640px);
  background: #000;
  border-radius: 14px;
  margin: 0 0 12px;
  object-fit: contain;
}

.embed { overflow: hidden; }

.embed[hidden] { display: none !important; }

.embed iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Stacked under a front split-screen width. Side by side on the rear landscape width and the front full width. */
@media (min-width: 1080px) {
  .row {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .row .label { flex: 1.4; min-width: 0; margin: 0; }

  .row .note { flex: 1; min-width: 0; margin: 0; }

  .row .choice { flex: 0 0 auto; }

  .player-block {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(240px, 0.7fr);
    gap: 16px;
    align-items: start;
  }

  .player-block .choice {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 839px) {
  .choice .btn { flex: 1 1 160px; }

  body { padding: 16px; }
}

.muted { color: var(--muted); }
