:root {
  --ink: #243b53;
  --muted: #6b7280;
  --line: #eadfca;
  --paper: #fffaf0;
  --card: #fffefb;
  --mint: #f7fcf8;
  --green: #1f6756;
  --green-dark: #16483d;
  --coral: #ed5b4f;
  --yellow: #ffd96a;
  --sky: #67aec5;
  --shadow: 0 20px 55px rgba(106, 75, 39, .13);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Nunito, sans-serif;
}
body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: .7;
  background-image: radial-gradient(#ecdcbf 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}
button, input { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--green-dark); outline-offset: 3px; }
.page-shell { width: min(1240px, calc(100% - 64px)); margin: 0 auto; }
.topbar { height: 84px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; font-size: 12px; font-weight: 900; letter-spacing: .08em; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: white; background: var(--coral); font-family: "Noto Sans SC", sans-serif; font-size: 17px; }
.top-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 10px; letter-spacing: .08em; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 4px rgba(231,104,76,.15); }
.experience-grid { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 36px; align-items: start; }
.intro-row { grid-column: 1; grid-row: 1; display: flex; align-items: end; padding: 64px 0 48px; }
.intro-row > div { max-width: 460px; }
.eyebrow, .prompt-label, .instructions-kicker { margin: 0 0 12px; color: var(--coral); font-size: 12px; font-weight: 900; letter-spacing: .08em; }
h1 { max-width: 430px; margin: 0; color: var(--ink); font-size: clamp(42px, 5vw, 72px); line-height: 1.08; letter-spacing: 0; font-weight: 900; }
h1 em { color: var(--green); font-family: inherit; font-weight: 900; }
.intro-copy { max-width: 360px; margin: 22px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.progress-panel { grid-column: 1; grid-row: 2; padding-top: 12px; }
.progress-heading { display: flex; justify-content: space-between; color: var(--green); font-family: "DM Mono", monospace; font-size: 11px; font-weight: 500; letter-spacing: .08em; }
.progress-track { height: 4px; margin: 14px 0 28px; overflow: hidden; background: #dce5df; }
.progress-track span { display: block; height: 100%; width: 3.45%; background: var(--coral); transition: width .35s ease; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 16px 0; }
.stat-item { display: flex; flex-direction: column; gap: 5px; }
.stat-value { color: var(--green-dark); font-size: 22px; font-weight: 700; }
.stat-label { color: var(--muted); font-family: "DM Mono", monospace; font-size: 10px; letter-spacing: .08em; }
.instructions { margin-top: 32px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.instructions p { margin: 9px 0 0; }
.text-button { display: flex; gap: 8px; align-items: center; margin-top: 28px; padding: 0; border: 0; color: var(--green); background: transparent; font-size: 12px; font-weight: 700; }
.text-button span { font-size: 18px; }
.quiz-card { grid-column: 2; grid-row: 1 / span 2; min-width: 0; padding: 30px clamp(22px, 4vw, 56px) 38px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); box-shadow: var(--shadow); }
.card-topline { display: flex; justify-content: space-between; color: var(--muted); font-family: "DM Mono", monospace; font-size: 11px; letter-spacing: .08em; }
#attempt-label { color: var(--coral); }
.map-frame { position: relative; display: grid; place-items: center; height: clamp(250px, 34vw, 390px); margin: 22px 0 30px; overflow: hidden; border: 1px solid #52606d; border-radius: 14px; background: #66727e; }
.map-frame::after { position: absolute; inset: 0; content: ""; border: 3px solid rgba(255,255,255,.18); border-radius: 12px; pointer-events: none; }
.map-frame img { width: 100%; height: 100%; max-width: 100%; max-height: 100%; min-width: 0; min-height: 0; object-fit: contain; mix-blend-mode: normal; image-rendering: auto; }
.map-caption { position: absolute; right: 16px; bottom: 14px; color: rgba(255,255,255,.72); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.prompt-block { display: grid; grid-template-columns: 1fr auto; align-items: end; column-gap: 20px; border-bottom: 1px solid var(--line); padding-bottom: 24px; }
.prompt-label { grid-column: 1 / -1; margin-bottom: 8px; color: var(--muted); }
h2 { margin: 0; font-size: 30px; letter-spacing: 0; }
.pinyin { margin: 0; color: var(--green); font-family: Nunito, sans-serif; font-size: 22px; font-weight: 700; }
.answer-wrap { margin-top: 24px; }
.answer-wrap label { display: flex; justify-content: space-between; margin-bottom: 9px; color: var(--ink); font-size: 12px; font-weight: 700; }
.answer-wrap label span { color: var(--muted); font-family: "DM Mono", monospace; font-size: 10px; font-weight: 400; letter-spacing: .04em; }
input { width: 100%; height: 58px; padding: 0 17px; border: 2px solid #b9d8c9; border-radius: 12px; outline: 0; color: var(--ink); background: #f2faf5; font-family: "Noto Sans SC", sans-serif; font-size: 25px; transition: border .2s, box-shadow .2s, background .2s; }
input::placeholder { color: #739486; font-family: Nunito, sans-serif; font-size: 13px; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(31,103,86,.1); }
input.correct { border-color: var(--green); background: #edf8f0; }
input.incorrect { border-color: var(--coral); background: #fff4f0; }
.feedback { min-height: 23px; padding-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.feedback.good { color: var(--green); }
.feedback.bad { color: var(--coral); }
.card-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 20px; }
.secondary-button, .primary-button { min-height: 44px; padding: 0 16px; border: 2px solid var(--line); border-radius: 10px; font-size: 13px; font-weight: 800; }
.secondary-button { color: var(--green-dark); border-color: #b9d8c9; background: #dcefe4; }
.secondary-button span { margin-left: 5px; font-size: 16px; }
.primary-button { color: white; border-color: var(--green); background: var(--green); }
.primary-button:disabled { cursor: not-allowed; opacity: .35; }
.primary-button:not(:disabled):hover { background: var(--green-dark); }
footer { display: flex; gap: 12px; padding: 40px 0 32px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 10px; letter-spacing: .06em; }
.complete { text-align: center; padding: 80px 20px; }
.complete h2 { font-size: clamp(32px, 5vw, 56px); }
.complete p { color: var(--muted); }
@media (min-width: 761px) and (max-height: 850px) {
  .topbar { height: 64px; }
  .intro-row { padding: 30px 0 26px; }
  h1 { font-size: clamp(42px, 4vw, 58px); }
  .quiz-card { padding-top: 22px; padding-bottom: 26px; }
  .map-frame { height: min(35vh, 270px); margin: 16px 0 20px; }
  .prompt-block { padding-bottom: 16px; }
  .answer-wrap { margin-top: 16px; }
  input { height: 50px; }
  .feedback { padding-top: 7px; }
  .card-actions { margin-top: 14px; }
  footer { padding-top: 24px; }
}
@media (max-width: 760px) {
  .page-shell { width: min(100% - 32px, 600px); }
  .topbar { height: 68px; }
  .session-label { display: none; }
  .intro-row { display: block; padding: 44px 0 32px; }
  .intro-copy { margin-top: 20px; }
  .experience-grid { display: block; }
  .progress-panel { margin-bottom: 28px; }
  .instructions { display: none; }
  .text-button { margin-top: 18px; }
  .quiz-card { padding: 22px 18px 26px; }
  .map-frame { height: min(72vw, 350px); margin: 18px 0 24px; }
  .prompt-block { display: block; }
  .pinyin { margin-top: 5px; }
  .card-actions { align-items: stretch; }
  .secondary-button, .primary-button { flex: 1; padding: 0 8px; }
}
