
:root {
  --brain-red: #7d0808;
  --brain-red-dark: #4d0303;
  --brain-red-soft: #f6e7e7;
  --brain-yellow: #ffe600;
  --brain-gold: #f4cf32;
  --cream: #fffaf0;
  --ink: #2f2222;
  --muted: #715f5f;
  --white: #ffffff;
  --border: #e6caca;
  --shadow: 0 18px 42px rgba(75, 3, 3, 0.17);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 18%, rgba(255,230,0,.15), transparent 23rem),
    radial-gradient(circle at 95% 75%, rgba(125,8,8,.11), transparent 28rem),
    linear-gradient(180deg, #fffdf7, #f7eded);
}

button { font: inherit; cursor: pointer; }

.site-header {
  background: var(--brain-red-dark);
  border-bottom: 5px solid var(--brain-yellow);
  box-shadow: 0 8px 25px rgba(40,0,0,.25);
}

.brain-banner {
  width: 100%;
  max-height: 230px;
  object-fit: cover;
  display: block;
}

.app-shell {
  width: min(1180px, calc(100% - 30px));
  margin: 34px auto 52px;
}

.screen { display: none; }
.screen.active { display: block; animation: fadeUp .45s ease; }

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

.hero-card,
.panel,
.result-card {
  background: rgba(255,255,255,.97);
  border: 1px solid var(--border);
  border-top: 7px solid var(--brain-red);
  border-radius: 20px;
  padding: clamp(24px, 4vw, 46px);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brain-red);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

h1, h2, h3 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--brain-red-dark);
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(2.1rem, 5vw, 3.7rem);
  line-height: 1.02;
}

h2 { margin: 0 0 14px; font-size: clamp(1.55rem, 3vw, 2.25rem); }
h3 { margin-top: 0; }
p { line-height: 1.65; }
.lead { font-size: 1.08rem; max-width: 820px; }

.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 28px 0;
}

.principles-grid article {
  padding: 22px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #fff, #fff7cf);
  transition: transform .2s ease, box-shadow .2s ease;
}

.principles-grid article:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(125,8,8,.11);
}

.principle-icon { font-size: 2rem; display: block; margin-bottom: 12px; }

.notice {
  margin: 24px 0;
  padding: 18px 20px;
  background: #fff7c5;
  border-left: 6px solid var(--brain-yellow);
  border-radius: 12px;
  line-height: 1.55;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 999px;
  border: 2px solid var(--brain-red);
  font-weight: 900;
  transition: transform .15s ease, box-shadow .15s ease;
}

.primary-button {
  color: var(--brain-yellow);
  background: var(--brain-red);
  box-shadow: 0 9px 20px rgba(125,8,8,.22);
}

.secondary-button {
  color: var(--brain-red);
  background: var(--white);
}

.primary-button:hover,
.secondary-button:hover { transform: translateY(-2px); }

.primary-button:disabled,
.secondary-button:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.room-badge {
  padding: 9px 14px;
  background: var(--brain-yellow);
  color: var(--brain-red-dark);
  border-radius: 999px;
  font-weight: 900;
}

.section-intro { max-width: 760px; }

.case-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 28px;
}

.case-card {
  position: relative;
  min-height: 330px;
  padding: 24px;
  border-radius: 18px;
  border: 2px solid #ecd6d6;
  background:
    radial-gradient(circle at top right, rgba(255,230,0,.24), transparent 35%),
    linear-gradient(180deg, #fff, #fff8de);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  overflow: hidden;
}

.case-card:hover {
  transform: translateY(-5px);
  border-color: var(--brain-red);
  box-shadow: 0 18px 34px rgba(125,8,8,.14);
}

.case-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -28px;
  width: 115px;
  height: 115px;
  border-radius: 50%;
  border: 18px solid rgba(125,8,8,.06);
}

.case-icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--brain-red);
  color: var(--brain-yellow);
  font-size: 1.8rem;
  margin-bottom: 18px;
}

.case-meta {
  color: var(--brain-red);
  font-weight: 800;
  font-size: .85rem;
}

.case-card button {
  margin-top: 12px;
  position: relative;
  z-index: 1;
}

.sim-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
  align-items: start;
}

.case-sidebar,
.reflection-stage {
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.case-sidebar {
  position: sticky;
  top: 18px;
  padding: 26px;
  color: white;
  background:
    radial-gradient(circle at top right, rgba(255,230,0,.18), transparent 33%),
    linear-gradient(155deg, var(--brain-red), var(--brain-red-dark));
}

.case-sidebar h2,
.case-sidebar h3,
.case-sidebar .eyebrow { color: var(--brain-yellow); }

.score-box {
  margin-top: 24px;
  padding: 18px;
  border-radius: 15px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.16);
}

.score-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,.13);
}

.score-row:last-child { border-bottom: 0; }
.score-row strong { color: var(--brain-yellow); }

.phase-map {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}

.phase-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.75);
  font-size: .87rem;
}

.phase-pill.active {
  background: var(--brain-yellow);
  color: var(--brain-red-dark);
  font-weight: 900;
  transform: translateX(5px);
}

.phase-pill.completed { color: white; }
.phase-pill.completed::before { content: "✓"; color: var(--brain-yellow); font-weight: 900; }

.reflection-stage {
  background: white;
  border: 1px solid var(--border);
  overflow: hidden;
}

.stage-progress {
  height: 12px;
  background: #ead8d8;
}

.stage-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brain-red), var(--brain-yellow));
  transition: width .4s ease;
}

.stage-card {
  padding: clamp(25px, 5vw, 48px);
  min-height: 650px;
}

.stage-icon {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border-radius: 23px;
  background: var(--brain-yellow);
  color: var(--brain-red-dark);
  font-size: 2.2rem;
  margin-bottom: 18px;
  animation: breathe 3.2s ease-in-out infinite;
}

@keyframes breathe {
  0%,100% { transform: scale(1); box-shadow: 0 8px 20px rgba(255,230,0,.16); }
  50% { transform: scale(1.05); box-shadow: 0 12px 28px rgba(255,230,0,.32); }
}

.stage-description { max-width: 760px; font-size: 1.05rem; }

.prompt-box {
  margin: 24px 0 20px;
  padding: 20px;
  border-radius: 16px;
  background: var(--cream);
  border-left: 6px solid var(--brain-yellow);
  font-weight: 700;
  line-height: 1.6;
}

.choices {
  display: grid;
  gap: 13px;
}

.choice-button {
  width: 100%;
  padding: 17px 18px;
  text-align: left;
  border-radius: 14px;
  border: 2px solid #ead6d6;
  background: white;
  color: var(--ink);
  line-height: 1.5;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.choice-button:hover {
  transform: translateX(4px);
  border-color: var(--brain-red);
}

.choice-button.selected {
  border-color: var(--brain-red);
  background: #fff6cf;
  box-shadow: inset 6px 0 0 var(--brain-red);
}

.feedback-box {
  margin-top: 20px;
  padding: 19px 20px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--brain-red), var(--brain-red-dark));
  color: white;
  animation: feedbackIn .35s ease;
}

.feedback-box strong { color: var(--brain-yellow); }
.hidden { display: none !important; }

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

.stage-actions {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 28px;
}

.result-card {
  position: relative;
  overflow: hidden;
  text-align: center;
}

.completion-orbit {
  position: absolute;
  top: 20px;
  right: 25px;
  width: 90px;
  height: 90px;
  border: 2px dashed rgba(125,8,8,.17);
  border-radius: 50%;
  animation: orbit 10s linear infinite;
}

.completion-orbit span {
  position: absolute;
  color: var(--brain-yellow);
  text-shadow: 0 0 0 var(--brain-red);
}

.completion-orbit span:nth-child(1) { top: -8px; left: 38px; }
.completion-orbit span:nth-child(2) { right: -7px; bottom: 17px; }
.completion-orbit span:nth-child(3) { left: -7px; bottom: 17px; }

@keyframes orbit { to { transform: rotate(360deg); } }

.result-score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 30px 0;
}

.result-score-grid article {
  padding: 23px;
  border-radius: 17px;
  background: linear-gradient(180deg, #fff, #fff6c8);
  border: 1px solid var(--border);
}

.result-score-grid span { font-size: 2rem; }
.result-score-grid strong {
  display: block;
  margin: 9px 0 0;
  font-size: 2rem;
  color: var(--brain-red);
}

.insight-panel,
.next-encounter,
.remember-panel {
  margin: 24px 0;
  padding: 26px;
  border-radius: 18px;
  text-align: left;
}

.insight-panel {
  color: white;
  background: linear-gradient(145deg, var(--brain-red), var(--brain-red-dark));
}

.insight-panel h2,
.insight-panel .eyebrow { color: var(--brain-yellow); }

.next-encounter {
  background: #fff8cf;
  border: 1px solid #ecd98b;
}

.next-action-card {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 16px;
  align-items: center;
  padding: 18px;
  border-radius: 14px;
  background: white;
}

.next-action-card span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--brain-yellow);
  background: var(--brain-red);
  font-size: 1.5rem;
}

.remember-panel { background: var(--cream); border: 1px solid var(--border); }

.remember-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.remember-grid div {
  padding: 18px;
  background: white;
  border-radius: 14px;
  border: 1px solid #ead6d6;
}

.remember-grid span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brain-yellow);
  color: var(--brain-red-dark);
  font-weight: 900;
}

footer {
  padding: 0 20px 30px;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
}

@media (max-width: 900px) {
  .sim-layout { grid-template-columns: 1fr; }
  .case-sidebar { position: static; }
  .case-grid { grid-template-columns: 1fr; }
  .principles-grid,
  .result-score-grid,
  .remember-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .app-shell { width: min(100% - 18px, 1180px); margin-top: 18px; }
  .hero-card, .panel, .result-card { padding: 22px 17px; border-radius: 15px; }
  .brain-banner { max-height: 155px; }
  .stage-card { padding: 24px 17px; }
  .stage-actions { flex-direction: column; }
  .stage-actions button { width: 100%; }
  .section-heading { flex-direction: column; }
}


.score-item {
  padding: 7px 0 11px;
  border-bottom: 1px solid rgba(255,255,255,.13);
}

.score-item:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}

.score-item .score-row {
  border-bottom: 0;
  padding: 3px 0 7px;
}

.mini-score-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.16);
}

.mini-score-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brain-yellow), #fff7a6);
  transition: width .35s ease;
}
