.brain-game-shell {
  display: grid;
  gap: 18px;
}

.brain-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 18px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 12% 15%, rgba(244, 197, 66, 0.26), transparent 180px),
    linear-gradient(180deg, #850e07, #650704);
  color: #fff8dc;
  box-shadow: var(--shadow);
  padding: 24px;
}

.brain-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 3.2vw, 3.2rem);
  line-height: 1;
}

.brain-hero p {
  max-width: 860px;
  margin: 0;
  color: #fff4c7;
  line-height: 1.5;
}

.brain-score-card {
  display: grid;
  min-height: 116px;
  place-items: center;
  align-content: center;
  border: 1px solid rgba(255, 240, 189, 0.42);
  border-radius: 8px;
  background: rgba(255, 248, 220, 0.12);
}

.brain-score-card span {
  color: #f4c542;
  font-size: 2.4rem;
  font-weight: 900;
}

.brain-score-card small {
  color: #fff4c7;
}

.brain-progress {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.progress-step {
  min-height: 72px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf4;
  padding: 10px;
}

.progress-step span,
.progress-step strong {
  display: block;
}

.progress-step span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  margin-bottom: 7px;
  border-radius: 50%;
  background: #fff0bd;
  color: #700b06;
  font-size: 0.72rem;
  font-weight: 900;
}

.progress-step strong {
  color: var(--muted);
  font-size: 0.82rem;
}

.progress-step.active {
  border-color: #700b06;
  background: #fff0bd;
}

.progress-step.completed span {
  background: #700b06;
  color: #fff8dc;
}

.poem-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf4;
  box-shadow: var(--shadow);
  padding: 22px;
}

.poem-card span {
  display: block;
  margin-bottom: 10px;
  color: #700b06;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.poem-card p {
  margin: 0;
  font-size: clamp(1.3rem, 2.3vw, 2.4rem);
  font-weight: 900;
  line-height: 1.2;
}

.poem-card mark {
  border-radius: 6px;
  background: transparent;
  color: inherit;
  transition: background 260ms ease, color 260ms ease;
}

.poem-card mark.lit {
  background: #fff0bd;
  color: #700b06;
}

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

.human-panel,
.ai-panel,
.stage-console,
.brain-final {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.human-panel,
.ai-panel {
  min-height: 118px;
  padding: 18px;
}

.human-panel span,
.ai-panel span {
  display: block;
  margin-bottom: 8px;
  color: #700b06;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.human-panel p,
.ai-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.stage-console {
  padding: 20px;
}

.stage-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.stage-header h2 {
  margin: 0;
  font-size: clamp(1.55rem, 2.4vw, 2.4rem);
  line-height: 1.05;
}

.stage-header > span {
  display: inline-grid;
  min-height: 34px;
  place-items: center;
  border-radius: 999px;
  background: #700b06;
  color: #fff8dc;
  font-weight: 900;
  padding: 0 12px;
}

.stage-area {
  display: grid;
  gap: 14px;
  min-height: 220px;
}

.stage-area h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.25rem;
}

.token-stream,
.option-grid,
.word-grid,
.meaning-board,
.stage-summary {
  display: grid;
  gap: 10px;
}

.token-stream {
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.token-stream span {
  min-height: 76px;
  border: 1px solid #d9ba65;
  border-radius: 8px;
  background: #fffdf4;
  color: #700b06;
  display: grid;
  place-items: center;
  font-weight: 900;
  animation: tokenPulse 680ms ease both;
  animation-delay: calc(var(--i) * 110ms);
}

.option-grid,
.word-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.option-card {
  min-height: 62px;
  border: 1px solid #d9ba65;
  border-radius: 8px;
  background: #fffdf4;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  padding: 12px 14px;
  text-align: left;
}

.option-card:hover,
.option-card.selected {
  border-color: #700b06;
  background: #fff0bd;
}

.option-card.selected {
  box-shadow: inset 4px 0 0 #700b06;
}

.attention-bars {
  display: grid;
  gap: 8px;
  max-width: 520px;
}

.attention-bars span {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-weight: 800;
}

.attention-bars b {
  display: block;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #700b06, #f4c542);
}

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

.meaning-zone {
  border: 1px solid #d9ba65;
  border-radius: 8px;
  background: #fff9e8;
  padding: 14px;
}

.meaning-zone-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.meaning-svg {
  flex: 0 0 76px;
  width: 76px;
  height: 54px;
  border: 1px solid #d9ba65;
  border-radius: 8px;
  background: #fff0bd;
  color: #700b06;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  padding: 8px;
}

.meaning-svg .meaning-smoke {
  fill: none;
}

.meaning-zone strong {
  display: block;
  color: #700b06;
  text-transform: uppercase;
}

.meaning-options {
  display: grid;
  gap: 8px;
}

.frame-diagram {
  display: grid;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  gap: 10px;
  align-items: center;
}

.frame-node {
  min-height: 76px;
  border: 1px solid #d9ba65;
  border-radius: 8px;
  background: #fffdf4;
  color: #700b06;
  display: grid;
  place-items: center;
  font-weight: 900;
  padding: 10px;
  text-align: center;
}

.frame-arrow {
  height: 4px;
  border-radius: 999px;
  background: #d9ba65;
}

.frame-diagram .new {
  opacity: 0.22;
}

.frame-diagram.reconfigured .initial {
  opacity: 0.3;
}

.frame-diagram.reconfigured .new {
  opacity: 1;
  background: #fff0bd;
}

.frame-trigger {
  justify-self: start;
}

.stage-note {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.stage-note-strong {
  display: grid;
  gap: 5px;
  border: 1px solid #d9ba65;
  border-left: 6px solid #700b06;
  border-radius: 8px;
  background: #fff0bd;
  color: #4d1f0b;
  box-shadow: 0 12px 26px rgba(89, 43, 8, 0.12);
  font-size: 1.02rem;
  font-weight: 800;
  padding: 14px 16px;
}

.stage-note-strong strong {
  color: #700b06;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stage-area textarea {
  width: 100%;
  min-height: 150px;
  border: 1px solid #d9ba65;
  border-radius: 8px;
  background: #fffdf4;
  color: var(--ink);
  font: inherit;
  padding: 14px;
  resize: vertical;
}

.pragmatic-actions {
  display: flex;
  justify-content: flex-start;
}

.feedback {
  min-height: 42px;
  margin-top: 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--muted);
}

.feedback.success {
  border-color: #6ea45f;
  background: #f1faeb;
  color: #315f22;
}

.feedback.error {
  border-color: #b44d42;
  background: #fff3ef;
  color: #8b1209;
}

.feedback.neutral {
  border-color: #d9ba65;
  background: #fff9e8;
  color: #7b5b37;
}

.stage-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.brain-final {
  display: none;
  padding: 20px;
}

.brain-final.active {
  display: block;
}

.stage-summary {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin: 16px 0;
}

.stage-summary div,
.reference-box {
  border: 1px solid #d9ba65;
  border-radius: 8px;
  background: #fffdf4;
  padding: 12px;
}

.stage-summary strong,
.stage-summary span,
.reference-box strong {
  display: block;
}

.stage-summary strong,
.reference-box strong {
  margin-bottom: 6px;
  color: #700b06;
}

.stage-summary span,
.reference-box p {
  color: var(--muted);
}

.reference-box p {
  margin: 0;
  line-height: 1.45;
}

@keyframes tokenPulse {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .brain-hero,
  .brain-progress,
  .comparison-grid,
  .meaning-board,
  .frame-diagram,
  .stage-summary {
    grid-template-columns: 1fr;
  }

  .frame-arrow {
    min-height: 24px;
    width: 4px;
    height: 24px;
    justify-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .token-stream span {
    animation: none;
  }

  .poem-card mark,
  .frame-diagram .new,
  .frame-diagram .initial {
    transition: none;
  }
}
