@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700;800&family=DM+Mono:wght@400;500&family=Montserrat:wght@500;600;700;800&display=swap');

:root {
  --studio: #16080f;
  --wine: #4e1224;
  --red: #be3154;
  --blue: #2d6ed6;
  --green: #11bb58;
  --yellow: #f4bf32;
  --white: #fff;
  --panel: #25101c;
  --btn-h: 44px;
  --btn-fs: 10px;
  --side-w: 100%;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--white);
  font-family: Montserrat, Arial, sans-serif;
  background: #11070d;
  overflow-x: hidden;
}

.screen {
  position: relative;
  min-height: 100svh;
  padding: 12px 8px 16px;
  background: radial-gradient(ellipse at 50% 22%, #78304d 0, #40162a 32%, #16080f 76%);
}

.screen:before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background:
    repeating-linear-gradient(90deg, #fff0 0 35px, #000 36px 38px),
    linear-gradient(90deg, #5a182c, #190a12 17%, #6b203c 35%, #1a0711 63%, #651d37 83%, #1a0711);
}

.topbar,
.broadcast-stage,
.control-deck { position: relative; z-index: 2; }

.topbar {
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 8px;
  padding: 10px 12px;
  background: #160a13ee;
  border: 1px solid #d6819b66;
  border-radius: 8px;
}

.brand {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
  text-shadow: 0 3px 8px #0008;
}

.brand-kicker,
.brand-sub {
  font: 500 10px 'DM Mono';
  letter-spacing: .12em;
}

.brand-kicker { color: #f3c7d0; }
.brand-sub { color: var(--yellow); }
.brand strong {
  font: 800 24px/1 'Barlow Condensed';
  letter-spacing: .08em;
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.broadcast-stage {
  background: linear-gradient(180deg, #371326d9, #170810f0);
  border: 1px solid #d6819b55;
  border-radius: 12px 12px 0 0;
  padding: 12px 8px;
  box-shadow: 0 18px 55px #0009, inset 0 1px #fff2;
}

.stage-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(35px);
  opacity: .32;
  pointer-events: none;
}

.glow-one { width: 180px; height: 140px; background: #cf2962; top: 24px; left: 8%; }
.glow-two { width: 140px; height: 120px; background: #2b69e1; right: 8%; bottom: 48px; }

.stage-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: center;
}

.rosco-slot { width: 100%; }
.rosco-board {
  width: min(96vw, 100%);
  aspect-ratio: 1;
  position: relative;
  margin: 0 auto;
  container-type: size;
}

.rosco-board:before {
  content: '';
  position: absolute;
  inset: 3%;
  border-radius: 50%;
  border: 1px solid #f4cbd54c;
  box-shadow: 0 0 0 12px #18081255, 0 0 40px #d22d6344;
}

.rosco { position: absolute; inset: 0; z-index: 2; }

.letter {
  appearance: none;
  position: absolute;
  transform: translate(-50%, -50%);
  width: 7.2%;
  height: 7.2%;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #fff;
  display: grid;
  place-items: center;
  color: #fff;
  font: 700 3.1cqw 'Montserrat';
  cursor: pointer;
  transition: transform .18s, filter .18s, box-shadow .18s;
  box-shadow: 0 3px 8px #0009;
  text-shadow: 0 1px 2px #0007;
}

.letter:hover { transform: translate(-50%, -50%) scale(1.08); filter: brightness(1.15); }
.letter.pending { background: linear-gradient(#5590ee, #2258bc); }
.letter.active {
  background: var(--yellow) !important;
  color: #36200a;
  border-color: #fff1af;
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow: 0 0 0 4px #f4bf324d, 0 5px 12px #0009;
}
.letter.correct { background: linear-gradient(#33e96e, #069c46) !important; }
.letter.wrong { background: linear-gradient(#fb6a7b, #a51f42) !important; }
.letter.passed { background: linear-gradient(#ffd869, #ce841b) !important; color: #3a200a; }

.show-center {
  position: absolute;
  inset: 27%;
  z-index: 1;
  overflow: hidden;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  background: radial-gradient(circle at 45% 35%, #6a2a49e6, #260e20f2 67%);
  border: 2px solid #f1c2cd88;
  box-shadow: inset 0 0 40px #0009, 0 0 34px #0008;
  container-type: inline-size;
}

.center-ribbon {
  font: 800 clamp(12px, 9cqw, 42px) 'Barlow Condensed';
  letter-spacing: .1em;
  background: #d73761;
  color: white;
  padding: 4px clamp(8px, 3cqw, 16px);
  transform: skew(-8deg);
  box-shadow: 4px 4px #500e27;
  white-space: nowrap;
}

.center-name {
  font: 800 clamp(28px, 24cqw, 120px) / .8 'Barlow Condensed';
  letter-spacing: .04em;
  color: #fff;
  text-shadow: 0 4px #ab3152, 0 8px 12px #0008;
}

.center-line {
  width: 45%;
  border-top: 2px solid var(--yellow);
  margin: 10px auto 6px;
}

.center-caption {
  font: 500 clamp(8px, 5cqw, 18px) 'DM Mono';
  letter-spacing: .16em;
  color: #ffdae0;
  white-space: nowrap;
}

.side-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.side-menu .setup-box { grid-column: 1 / -1; }

.meta-box {
  min-width: 0;
  background: #160a13f2;
  border: 1px solid #f1c5d166;
  border-radius: 5px;
  padding: 10px 8px;
  text-align: center;
  box-shadow: 0 5px 18px #0009;
}

.meta-box > span {
  display: block;
  color: #eeb6c3;
  font: 500 9px 'DM Mono';
  letter-spacing: .15em;
}

.meta-box strong {
  display: block;
  color: var(--yellow);
  font: 800 28px 'Barlow Condensed';
  letter-spacing: .05em;
}

.meta-box small {
  display: block;
  color: #efdce1;
  font: 10px 'DM Mono';
}

.timer-box { border-color: #f4bf3277; box-shadow: 0 0 18px #f4bf3222; }

.timer-setup {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.timer-setup label {
  display: grid;
  gap: 4px;
  color: #e8cdd4;
  font: 500 9px 'DM Mono';
  letter-spacing: .08em;
}

.timer-setup input {
  width: 100%;
  min-width: 0;
  background: #301322;
  border: 1px solid #ba607c;
  color: #fff;
  border-radius: 3px;
  padding: 8px 4px;
  text-align: center;
  font: 500 12px 'DM Mono';
}

.timer-setup input:disabled { opacity: .45; }

.timer-setup button,
.top-reset,
.actions button {
  border: 0;
  border-radius: 5px;
  min-width: 0;
  min-height: var(--btn-h);
  padding: 8px;
  font: 800 var(--btn-fs) 'DM Mono';
  letter-spacing: .04em;
  cursor: pointer;
}

.timer-setup button {
  grid-column: 1 / -1;
  background: var(--yellow);
  color: #36200a;
}

.control-deck {
  background: #fff;
  border-radius: 0 0 12px 12px;
  padding: 10px 8px;
  color: #2c1420;
  box-shadow: 0 16px 40px #0008;
}

.actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.actions button { box-shadow: 0 4px 0 #0004; }
.pass-button { background: linear-gradient(#ffd84a, #f0b400); color: #3a2208; border: 1px solid #ffe27a; text-shadow: 0 1px #fff6; }
.correct-button { background: linear-gradient(#2ee56a, #0a9a3e); color: #fff; border: 1px solid #7dffab; }
.wrong-button { background: linear-gradient(#ff5b73, #c3183d); color: #fff; border: 1px solid #ff9aab; }
.reset-button { background: linear-gradient(#4d8dff, #2157c9); color: #fff; border: 1px solid #9cc2ff; }
.timer-setup button { background: linear-gradient(#ffd84a, #f0b400); color: #3a2208; }

/* Tablet / small desktop: side panel + viewport-fit layout */
@media (min-width: 768px) {
  :root { --btn-h: 48px; --btn-fs: 12px; --side-w: 210px; }

  html, body { height: 100%; overflow: hidden; }

  .screen {
    height: 100svh;
    min-height: 100svh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    gap: 8px;
    padding: 12px 16px;
    overflow: hidden;
  }

  .topbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 8px 14px;
  }

  .brand strong { font-size: 28px; }
  .brand-kicker, .brand-sub { font-size: 11px; }

  .broadcast-stage {
    min-height: 0;
    height: 100%;
    overflow: hidden;
    padding: 12px 16px;
  }

  .stage-layout {
    height: 100%;
    min-height: 0;
    grid-template-columns: minmax(0, 1fr) var(--side-w);
    gap: 16px;
  }

  .rosco-slot {
    height: 100%;
    min-width: 0;
    min-height: 0;
    display: grid;
    place-items: center;
    container-type: size;
  }
  .rosco-board {
    width: min(100cqw, 100cqh);
    height: min(100cqw, 100cqh);
    max-width: none;
    margin: 0 auto;
  }

  .side-menu {
    grid-template-columns: 1fr;
    align-content: center;
    height: 100%;
    min-height: 0;
    overflow: auto;
  }

  .side-menu .setup-box { grid-column: auto; }

  .meta-box { padding: 12px 10px; }
  .meta-box > span { font-size: 10px; }
  .meta-box strong { font-size: 36px; }

  .control-deck { padding: 10px 16px; }
  .actions { max-width: 720px; margin: 0 auto; gap: 10px; }
}

@media (min-width: 1280px) {
  :root { --btn-h: 50px; --btn-fs: 13px; --side-w: 240px; }

  .screen { padding: 14px 20px; gap: 10px; }
  .brand strong { font-size: 32px; }
  .brand-kicker, .brand-sub { font-size: 12px; }
  .meta-box strong { font-size: 44px; }
  .meta-box > span { font-size: 11px; }
  .timer-setup input { font-size: 13px; padding: 10px 4px; }
}

@media (min-width: 1920px) {
  :root { --btn-h: 52px; --btn-fs: 14px; --side-w: 280px; }

  .screen { padding: 16px 24px; }
  .brand strong { font-size: 36px; }
  .meta-box { padding: 16px 12px; }
  .meta-box strong { font-size: 52px; }
  .center-name { font-size: clamp(36px, 24cqw, 140px); }
}

/* TV / zoomed-out giant CSS viewport */
@media (min-width: 2560px) {
  :root { --btn-h: max(96px, 9vh); --btn-fs: max(26px, 2.4vh); --side-w: 360px; }

  .screen { padding: 20px 32px; gap: 14px; }
  .topbar { padding: 14px 22px; }
  .brand strong { font-size: 48px; }
  .brand-kicker, .brand-sub { font-size: 16px; }
  .meta-box { padding: 20px 16px; }
  .meta-box > span { font-size: 14px; }
  .meta-box strong { font-size: 72px; }
  .meta-box small { font-size: 14px; }
  .timer-setup label { font-size: 13px; }
  .timer-setup input { font-size: 18px; padding: 12px 6px; }
  .center-ribbon { font-size: clamp(18px, 9cqw, 64px); }
  .center-name { font-size: clamp(48px, 24cqw, 180px); }
  .center-caption { font-size: clamp(12px, 5cqw, 28px); }
  .actions { max-width: 72vw; gap: 1.2vw; }
  .control-deck { padding: 1.2vh 2vw; }
}

@media (max-width: 767px) {
  .broadcast-stage,
  .stage-layout { display: contents; }
  .screen { display: flex; flex-direction: column; }
  .topbar { order: 1; }
  .rosco-slot { order: 2; }
  .control-deck {
    order: 3;
    border-radius: 12px;
    margin: 8px 0;
  }
  .side-menu { order: 4; }
  .stage-glow { display: none; }
}

@media (min-width: 3840px) {
  :root { --btn-h: max(140px, 11vh); --btn-fs: max(36px, 3vh); --side-w: 460px; }
  .actions { max-width: 78vw; gap: 1.4vw; }
  .control-deck { padding: 1.4vh 2vw; }

  .brand strong { font-size: 64px; }
  .brand-kicker, .brand-sub { font-size: 20px; }
  .meta-box strong { font-size: 96px; }
  .meta-box > span, .meta-box small, .timer-setup label { font-size: 18px; }
  .timer-setup input { font-size: 22px; padding: 16px 8px; }
}
