.color-shell {
  width: min(1060px, calc(100% - 32px));
}

.game-card {
  overflow: hidden;
  border: 3px solid var(--ink);
  background: var(--panel);
  box-shadow: 10px 10px 0 var(--shadow);
}

.game-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: end;
  padding: 30px 34px;
  border-bottom: 3px solid var(--ink);
}

.game-heading .eyebrow { margin-bottom: 10px; }

.game-heading h1 {
  max-width: none;
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 0.94;
}

.lede {
  max-width: 670px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.timer-box {
  min-width: 150px;
  padding: 16px;
  border: 2px solid var(--line);
  background: #171220;
  text-align: center;
}

.timer-box > span,
.stat > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.timer-box strong {
  color: var(--gold);
  font-size: 1.9rem;
}

.timer-box small {
  margin-left: 4px;
  font-size: 0.8rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 3px solid var(--ink);
}

.stat {
  min-width: 0;
  padding: 18px 14px;
  border-right: 2px solid var(--line);
  text-align: center;
}

.stat:last-child { border-right: 0; }
.stat strong { font-size: clamp(1.1rem, 3vw, 1.7rem); }

.game-stage {
  min-height: 620px;
  padding: 36px 34px 30px;
  background:
    linear-gradient(rgba(247, 201, 72, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(247, 201, 72, 0.025) 1px, transparent 1px),
    radial-gradient(circle at 50% 25%, #2a2039 0, transparent 52%);
  background-size: 24px 24px, 24px 24px, auto;
}

.target-area {
  display: flex;
  min-height: 310px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.stage-kicker {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.target-swatch {
  display: grid;
  width: 112px;
  height: 112px;
  margin: 0 0 16px;
  place-items: center;
  border: 3px solid var(--ink);
  background-color: var(--swatch);
  background-image: var(--pattern);
  box-shadow: 7px 7px 0 var(--shadow);
  color: #120f1d;
}

.target-swatch span {
  padding: 2px 8px;
  background: rgba(18, 15, 29, 0.88);
  color: var(--ink);
  font-size: 2.2rem;
  font-weight: 900;
}

.target-area h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.7rem);
  letter-spacing: -0.04em;
}

.target-area > p:not(.stage-kicker) {
  max-width: 650px;
  min-height: 48px;
  margin: 12px 0 15px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
}

.feedback {
  display: flex;
  min-height: 42px;
  margin-bottom: 14px;
  flex-direction: column;
}

.feedback[hidden] { display: none; }
.feedback strong { color: var(--green); font-size: 1.25rem; }
.feedback span { color: var(--muted); font-size: 0.82rem; }

.color-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 880px;
  margin: 24px auto 0;
}

.color-button {
  position: relative;
  display: grid;
  min-height: 148px;
  grid-template-columns: 1fr auto;
  align-content: center;
  align-items: center;
  gap: 3px 10px;
  padding: 16px;
  border: 3px solid var(--ink);
  border-radius: 0;
  background-color: var(--swatch);
  background-image: var(--pattern);
  box-shadow: 5px 5px 0 var(--shadow);
  color: #120f1d;
  cursor: pointer;
  text-align: left;
  touch-action: manipulation;
  transition: transform 80ms ease, box-shadow 80ms ease, filter 100ms ease;
  user-select: none;
}

.color-button:hover { filter: brightness(1.12); }
.color-button:active,
.color-button.is-pressed { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--shadow); }
.color-button:focus-visible { outline: 4px solid var(--ink); outline-offset: 3px; }
.color-button:disabled { cursor: default; filter: saturate(0.35) brightness(0.55); }

.tile-key { grid-column: 2; grid-row: 1 / 4; }
.tile-key kbd { border-color: #120f1d; background: rgba(18, 15, 29, 0.9); color: var(--ink); }
.tile-pattern { font-size: 2.5rem; font-weight: 900; line-height: 1; }
.color-button strong { font-size: 1rem; letter-spacing: 0.08em; }
.color-button small { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.1em; }

.color-gold {
  --swatch: #f7c948;
  --pattern: repeating-linear-gradient(135deg, transparent 0 12px, rgba(18, 15, 29, 0.18) 12px 17px);
}
.color-coral {
  --swatch: #ed6b65;
  --pattern: radial-gradient(rgba(18, 15, 29, 0.26) 3px, transparent 4px);
  background-size: 18px 18px;
}
.color-cyan {
  --swatch: #58c7d7;
  --pattern: repeating-linear-gradient(0deg, transparent 0 13px, rgba(18, 15, 29, 0.22) 13px 17px);
}
.color-green {
  --swatch: #53dd83;
  --pattern: repeating-linear-gradient(45deg, transparent 0 14px, rgba(18, 15, 29, 0.16) 14px 17px), repeating-linear-gradient(-45deg, transparent 0 14px, rgba(18, 15, 29, 0.12) 14px 17px);
}

.control-note {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
  text-align: center;
}

.game-stage[data-state="playing"] .primary-button { visibility: hidden; }
.game-stage[data-state="playing"] .target-swatch { animation: target-pop 130ms steps(2, end); }
.game-stage[data-state="wrong"] { background-color: #351521; }
.game-stage[data-state="complete"] { background-color: #2d2515; }
.game-stage[data-state="cancelled"] { background-color: #241a31; }

.content-section {
  display: grid;
  grid-template-columns: 0.85fr 1.6fr;
  gap: 64px;
  padding: 76px 18px 58px;
}

.content-section h2,
.info-panel h2,
.faq-section h2,
.related-section h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.steps-list { margin: 0; padding: 0; border-top: 2px solid var(--line); list-style: none; }
.steps-list li { display: grid; grid-template-columns: 54px 1fr; gap: 18px; padding: 20px 0; border-bottom: 2px solid var(--line); }
.steps-list span { color: var(--gold); font-weight: 800; }
.steps-list p,
.info-panel p,
.faq-list p { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.7; }

.reading-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.info-panel { padding: 30px; border: 2px solid var(--line); background: var(--panel); }
.info-panel h2 { margin-bottom: 22px; }
.info-panel > p:not(.section-kicker) + p { margin-top: 16px; }

.faq-section,
.related-section { padding: 72px 18px 0; }
.faq-list { margin-top: 28px; border-top: 2px solid var(--line); }
.faq-list details { border-bottom: 2px solid var(--line); }
.faq-list summary { padding: 22px 44px 22px 0; color: var(--ink); cursor: pointer; font-size: 1.05rem; font-weight: 800; line-height: 1.4; }
.faq-list details p { max-width: 850px; padding: 0 0 24px; }

.related-links { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 28px; }
.related-links a { display: flex; min-height: 118px; flex-direction: column; justify-content: space-between; padding: 18px; border: 2px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 800; line-height: 1.35; text-decoration: none; }
.related-links a:hover,
.related-links a:focus-visible { border-color: var(--gold); outline: 0; }
.related-links small { color: var(--muted); font-size: 0.76rem; font-weight: 400; }

@keyframes target-pop {
  0% { transform: scale(0.92); }
  100% { transform: scale(1); }
}

@media (max-width: 820px) {
  .game-heading { grid-template-columns: 1fr; }
  .timer-box { display: flex; align-items: center; justify-content: space-between; }
  .timer-box > span { margin: 0; }
  .color-grid { grid-template-columns: repeat(2, 1fr); }
  .related-links { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 620px) {
  .color-shell { width: min(100% - 18px, 600px); padding-top: 10px; }
  .game-card { box-shadow: 6px 6px 0 var(--shadow); }
  .game-heading { gap: 20px; padding: 24px 18px; }
  .game-heading h1 { font-size: clamp(2.2rem, 12vw, 3.8rem); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(-n + 2) { border-bottom: 2px solid var(--line); }
  .game-stage { min-height: 650px; padding: 30px 14px 24px; }
  .target-area { min-height: 335px; }
  .target-swatch { width: 94px; height: 94px; }
  .color-grid { gap: 10px; }
  .color-button { min-height: 118px; padding: 12px; }
  .tile-pattern { font-size: 2rem; }
  .content-section,
  .reading-grid { grid-template-columns: 1fr; }
  .content-section { gap: 30px; padding: 58px 8px 44px; }
  .info-panel { padding: 24px 20px; }
  .faq-section,
  .related-section { padding: 58px 8px 0; }
  .related-links { grid-template-columns: 1fr; }
  .related-links a { min-height: 92px; }
}

@media (prefers-reduced-motion: reduce) {
  .game-stage[data-state="playing"] .target-swatch { animation: none; }
}
