:root {
  --bg: #030504;
  --void: #010202;
  --panel: rgba(7, 9, 7, 0.91);
  --panel-2: rgba(13, 15, 12, 0.94);
  --panel-3: rgba(20, 19, 15, 0.92);
  --line: rgba(180, 166, 126, 0.24);
  --line-dim: rgba(180, 166, 126, 0.1);
  --line-hot: rgba(242, 132, 37, 0.64);
  --text: #d9ddc7;
  --text-strong: #eef2d6;
  --muted: #8f9683;
  --dim: #596251;
  --green: #8de879;
  --green-dim: #315c35;
  --amber: #f3a43b;
  --amber-bright: #ffc35d;
  --orange: #c7671d;
  --red: #eb3e35;
  --cyan: #79aeb2;
  --field: rgba(2, 4, 3, 0.72);
  color-scheme: dark;
  font-family:
    Bahnschrift, "Segoe UI Condensed", "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-height: 100%;
  background: var(--void);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  overflow-x: hidden;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0.12) 18%, rgba(0, 0, 0, 0.08) 82%, rgba(0, 0, 0, 0.66) 100%),
    linear-gradient(180deg, rgba(2, 4, 4, 0.1), rgba(2, 3, 2, 0.26)),
    url("assets/ops-room-background.png") center top / cover fixed no-repeat,
    #030504;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
}

body::before {
  z-index: 0;
  background:
    radial-gradient(ellipse at 50% 18%, rgba(98, 137, 135, 0.13), transparent 42%),
    radial-gradient(ellipse at 50% 100%, rgba(0, 0, 0, 0.4), transparent 58%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.04), rgba(0, 0, 0, 0.36));
}

body::after {
  z-index: 9;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, rgba(255, 60, 40, 0.035), transparent 18%, transparent 82%, rgba(89, 180, 180, 0.035));
  mix-blend-mode: screen;
  opacity: 0.55;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.room-scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  display: none;
  pointer-events: none;
}

.case-board {
  position: absolute;
  left: 0;
  top: 72px;
  width: 174px;
  height: 375px;
  border: 1px solid rgba(196, 183, 146, 0.1);
  background:
    linear-gradient(90deg, transparent 42%, rgba(180, 38, 30, 0.75) 43% 44%, transparent 45%),
    linear-gradient(28deg, transparent 46%, rgba(180, 38, 30, 0.7) 47% 48%, transparent 49%),
    linear-gradient(143deg, transparent 45%, rgba(180, 38, 30, 0.68) 46% 47%, transparent 48%),
    linear-gradient(180deg, rgba(222, 211, 184, 0.11), rgba(0, 0, 0, 0.28));
  box-shadow: inset -35px 0 50px rgba(0, 0, 0, 0.78);
  opacity: 0.64;
}

.case-board span {
  position: absolute;
  width: 46px;
  height: 34px;
  border: 1px solid rgba(204, 195, 164, 0.16);
  background: rgba(181, 173, 149, 0.12);
  transform: rotate(var(--r, 0deg));
}

.case-board span:nth-child(1) { left: 20px; top: 42px; --r: -7deg; }
.case-board span:nth-child(2) { left: 89px; top: 78px; --r: 4deg; }
.case-board span:nth-child(3) { left: 30px; top: 176px; --r: 8deg; }
.case-board span:nth-child(4) { left: 104px; top: 235px; --r: -5deg; }

.left-console {
  position: absolute;
  left: 18px;
  top: 500px;
  width: 170px;
}

.crt-shell {
  position: relative;
  width: 165px;
  height: 120px;
  padding: 8px;
  border: 1px solid rgba(128, 174, 171, 0.18);
  background:
    linear-gradient(180deg, rgba(41, 58, 58, 0.9), rgba(4, 7, 7, 0.95)),
    #060807;
  box-shadow:
    inset 0 0 22px rgba(0, 0, 0, 0.9),
    0 16px 34px rgba(0, 0, 0, 0.65);
}

.crt-shell::before,
.crt-shell::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.crt-shell::before {
  inset: 9px;
  z-index: 2;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 4px),
    radial-gradient(ellipse at center, transparent 42%, rgba(0, 0, 0, 0.48));
  opacity: 0.75;
}

.crt-shell::after {
  left: 28px;
  bottom: -9px;
  width: 78px;
  height: 5px;
  border-radius: 999px;
  background: rgba(48, 88, 54, 0.55);
  box-shadow: 28px 0 0 rgba(95, 121, 73, 0.42), 56px 0 0 rgba(17, 20, 15, 0.9);
}

.crt-shell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.78) sepia(0.22) hue-rotate(135deg) saturate(1.15) contrast(1.04) brightness(0.72);
}

.sys-card {
  display: grid;
  gap: 4px;
  width: 132px;
  margin-top: 28px;
  padding: 13px 14px;
  border: 1px solid rgba(104, 170, 99, 0.24);
  background: rgba(4, 8, 6, 0.72);
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.15;
  text-transform: uppercase;
}

.sys-card strong {
  color: var(--green);
}

.sys-card span {
  color: var(--green);
}

.right-monitor {
  position: absolute;
  right: 44px;
  top: 158px;
  width: 178px;
  height: 220px;
  padding: 24px 22px;
  border: 1px solid rgba(103, 164, 169, 0.16);
  transform: perspective(650px) rotateY(-11deg) rotateZ(-1deg);
  transform-origin: right center;
  background:
    linear-gradient(180deg, rgba(30, 67, 69, 0.58), rgba(7, 12, 12, 0.86)),
    repeating-linear-gradient(180deg, rgba(141, 232, 121, 0.07) 0 1px, transparent 1px 5px);
  box-shadow: 0 0 28px rgba(96, 181, 181, 0.12), inset 0 0 28px rgba(0, 0, 0, 0.82);
  opacity: 0.76;
}

.right-monitor strong,
.right-monitor span {
  display: block;
  color: #a2d7cc;
  text-transform: uppercase;
}

.right-monitor strong {
  font-size: 1.2rem;
}

.right-monitor span {
  margin-top: 5px;
  font-size: 0.82rem;
}

.right-monitor i {
  display: block;
  height: 90px;
  margin-top: 22px;
  border: 1px solid rgba(154, 214, 198, 0.16);
  background:
    radial-gradient(circle at 55% 40%, rgba(159, 216, 199, 0.38) 0 3px, transparent 4px),
    radial-gradient(circle at 36% 55%, rgba(159, 216, 199, 0.35) 0 3px, transparent 4px),
    radial-gradient(circle at 64% 66%, rgba(159, 216, 199, 0.24) 0 2px, transparent 3px),
    linear-gradient(30deg, transparent 34%, rgba(159, 216, 199, 0.25) 35% 36%, transparent 37%),
    linear-gradient(150deg, transparent 43%, rgba(159, 216, 199, 0.22) 44% 45%, transparent 46%);
}

.ops-mug {
  position: absolute;
  right: 82px;
  bottom: 172px;
  width: 72px;
  height: 82px;
  border: 1px solid rgba(179, 155, 109, 0.24);
  border-radius: 3px 3px 10px 10px;
  background:
    radial-gradient(circle at 50% 28%, rgba(210, 190, 138, 0.19), transparent 17%),
    linear-gradient(90deg, rgba(72, 57, 39, 0.88), rgba(14, 13, 11, 0.94));
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.8), 14px 18px 26px rgba(0, 0, 0, 0.45);
  opacity: 0.78;
}

.ops-mug::after {
  content: "";
  position: absolute;
  right: -22px;
  top: 23px;
  width: 28px;
  height: 30px;
  border: 5px solid rgba(79, 63, 43, 0.76);
  border-left: 0;
  border-radius: 0 18px 18px 0;
}

.ops-mug span {
  position: absolute;
  left: 18px;
  bottom: 9px;
  color: rgba(190, 167, 115, 0.72);
  font-size: 0.73rem;
  font-weight: 900;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1292px, calc(100vw - 80px));
  min-width: 980px;
  margin: 34px auto 28px;
}

.ops-frame {
  position: relative;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.024), transparent 16%),
    linear-gradient(90deg, rgba(14, 17, 13, 0.94), rgba(5, 6, 5, 0.92));
  box-shadow:
    0 34px 80px rgba(0, 0, 0, 0.55),
    inset 0 0 0 1px rgba(0, 0, 0, 0.62);
}

.ops-frame::before,
.ops-frame::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.ops-frame::before {
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(180, 166, 126, 0.035) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(180deg, rgba(141, 232, 121, 0.022) 0 1px, transparent 1px 6px);
  mix-blend-mode: screen;
  opacity: 0.72;
}

.ops-frame::after {
  inset: 8px;
  border: 1px solid rgba(180, 166, 126, 0.1);
}

.top-bar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(440px, 1fr) minmax(510px, 680px);
  gap: 22px;
  min-height: 136px;
  padding: 18px 24px 14px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(5, 7, 6, 0.96), rgba(16, 17, 14, 0.9)),
    linear-gradient(180deg, rgba(111, 123, 102, 0.12), transparent 58%);
}

.top-bar::before {
  content: "";
  position: absolute;
  left: 360px;
  top: 12px;
  width: 112px;
  height: 118px;
  opacity: 0.2;
  background:
    radial-gradient(circle at 50% 38%, transparent 0 28px, rgba(207, 215, 185, 0.42) 29px 34px, transparent 35px),
    radial-gradient(circle at 36% 44%, rgba(207, 215, 185, 0.72) 0 5px, transparent 6px),
    radial-gradient(circle at 64% 44%, rgba(207, 215, 185, 0.72) 0 5px, transparent 6px),
    linear-gradient(180deg, transparent 54%, rgba(207, 215, 185, 0.52) 55% 59%, transparent 60%),
    linear-gradient(24deg, transparent 61%, rgba(207, 215, 185, 0.52) 62% 66%, transparent 67%),
    linear-gradient(156deg, transparent 61%, rgba(207, 215, 185, 0.52) 62% 66%, transparent 67%);
}

.brand-block {
  position: relative;
  display: grid;
  align-content: center;
  min-width: 0;
}

.eyebrow,
.panel-label {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.8rem;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(141, 232, 121, 0.24);
}

h1 {
  margin: 0;
  color: var(--text-strong);
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", Bahnschrift, sans-serif;
  font-size: clamp(3.7rem, 6.8vw, 5.35rem);
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow:
    2px 0 0 rgba(104, 165, 174, 0.42),
    0 0 24px rgba(141, 232, 121, 0.22),
    0 12px 24px rgba(0, 0, 0, 0.9);
  filter: contrast(1.12);
}

.clearance-strip {
  position: absolute;
  right: 24px;
  top: 15px;
  display: flex;
  align-items: center;
  gap: 18px;
  color: rgba(217, 221, 199, 0.67);
  font-size: 0.76rem;
  line-height: 1;
  text-transform: uppercase;
}

.clearance-strip strong {
  color: var(--red);
  text-shadow: 0 0 12px rgba(235, 62, 53, 0.3);
}

.clearance-strip strong::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 8px;
  background: var(--red);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-self: end;
  min-height: 86px;
  border: 1px solid var(--line-dim);
  background: rgba(0, 0, 0, 0.28);
}

.stat-grid div {
  display: grid;
  align-content: center;
  justify-items: center;
  min-width: 0;
  padding: 16px 10px 13px;
  border-left: 1px solid var(--line-dim);
}

.stat-grid div:first-child {
  border-left: 0;
}

.stat-grid span,
.daily-strip strong {
  display: block;
  color: var(--amber-bright);
  font-size: 1.75rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(243, 164, 59, 0.24);
}

.stat-grid small,
.daily-strip small,
.answer-grid small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.game-layout {
  position: relative;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 286px;
  gap: 14px;
  padding: 14px 16px 12px;
}

.mode-toolbar,
.play-panel,
.results-panel > div,
.command-strip {
  position: relative;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.028), transparent 18%),
    linear-gradient(90deg, rgba(16, 19, 15, 0.9), rgba(6, 7, 6, 0.94));
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.62),
    0 14px 34px rgba(0, 0, 0, 0.35);
}

.mode-toolbar::before,
.play-panel::before,
.results-panel > div::before,
.command-strip::before {
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  border: 1px solid rgba(180, 166, 126, 0.08);
}

.mode-toolbar::after,
.play-panel::after,
.results-panel > div::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 0;
  width: 40px;
  height: 2px;
  background: var(--line-hot);
  box-shadow: -18px 0 0 rgba(243, 164, 59, 0.28);
}

.mode-toolbar {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 390px;
  padding: 18px 10px;
}

.mode-toolbar .panel-label {
  margin: 0 12px 16px;
}

.mode-button {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 18px;
  gap: 4px;
  align-items: center;
  min-height: 54px;
  padding: 10px 16px;
  color: rgba(217, 221, 199, 0.58);
  text-align: left;
  border: 0;
  border-top: 1px solid rgba(180, 166, 126, 0.08);
  border-bottom: 1px solid rgba(0, 0, 0, 0.62);
  background: transparent;
  text-transform: uppercase;
}

.mode-button span {
  display: none;
}

.mode-button strong {
  grid-column: 1;
  min-width: 0;
  color: inherit;
  font-size: 1.15rem;
  font-weight: 950;
  line-height: 1;
}

.mode-button small {
  grid-column: 1 / -1;
  color: rgba(143, 150, 131, 0.56);
  font-size: 0.65rem;
  font-weight: 900;
  line-height: 1;
}

.mode-button::after {
  content: "";
  grid-column: 2;
  grid-row: 1;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid transparent;
  opacity: 0;
}

.mode-button.active {
  color: var(--amber-bright);
  background:
    repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.18) 0 7px, transparent 7px 13px),
    linear-gradient(90deg, rgba(119, 60, 12, 0.62), rgba(243, 164, 59, 0.08));
  box-shadow: inset 0 0 20px rgba(243, 164, 59, 0.15);
}

.mode-button.active::after {
  border-left-color: var(--amber-bright);
  opacity: 1;
}

.mode-button.active small {
  color: rgba(243, 164, 59, 0.55);
}

.play-panel {
  min-width: 0;
  padding: 16px 22px 16px;
}

.dossier-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-height: 28px;
  margin-bottom: 10px;
}

.dossier-head h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.clearance-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.clearance-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  background: var(--green);
  box-shadow: 0 0 10px rgba(141, 232, 121, 0.58);
}

.daily-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 72px;
  border: 1px solid var(--line-dim);
  border-top: 0;
  background: rgba(4, 7, 5, 0.52);
}

.daily-strip div {
  display: grid;
  align-content: center;
  min-width: 0;
  padding: 11px 20px 10px;
  border-left: 1px solid rgba(91, 143, 66, 0.28);
}

.daily-strip div:first-child {
  border-left: 0;
}

.daily-strip strong {
  margin-top: 6px;
  font-size: 1.58rem;
}

audio {
  width: 100%;
  height: 26px;
  margin: 10px 0 12px;
  accent-color: var(--amber);
  filter: sepia(0.35) saturate(1.25) brightness(0.82);
  opacity: 0.86;
}

.guess-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-items: end;
}

.guess-form label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.guess-form span {
  color: rgba(217, 221, 199, 0.68);
  font-size: 0.77rem;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.guess-form input {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  color: var(--text-strong);
  border: 1px solid rgba(180, 166, 126, 0.24);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent),
    var(--field);
  outline: none;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.42);
}

.guess-form input::placeholder {
  color: rgba(217, 221, 199, 0.52);
}

.guess-form input:focus {
  border-color: rgba(243, 164, 59, 0.78);
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(243, 164, 59, 0.28);
}

.submit-button {
  grid-column: 1 / -1;
  min-height: 48px;
}

.primary-button,
.ghost-button,
.submit-button {
  position: relative;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 0;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.primary-button,
.submit-button {
  color: #1a1007;
  border: 1px solid rgba(243, 164, 59, 0.95);
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.18), transparent 9%, transparent 91%, rgba(0, 0, 0, 0.18)),
    linear-gradient(180deg, var(--amber-bright), var(--orange));
  box-shadow: inset 0 0 28px rgba(255, 237, 176, 0.12), 0 0 24px rgba(199, 103, 29, 0.2);
}

.ghost-button {
  color: rgba(217, 221, 199, 0.72);
  border: 1px solid rgba(180, 166, 126, 0.22);
  background: rgba(255, 255, 255, 0.025);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.primary-button:hover,
.submit-button:hover,
.primary-button:focus-visible,
.submit-button:focus-visible {
  border-color: var(--amber-bright);
  filter: brightness(1.08);
}

.ghost-button:hover,
.ghost-button:focus-visible {
  color: var(--amber-bright);
  border-color: rgba(243, 164, 59, 0.62);
  background: rgba(243, 164, 59, 0.07);
}

.results-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
}

.results-panel > div {
  padding: 24px 20px;
}

.history-card {
  min-height: 218px;
}

.legend-card {
  min-height: 176px;
}

.answer-grid {
  display: grid;
  gap: 8px;
}

.answer-grid div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line-dim);
  background: rgba(0, 0, 0, 0.24);
}

.answer-grid small {
  margin-top: 0;
  margin-bottom: 5px;
}

.answer-grid strong {
  display: block;
  color: var(--text-strong);
  overflow-wrap: anywhere;
}

#sourceLink {
  display: inline-flex;
  margin-top: 13px;
  color: var(--amber);
  font-size: 0.8rem;
  font-weight: 950;
  text-transform: uppercase;
}

.guess-history {
  display: grid;
  gap: 10px;
}

.empty-state {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.guess-row {
  display: grid;
  gap: 8px;
  padding: 9px;
  border: 1px solid rgba(180, 166, 126, 0.12);
  background: rgba(0, 0, 0, 0.28);
}

.guess-cell {
  min-width: 0;
  padding: 9px;
  border: 1px solid transparent;
  overflow-wrap: anywhere;
}

.guess-cell strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.73rem;
  text-transform: uppercase;
}

.guess-cell small {
  display: block;
  margin-top: 5px;
  color: rgba(255, 255, 255, 0.8);
}

.guess-cell.green {
  color: #061008;
  background: #86e86c;
}

.guess-cell.yellow {
  color: #181005;
  background: var(--amber);
}

.guess-cell.red {
  color: #fff4ed;
  background: rgba(235, 62, 53, 0.78);
  border-color: rgba(255, 255, 255, 0.14);
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 31px;
  color: var(--text);
}

.swatch {
  width: 15px;
  height: 15px;
  border-radius: 2px;
}

.swatch.green { background: #86e86c; }
.swatch.yellow { background: var(--amber); }
.swatch.red { background: var(--red); }

.final-card {
  text-align: center;
}

.final-rating {
  margin: 6px 0 8px;
  color: var(--amber-bright);
  font-size: clamp(3rem, 8vw, 5.3rem);
  font-weight: 950;
  line-height: 0.95;
  text-shadow: 0 0 24px rgba(243, 164, 59, 0.3);
}

.final-card p {
  margin: 7px 0;
  color: var(--muted);
}

.final-card .ghost-button {
  width: 100%;
  margin-top: 10px;
}

.command-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  margin: 0 16px 16px;
  padding: 8px 8px 8px 18px;
}

.status-line {
  min-width: 0;
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.status-line::before {
  content: "// ";
  color: var(--green);
}

.status-line.good {
  color: var(--green);
}

.status-line.bad {
  color: var(--red);
}

.button-row {
  display: grid;
  grid-template-columns: 154px 164px 198px;
  gap: 10px;
}

@media (max-width: 1320px) {
  .app-shell {
    width: min(1180px, calc(100vw - 44px));
    min-width: 0;
  }

  .game-layout {
    grid-template-columns: 144px minmax(0, 1fr) 270px;
  }

  .top-bar {
    grid-template-columns: minmax(350px, 1fr) minmax(470px, 600px);
  }

  .button-row {
    grid-template-columns: 136px 146px 176px;
  }
}

@media (max-width: 1080px) {
  body::before {
    background:
      linear-gradient(180deg, rgba(96, 127, 127, 0.12), transparent 30%),
      linear-gradient(115deg, transparent 0 33%, rgba(107, 56, 25, 0.14) 33% 34%, transparent 34% 100%);
  }

  .room-scene {
    opacity: 0.32;
  }

  .app-shell {
    width: min(100% - 28px, 920px);
    margin-top: 18px;
  }

  .top-bar,
  .game-layout,
  .command-strip {
    grid-template-columns: 1fr;
  }

  .top-bar {
    padding-top: 46px;
  }

  .clearance-strip {
    left: 24px;
    right: auto;
    flex-wrap: wrap;
  }

  .top-bar::before {
    left: auto;
    right: 210px;
  }

  .mode-toolbar {
    min-height: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px;
  }

  .mode-toolbar .panel-label {
    grid-column: 1 / -1;
    margin: 0;
  }

  .results-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .answer-strip,
  .final-card {
    grid-column: 1 / -1;
  }

  .button-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 18px, 680px);
  }

  .top-bar,
  .play-panel,
  .results-panel > div {
    padding: 16px;
  }

  h1 {
    font-size: clamp(3.2rem, 17vw, 4.6rem);
  }

  .stat-grid,
  .daily-strip,
  .guess-form,
  .results-panel {
    grid-template-columns: 1fr;
  }

  .cue-visualizer {
    flex-direction: column;
  }

  .stat-grid div,
  .daily-strip div {
    border-left: 0;
    border-top: 1px solid var(--line-dim);
  }

  .stat-grid div:first-child,
  .daily-strip div:first-child {
    border-top: 0;
  }

  .button-row {
    grid-template-columns: 1fr;
  }

  .mode-toolbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .app-shell {
    width: calc(100% - 12px);
    margin-top: 6px;
  }

  .ops-frame {
    border-left: 0;
    border-right: 0;
  }

  .clearance-strip {
    gap: 10px;
    font-size: 0.66rem;
  }

  .game-layout {
    padding: 10px;
  }

  .command-strip {
    margin: 0 10px 10px;
    padding: 10px;
  }
}
