/* =========================================================
   THẦY GIÁO ÁC MA — arcade cabinet shell
   1990 Japanese arcade / 16-bit CRT
   ========================================================= */

:root{
  --bg:        #170a2e;
  --bg-2:      #24104a;
  --panel:     #331a68;
  --panel-2:   #45248a;
  --panel-3:   #5a31ad;
  --edge:      #9a6ce0;
  --edge-hot:  #c49bff;
  --gold:      #ffc83d;
  --gold-dk:   #c98a12;
  --cream:     #fff8ec;
  --teal:      #3ee8d2;
  --green:     #43f07c;
  --red:       #ff5b5b;
  --red-dk:    #c02128;
  --ink:       #14082a;

  --px:    'Pixelify Sans', 'Press Start 2P', 'Courier New', monospace;
  --px-strict: 'Press Start 2P', 'Courier New', monospace;
  --jp:    'DotGothic16', 'Pixelify Sans', monospace;

  --bevel: 3px;
}

*,*::before,*::after{ box-sizing:border-box; }

html,body{ height:100%; }

body{
  margin:0;
  background:
    radial-gradient(ellipse at 50% -10%, #5a2fb0 0%, transparent 62%),
    radial-gradient(ellipse at 50% 120%, #4a2190 0%, transparent 58%),
    var(--bg);
  color:var(--cream);
  font-family:var(--px);
  font-size:16px;
  line-height:1.25;
  overflow:hidden;
  -webkit-font-smoothing:none;
  font-smooth:never;
  text-rendering:geometricPrecision;
  user-select:none;
  -webkit-tap-highlight-color:transparent;
}

/* ---------- CRT scanlines + vignette ---------- */
body::after{
  content:"";
  position:fixed; inset:0;
  pointer-events:none;
  z-index:9000;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0,0,0,0)   0px,
      rgba(0,0,0,0)   3px,
      rgba(0,0,0,.09) 4px,
      rgba(0,0,0,.09) 5px);
  mix-blend-mode:multiply;
}
body::before{
  content:"";
  position:fixed; inset:0;
  pointer-events:none;
  z-index:8999;
  background:radial-gradient(ellipse at 50% 45%, transparent 68%, rgba(0,0,0,.22) 100%);
}

.vn{ font-family:var(--px); opacity:.82; }
.sep{ opacity:.35; margin:0 .45em; }
.glyph{
  font-family:'Segoe UI Symbol','Segoe UI Emoji',var(--px);
  font-size:1.35em;
  line-height:1;
  vertical-align:-0.12em;
  margin-right:.12em;
}

/* =========================================================
   CABINET / SCREENS
   ========================================================= */
#cabinet{
  position:fixed; inset:0;
  display:flex;
}
.screen{
  display:none;
  flex:1;
  min-width:0;
  min-height:0;
  flex-direction:column;
}
.screen.is-active{ display:flex; animation:screenIn .28s ease-out both; }
@keyframes screenIn{ from{ opacity:0; transform:scale(.985);} to{ opacity:1; transform:none;} }

/* =========================================================
   TITLE / SETUP
   ========================================================= */
#screen-title{
  overflow:auto;
  padding:clamp(10px,2.2vh,26px) clamp(12px,2.4vw,36px);
  gap:clamp(10px,2vh,24px);
}
.title-wrap{
  margin:auto;
  width:min(1240px,100%);
  display:flex; flex-direction:column;
  gap:clamp(12px,2.4vh,28px);
}

.logo{ text-align:center; }
.logo-jp{
  font-family:var(--jp);
  font-size:clamp(12px,1.5vw,18px);
  color:var(--teal);
  letter-spacing:.5em;
  text-shadow:0 0 10px rgba(45,212,191,.5);
  margin-bottom:.4em;
}
.logo-main{
  margin:0;
  font-family:var(--px);
  font-weight:700;
  font-size:clamp(26px,4.6vw,56px);
  line-height:1;
  letter-spacing:.02em;
  color:var(--gold);
  text-shadow:
     3px 0 0 var(--red-dk), -3px 0 0 var(--red-dk), 0 3px 0 var(--red-dk), 0 -3px 0 var(--red-dk),
     0 0 26px rgba(255,200,61,.55), 6px 6px 0 rgba(0,0,0,.45);
  animation:logoPulse 2.6s ease-in-out infinite;
}
@keyframes logoPulse{
  0%,100%{ filter:brightness(1); }
  50%    { filter:brightness(1.22); }
}
.logo-sub{
  margin-top:.7em;
  font-family:var(--px-strict);
  font-size:clamp(9px,1.05vw,14px);
  color:var(--teal);
  letter-spacing:.12em;
}
.logo-sub .vn{ font-family:var(--px); }
.logo-blurb{
  margin:.9em auto 0;
  max-width:72ch;
  font-size:clamp(12px,1.1vw,15px);
  color:#d9cbf2;
}
.logo-blurb p{ margin:.25em 0; }
.logo-blurb .vn{ color:#a99ac9; }

.title-body{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:clamp(12px,1.6vw,24px);
  align-items:start;
}
@media (max-width:900px){ .title-body{ grid-template-columns:1fr; } }

.panel{
  background:linear-gradient(180deg,var(--panel-2),var(--panel));
  border:3px solid var(--edge);
  box-shadow:
     inset 0 0 0 3px rgba(0,0,0,.45),
     inset 0 2px 0 rgba(255,255,255,.07),
     6px 6px 0 rgba(0,0,0,.4);
  border-radius:2px;
  padding:clamp(12px,1.6vw,20px);
  display:flex; flex-direction:column; gap:12px;
}
.panel-title{
  margin:0;
  font-family:var(--px-strict);
  font-size:clamp(9px,1vw,13px);
  letter-spacing:.08em;
  color:var(--gold);
  display:flex; align-items:center; gap:.6em;
  border-bottom:3px solid rgba(107,63,160,.55);
  padding-bottom:.7em;
}
.panel-title .vn{ font-family:var(--px); color:var(--teal); }
.panel-title .num{
  display:inline-grid; place-items:center;
  width:1.9em; height:1.9em;
  background:var(--gold); color:var(--ink);
  font-size:1em;
}

textarea,input[type=text]{
  width:100%;
  background:#190b34;
  border:3px solid var(--edge);
  color:var(--cream);
  font-family:var(--px);
  font-size:clamp(13px,1.25vw,17px);
  padding:.7em .8em;
  outline:none;
  resize:none;
  box-shadow:inset 0 0 0 2px rgba(0,0,0,.5);
}
textarea{ height:clamp(120px,21vh,210px); line-height:1.35; }
textarea:focus,input[type=text]:focus{ border-color:var(--edge-hot); box-shadow:inset 0 0 0 2px rgba(0,0,0,.5), 0 0 0 3px rgba(162,107,255,.3); }

.hint{ margin:0; font-size:clamp(11px,1vw,13px); color:#a99ac9; }
.hint-tight{ font-size:clamp(10px,.92vw,12px); line-height:1.5; }
.hint .vn{ color:#8b7bb0; }

.parsed-count{
  font-family:var(--px-strict);
  font-size:clamp(10px,1vw,13px);
  color:var(--green);
}
.parsed-count .vn{ font-family:var(--px); }

.field{ display:flex; flex-direction:column; gap:.45em; }
.field-label{
  font-family:var(--px-strict);
  font-size:clamp(9px,.95vw,12px);
  color:var(--teal);
  letter-spacing:.06em;
}
.field-label .vn{ font-family:var(--px); color:#8b7bb0; }

.stepper{ display:flex; align-items:center; gap:10px; }
.stepper output{
  font-family:var(--px-strict);
  font-size:clamp(16px,1.8vw,24px);
  color:var(--gold);
  min-width:2.2em; text-align:center;
}
.step-btn{
  width:2.4em; height:2.4em;
  font-family:var(--px-strict);
  font-size:clamp(14px,1.4vw,18px);
  background:var(--panel-3);
  color:var(--cream);
  border:3px solid var(--edge);
  cursor:pointer;
  box-shadow:3px 3px 0 rgba(0,0,0,.45);
}
.step-btn:active{ transform:translate(3px,3px); box-shadow:none; }

.boss-preview{
  display:flex; gap:10px; align-items:center;
  background:radial-gradient(ellipse at 30% 60%, rgba(120,60,200,.35), transparent 70%);
  border:3px solid rgba(107,63,160,.6);
  padding:8px;
}
#boss-preview{ image-rendering:pixelated; flex:0 0 auto; }
.bp-name{ margin:0; font-size:clamp(12px,1.15vw,16px); color:var(--gold); font-weight:700; }
.bp-tag{ margin:.2em 0 .4em; font-family:var(--px-strict); font-size:clamp(8px,.8vw,10px); color:var(--red); }
.bp-hint{ margin:0; font-size:clamp(10px,.92vw,12px); color:#a99ac9; line-height:1.4; }
.bp-hint .vn{ color:#8b7bb0; }

.set-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px 12px;
  align-items:end;
}
@media (max-width:620px){ .set-grid{ grid-template-columns:1fr; } }

.start-hint{ margin:0; font-size:11px; color:#8b7bb0; text-align:center; }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn{
  font-family:var(--px-strict);
  font-size:clamp(10px,1.05vw,14px);
  letter-spacing:.06em;
  color:var(--cream);
  background:linear-gradient(180deg,var(--panel-3),var(--panel-2));
  border:3px solid var(--edge);
  padding:.95em 1.3em;
  cursor:pointer;
  box-shadow:5px 5px 0 rgba(0,0,0,.5);
  transition:transform .06s, box-shadow .06s, filter .12s;
  text-transform:uppercase;
}
.btn .vn{ font-family:var(--px); text-transform:none; opacity:.75; }
.btn:hover{ filter:brightness(1.22); }
.btn:active{ transform:translate(5px,5px); box-shadow:0 0 0 rgba(0,0,0,.5); }
.btn:disabled{ opacity:.4; cursor:not-allowed; filter:grayscale(.6); }

.btn-start{
  background:linear-gradient(180deg,#ffd76a,#f0b429 55%,#c98a12);
  color:#3a2200;
  border-color:#ffe9a8;
  text-shadow:0 1px 0 rgba(255,255,255,.4);
  font-size:clamp(13px,1.5vw,20px);
  padding:1em;
  box-shadow:5px 5px 0 #7a4f05, 0 0 26px rgba(240,180,41,.35);
}
.btn-start:hover{ filter:brightness(1.08) saturate(1.05); }

.btn-fight{
  background:linear-gradient(180deg,#ff6b5a,#e03131 55%,#8f1116);
  border-color:#ffb3a8;
  color:#fff5f2;
  font-size:clamp(13px,1.5vw,20px);
  padding:.85em 2.2em;
  box-shadow:5px 5px 0 #5d0a0e, 0 0 26px rgba(224,49,49,.45);
  animation:fightGlow 1.8s ease-in-out infinite;
}
@keyframes fightGlow{
  0%,100%{ box-shadow:5px 5px 0 #5d0a0e, 0 0 18px rgba(224,49,49,.35); }
  50%    { box-shadow:5px 5px 0 #5d0a0e, 0 0 34px rgba(224,49,49,.75); }
}
.btn-random{
  width:100%;
  background:linear-gradient(180deg,#3ad6c0,#159e8c);
  border-color:#a8f5ea;
  color:#032b26;
  box-shadow:4px 4px 0 #0a4f45;
}
.btn-random .vn{ opacity:.6; }

.icon-btn{
  font-family:var(--px-strict);
  font-size:clamp(9px,1vw,12px);
  background:var(--panel-2);
  color:var(--cream);
  border:3px solid var(--edge);
  padding:.55em .7em;
  cursor:pointer;
  box-shadow:3px 3px 0 rgba(0,0,0,.45);
  display:inline-flex; align-items:center; gap:.4em;
  min-height:34px;
}
.icon-btn .vn{ font-family:var(--px); opacity:.7; text-transform:none; }
.icon-btn:active{ transform:translate(3px,3px); box-shadow:none; }
.icon-btn[aria-pressed="false"]{ opacity:.42; }
.icon-btn.is-off{ opacity:.35; }

/* =========================================================
   BATTLE — HUD
   ========================================================= */
#screen-game{ padding:0; }

.hud{
  display:flex; align-items:center; justify-content:space-between;
  gap:10px;
  padding:.5vh .7vw;
  background:linear-gradient(180deg,var(--panel-2),var(--panel));
  border-bottom:3px solid var(--edge);
  flex:0 0 auto;
}
.hud-left{ display:flex; align-items:center; gap:8px; min-width:0; flex-wrap:wrap; }
.hud-chip{
  font-size:clamp(11px,1.1vw,16px);
  padding:.35em .7em;
  border:3px solid var(--edge);
  background:#0d0420;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.hud-class{ color:var(--teal); }
.hud-bossname{ color:var(--red); font-weight:700; }
.hud-right{ display:flex; align-items:center; gap:6px; flex-wrap:wrap; justify-content:flex-end; }

/* ---------- HP BAR ---------- */
.hpbar{
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:clamp(8px,1.2vw,20px);
  padding:.9vh 1.4vw;
  background:linear-gradient(180deg,#1a0a33,#120722);
  border-bottom:3px solid var(--edge);
  flex:0 0 auto;
}
.hp-side{ display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:.7em; min-width:0; }
.hp-boss .hp-label{ text-align:right; }
.hp-boss .hp-track{ direction:rtl; }
.hp-label{
  font-family:var(--px-strict);
  font-size:clamp(8px,.85vw,12px);
  color:var(--cream);
  white-space:nowrap;
}
.hp-label .vn{ font-family:var(--px); color:#a99ac9; }
.hp-students .hp-label{ color:var(--teal); }
.hp-boss .hp-label{ color:var(--red); }

.hp-track{
  position:relative;
  height:clamp(18px,2.6vh,30px);
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 5px, transparent 5px 11px),
    #150a2e;
  border:3px solid var(--edge);
  box-shadow:inset 0 0 0 2px rgba(0,0,0,.6);
  overflow:hidden;
}
.hp-fill{
  position:absolute; top:0; bottom:0; left:0;
  width:0%;
  transition:width .45s cubic-bezier(.2,.9,.25,1);
}
.hp-students .hp-fill{
  background:repeating-linear-gradient(90deg,var(--green) 0 10px, #1f9d4c 10px 20px);
  box-shadow:0 0 14px rgba(46,224,106,.55);
}
.hp-boss .hp-fill{
  background:repeating-linear-gradient(90deg,var(--red) 0 10px, #a3161b 10px 20px);
  box-shadow:0 0 14px rgba(224,49,49,.55);
  left:auto; right:0;
}
.hp-ticks{
  position:absolute; inset:0;
  background:repeating-linear-gradient(90deg, transparent 0 19px, rgba(0,0,0,.45) 19px 21px);
  pointer-events:none;
}
.hp-value{
  font-family:var(--px-strict);
  font-size:clamp(12px,1.4vw,20px);
  min-width:2.4em; text-align:center;
}
.hp-students .hp-value{ color:var(--green); }
.hp-boss .hp-value{ color:var(--red); }
.hp-vs{
  font-family:var(--px-strict);
  font-size:clamp(10px,1.2vw,16px);
  color:var(--gold);
  text-shadow:0 0 12px rgba(240,180,41,.6);
}

/* =========================================================
   BATTLE — STAGE ROW
   ========================================================= */
.stage-row{
  flex:1 1 auto;
  display:grid;
  grid-template-columns:clamp(230px,23vw,360px) 1fr;
  min-height:0;
}

/* ---------- ROSTER ---------- */
.roster{
  display:flex; flex-direction:column;
  min-height:0;
  background:linear-gradient(180deg,var(--panel),#1b0b38);
  border-right:3px solid var(--edge);
}
.roster-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:.6em .8em;
  font-family:var(--px-strict);
  font-size:clamp(8px,.85vw,11px);
  color:var(--gold);
  border-bottom:3px solid rgba(107,63,160,.6);
  flex:0 0 auto;
}
.roster-head .vn{ font-family:var(--px); color:#a99ac9; }
.roster-count{
  background:var(--gold); color:var(--ink);
  padding:.15em .5em; font-family:var(--px-strict);
}
.roster-list{
  flex:1 1 auto;
  overflow-y:auto;
  overflow-x:hidden;
  padding:8px;
  display:flex; flex-direction:column; gap:6px;
  scrollbar-width:thin;
  scrollbar-color:var(--edge) transparent;
}
.roster-list::-webkit-scrollbar{ width:10px; }
.roster-list::-webkit-scrollbar-thumb{ background:var(--edge); }

.pup{
  position:relative;
  display:grid;
  grid-template-columns:1fr auto;
  align-items:center;
  gap:8px;
  padding:.5em .6em;
  background:linear-gradient(180deg,#341768,#241146);
  border:3px solid var(--edge);
  cursor:pointer;
  box-shadow:3px 3px 0 rgba(0,0,0,.4);
  transition:transform .08s, filter .12s;
  text-align:left;
  width:100%;
  font-family:var(--px);
  color:var(--cream);
  font-size:clamp(13px,1.15vw,17px);
  line-height:1.15;
}
.pup:hover{ filter:brightness(1.25); }
.pup:active{ transform:translate(3px,3px); box-shadow:none; }
.pup-name{
  min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  padding-left:26px;
}
.pup-idx{
  position:absolute; left:5px; top:50%; transform:translateY(-50%);
  font-family:var(--px-strict); font-size:.62em; color:var(--teal);
  width:1.5em;
}
.pup-hearts{ display:flex; gap:3px; align-items:center; }
.heart{ width:clamp(11px,1.05vw,16px); height:auto; display:block; color:var(--red); }
.heart.gone{ color:#6b5a95; }
.pup-strikes{
  position:absolute; left:8px; bottom:1px;
  font-family:var(--px-strict); font-size:.48em; color:#9d8bc7;
  letter-spacing:.02em;
}
.pup.is-out{ opacity:.62; }
.pup.is-picked{
  filter:brightness(1.6) saturate(1.3);
  border-color:var(--gold);
  box-shadow:0 0 18px rgba(240,180,41,.7), 3px 3px 0 rgba(0,0,0,.4);
  transform:scale(1.02);
}
.pup.is-out .pup-name{ text-decoration:line-through; text-decoration-color:rgba(239,68,68,.7); }
.pup.flash-bad{ animation:flashBad .45s ease-out; }
@keyframes flashBad{
  0%{ background:#ff4d4d; transform:translateX(-4px); }
  25%{ transform:translateX(4px); }
  50%{ transform:translateX(-3px); }
  75%{ transform:translateX(3px); }
  100%{ transform:none; }
}
.pup.flash-good{ animation:flashGood .45s ease-out; }
@keyframes flashGood{
  0%{ background:#2ee06a; } 100%{ background:linear-gradient(180deg,#341768,#241146); }
}

.roster-foot{
  flex:0 0 auto;
  padding:8px;
  border-top:3px solid rgba(107,63,160,.6);
  display:flex; flex-direction:column; gap:6px;
}

/* ---------- STAGE ---------- */
.stage{
  position:relative;
  min-width:0; min-height:0;
  background:#07030f;
  overflow:hidden;
}
#boss-canvas{
  display:block; width:100%; height:100%;
  image-rendering:pixelated;
}
.stage-tag{
  position:absolute; left:0; right:0; bottom:0;
  display:flex; align-items:flex-end; justify-content:space-between;
  gap:10px;
  padding:10px 14px;
  pointer-events:none;
  background:linear-gradient(0deg, rgba(7,3,15,.9), transparent);
}
.stage-tag-lv{
  font-family:var(--px-strict);
  font-size:clamp(10px,1.2vw,16px);
  color:var(--red);
  text-shadow:0 0 14px rgba(224,49,49,.7);
}
.stage-tag-name{
  font-size:clamp(11px,1.3vw,18px);
  color:var(--gold);
  text-shadow:0 0 12px rgba(240,180,41,.5);
}

/* ---------- FIGHT BAR ---------- */
.fightbar{
  flex:0 0 auto;
  display:flex; align-items:center; justify-content:center; gap:1.4em;
  padding:.7vh 1vw;
  background:linear-gradient(180deg,var(--panel),var(--panel-2));
  border-top:3px solid var(--edge);
}

/* =========================================================
   CINEMATIC OVERLAY
   ========================================================= */
.overlay{
  position:fixed; inset:0;
  z-index:8000;
  background:#05020c;
}
.overlay[hidden]{ display:none; }
#cine-canvas{ position:absolute; inset:0; width:100%; height:100%; display:block; }
.cine-text{
  position:absolute; inset:0;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  gap:.5em;
  pointer-events:none;
  text-align:center;
  padding:4vh 4vw;
}
.cine-text.cine-top{ justify-content:flex-start; padding-top:5vh; }
.cine-banner{
  font-family:var(--px-strict);
  font-size:clamp(22px,6vw,74px);
  line-height:1.1;
  letter-spacing:.04em;
  color:var(--gold);
  text-shadow:
    4px 0 0 var(--red-dk), -4px 0 0 var(--red-dk), 0 4px 0 var(--red-dk), 0 -4px 0 var(--red-dk),
    0 0 40px rgba(0,0,0,.9);
  animation:bannerIn .28s cubic-bezier(.2,1.4,.4,1) both;
}
.cine-banner.vn{ font-family:var(--px); }
.cine-banner.red{ color:#ff6b5a; text-shadow:4px 0 0 #4d0609,-4px 0 0 #4d0609,0 4px 0 #4d0609,0 -4px 0 #4d0609,0 0 40px rgba(0,0,0,.9); }
.cine-banner.green{ color:#5dff9c; text-shadow:4px 0 0 #0a4f22,-4px 0 0 #0a4f22,0 4px 0 #0a4f22,0 -4px 0 #0a4f22,0 0 40px rgba(0,0,0,.9); }
.cine-sub{
  font-size:clamp(12px,1.8vw,24px);
  color:#d9cbf2;
  background:rgba(10,4,24,.72);
  border:3px solid var(--edge);
  padding:.5em .9em;
  max-width:80%;
}
.cine-sub .vn{ display:block; margin-top:.35em; font-size:.85em; color:#a99ac9; }
.cine-banner.shake{ animation:bannerIn .28s cubic-bezier(.2,1.4,.4,1) both, bannerShake .35s .1s both; }
@keyframes bannerIn{ from{ transform:scale(.2); opacity:0; } to{ transform:scale(1); opacity:1; } }
@keyframes bannerShake{ 0%,100%{transform:none;} 25%{transform:translate(-8px,4px) rotate(-2deg);} 50%{transform:translate(7px,-4px) rotate(2deg);} 75%{transform:translate(-4px,-2px);} }

.cine-actions{
  position:absolute; left:0; right:0; bottom:6vh;
  display:flex; gap:14px; justify-content:center; flex-wrap:wrap;
  pointer-events:auto;
}
.cine-actions[hidden]{ display:none; }

/* =========================================================
   TEACHER GUIDE (help screen)
   ========================================================= */
.help-fab{
  position:absolute;
  top:14px; right:16px;
  z-index:20;
  font-family:var(--px-strict);
  font-size:clamp(9px,1vw,12px);
  background:linear-gradient(180deg,var(--panel-3),var(--panel-2));
  color:var(--cream);
  border:3px solid var(--edge);
  padding:.7em 1em;
  cursor:pointer;
  box-shadow:4px 4px 0 rgba(0,0,0,.5);
}
.help-fab .vn{ font-family:var(--px); opacity:.7; text-transform:none; }
.help-fab:hover{ filter:brightness(1.25); }
.help-fab:active{ transform:translate(4px,4px); box-shadow:none; }

#screen-help{ overflow:auto; padding:clamp(10px,1.6vh,18px) clamp(12px,2vw,28px); }
.help-wrap{ margin:auto; width:min(1180px,100%); display:flex; flex-direction:column; gap:clamp(8px,1.2vh,14px); }

.help-head{
  display:flex; align-items:flex-start; justify-content:space-between;
  gap:20px; flex-wrap:wrap;
  border-bottom:3px solid var(--edge);
  padding-bottom:9px;
}
.help-title{
  margin:0;
  font-family:var(--px-strict);
  font-size:clamp(14px,1.6vw,21px);
  color:var(--gold);
  text-shadow:0 0 18px rgba(255,200,61,.4);
}
.help-title .vn{ font-family:var(--px); color:var(--teal); }
.help-sub{ margin:.45em 0 0; font-size:clamp(10px,.92vw,13px); color:#a99ac9; max-width:70ch; line-height:1.45; }
.help-sub .vn{ color:#8b7bb0; }

.help-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(320px,1fr));
  gap:clamp(8px,1vw,12px);
}
.help-step{
  display:grid; grid-template-columns:auto 1fr; gap:12px;
  background:linear-gradient(180deg,var(--panel-2),var(--panel));
  border:3px solid var(--edge);
  box-shadow:5px 5px 0 rgba(0,0,0,.4);
  padding:10px 13px;
}
.help-step-wide{ grid-column:1 / -1; }
.help-num{
  display:grid; place-items:center;
  width:2.1em; height:2.1em;
  font-family:var(--px-strict);
  font-size:clamp(11px,1.1vw,15px);
  background:var(--gold); color:var(--ink);
  box-shadow:2px 2px 0 rgba(0,0,0,.4);
}
.help-step-wide .help-num{ background:var(--teal); }
.help-copy h3{
  margin:0 0 .45em;
  font-family:var(--px-strict);
  font-size:clamp(10px,.95vw,12px);
  color:var(--gold);
  letter-spacing:.05em;
}
.help-copy h3 .vn{ font-family:var(--px); color:var(--teal); }
.help-copy p{ margin:.3em 0; font-size:clamp(10px,.92vw,12px); line-height:1.45; color:#e4d9f5; }
.help-copy p.vn{ color:#a99ac9; }
.help-copy b{ color:var(--cream); }

/* wide card: English left, Vietnamese right, so it stays one short row */
.help-step-wide .help-copy{ display:grid; grid-template-columns:1fr 1fr; column-gap:22px; align-items:start; }
.help-step-wide .help-copy h3{ grid-column:1 / -1; }
@media (max-width:900px){ .help-step-wide .help-copy{ grid-template-columns:1fr; } }

/* =========================================================
   STORY CARDS
   ========================================================= */
.cine-text.cine-story{ justify-content:flex-end; padding:0 3vw 2.2vh; }
.cine-text.cine-story .story-card{ pointer-events:auto; }
.story-card{
  width:min(1180px, 96%);
  display:grid; grid-template-columns:1fr auto; gap:clamp(12px,2vw,30px); align-items:center;
  text-align:left;
  background:linear-gradient(180deg, rgba(45,21,86,.96), rgba(14,6,28,.97));
  border:3px solid var(--edge);
  box-shadow:6px 6px 0 rgba(0,0,0,.55), inset 0 0 0 2px rgba(0,0,0,.45);
  padding:clamp(10px,1.6vh,18px) clamp(14px,1.8vw,26px);
  animation:storyIn .3s ease-out both;
}
.story-copy{ text-align:left; }
@keyframes storyIn{ from{ opacity:0; transform:translateY(24px);} to{ opacity:1; transform:none;} }
.story-tag{
  font-family:var(--px-strict);
  font-size:clamp(8px,.85vw,11px);
  color:var(--teal);
  letter-spacing:.1em;
  margin-bottom:.5em;
}
.story-tag .vn{ font-family:var(--px); color:#8b7bb0; }
.story-title{
  margin:0 0 .5em;
  font-family:var(--px-strict);
  font-size:clamp(13px,1.7vw,22px);
  color:var(--gold);
  text-shadow:3px 3px 0 rgba(0,0,0,.6);
}
.story-title .vn{ font-family:var(--px); color:var(--red); display:block; font-size:.72em; text-shadow:2px 2px 0 rgba(0,0,0,.6); margin-top:.35em; }
.story-body{
  margin:.35em 0;
  font-size:clamp(11px,1.05vw,15px);
  line-height:1.5;
  color:#e8ddf8;
  max-width:78ch;
}
.story-body.vn{ color:#a99ac9; font-size:.92em; margin-top:.75em; }
.story-nav{ display:flex; flex-direction:column; align-items:center; gap:8px; }
.story-hint{ margin:0; font-size:10px; color:#8b7bb0; text-align:center; }

/* =========================================================
   FLOATERS / TOAST
   ========================================================= */
.fx-layer{ position:fixed; inset:0; pointer-events:none; z-index:8500; }
.floater{
  position:absolute;
  font-family:var(--px-strict);
  font-size:clamp(13px,1.6vw,22px);
  color:var(--red);
  text-shadow:2px 2px 0 #000, 0 0 16px rgba(239,68,68,.9);
  animation:floatUp 1s ease-out forwards;
  white-space:nowrap;
}
@keyframes floatUp{
  0%{ transform:translate(-50%,0) scale(.5); opacity:0; }
  20%{ transform:translate(-50%,-14px) scale(1.25); opacity:1; }
  100%{ transform:translate(-50%,-90px) scale(1); opacity:0; }
}
.flyheart{
  position:absolute;
  width:22px; height:22px;
  animation:flyHeart 1.05s cubic-bezier(.4,0,.6,1) forwards;
}
@keyframes flyHeart{
  0%{ transform:translate(-50%,-50%) scale(.6) rotate(0deg); opacity:1; }
  60%{ opacity:1; }
  100%{ transform:translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.9) rotate(220deg); opacity:0; }
}

.toast{
  position:fixed;
  left:50%; bottom:4vh;
  transform:translateX(-50%);
  z-index:8800;
  background:var(--panel-2);
  border:3px solid var(--gold);
  color:var(--cream);
  font-size:clamp(12px,1.2vw,16px);
  padding:.7em 1.2em;
  box-shadow:5px 5px 0 rgba(0,0,0,.5);
  animation:toastIn .2s ease-out both;
}
.toast[hidden]{ display:none; }
@keyframes toastIn{ from{ transform:translate(-50%,20px); opacity:0; } to{ transform:translate(-50%,0); opacity:1; } }

/* ---------- rotate hint ---------- */
.rotate-hint{
  position:fixed; inset:0; z-index:9500;
  display:none;
  place-items:center;
  background:#0b0417;
  text-align:center;
  padding:8vw;
}
@media (max-aspect-ratio:3/4){
  .rotate-hint{ display:grid; }
}
.rotate-hint p{ font-size:clamp(16px,5vw,30px); color:var(--gold); margin:.3em 0; }
.rotate-hint .vn{ color:var(--teal); font-size:.7em; }
.rotate-icon{ font-size:clamp(50px,16vw,110px); animation:rot 2.4s ease-in-out infinite; }
@keyframes rot{ 0%,40%{ transform:rotate(0deg); } 60%,100%{ transform:rotate(90deg); } }

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{ animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.01ms !important; }
}
