:root {
  --bg: #07090a;
  --panel: rgba(15, 18, 20, 0.82);
  --panel-strong: rgba(22, 25, 28, 0.96);
  --ink: #f4f7f4;
  --muted: #9aa6a3;
  --line: rgba(255, 255, 255, 0.12);
  --red: #c50039;
  --red-hot: #ff2558;
  --cyan: #4de1d1;
  --green: #8ef0a4;
  --gold: #f6c96f;
  --square-light: #EEE4D1;
  --square-dark: #1A8E78;
  --board-coords: #D4AF37;
  --danger: #ff3f5f;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scrollbar-color: rgba(255, 37, 88, 0.86) rgba(5, 8, 8, 0.96);
  scrollbar-width: thin;
}

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background:
    linear-gradient(180deg, rgba(197, 0, 57, 0.1), rgba(77, 225, 209, 0.08)),
    #050808;
  border-left: 1px solid rgba(77, 225, 209, 0.16);
}

::-webkit-scrollbar-thumb {
  border: 3px solid #050808;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 37, 88, 0.96), rgba(246, 201, 111, 0.86) 54%, rgba(77, 225, 209, 0.86));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18), 0 0 18px rgba(255, 37, 88, 0.22);
}

::-webkit-scrollbar-thumb:hover {
  background:
    linear-gradient(180deg, #ff3f6f, rgba(246, 201, 111, 0.94) 52%, #4de1d1);
}

::-webkit-scrollbar-corner {
  background: #050808;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, Arial, sans-serif;
  background:
    linear-gradient(135deg, rgba(197, 0, 57, 0.2), transparent 28%),
    linear-gradient(210deg, rgba(77, 225, 209, 0.12), transparent 36%),
    var(--bg);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, transparent 0%, transparent 42%, rgba(0, 0, 0, 0.62) 100%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: auto, 54px 54px, 54px 54px;
  opacity: 0.86;
}

.silicio-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, transparent 0 72px, rgba(77, 225, 209, 0.06) 72px 73px),
    repeating-linear-gradient(0deg, transparent 0 72px, rgba(197, 0, 57, 0.055) 72px 73px);
  mask-image: linear-gradient(to bottom, black, transparent 88%);
  opacity: 0.45;
}

.challenge-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 16px 0;
  backdrop-filter: blur(14px);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(197, 0, 57, 0.55));
}

.challenge-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  background: rgba(6, 9, 10, 0.7);
  border-radius: 999px;
}

.challenge-nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 700;
  padding: 9px 13px;
  border-radius: 999px;
  transition: color 180ms ease, background 180ms ease;
}

.challenge-nav a:hover,
.challenge-nav a.is-active {
  color: var(--ink);
  background: rgba(197, 0, 57, 0.28);
}

.challenge-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 70px;
}

.challenge-hero {
  min-height: 220px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 360px);
  gap: 26px;
  align-items: center;
  padding: 26px 0 20px;
}

.eyebrow,
.panel-kicker,
.result-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.hero-copy h1 {
  margin: 8px 0 12px;
  font-size: clamp(2.4rem, 6vw, 5.6rem);
  line-height: 0.92;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 0 34px rgba(197, 0, 57, 0.34);
}

.hero-copy p {
  max-width: 680px;
  margin: 0;
  color: #c8d1ce;
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.7;
}

.hero-signal {
  position: relative;
  min-height: 240px;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.signal-core {
  width: min(220px, 60vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(77, 225, 209, 0.28);
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(197, 0, 57, 0.35), rgba(77, 225, 209, 0.08)),
    rgba(9, 12, 13, 0.7);
  box-shadow: 0 0 80px rgba(77, 225, 209, 0.18), inset 0 0 60px rgba(197, 0, 57, 0.12);
}

.signal-core img {
  width: 54%;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.5));
}

.signal-lines {
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transform: rotate(45deg);
}

.signal-lines::before,
.signal-lines::after {
  content: "";
  position: absolute;
  inset: 18%;
  border: 1px solid rgba(197, 0, 57, 0.24);
}

.signal-lines::after {
  inset: 34%;
  border-color: rgba(77, 225, 209, 0.28);
}

.challenge-console {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 38%),
    rgba(9, 11, 12, 0.74);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.challenge-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
}

.challenge-tab {
  min-height: 66px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  color: #b8c3bf;
  background: rgba(11, 14, 15, 0.92);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background 180ms ease, color 180ms ease;
}

.challenge-tab i {
  color: var(--red-hot);
}

.challenge-tab:hover,
.challenge-tab.is-active {
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(197, 0, 57, 0.32), rgba(77, 225, 209, 0.12)),
    rgba(17, 21, 22, 0.98);
}

.lab-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.62fr) minmax(520px, 1.38fr);
  grid-template-areas:
    "mission board"
    "control board";
  gap: 0;
}

.mission-panel,
.control-panel,
.board-stage {
  min-width: 0;
  padding: 24px;
}

.mission-panel,
.control-panel {
  background: var(--panel);
}

.mission-panel {
  grid-area: mission;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.control-panel {
  grid-area: control;
  border-right: 1px solid var(--line);
}

.mission-panel h2 {
  margin: 12px 0 14px;
  font-size: clamp(1.45rem, 2.2vw, 2.2rem);
  line-height: 1;
  letter-spacing: 0;
}

.mission-panel p {
  margin: 0;
  color: #c1cbc7;
  line-height: 1.65;
}

.mission-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 22px 0;
}

.mission-tags span {
  display: inline-flex;
  padding: 7px 9px;
  border: 1px solid rgba(77, 225, 209, 0.24);
  color: #dfe9e5;
  background: rgba(77, 225, 209, 0.06);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.mission-rule {
  padding: 16px;
  border-left: 3px solid var(--red-hot);
  background: rgba(197, 0, 57, 0.11);
  color: #f2dfe4;
  line-height: 1.55;
}

.board-stage {
  grid-area: board;
  display: grid;
  gap: 18px;
  align-content: start;
  background:
    linear-gradient(180deg, rgba(77, 225, 209, 0.07), transparent 46%),
    rgba(9, 12, 13, 0.5);
}

.board-frame {
  position: relative;
  width: min(100%, 780px);
  margin: 0 auto;
  padding: 14px;
  border: 1px solid rgba(77, 225, 209, 0.22);
  background:
    linear-gradient(135deg, rgba(197, 0, 57, 0.2), rgba(77, 225, 209, 0.09)),
    rgba(5, 8, 8, 0.78);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.46);
}

.board-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 4px 12px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.board-hud strong {
  color: var(--green);
  font-size: 1rem;
}

.board-coordinate-frame {
  width: min(100%, 680px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: clamp(18px, 2.2vw, 26px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) clamp(18px, 2.2vw, 26px);
  gap: 0.35rem;
  align-items: stretch;
}

.board-core {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  aspect-ratio: 1;
}

.board-ranks,
.board-files {
  color: var(--board-coords);
  font-size: clamp(0.72rem, 1vw, 0.9rem);
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9), 0 0 8px rgba(212, 175, 55, 0.2);
  pointer-events: none;
}

.board-ranks {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-rows: repeat(var(--board-size, 8), 1fr);
  justify-items: end;
  align-items: center;
}

.board-files {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(var(--board-size, 8), 1fr);
  justify-items: center;
  align-items: start;
}

.silicio-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--board-size, 8), 1fr);
  grid-template-rows: repeat(var(--board-size, 8), 1fr);
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  overflow: hidden;
  background: var(--square-light);
  box-shadow: 0 26px 72px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(212, 175, 55, 0.22), 0 0 34px rgba(77, 225, 209, 0.1);
  touch-action: none;
}

.board-coordinate-frame.is-guarini-profile {
  width: min(100%, 640px);
  padding: clamp(10px, 1.8vw, 18px);
  gap: clamp(0.38rem, 1vw, 0.72rem);
  border: 1px solid rgba(246, 201, 111, 0.5);
  border-radius: 8px;
  background:
    radial-gradient(circle at 15% 14%, rgba(255, 232, 145, 0.34), transparent 30%),
    radial-gradient(circle at 86% 86%, rgba(77, 225, 209, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(244, 191, 65, 0.85), rgba(24, 109, 96, 0.9) 42%, rgba(83, 10, 37, 0.86) 72%, rgba(233, 184, 55, 0.92)),
    #133d35;
  box-shadow: 0 24px 68px rgba(0, 0, 0, 0.52), 0 0 36px rgba(77, 225, 209, 0.12), inset 0 0 0 1px rgba(255, 241, 176, 0.14);
}

.board-coordinate-frame.is-guarini-profile .board-ranks,
.board-coordinate-frame.is-guarini-profile .board-files {
  color: #fff0a8;
  font-size: clamp(1.1rem, 2.8vw, 1.65rem);
  font-weight: 1000;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.72), 0 0 10px rgba(246, 201, 111, 0.18);
}

.board-coordinate-frame.is-guarini-profile .silicio-board {
  border-color: rgba(5, 8, 7, 0.26);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.challenge-square {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: var(--square-light);
  overflow: hidden;
  touch-action: none;
}

.challenge-square.dark {
  background: var(--square-dark);
}

.challenge-square::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

.challenge-square:hover,
.challenge-square.is-selected {
  outline: 3px solid rgba(77, 225, 209, 0.78);
  outline-offset: -3px;
  z-index: 2;
}

.challenge-square.is-visited {
  box-shadow: inset 0 0 0 999px rgba(77, 225, 209, 0.13);
}

.challenge-square.is-valid {
  box-shadow: inset 0 0 0 999px rgba(142, 240, 164, 0.24);
}

.challenge-square.is-conflict,
.challenge-square.is-uncovered {
  animation: conflictPulse 1.2s ease-in-out 2;
  box-shadow: inset 0 0 0 4px rgba(255, 63, 95, 0.92), inset 0 0 0 999px rgba(255, 63, 95, 0.2);
  z-index: 3;
}

.challenge-square.is-covered {
  box-shadow: inset 0 0 0 999px rgba(142, 240, 164, 0.14);
}

.challenge-square.is-drag-source .piece-img {
  opacity: 0.32;
}

@keyframes conflictPulse {
  0%, 100% { filter: saturate(1); }
  50% { filter: saturate(1.55) brightness(1.16); }
}

.piece-img {
  width: 91%;
  height: 91%;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  z-index: 4;
  filter: drop-shadow(0 7px 7px rgba(0, 0, 0, 0.28));
}

.silicio-board[data-board-size="3"] .piece-img {
  width: 74%;
  height: 74%;
  max-width: 154px;
  max-height: 154px;
}

.piece-drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 56px;
  height: 56px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.42));
  will-change: transform;
}

.move-number {
  position: absolute;
  top: 6px;
  left: 7px;
  z-index: 5;
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #07100f;
  background: var(--green);
  font-size: clamp(0.62rem, 1.5vw, 0.82rem);
  font-weight: 900;
}

.path-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}

.path-layer polyline {
  fill: none;
  stroke: rgba(197, 0, 57, 0.88);
  stroke-width: 0.06;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 0.12px rgba(255, 37, 88, 0.9));
}

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

.icon-command,
.piece-token,
.hint-button {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.055);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  border-radius: 8px;
  transition: transform 170ms ease, border-color 170ms ease, background 170ms ease;
}

.icon-command {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 12px;
}

.icon-command:hover,
.piece-token:hover,
.hint-button:hover {
  transform: translateY(-2px);
  border-color: rgba(77, 225, 209, 0.44);
  background: rgba(77, 225, 209, 0.08);
}

.primary-command {
  background: linear-gradient(135deg, rgba(197, 0, 57, 0.9), rgba(255, 37, 88, 0.68));
  border-color: rgba(255, 255, 255, 0.25);
}

.icon-command:disabled {
  cursor: not-allowed;
  opacity: 0.42;
  transform: none;
}

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

.metric {
  min-height: 92px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.045);
  border-radius: 8px;
}

.metric span,
.status-panel span {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 12px;
  color: var(--ink);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1;
}

.piece-console {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.piece-token {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px;
  text-align: left;
}

.piece-token img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 7px 7px rgba(0, 0, 0, 0.28));
}

.piece-token strong {
  display: block;
  font-size: 0.92rem;
}

.piece-token span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.piece-token.is-active {
  border-color: rgba(77, 225, 209, 0.64);
  background: rgba(77, 225, 209, 0.1);
}

.guarini-turn-panel {
  min-width: 0;
}

.guarini-turn-panel p {
  color: var(--green);
  font-size: clamp(1rem, 1.7vw, 1.2rem);
  font-weight: 1000;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.notation-sheet {
  margin: 18px 0;
  padding: 14px;
  border: 1px solid rgba(246, 201, 111, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(246, 201, 111, 0.12), transparent 48%),
    rgba(10, 13, 14, 0.7);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.notation-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.notation-heading span {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.notation-heading strong {
  color: var(--green);
  font-size: 0.9rem;
}

.notation-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-variant-numeric: tabular-nums;
}

.notation-table th,
.notation-table td {
  padding: 9px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.notation-table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 1000;
  text-transform: uppercase;
}

.notation-table td {
  color: #edf7f2;
  font-size: 0.92rem;
  font-weight: 850;
}

.notation-table th:first-child,
.notation-table td:first-child {
  width: 34px;
  color: var(--board-coords);
}

.status-panel {
  padding: 16px;
  border: 1px solid rgba(142, 240, 164, 0.22);
  background: rgba(142, 240, 164, 0.06);
  border-radius: 8px;
}

.status-panel p {
  margin: 10px 0 0;
  color: #dce8e2;
  line-height: 1.5;
}

.hint-row {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.hint-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
}

.hint-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.result-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.74);
  backdrop-filter: blur(14px);
}

.result-modal.is-open {
  display: grid;
}

.result-dialog {
  position: relative;
  width: min(460px, 100%);
  padding: 30px;
  border: 1px solid rgba(77, 225, 209, 0.34);
  background:
    linear-gradient(135deg, rgba(197, 0, 57, 0.18), transparent 45%),
    var(--panel-strong);
  border-radius: 8px;
  box-shadow: 0 34px 80px rgba(0, 0, 0, 0.58);
}

.result-modal.is-success .result-dialog {
  border-color: rgba(142, 240, 164, 0.58);
  background:
    linear-gradient(135deg, rgba(52, 211, 153, 0.2), transparent 45%),
    linear-gradient(180deg, rgba(246, 201, 111, 0.08), transparent 62%),
    var(--panel-strong);
  box-shadow: 0 34px 80px rgba(0, 0, 0, 0.58), 0 0 34px rgba(142, 240, 164, 0.14);
}

.result-modal.is-success .result-chip {
  color: var(--green);
}

.result-modal.is-success .result-dialog h2 {
  color: var(--green);
}

.result-dialog h2 {
  margin: 14px 0 10px;
  font-size: 2rem;
  letter-spacing: 0;
}

.result-dialog p {
  margin: 0;
  color: #d4ddd9;
  line-height: 1.6;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1080px) {
  .lab-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "mission"
      "board"
      "control";
  }

  .mission-panel,
  .control-panel {
    border: 0;
  }

  .mission-panel {
    border-bottom: 1px solid var(--line);
  }

  .control-panel {
    border-top: 1px solid var(--line);
  }

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

@media (max-width: 760px) {
  .challenge-topbar {
    position: relative;
    align-items: flex-start;
    flex-direction: column;
  }

  .challenge-nav {
    width: 100%;
    flex-wrap: wrap;
    overflow: hidden;
    border-radius: 8px;
  }

  .challenge-nav a {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
    padding: 9px 8px;
    text-align: center;
  }

  .challenge-shell {
    width: min(100% - 18px, 1180px);
    padding-top: 6px;
  }

  .challenge-hero {
    grid-template-columns: 1fr;
    gap: 6px;
    min-height: 0;
    padding-top: 10px;
  }

  .hero-signal {
    min-height: 118px;
  }

  .signal-core {
    width: 110px;
  }

  .hero-copy h1 {
    font-size: clamp(2.35rem, 14vw, 3.7rem);
  }

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

  .challenge-tab {
    min-width: 0;
    min-height: 56px;
    gap: 7px;
    padding: 0 8px;
    line-height: 1.12;
    white-space: normal;
  }

  .challenge-tab span {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .mission-panel,
  .control-panel,
  .board-stage {
    padding: 16px;
  }

  .board-frame {
    padding: 10px;
  }

  .board-actions,
  .metric-grid,
  .piece-console {
    grid-template-columns: 1fr;
  }

  .icon-command {
    min-height: 52px;
  }

  .move-number {
    top: 4px;
    left: 4px;
    min-width: 19px;
    height: 19px;
  }
}
