:root{
  --navy:#14233f; --ink:#08142f; --paper:#fffaf0; --yellow:#ffd34f; --coral:#f17955;
  --teal:#4cc6c0; --lime:#a8dc62; --pink:#ff8eb6; --sky:#bfe7ff; --white:#fff;
  --shadow:6px 6px 0 #08142f; --radius:18px; --red:#d9343a;
}
*{box-sizing:border-box} html,body{margin:0;min-height:100%;font-family:Inter,Arial,sans-serif;background:#91d4f4;color:var(--ink)}
body{background-image:linear-gradient(rgba(255,255,255,.2) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.2) 1px,transparent 1px);background-size:24px 24px}
button{font:inherit}.hidden{display:none!important}.app-shell{min-height:100vh;display:flex;flex-direction:column}
.topbar{position:sticky;top:0;z-index:20;display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:12px;padding:10px 16px;background:var(--navy);color:#fff;border-bottom:4px solid var(--yellow)}
.brand{font-weight:900;letter-spacing:.14em;text-align:center}.top-actions{display:flex;gap:8px}.top-btn,.icon-btn{border:2px solid #fff;background:#24436f;color:#fff;border-radius:10px;padding:9px 12px;font-weight:800;cursor:pointer}.icon-btn{width:42px;padding:9px 0}.top-btn:hover,.icon-btn:hover{background:#315788}.top-btn:focus-visible,.icon-btn:focus-visible,.choice:focus-visible,.country-card:focus-visible{outline:4px solid var(--yellow);outline-offset:2px}
#main{flex:1;display:flex;align-items:stretch;justify-content:center;padding:18px}.screen{width:min(1240px,100%);margin:auto}.panel{background:var(--paper);border:4px solid var(--ink);border-radius:var(--radius);box-shadow:var(--shadow)}
.hero{overflow:hidden;display:grid;grid-template-columns:1.2fr .8fr;min-height:68vh}.hero-art{background:#000;min-height:420px}.hero-art img{width:100%;height:100%;object-fit:cover;display:block}.hero-copy{padding:34px;display:flex;flex-direction:column;justify-content:center}.eyebrow{font-weight:900;color:#b6422e;letter-spacing:.12em}.hero h1{font-size:clamp(38px,6vw,78px);margin:8px 0 10px;line-height:.92}.hero p{font-size:18px;line-height:1.5}.primary,.secondary{border:3px solid var(--ink);border-radius:12px;padding:13px 18px;font-weight:900;cursor:pointer;box-shadow:4px 4px 0 var(--ink)}.primary{background:var(--yellow)}.secondary{background:#fff}.buttons{display:flex;gap:12px;flex-wrap:wrap;margin-top:18px}
.country-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:14px}.country-card{position:relative;min-height:430px;border:4px solid var(--ink);border-radius:18px;overflow:hidden;background:#fff;cursor:pointer;box-shadow:5px 5px 0 var(--ink);text-align:left;padding:0}.country-card img{width:100%;height:330px;object-fit:cover;display:block}.country-card .country-label{padding:14px;font-size:21px;font-weight:900}.country-card .country-role{display:block;font-size:12px;margin-top:5px;color:#4b566c}.country-card:hover{transform:translateY(-3px)}
.setup{padding:24px}.setup h2{margin-top:0}.population-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.population-row input{width:120px;border:3px solid var(--ink);border-radius:10px;padding:10px;font-size:20px;font-weight:900}.hint{font-size:14px;color:#5b6475}
.game{display:grid;grid-template-rows:auto 1fr auto;gap:12px}.hud{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.meter{background:#fff;border:3px solid var(--ink);border-radius:14px;padding:10px 12px}.meter-top{display:flex;justify-content:space-between;font-weight:900;font-size:13px}.bar{height:14px;background:#e4e8ef;border:2px solid var(--ink);border-radius:99px;overflow:hidden;margin-top:6px}.fill{height:100%;background:var(--teal);width:50%}.meter.economy .fill{background:var(--yellow)}.meter.support .fill{background:var(--pink)}.meter.population .fill{background:var(--lime)}
.story-panel{display:grid;grid-template-columns:1.08fr .92fr;overflow:hidden;min-height:560px}.scene-art{background:#0a1326;position:relative}.scene-art img{width:100%;height:100%;object-fit:cover;display:block}.scene-badge{position:absolute;top:14px;left:14px;background:var(--yellow);border:3px solid var(--ink);border-radius:10px;padding:7px 10px;font-weight:900}.story-copy{padding:24px;display:flex;flex-direction:column}.story-copy h2{font-size:30px;margin:0 0 10px}.story-copy p{font-size:17px;line-height:1.45}.choice-grid{display:grid;gap:10px;margin-top:auto}.choice{border:3px solid var(--ink);border-radius:12px;background:#fff;padding:13px 14px;text-align:left;font-weight:800;cursor:pointer}.choice:hover{background:#fff2b8}.choice b{display:block;margin-bottom:4px}.choice small{font-weight:500;color:#566070}.round-line{display:flex;justify-content:space-between;align-items:center;font-size:13px;font-weight:900}.consequence{background:#fff;border:3px dashed var(--ink);border-radius:12px;padding:14px;margin-top:12px}.delta{display:inline-block;margin:4px 4px 0 0;border:2px solid var(--ink);border-radius:999px;padding:5px 8px;background:#fff;font-size:12px;font-weight:900}.delta.pos{background:#dff7c4}.delta.neg{background:#ffd6d1}
.end-grid{display:grid;grid-template-columns:1fr 1fr;overflow:hidden}.end-art img{width:100%;height:100%;object-fit:cover}.end-copy{padding:30px}.rank{font-size:60px;font-weight:1000;margin:0;color:#d95135}.report{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:16px 0}.report .meter{background:#fff}.score{font-size:26px;font-weight:900}
.modal-layer{position:fixed;inset:0;z-index:100;background:rgba(5,12,28,.72);display:flex;align-items:center;justify-content:center;padding:20px}.modal{width:min(920px,100%);max-height:90vh;overflow:auto;background:var(--paper);border:4px solid var(--ink);border-radius:18px;box-shadow:8px 8px 0 var(--ink);padding:24px}.modal h2{margin-top:0}.tutorial-step{font-size:18px;line-height:1.5}.vocab-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}.vocab-item{background:#fff;border:2px solid var(--ink);border-radius:10px;padding:9px}.vocab-item b{display:block}.print-only{display:none}
.crossword-wrap{margin-top:16px;overflow:auto}.crossword{border-collapse:collapse;margin:auto}.crossword td{width:28px;height:28px;border:1px solid #777;background:#fff;text-align:center;position:relative;font-weight:900}.crossword td.block{background:#1a2740}.crossword td .num{position:absolute;top:1px;left:2px;font-size:8px;font-weight:700}.clues{columns:2;column-gap:28px;margin-top:18px}.clue{break-inside:avoid;margin:0 0 8px}.teacher-answer{color:#8a1f1f}
@media(max-width:980px){.country-grid{grid-template-columns:repeat(2,1fr)}.hero,.story-panel,.end-grid{grid-template-columns:1fr}.hero-art{min-height:280px}.scene-art{min-height:360px}.hud{grid-template-columns:repeat(2,1fr)}}
@media(max-width:560px){#main{padding:10px}.country-grid{grid-template-columns:1fr}.country-card{min-height:0}.country-card img{height:230px}.topbar{grid-template-columns:1fr auto}.brand{display:none}.story-copy{padding:16px}.hud{grid-template-columns:1fr 1fr}.vocab-grid{grid-template-columns:1fr}.clues{columns:1}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}.country-card:hover{transform:none}}
@media print{body{background:#fff}.app-shell,.modal-layer{display:none!important}.print-only{display:block!important}.print-sheet{padding:8mm;color:#000}.crossword td{width:7mm;height:7mm}.clues{columns:2}.teacher-answer{color:#000}}

/* v17.6 — tutorial/modal overlays never participate in document flow. */
.modal-layer{
  position:fixed!important;
  inset:0!important;
  z-index:1000!important;
  width:100vw!important;
  height:100dvh!important;
  contain:layout paint;
}
.modal-layer.hidden{display:none!important}
.modal-layer>.modal{position:relative;max-height:calc(100dvh - 32px);overflow:auto}


/* =========================================================
   v17.7 — State of Affairs Classroom Edition
   Projector-first layout + country identity cards + ESL tools
   ========================================================= */

#main{
  min-height:calc(100dvh - 58px);
  padding:12px 16px 16px;
}
.screen{
  width:min(1580px,100%);
}
.hero{
  min-height:min(780px,calc(100dvh - 90px));
}
.setting-summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  margin-top:16px;
  padding:11px 13px;
  background:#eef8ff;
  border:2px solid var(--ink);
  border-radius:11px;
}
.setting-summary span{
  color:#58667e;
  font-size:12px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.setting-summary strong{
  text-align:right;
}
.teacher-settings-btn{
  background:#eaf6ff;
}
.secondary.compact{
  padding:9px 12px;
  box-shadow:3px 3px 0 var(--ink);
}

.country-select{
  margin:0 auto;
}
.country-select .setup{
  padding:22px;
}
.country-heading{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:20px;
  margin-bottom:16px;
}
.country-heading h2{
  margin:3px 0 6px;
  font-size:clamp(28px,2.4vw,40px);
}
.country-heading p{
  margin:0;
}
.country-grid{
  grid-template-columns:repeat(5,minmax(0,1fr));
  gap:16px;
}
.country-card{
  --country-accent:#ffffff;
  --country-accent-2:#cf2d39;
  aspect-ratio:4/5;
  min-height:0;
  isolation:isolate;
  border:4px solid var(--ink);
  border-bottom:8px solid var(--country-accent-2);
  border-radius:18px;
  box-shadow:6px 6px 0 var(--ink);
  background:#10182c;
  transition:transform .18s ease,filter .18s ease;
}
.country-card img{
  position:absolute;
  inset:0;
  z-index:-2;
  width:100%;
  height:100%;
  object-fit:cover;
}
.country-card .country-shade{
  position:absolute;
  inset:0;
  z-index:-1;
  background:
    linear-gradient(180deg,rgba(4,12,30,.03) 42%,rgba(4,12,30,.2) 58%,rgba(4,12,30,.96) 100%),
    linear-gradient(135deg,transparent 55%,color-mix(in srgb,var(--country-accent-2) 35%,transparent));
}
.country-card .country-label{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  padding:56px 16px 16px;
  color:#fff;
  text-shadow:0 2px 4px rgba(0,0,0,.75);
}
.country-name{
  display:block;
  font-size:clamp(22px,1.65vw,30px);
  font-weight:1000;
  line-height:1;
}
.country-card .country-role{
  margin-top:8px;
  color:#fff;
  font-size:11px;
  letter-spacing:.07em;
  text-transform:uppercase;
  opacity:.9;
}
.country-card:hover{
  transform:translateY(-5px) scale(1.012);
  filter:saturate(1.08) contrast(1.02);
}
.country-kr{--country-accent:#fff;--country-accent-2:#d9343a}
.country-tw{--country-accent:#173d83;--country-accent-2:#e52d35}
.country-cn{--country-accent:#d91f26;--country-accent-2:#f6c542}
.country-nk{--country-accent:#24559c;--country-accent-2:#d42d35}
.country-jp{--country-accent:#fff;--country-accent-2:#d7193f}

.route-setup{
  display:grid;
  grid-template-columns:minmax(320px,.72fr) 1.28fr;
  min-height:min(720px,calc(100dvh - 92px));
  overflow:hidden;
  padding:0;
}
.route-cover{
  min-height:520px;
  background:#0c1932;
}
.route-cover img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.route-copy{
  padding:clamp(26px,4vw,54px);
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.route-copy h2{
  font-size:clamp(34px,4vw,58px);
  margin:6px 0 14px;
}
.route-copy>p{
  font-size:18px;
  line-height:1.55;
}

.game{
  width:min(1660px,100%);
  height:calc(100dvh - 86px);
  min-height:0;
  margin:0 auto;
  grid-template-rows:auto minmax(0,1fr);
  gap:10px;
}
.hud{
  gap:10px;
}
.meter{
  padding:8px 11px;
}
.bar{
  height:12px;
  margin-top:5px;
}
.story-panel{
  min-height:0;
  height:100%;
  grid-template-columns:minmax(0,1.08fr) minmax(440px,.92fr);
}
.scene-art{
  min-height:0;
}
.story-copy{
  min-height:0;
  padding:clamp(19px,2.1vw,30px);
  overflow:auto;
}
.story-copy h2{
  font-size:clamp(27px,2.3vw,39px);
  line-height:1.02;
  margin:7px 0 10px;
}
.scenario-text{
  margin:4px 0 10px;
  font-size:clamp(16px,1.16vw,19px)!important;
  line-height:1.42!important;
}
.teacher-prompt{
  margin:7px 0 12px;
  padding:9px 11px;
  background:#edf8ff;
  border-left:5px solid var(--teal);
  border-radius:8px;
  color:#495874;
  font-size:13px!important;
  line-height:1.4!important;
}
.teacher-prompt span{
  display:block;
  margin-top:2px;
  font-size:11px;
}
.choice-grid{
  gap:9px;
}
.choice{
  padding:11px 13px;
}
.choice b{
  font-size:15px;
}
.choice small{
  display:block;
  line-height:1.32;
}
.consequence{
  padding:12px;
  margin-top:0;
}
.consequence p{
  margin:7px 0;
}

/* Inline vocabulary: L2 meaning appears on hover, keyboard focus or tap. */
.vocab{
  position:relative;
  display:inline;
  border-bottom:2px dotted #b6422e;
  color:#8f2f23;
  font-weight:800;
  cursor:help;
}
.vocab:focus{
  outline:3px solid var(--yellow);
  outline-offset:2px;
  border-radius:3px;
}
.vocab-tooltip{
  position:absolute;
  left:50%;
  bottom:calc(100% + 10px);
  z-index:60;
  width:max-content;
  max-width:min(330px,70vw);
  transform:translate(-50%,5px);
  padding:9px 11px;
  background:var(--navy);
  color:#fff;
  border:2px solid #fff;
  border-radius:10px;
  box-shadow:4px 4px 0 rgba(8,20,47,.45);
  font-size:13px;
  font-weight:600;
  line-height:1.35;
  text-align:left;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .12s ease,transform .12s ease;
}
.vocab-tooltip::after{
  content:"";
  position:absolute;
  top:100%;
  left:50%;
  border:7px solid transparent;
  border-top-color:var(--navy);
  transform:translateX(-50%);
}
.vocab-tooltip strong{
  display:block;
  margin-bottom:3px;
  color:var(--yellow);
  text-transform:uppercase;
  letter-spacing:.05em;
  font-size:10px;
}
.vocab:hover>.vocab-tooltip,
.vocab:focus>.vocab-tooltip,
.vocab.vocab-open>.vocab-tooltip{
  opacity:1;
  visibility:visible;
  transform:translate(-50%,0);
}

/* Teacher settings */
.teacher-settings-modal{
  width:min(720px,100%);
}
.settings-field{
  display:grid;
  gap:8px;
  margin:20px 0;
}
.settings-field>span{
  font-size:12px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.settings-field select{
  width:100%;
  border:3px solid var(--ink);
  border-radius:10px;
  background:#fff;
  padding:13px;
  font:inherit;
  font-weight:800;
  color:var(--ink);
}
.settings-preview{
  padding:14px 16px;
  background:#eef8ff;
  border:2px solid #90cde9;
  border-radius:12px;
}
.settings-preview-label{
  font-size:11px;
  font-weight:900;
  color:#32627b;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.settings-preview p{
  margin:5px 0 0;
  line-height:1.45;
}

/* Student support center */
.support-modal{
  width:min(1120px,96vw);
  height:min(820px,90dvh);
  overflow:hidden!important;
  display:flex;
  flex-direction:column;
}
.support-header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:22px;
}
.support-header h2{
  margin-bottom:6px;
}
.support-language{
  flex:none;
  min-width:230px;
  padding:9px 11px;
  border:2px solid var(--ink);
  border-radius:10px;
  background:#eef8ff;
}
.support-language span,
.support-language strong{
  display:block;
}
.support-language span{
  color:#5b6475;
  font-size:10px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.support-tabs{
  display:flex;
  gap:8px;
  margin:12px 0;
  border-bottom:3px solid var(--ink);
}
.support-tab{
  border:0;
  border-radius:9px 9px 0 0;
  background:#dce4ed;
  color:var(--ink);
  padding:10px 17px;
  font-weight:900;
  cursor:pointer;
}
.support-tab.active{
  background:var(--yellow);
}
.support-panel{
  flex:1;
  min-height:0;
  overflow:auto;
  padding:2px 4px 6px 0;
}
.support-intro{
  margin:2px 0 12px;
  color:#566070;
}
.vocab-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
.vocab-item{
  padding:11px 12px;
}
.vocab-word{
  font-size:16px;
  font-weight:1000;
  color:#9b3527;
}
.vocab-definition{
  margin-top:3px;
  color:#404b60;
  font-size:13px;
  line-height:1.35;
}
.vocab-l2{
  margin-top:7px;
  padding-top:7px;
  border-top:1px solid #d6dce5;
  color:#14233f;
  font-size:14px;
  font-weight:700;
}
.vocab-l2 span{
  display:block;
  margin-bottom:2px;
  color:#6b7588;
  font-size:9px;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.crossword-toolbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  margin-bottom:10px;
}
.crossword-toolbar .buttons{
  margin:0;
  flex-wrap:nowrap;
}
.crossword-layout{
  display:grid;
  grid-template-columns:minmax(500px,1.05fr) minmax(280px,.95fr);
  gap:22px;
  align-items:start;
}
.crossword-wrap{
  margin:0;
  overflow:auto;
  padding:10px;
  background:#d8edf8;
  border:2px solid var(--ink);
  border-radius:12px;
}
.crossword td{
  width:25px;
  height:25px;
  border:1px solid #7a8798;
}
.crossword td.block{
  background:#14233f;
}
.student-preview .teacher-answer{
  color:#9a2e27;
  opacity:.33;
}
.clues{
  columns:1;
  margin:0;
  font-size:13px;
  line-height:1.35;
}
.clue{
  padding:5px 0;
  border-bottom:1px solid #d8dde5;
}
.support-footer{
  margin-top:10px;
  justify-content:flex-end;
}

@media(max-width:1100px){
  .country-grid{grid-template-columns:repeat(3,1fr)}
  .country-card{aspect-ratio:4/5}
  .game{height:auto;min-height:calc(100dvh - 86px)}
  .story-panel{grid-template-columns:1fr}
  .scene-art{min-height:48vh}
  .crossword-layout{grid-template-columns:1fr}
}
@media(max-width:760px){
  .country-heading{align-items:flex-start;flex-direction:column}
  .country-grid{grid-template-columns:repeat(2,1fr)}
  .route-setup{grid-template-columns:1fr}
  .route-cover{min-height:44vh}
  .support-header,.crossword-toolbar{align-items:stretch;flex-direction:column}
  .support-language{min-width:0}
  .crossword-toolbar .buttons{flex-wrap:wrap}
}
@media(max-width:520px){
  .country-grid{grid-template-columns:1fr}
  .support-modal{height:94dvh;padding:16px}
}
@media(max-height:760px) and (min-width:1101px){
  #main{padding-top:9px}
  .game{height:calc(100dvh - 78px)}
  .story-copy{padding:16px 18px}
  .story-copy h2{font-size:26px}
  .scenario-text{font-size:15px!important}
  .choice{padding:8px 11px}
  .choice b{font-size:14px}
  .choice small{font-size:11px}
  .teacher-prompt{padding:7px 9px;margin:5px 0 8px}
}

/* V18.1 — branching classroom play and accessible inline language support. */
button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:4px solid #a84f00;outline-offset:3px}
.fill{transition:width .3s ease}
.vote-option{display:grid;grid-template-columns:minmax(0,1fr) 66px;gap:8px;align-items:stretch}
.vote-label{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:4px;font-size:12px;font-weight:800;background:#e6f3fa;border:2px solid #89a5ba;border-radius:10px}
.vote-input{width:49px;padding:5px 2px;border:1px solid #667d96;border-radius:5px;text-align:center;font:inherit;font-size:17px;background:#fff;color:var(--ink)}
.vote-tools{display:flex;align-items:center;gap:12px;margin-top:3px}.vote-tools .hint{line-height:1.3}.vote-tools button{flex:none;font-size:11px}
.scene-art img{object-fit:contain;position:absolute;inset:0;width:100%;height:100%}
.story-copy{scrollbar-gutter:stable;gap:2px}.story-copy h2:focus{outline:none}
.story-copy .choice-grid{margin-top:auto;padding-bottom:5px}
.scenario-text{font-size:clamp(17px,1.22vw,21px)!important;line-height:1.5!important}
.round-line{gap:12px;flex-wrap:wrap;color:#415570}
.choice b{font-size:16px}.choice small{font-size:14px;line-height:1.4}
.vocab{color:#873423;border-bottom:2px dotted #873423;text-underline-offset:3px;cursor:pointer}
.floating-vocab{position:fixed;z-index:2000;max-width:min(370px,calc(100vw - 16px));width:max-content;background:var(--navy);color:white;border:2px solid white;border-radius:12px;padding:13px 16px;box-shadow:0 5px 20px #0005;line-height:1.5;font-size:17px;overflow-wrap:anywhere;max-height:calc(100dvh - 16px);overflow:auto}
.floating-vocab strong{display:block;color:var(--yellow);font-size:13px;margin-bottom:4px}
.floating-vocab span{display:block}
.end-grid{grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr)}
.end-art{min-height:550px;background:var(--navy)}.end-art img{display:block;object-fit:contain;max-height:calc(100dvh - 100px)}
.end-copy h2{font-size:clamp(30px,3vw,44px);margin:12px 0}.end-copy .hud{grid-template-columns:repeat(2,minmax(0,1fr))}
.ending-summary{padding-left:22px;line-height:1.6}.ending-summary li{margin:8px 0}details{margin:18px 0}summary{cursor:pointer;font-weight:800}details li{margin:12px 0;line-height:1.4}
.crossword td{min-width:22px;width:22px;height:22px}.crossword-layout{grid-template-columns:minmax(0,1.1fr) minmax(240px,.9fr)}
#saveStatus:empty{display:none}.settings-field>span{font-size:15px}.modal p{line-height:1.5}
@media(min-width:1101px){.story-panel{grid-template-columns:minmax(0,1.02fr) minmax(480px,.98fr)}.scene-art{overflow:hidden}.story-copy{padding:20px 24px}}
@media(max-height:800px) and (min-width:1101px){.story-copy{padding:12px 18px}.story-copy h2{font-size:27px}.scenario-text{font-size:17px!important;line-height:1.42!important}.choice{padding:9px 11px}.choice small{font-size:13px}.teacher-prompt{margin:5px 0;padding:6px 8px}}
@media(max-width:1100px){.game{height:auto}.scene-art{min-height:0;aspect-ratio:16/9}.scene-art img{object-fit:contain}.story-copy{overflow:visible}.story-panel{height:auto}.choice-grid{margin-top:14px!important}.end-grid{grid-template-columns:1fr}.end-art{min-height:0;max-height:45vh;overflow:hidden}.end-art img{height:45vh}.end-copy{padding:24px}}
@media(max-width:680px){.topbar{grid-template-columns:auto 1fr;padding:8px;gap:6px}.brand{display:none}.top-actions{justify-content:flex-end;gap:5px;flex-wrap:wrap}.top-btn{font-size:11px;padding:8px}.icon-btn{width:34px;font-size:14px;padding:6px 0}.hero-copy{padding:24px}.vote-tools{align-items:flex-start}.modal-layer{padding:8px}.modal{padding:18px}.crossword-layout{grid-template-columns:1fr}.vocab-grid{grid-template-columns:1fr}.floating-vocab{font-size:16px}.scenario-text{font-size:18px!important}}
@media print{@page{size:A4;margin:12mm}.floating-vocab{display:none!important}.print-sheet{padding:0;font-family:Arial,sans-serif}.print-sheet h1{font-size:19px;margin:0 0 4mm}.print-sheet h2{font-size:15px;margin:0 0 3mm}.print-sheet p{font-size:11px;margin:2mm 0}.print-sheet .crossword{margin:5mm auto}.print-sheet .crossword td{width:5.5mm;min-width:5.5mm;height:5.5mm;font-size:12px;padding:0;border:1px solid #333}.print-sheet .crossword td.block{background:#ccc!important;print-color-adjust:exact}.print-sheet .clues{columns:2;font-size:11px;line-height:1.35;column-gap:8mm}.print-sheet .clue{padding:2mm 0;break-inside:avoid}.print-sheet .num{font-size:7px}}
@media print{html,body{background:#fff!important;background-image:none!important;min-height:0!important;height:auto!important}.print-sheet .answer-letter{display:block;padding-top:2px;line-height:1}.print-sheet .clue{border-bottom:1px solid #ddd}}
html,body{font-family:Inter,Arial,'Noto Sans CJK KR','Noto Sans KR','Malgun Gothic','Apple SD Gothic Neo','Hiragino Kaku Gothic ProN','Yu Gothic','Microsoft YaHei','Microsoft JhengHei',sans-serif}
/* V18.2: classroom reading space, intact art and a shared selection system. */
.country-grid{grid-template-columns:repeat(6,minmax(0,1fr));width:100%;max-width:clamp(660px,calc((100svh - 220px)*1.18),960px);margin:0 auto;gap:18px 22px}
.country-card{grid-column:span 2;--country-accent-2:var(--red);border-bottom-color:var(--red)}
.country-card:nth-child(4){grid-column:2 / span 2}.country-card:nth-child(5){grid-column:4 / span 2}
.country-card img,.route-cover img,.hero-art img,.scene-art img,.end-art img{object-fit:contain}
.country-card .country-shade{background:linear-gradient(180deg,transparent 50%,rgba(4,12,30,.9) 100%)}
.country-name{font-size:clamp(21px,1.7vw,28px)}
.country-card .country-label{padding:38px 12px 12px}
.country-card .country-role{font-size:10px;line-height:1.4;letter-spacing:.03em}
.scene-art{background:var(--navy)}
.scene-art img{object-position:center;transition:filter .25s ease}
.story-copy{display:flex;flex-direction:column;min-width:0;gap:0}
.story-copy .choice-grid{margin-top:14px;flex-shrink:0}
.story-copy h2{font-size:clamp(26px,2.2vw,36px);line-height:1.08;margin:7px 0 10px}
.story-copy .scenario-text{font-size:18px!important;line-height:1.45!important;margin:0 0 9px}
.teacher-prompt{font-size:13px!important;margin:3px 0 10px;padding:7px 10px}
.scene-vocabulary{border:1px solid #b6c5d6;border-left:4px solid var(--red);border-radius:9px;background:#edf3f8;padding:10px 12px;margin:0;color:var(--ink);flex-shrink:0}
.scene-vocabulary h3{font:800 11px/1.35 Inter,Arial,sans-serif;letter-spacing:.08em;margin:0 0 7px;color:#40516c}
.scene-vocabulary h3 span{font-weight:500;letter-spacing:0;margin-left:7px}
.scene-vocabulary dl{margin:0;display:grid;gap:7px}
.scene-vocabulary dl>div{display:grid;grid-template-columns:minmax(90px,25%) minmax(0,1fr);column-gap:9px}
.scene-vocabulary dt{font-size:15px;font-weight:800;color:#842d36;overflow-wrap:anywhere}
.scene-vocabulary dd{margin:0;font-size:14px;line-height:1.35;color:#253753}
.vocabulary-l2{display:block;font-size:13px;color:#465a76;margin-top:2px}
.choice b{font-size:16px}.choice small{font-size:14px;line-height:1.35}
.decision-back{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:3px}
.decision-back .hint{font-size:12px}
.meter-value{font-variant-numeric:tabular-nums}
.meter-change{display:inline-block;min-width:24px;font-size:14px;opacity:0;transition:opacity .2s ease}
.meter-change.positive{color:#11633f}.meter-change.negative{color:#a22929}
.meters-moving .meter-change,.consequence-ready .meter-change{opacity:1}
.meters-moving .meter-change{animation:delta-pulse 1s ease-out}
.is-resolving .fill{transition:none}
.meters-moving .scene-art img{filter:brightness(.78)}
.animated-consequence{padding:12px 0 0;border-top:2px solid #c4d0df;min-height:120px}
.resolution-label{font-weight:800;color:#273950;line-height:1.4;font-size:15px}
.resolution-label span{display:block;font-weight:500;color:#58667b;font-size:12px;margin-top:3px}
#resolutionCopy{font-size:18px;line-height:1.45;margin:10px 0}
.consequence-ready #resolutionCopy{animation:consequence-reveal .3s ease-out}
.animated-consequence .buttons{margin-top:12px}
button:disabled{cursor:default;opacity:.5;transform:none}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@keyframes delta-pulse{0%{transform:scale(1)}40%{transform:scale(1.25)}100%{transform:scale(1)}}
@keyframes consequence-reveal{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
@media(min-width:1101px){.story-panel{grid-template-columns:minmax(0,.82fr) minmax(520px,1.18fr)}.story-copy{padding:16px 20px}}
@media(max-width:1100px){.story-panel{grid-template-columns:1fr}.story-copy{padding:20px}.country-grid{max-width:800px}.scene-art{aspect-ratio:16/9}.game>.hud{position:sticky;top:var(--topbar-height,96px);z-index:15;padding:6px 0;background:#91d4f4}.choice,.animated-consequence .buttons{scroll-margin-top:calc(var(--topbar-height,96px) + 130px)}}
@media(max-width:760px){.country-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.country-card,.country-card:nth-child(4),.country-card:nth-child(5){grid-column:auto}.country-card:nth-child(5){grid-column:1 / -1;width:calc((100% - 14px)/2);justify-self:center}.scene-vocabulary h3 span{display:block;margin:3px 0 0}}
@media(max-width:520px){.country-grid{grid-template-columns:1fr;max-width:320px}.country-card,.country-card:nth-child(5){grid-column:auto;width:100%}.country-name{font-size:26px}.story-copy{padding:16px}.meter-top{font-size:12px}.meter-change{font-size:12px;min-width:18px}.scene-vocabulary dl>div{grid-template-columns:minmax(80px,29%) minmax(0,1fr)}}
@media(prefers-reduced-motion:reduce){.country-card,.scene-art img,.fill,.meter-change{transition:none!important}.meters-moving .meter-change,.consequence-ready #resolutionCopy{animation:none!important}.country-card:hover{transform:none}}
#fullscreenBtn{font-size:0}#fullscreenBtn::before{content:'';display:block;width:15px;height:15px;margin:auto;background:linear-gradient(#fff,#fff) left top/6px 2px no-repeat,linear-gradient(#fff,#fff) left top/2px 6px no-repeat,linear-gradient(#fff,#fff) right top/6px 2px no-repeat,linear-gradient(#fff,#fff) right top/2px 6px no-repeat,linear-gradient(#fff,#fff) left bottom/6px 2px no-repeat,linear-gradient(#fff,#fff) left bottom/2px 6px no-repeat,linear-gradient(#fff,#fff) right bottom/6px 2px no-repeat,linear-gradient(#fff,#fff) right bottom/2px 6px no-repeat}
@media print{.print-sheet .crossword td{width:6.5mm;min-width:6.5mm;height:6.5mm;font-size:13px}.print-sheet .answer-letter{padding-top:4px}.print-sheet .num{font-size:7px;line-height:1}}

/* V18.3 — artwork-led decisions and a separate history screen. */
.game.decision-screen{height:auto;min-height:0;width:min(1800px,100%);grid-template-rows:auto auto;align-content:start;align-self:flex-start}
.decision-screen .story-panel{grid-template-columns:minmax(0,2fr) minmax(0,1fr);align-items:start;height:auto;min-height:0;background:transparent;border:0;box-shadow:none;gap:12px;overflow:visible}
.decision-screen .scene-art{min-height:0;aspect-ratio:auto;align-self:start;background:transparent;border:3px solid var(--ink);border-radius:16px;overflow:hidden}
.decision-screen .scene-art img{position:static;inset:auto;width:100%;height:auto;max-height:none;display:block;object-fit:contain}
.decision-screen .story-copy{background:var(--cream,#fff9ed);border:3px solid var(--ink);border-radius:16px;padding:16px;max-height:var(--scene-height,calc(100dvh - 180px));overflow:auto;scrollbar-gutter:stable;min-width:0}
.decision-screen .story-copy h2{font-size:clamp(24px,2vw,34px);line-height:1.1}
.decision-screen .story-copy .choice-grid{margin-top:12px}
.decision-screen .round-line{font-size:11px;gap:6px}
.decision-screen .scenario-text{font-size:clamp(16px,1.16vw,20px)!important;line-height:1.45!important}
.decision-screen .choice b{font-size:15px;line-height:1.35}
.decision-screen .choice small{font-size:13px}
.decision-screen .scene-vocabulary dl>div{grid-template-columns:1fr;gap:4px}
.decision-screen .scene-vocabulary dd{margin:0}
.decision-screen .scene-vocabulary h3 span{display:block;margin:4px 0 0}
.decision-screen .decision-back{flex-wrap:wrap}
.consequence-screen{width:min(1320px,100%);margin:0 auto;display:grid;gap:14px}
.consequence-heading{text-align:center}
.consequence-heading h2{font-size:clamp(25px,2.4vw,38px);line-height:1.12;margin:8px 0}
.consequence-heading h2:focus{outline:none}
.consequence-heading p{font-size:17px;margin:6px 0 2px}
.history-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.history-card{--chart-color:#168b83;background:#fff;border:3px solid var(--ink);border-radius:16px;padding:12px 16px 8px;min-width:0;box-shadow:0 4px 0 var(--ink)}
.history-card.population{--chart-color:#64992e}.history-card.economy{--chart-color:#aa7900}.history-card.support{--chart-color:#be417e}
.history-card header{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap}
.history-card h3{font-size:clamp(17px,1.6vw,23px);margin:0}
.history-value{font-variant-numeric:tabular-nums;white-space:nowrap}
.chart-value{font-size:26px;font-weight:900}
.chart-delta{font-size:16px;font-weight:800;opacity:0;display:inline-block}
.chart-delta.positive{color:#17673e}.chart-delta.negative{color:#a22929}.chart-delta.unchanged{color:#566070;font-size:13px}
.chart-unit{font-size:12px;color:#526071;margin:3px 0 0}
.history-card svg{width:100%;height:clamp(100px,calc((100dvh - var(--topbar-height,64px) - 450px)/2),190px);display:block;overflow:visible}
.chart-grid{stroke:#dbe3eb;stroke-width:1}.chart-tick{font-size:12px;fill:#4d5c6c;font-family:Arial,sans-serif}
.history-line,.new-segment{fill:none;stroke:var(--chart-color);stroke-width:3;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.history-dot,.current-point{fill:var(--chart-color)}
.current-point{stroke:#fff;stroke-width:2;transform-box:fill-box;transform-origin:center}
.chart-now{fill:var(--chart-color);font-size:11px;font-weight:900;opacity:0}
.chart-axis-label{display:block;text-align:center;font-size:11px;color:#526071;margin:0 0 2px}
.meters-moving .chart-delta,.consequence-ready .chart-delta,.consequence-ready .chart-now{opacity:1}
.consequence-ready .current-point{animation:history-point-pulse .7s ease-out}
.consequence-footer{padding:14px 20px;display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.consequence-message{flex:1;min-width:220px;min-height:52px;display:flex;align-items:center}
.consequence-footer #resolutionCopy{font-size:19px;margin:0}
.consequence-footer .buttons{margin:0;flex-shrink:0}
.consequence-footer #saveStatus:empty{display:none}
.tutorial-chart .history-card svg{max-height:160px}
@keyframes history-point-pulse{50%{transform:scale(1.8)}}
@media(min-width:1600px){.decision-screen .scene-vocabulary dl>div{grid-template-columns:minmax(80px,28%) minmax(0,1fr)}}
@media(max-width:1100px) and (min-width:901px){.decision-screen>.hud{position:static;grid-template-columns:repeat(4,minmax(0,1fr))}.decision-screen .story-copy{padding:12px}.decision-screen .meter-top{font-size:11px}}
@media(max-width:900px){.decision-screen .story-panel{grid-template-columns:1fr}.decision-screen .story-copy{max-height:none;overflow:visible}.decision-screen .scene-art{aspect-ratio:auto}.history-card{padding:10px}.history-card svg{height:auto;max-height:none;min-height:0}.consequence-footer .buttons{flex-wrap:wrap}.consequence-heading p{font-size:15px}}
@media(max-width:560px){.history-grid{gap:9px}.history-card{padding:8px 6px;border-width:2px;border-radius:10px}.history-card header{display:block}.history-card h3{font-size:14px}.chart-value{font-size:23px}.chart-delta{font-size:12px}.chart-unit{font-size:10px;min-height:25px}.history-card svg{min-height:90px}.chart-axis-label{font-size:9px}.consequence-screen{gap:12px}.consequence-footer{padding:12px}.consequence-footer #resolutionCopy{font-size:17px}.consequence-footer .buttons{width:100%}.consequence-footer .buttons button{flex:1;padding:10px;font-size:12px}}
@media(prefers-reduced-motion:reduce){.consequence-ready .current-point{animation:none}}
@media(max-width:560px){.history-card .chart-tick{font-size:26px}.history-card .chart-now{display:none}}

/* V19: fixed classroom viewport; full-height reading panel, not artwork-height. */
@media screen{
 html,body{height:100%;min-height:0;overflow:hidden;overscroll-behavior:none}
 .app-shell{height:100dvh;min-height:0;overflow:hidden}
 .topbar{flex-shrink:0;position:relative}
 #main{min-height:0;min-width:0;overflow:auto;overscroll-behavior:contain;padding:10px 12px 12px}
 #main:has(.decision-screen),#main:has(.consequence-screen){overflow:hidden}
 #main>.screen:not(.decision-screen):not(.consequence-screen){margin-top:0;margin-bottom:auto;flex-shrink:0}
 .game.decision-screen{height:100%;width:100%;margin:0;grid-template-rows:auto minmax(0,1fr);gap:10px;align-self:stretch}
 .decision-screen>.hud{position:static;grid-template-columns:repeat(4,minmax(0,1fr));padding:0;background:none}
 .decision-screen .story-panel{height:100%;min-height:0;grid-template-columns:minmax(0,2fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr);align-items:start}
 .decision-screen .scene-art{height:auto;max-height:100%;max-width:100%;justify-self:start;min-width:0;aspect-ratio:auto}
 .decision-screen .scene-art img{width:auto;max-width:100%;height:auto;max-height:calc(100dvh - var(--topbar-height,64px) - 110px);object-fit:contain}
 .decision-screen .story-copy{--scene-scale:1;height:100%;max-height:none;overflow:hidden;scrollbar-gutter:auto;padding:calc(14px * var(--scene-scale));gap:0}
 .decision-screen .story-copy>*{flex-shrink:0}
 .decision-screen .story-copy h2{font-size:calc(clamp(24px,1.9vw,34px) * var(--scene-scale));line-height:1.12;margin:calc(6px * var(--scene-scale)) 0 calc(9px * var(--scene-scale))}
 .decision-screen .round-line{font-size:calc(11px * var(--scene-scale));line-height:1.25;gap:5px}
 .decision-screen .scenario-text{font-size:calc(18px * var(--scene-scale))!important;line-height:1.4!important;margin:0 0 calc(9px * var(--scene-scale))}
 .decision-screen .teacher-prompt{font-size:calc(12px * var(--scene-scale))!important;line-height:1.3;padding:calc(7px * var(--scene-scale));margin:0 0 calc(9px * var(--scene-scale))}
 .decision-screen .scene-vocabulary{padding:calc(9px * var(--scene-scale));border-left-width:3px}
 .decision-screen .scene-vocabulary h3{font-size:calc(11px * var(--scene-scale));margin-bottom:calc(6px * var(--scene-scale))}
 .decision-screen .scene-vocabulary h3 span{display:inline;margin:0 0 0 5px}
 .decision-screen .scene-vocabulary dl{gap:calc(6px * var(--scene-scale))}
 .decision-screen .scene-vocabulary dl>div{grid-template-columns:minmax(0,28%) minmax(0,1fr);gap:calc(8px * var(--scene-scale))}
 .decision-screen .scene-vocabulary dt{font-size:calc(14px * var(--scene-scale))}
 .decision-screen .scene-vocabulary dd{font-size:calc(13px * var(--scene-scale));line-height:1.3}
 .decision-screen .vocabulary-l2{font-size:calc(12px * var(--scene-scale));margin-top:1px}
 .decision-screen .story-copy .choice-grid{margin-top:calc(10px * var(--scene-scale))!important;gap:calc(8px * var(--scene-scale));padding-bottom:4px}
 .decision-screen .choice{padding:calc(9px * var(--scene-scale));border-width:2px;min-width:0}
 .decision-screen .choice b{font-size:calc(15px * var(--scene-scale));line-height:1.25;margin-bottom:calc(3px * var(--scene-scale))}
 .decision-screen .choice small{display:block;font-size:calc(13px * var(--scene-scale));line-height:1.25}
 .decision-screen .decision-back{gap:calc(6px * var(--scene-scale));margin:0}
 .decision-screen .decision-back button{font-size:calc(12px * var(--scene-scale));padding:calc(8px * var(--scene-scale))}
 .decision-screen .story-copy .hint{font-size:calc(11px * var(--scene-scale));line-height:1.2;margin:0}
 .decision-screen #saveStatus:empty{display:none}
 .consequence-screen{height:100%;min-height:0;grid-template-rows:auto minmax(0,1fr) auto;gap:10px}
 .consequence-screen .history-grid{min-height:0;grid-template-rows:repeat(2,minmax(0,1fr))}
 .consequence-screen .history-card{min-height:0;display:flex;flex-direction:column}
 .consequence-screen .history-card svg{height:0;min-height:0;flex:1}
}
@media screen and (max-width:1000px){
 .decision-screen .story-panel{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px}
 .decision-screen .meter{padding:6px 8px}.decision-screen .meter-top{font-size:11px}.decision-screen .bar{height:10px;margin-top:4px}
}
@media screen and (max-width:600px) and (min-height:601px){
 .decision-screen .story-panel{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,22%) minmax(0,1fr);gap:8px}
 .decision-screen .scene-art{height:100%;justify-self:center}
 .decision-screen .scene-art img{height:100%;width:auto;max-height:100%}
 .decision-screen>.hud{gap:4px}.decision-screen .meter{border-width:2px;padding:5px 4px;border-radius:8px}.decision-screen .meter-top{font-size:9px;gap:2px;flex-wrap:wrap}
 .decision-screen .meter-change{display:none}
 .consequence-heading h2{font-size:22px}.consequence-heading .eyebrow{font-size:11px}
}
@media screen and (max-height:500px){
 .topbar{padding:4px 8px}.top-btn,.icon-btn{padding:4px 8px}
 #main{padding:6px}.decision-screen .story-panel{grid-template-columns:minmax(0,.6fr) minmax(0,2fr)}
 .decision-screen .story-copy{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr);gap:calc(10px * var(--scene-scale));align-content:start}
 .decision-screen .scene-narrative,.decision-screen .scene-actions{min-width:0}
 .decision-screen>.hud .meter{padding:4px 8px}.decision-screen>.hud .bar{height:8px}
 .consequence-screen{gap:5px}.consequence-heading h2{font-size:18px;margin:2px}.consequence-heading p,.consequence-heading .eyebrow{font-size:11px;margin:2px}
 .consequence-screen .history-grid{grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:minmax(0,1fr);gap:7px}
 .consequence-screen .history-card{padding:6px}.consequence-screen .history-card h3{font-size:13px}.chart-value{font-size:18px}
 .consequence-footer{padding:6px 10px;gap:6px}.consequence-footer #resolutionCopy{font-size:13px}.consequence-message{min-height:20px}
 .consequence-footer .buttons{width:auto}.consequence-footer .buttons button{padding:6px;font-size:11px}
}

/* V19.2 — title, route and decision presentation polish. */
.country-card:hover,.country-card:focus-visible{border-bottom-color:#91d4f4}
.story-vocab{text-decoration-line:underline;text-decoration-color:var(--red);text-decoration-thickness:2px;text-underline-offset:3px}
@media screen and (min-width:981px){
  #main>.hero{grid-template-columns:minmax(0,2fr) minmax(360px,1fr);min-height:0;height:auto;margin:auto!important;align-self:center}
  .hero-art{min-height:0;aspect-ratio:16/9;background:var(--navy)}
  .hero-art img{object-fit:cover}
  #main>.route-setup{margin:auto!important;align-self:center}
  .decision-screen .story-panel{align-items:center}
  .decision-screen .scene-art{align-self:center;justify-self:center}
}
