:root {
  color-scheme: light;
  --background: #f3f6fb;
  --panel: #ffffff;
  --panel-strong: #162033;
  --text: #162033;
  --muted: #667085;
  --border: #d7deea;
  --primary: #2251d1;
  --primary-dark: #163f9f;
  --primary-soft: #e9efff;
  --exam-blue: #25256d;
  --exam-panel: #d9d5cf;
  --exam-text: #4f4d6d;
  --success: #16875d;
  --danger: #b42318;
  --shadow: 0 20px 55px rgba(22, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(34, 81, 209, 0.14), transparent 32rem),
    var(--background);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
select {
  font: inherit;
}

.site-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 1.25rem;
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0.45rem;
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: -0.05em;
}

h2 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
}

.intro {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.score-card {
  min-width: 170px;
  padding: 1rem 1.25rem;
  border-radius: 1.25rem;
  background: var(--panel-strong);
  color: white;
  box-shadow: var(--shadow);
}

.score-label,
.status-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.score-card .score-label {
  color: rgba(255, 255, 255, 0.68);
}

.score-card strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 2rem;
}

.layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1rem;
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto 2rem;
}

.control-panel,
.practice-panel,
.results-panel {
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.control-panel {
  align-self: start;
  padding: 1rem;
}

.control-panel label {
  display: block;
  margin: 0.8rem 0 0.45rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.control-panel select {
  appearance: none;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background:
    linear-gradient(45deg, transparent 50%, #667085 50%) right 1rem top 1.05rem / 0.42rem 0.42rem no-repeat,
    linear-gradient(135deg, #667085 50%, transparent 50%) right 0.72rem top 1.05rem / 0.42rem 0.42rem no-repeat,
    white;
  padding: 0.8rem 2.25rem 0.8rem 0.85rem;
  color: var(--text);
  line-height: 1.35;
}

.control-panel select:disabled {
  background:
    linear-gradient(45deg, transparent 50%, #a7b0c0 50%) right 1rem top 1.05rem / 0.42rem 0.42rem no-repeat,
    linear-gradient(135deg, #a7b0c0 50%, transparent 50%) right 0.72rem top 1.05rem / 0.42rem 0.42rem no-repeat,
    #f7f9fc;
  color: #7b8495;
}

.section-note {
  min-height: 6rem;
  margin: 1rem 0;
  border-radius: 1rem;
  background: #eef3ff;
  padding: 0.9rem;
  color: #29436f;
  font-size: 0.92rem;
  line-height: 1.45;
}

.primary-button,
.secondary-button {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1rem;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  background: var(--primary);
  color: white;
}

.primary-button:hover {
  background: var(--primary-dark);
}

.primary-button:disabled,
.primary-button:disabled:hover {
  background: #d9e2f6;
  color: #7b88a5;
  opacity: 1;
}

.secondary-button {
  margin-top: 0.55rem;
  border: 1px solid var(--border);
  background: white;
  color: var(--text);
}

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

.tips {
  margin-top: 1.25rem;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.tips ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.practice-panel {
  min-height: 620px;
  padding: 1.1rem;
}

.status-row,
.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.status-row > div,
.result-grid > div {
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: white;
  padding: 0.85rem 1rem;
}

.status-row strong,
.result-grid strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 1.45rem;
}

.question-area {
  display: grid;
  place-items: center;
  min-height: 420px;
  margin: 1rem 0;
  border: 1px dashed #d9deea;
  border-radius: 1.25rem;
  background: #fbfcff;
  padding: 1.2rem;
  text-align: center;
}

.placeholder {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.prompt {
  margin-bottom: 1rem;
  color: var(--muted);
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.statement {
  margin-bottom: 0.5rem;
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  font-weight: 850;
  letter-spacing: -0.04em;
}

.sub-prompt {
  color: var(--muted);
  font-size: 1.1rem;
}

.answer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.answer-grid:empty {
  display: none;
}

.exam-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1.5rem;
  width: min(620px, 100%);
  min-height: 330px;
  border: 1px solid #aaa69e;
  border-radius: 1rem;
  background: var(--exam-panel);
  padding: 2rem;
  color: var(--exam-text);
}

.compact-exam-screen {
  min-height: 270px;
}

.reasoning-ready-screen {
  border: 1px solid #aaa69e;
  cursor: pointer;
}

.reasoning-ready-screen:hover {
  box-shadow: 0 10px 30px rgba(37, 37, 109, 0.16);
}

.statement-box {
  display: grid;
  place-items: center;
  min-width: min(300px, 90%);
  min-height: 82px;
  border: 2px solid #aeb6b0;
  background: white;
  padding: 1rem 1.2rem;
  color: #1f2433;
  font-size: 1rem;
  font-weight: 850;
  line-height: 1.35;
}

.ready-copy {
  color: #7a2318;
  font-size: 0.76rem;
  font-weight: 850;
}

.reasoning-placeholder-row {
  display: flex;
  justify-content: center;
  gap: 1.7rem;
  width: 100%;
}

.reasoning-placeholder-row span {
  display: block;
  width: 118px;
  height: 56px;
  background: var(--exam-blue);
}

.inline-answer-area {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
}

.count-answer-area {
  gap: 0.9rem;
}

.number-answer-area,
.word-answer-area {
  gap: 1.2rem;
}

.answer-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  min-height: 56px;
  border: 0;
  border-radius: 0;
  background: var(--exam-blue);
  color: white;
  font-weight: 850;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

.answer-button:hover {
  box-shadow: 0 10px 25px rgba(37, 37, 109, 0.24);
  transform: translateY(-1px);
}

.reasoning-answer-button,
.word-answer-button {
  min-width: 142px;
}

.number-answer-button {
  min-width: 116px;
}

.count-answer-area .answer-button {
  min-width: 64px;
  min-height: 58px;
}

.choice-value {
  font-size: 1.35rem;
  font-weight: 900;
}

.reasoning-answer-button .choice-value,
.word-answer-button .choice-value {
  font-size: 1rem;
}

.number-answer-button .choice-value {
  font-size: 1.7rem;
}

.visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 1.15rem;
  width: min(360px, 100%);
}

.spatial-pair,
.perceptual-pair {
  border: 1px solid var(--border);
  border-radius: 0;
  background: white;
  padding: 0.55rem;
}

.spatial-symbols {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 0.25rem;
}

.symbol-card {
  display: grid;
  place-items: center;
  min-height: 94px;
  border-radius: 0;
  background: #ffffff;
}

.symbol-card svg {
  width: 78px;
  height: 78px;
}

.pair-title {
  margin-bottom: 0.6rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.perceptual-matrix {
  display: grid;
  gap: 1rem;
  min-width: min(360px, 100%);
  color: #111111;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: 0.28em;
}

.perceptual-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  justify-items: center;
  gap: 0.7rem;
}

.number-row,
.word-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}

.number-token,
.word-token {
  min-width: 110px;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: white;
  padding: 1rem 1.25rem;
  font-size: 2rem;
  font-weight: 850;
}

.word-token {
  min-width: 150px;
  font-size: 1.4rem;
}

.results-panel {
  grid-column: 2;
  padding: 1.1rem;
}

.result-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.review-list {
  max-height: 340px;
  overflow: auto;
  margin: 1rem 0 0;
  padding-left: 1.4rem;
}

.review-list li {
  margin-bottom: 0.75rem;
  color: var(--muted);
  line-height: 1.45;
}

.review-list strong {
  color: var(--text);
}

.correct {
  color: var(--success);
}

.wrong {
  color: var(--danger);
}

@media (max-width: 850px) {
  .site-header {
    align-items: stretch;
    flex-direction: column;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .results-panel {
    grid-column: auto;
  }

  .status-row,
  .result-grid,
  .visual-grid {
    grid-template-columns: 1fr;
  }
}
