/* Pi Games — Chiếc Nón Kỳ Diệu: Stage Edition. Visual-only redesign, 2026-10-22.
   No game rules / score / probability changes. */
:root{
  --wine-900:#10091e;--wine-850:#170b24;--wine-800:#24102f;--wine-700:#421b3e;--wine-600:#753052;
  --gold-300:#ffedb0;--gold-400:#ffcf67;--gold-500:#eca53e;--gold-600:#986018;
  --cream:#fff6e9;--cream-dim:#ebd6dc;--jade:#42e6c7;
  --shadow:0 16px 45px rgba(7,2,17,.53);
  --radius:19px;
}
html {scroll-behavior:smooth}
body {
  background:
    radial-gradient(ellipse 72% 65% at 50% 12%,rgba(137,67,152,.3) 0%,transparent 67%),
    linear-gradient(180deg,rgba(13,5,26,.25),rgba(14,5,25,.66)),
    url("stage-bokeh.webp") center top/cover fixed,
    #10091e;
}
body::before{content:"";position:fixed;inset:0;pointer-events:none;z-index:0;
  background:repeating-linear-gradient(90deg,transparent 0,transparent calc(50% - 470px),rgba(229,128,70,.025) calc(50% - 465px),transparent 50%,transparent 100%);
}
.beams{opacity:.7;background:
  conic-gradient(from 210deg at 50% -22%,transparent 0deg,rgba(251,195,112,.17) 10deg,transparent 17deg,
  transparent 30deg,rgba(98,175,255,.13) 38deg,transparent 47deg,transparent 58deg,
  rgba(243,183,111,.14) 66deg,transparent 73deg,transparent 85deg,
  rgba(240,118,167,.13) 91deg,transparent 100deg);
}
.vignette{box-shadow:inset 0 0 160px 28px rgba(5,1,15,.62)}
.wrap{max-width:1450px;padding:18px clamp(14px,2.5vw,35px) 45px}
.topbar{gap:14px;padding:6px 1px 18px;margin-bottom:16px;border-bottom:1px solid rgba(255,208,111,.24)}
.brand{gap:14px}
.brand-mark{width:52px;height:52px;filter:drop-shadow(0 0 12px rgba(255,199,75,.4))}
.brand-name{font-size:clamp(19px,2.65vw,30px);line-height:1.25;letter-spacing:.035em;
  filter:drop-shadow(0 2px 5px rgba(0,0,0,.65))}
.brand-sub{display:inline-flex;align-items:center;margin-top:4px;padding:3px 10px;border-radius:20px;
  border:1px solid rgba(255,201,109,.28);background:rgba(119,26,57,.67);
  font-weight:800;letter-spacing:.19em;color:#ffe2c3;font-size:10px;opacity:1}
.topbtns{flex-wrap:wrap;justify-content:flex-end}
.ghost{color:#fff0cf;border:1px solid rgba(255,205,119,.49);background:linear-gradient(180deg,rgba(87,36,73,.81),rgba(38,17,42,.86));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 3px 13px rgba(0,0,0,.17);min-height:40px;
  transition:transform .16s,background .16s,box-shadow .16s,border-color .16s}
.ghost:hover{transform:translateY(-2px);background:linear-gradient(180deg,rgba(122,52,87,.95),rgba(55,22,54,.96));
  box-shadow:0 0 15px rgba(250,187,87,.16)}
.ghost.danger{background:linear-gradient(180deg,rgba(134,31,64,.56),rgba(55,17,46,.83))}
.hero{display:flex;flex-direction:column;align-items:center;gap:5px;margin:12px auto 6px}
.hero-emblem{width:clamp(105px,15vw,168px);height:auto;aspect-ratio:1;object-fit:contain;
  filter:drop-shadow(0 12px 27px rgba(7,3,19,.68))}
.hero h1{font-size:clamp(42px,7.8vw,78px);filter:drop-shadow(0 6px 22px rgba(0,0,0,.68));}
.hero .tag{margin:6px auto 0;max-width:69ch;color:#ffead6}
.panel{max-width:960px;margin:20px auto 0;padding:clamp(18px,3vw,30px);
  background:linear-gradient(160deg,rgba(76,32,73,.92),rgba(21,12,34,.97));
  border:1.5px solid rgba(255,207,117,.46);box-shadow:0 23px 60px rgba(0,0,0,.49),inset 0 1px 0 rgba(255,255,255,.11)}
.panel h2{font-size:24px}
.mode{background:linear-gradient(145deg,rgba(255,230,195,.1),rgba(255,217,166,.025));border-color:rgba(255,212,129,.38)}
.mode[aria-pressed="true"]{background:linear-gradient(140deg,rgba(248,193,87,.22),rgba(145,70,123,.18));box-shadow:inset 0 0 0 1px rgba(255,220,153,.26),0 0 17px rgba(255,191,90,.1)}
.cta,.spinbtn{position:relative;background:linear-gradient(180deg,#ffedac 0%,#ffcd62 40%,#e09c30 88%,#c17825 100%);
  color:#34150e;border:1px solid #ffd784;text-shadow:0 1px 0 rgba(255,255,255,.36);
  box-shadow:0 6px 0 #905519,0 13px 28px rgba(0,0,0,.43),inset 0 2px 1px rgba(255,255,255,.7)}
.cta:hover,.spinbtn:hover:not(:disabled){filter:brightness(1.075);box-shadow:0 6px 0 #905519,0 13px 28px rgba(0,0,0,.43),0 0 27px rgba(255,212,94,.22)}
/* Two-column stage: large, central wheel on the left and information on the right. */
.arena{grid-template-areas:"wheel question" "wheel board";grid-template-columns:minmax(300px,500px) minmax(0,1fr);column-gap:clamp(18px,2.45vw,34px);row-gap:14px}
.wheelbox{--col:500px;width:100%;min-width:0;gap:15px;padding:4px 8px 0}
.wheelstage{max-width:min(100%,var(--col));isolation:isolate;flex:0 0 auto;
  filter:drop-shadow(0 12px 15px rgba(0,0,0,.4))}
.wheelstage::before{content:"";position:absolute;inset:3%;border-radius:50%;z-index:-1;
  box-shadow:0 0 0 8px rgba(245,166,65,.11),0 0 65px 13px rgba(255,168,35,.23),0 0 110px 24px rgba(122,51,195,.2)}
.wheelstage::after{content:"";position:absolute;inset:0;z-index:0;border-radius:50%;pointer-events:none;
  background:linear-gradient(137deg,rgba(255,255,255,.085),transparent 30%,transparent 76%,rgba(255,255,255,.035));}
.wheelstage canvas{filter:drop-shadow(0 12px 25px rgba(0,0,0,.56))}
.pointer{width:42px;height:53px;top:-9px;filter:drop-shadow(0 3px 6px #08010c) drop-shadow(0 0 10px rgba(255,224,137,.4))}
.hub{width:23%;height:23%;z-index:2;border:4px solid #89500e;
  background:radial-gradient(circle at 28% 15%,#fffbd9 2%,#ffe18b 29%,#efaf3f 59%,#ad651b 90%);
  box-shadow:0 6px 18px rgba(0,0,0,.64),inset 0 3px 5px rgba(255,255,255,.8),inset 0 -8px 9px rgba(105,47,2,.31),0 0 0 4px rgba(255,209,94,.6)}
.hub span{font-size:clamp(12px,2vw,20px);line-height:1.05;text-shadow:0 1px 1px rgba(255,245,201,.5)}
.spinbtn{min-height:57px;max-width:480px;letter-spacing:.14em;font-size:clamp(21px,2.5vw,28px)}
.spinbtn:disabled{box-shadow:0 3px 0 #554137;opacity:.7;filter:grayscale(.45)}
.qcard{padding:17px 23px 20px;min-height:110px;
  background:linear-gradient(117deg,rgba(105,40,76,.96),rgba(35,16,54,.94) 68%,rgba(76,30,66,.96));
  border:1.5px solid rgba(255,204,99,.73);
  box-shadow:0 6px 0 rgba(22,9,32,.48),inset 0 2px 0 rgba(255,255,255,.11),0 0 30px rgba(237,142,58,.08)}
.qlabel{font-size:14px;letter-spacing:.13em;margin-bottom:10px}
.qmeta span{font-size:10px;padding:5px 9px}
.qtext{font-size:clamp(17px,1.9vw,24px);line-height:1.52;text-shadow:0 2px 10px rgba(0,0,0,.3)}
.boardbox{gap:13px;align-self:start;padding-top:1px}
.board{--t:42px;border:1.5px solid rgba(255,208,113,.62);border-radius:20px;min-height:145px;
  padding:17px 12px;flex-direction:column;flex-wrap:nowrap;justify-content:center;gap:8px;
  background:linear-gradient(180deg,rgba(25,11,34,.96),rgba(38,14,43,.93));
  box-shadow:inset 0 6px 24px rgba(0,0,0,.36),0 7px 0 rgba(15,6,26,.43),0 0 24px rgba(255,166,73,.06)}
.boardline{width:100%;display:flex;justify-content:center;align-items:center;gap:clamp(5px,.85vw,11px);min-width:0}
.word{flex-wrap:nowrap;justify-content:center;gap:4px;min-width:0}
.tile{border-radius:7px;height:calc(var(--t)*1.20);font-size:calc(var(--t)*.66);
  border:1px solid #ffdb87;border-bottom:3px solid #ba772e;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.52),0 3px 6px rgba(0,0,0,.37)}
.tile.blank{background:linear-gradient(180deg,#704260 0%,#4b2b50 63%,#38223e 100%);
  border:1px solid #d8a06b;border-bottom:3px solid #ffc96e;color:transparent;
  box-shadow:inset 0 2px 7px rgba(255,255,255,.07),0 4px 8px rgba(0,0,0,.28)}
.msgline{min-height:52px;border-color:rgba(251,202,105,.39);border-radius:14px;
  background:linear-gradient(90deg,rgba(88,39,61,.95),rgba(68,27,54,.88));
  padding:13px 17px;font-size:14px;color:#ffefd7;box-shadow:inset 0 1px 0 rgba(255,255,255,.08)}
.keys{gap:6px;row-gap:7px}
.key{max-width:none;min-height:50px;border-radius:10px;font-family:var(--fx-display);
  font-size:clamp(17px,2vw,23px);line-height:1;color:#fff5eb;
  background:linear-gradient(170deg,#813252 0%,#5c244a 57%,#391a39 100%);
  border:1px solid #bb6a76;border-bottom:3px solid #271127;
  box-shadow:inset 0 1px 0 rgba(255,207,201,.23),0 3px 6px rgba(0,0,0,.25);
  text-shadow:0 1px 4px rgba(0,0,0,.45)}
.key.vn{background:linear-gradient(170deg,#9b405a,#672c51 57%,#421d40);border-color:#e29b89;border-bottom-color:#271127}
.key:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 5px 11px rgba(0,0,0,.4);background:linear-gradient(180deg,#fff1ac,#e7af4c);color:#351528}
.key.hit{background:linear-gradient(180deg,#80f4d1,#29ba9a);color:#09362f;border-color:#8cf7df;text-shadow:none}
.key.miss{background:#25152b;color:#72596e;border-color:#38223a;text-shadow:none;box-shadow:none}
.key.locked{opacity:.7}
.solve{min-height:58px;border-radius:15px;border:1px solid #9dffe5;font-size:clamp(20px,2.1vw,25px);
  background:linear-gradient(180deg,#a5ffe9 0%,#4ce1c4 42%,#1cab99 100%);
  box-shadow:0 6px 0 #127464,0 13px 27px rgba(0,0,0,.35),inset 0 2px 1px rgba(255,255,255,.55)}
.solve:hover:not(:disabled){filter:brightness(1.06);box-shadow:0 6px 0 #127464,0 13px 27px rgba(0,0,0,.35),0 0 18px rgba(68,240,195,.2)}
.scene{max-width:480px;width:100%;border-radius:17px;border:2px solid rgba(255,203,113,.74);
  box-shadow:0 6px 0 rgba(31,13,30,.64),0 13px 28px rgba(0,0,0,.48),0 0 19px rgba(255,177,78,.13);
  --sky1:#213b64;--sky2:#8f5e83;--hill:#355d65;--ground:#3d6354;--fence:#d1a064}
.scene[data-danger="1"]{--sky1:#29365b;--sky2:#935579;--hill:#38565d;--ground:#385a4d;--fence:#c18b5a}
.scene[data-danger="2"]{--sky1:#263050;--sky2:#a25671;--hill:#35474f;--ground:#354e45;--fence:#a97d5a}
.scene[data-danger="3"]{--sky1:#212444;--sky2:#a34e61;--hill:#2c4047;--ground:#2b443d;--fence:#987054}
.scene[data-danger="4"]{--sky1:#221932;--sky2:#943650;--hill:#2d303c;--ground:#303837;--fence:#78534b}
.scene[data-danger="5"]{--sky1:#140d25;--sky2:#611f38;--hill:#252433;--ground:#302d37;--fence:#4a342f}
.scene > svg{filter:saturate(1.16)}
.hudMain{border-color:rgba(255,211,132,.7);background:rgba(20,9,35,.82);box-shadow:0 5px 12px rgba(0,0,0,.39)}
.hudHearts{background:rgba(21,9,35,.79);border-color:rgba(255,164,158,.55)}
.hudHearts svg{width:15px;height:15px}
.sheet{background:linear-gradient(150deg,#5a2858,#1a102b);border-color:rgba(255,210,120,.63);
  box-shadow:0 18px 70px rgba(0,0,0,.69),inset 0 1px 0 rgba(255,255,255,.1)}
.gbox{background:linear-gradient(160deg,#a65c62,#4c214d);border-color:#ebb16a}
.qopt{border-color:rgba(255,205,111,.53)}
#confetti{z-index:60}
@media (min-width:1350px){.wrap{max-width:1470px}.arena{grid-template-columns:minmax(360px,500px) minmax(0,1fr)}}
@media (max-width:960px){
  .arena{grid-template-columns:minmax(260px,340px) minmax(0,1fr);column-gap:16px}
  .wheelbox{--col:340px}
  .board{min-height:110px;padding:11px 7px}
  .tile{border-radius:5px}
  .key{min-height:42px}
  .qcard{padding:14px 16px}
}
@media (max-width:760px){
  .wrap{padding:10px 12px 32px}
  .topbar{gap:9px;padding:4px 0 10px;margin-bottom:12px}
  .brand-mark{width:42px;height:42px}
  .brand-name{font-size:clamp(17px,3.7vw,24px)}
  .brand-sub{font-size:9px}
  .topbtns{width:100%;justify-content:flex-end;gap:5px}
  .ghost{min-height:36px;padding:6px 9px;font-size:12px}
  .arena{grid-template-columns:minmax(0,1fr);grid-template-areas:"question" "wheel" "board";gap:11px}
  .wheelbox{--col:300px;margin:auto;padding:0;width:100%;gap:9px}
  .wheelstage{width:min(100%,300px)}
  .spinbtn{min-height:51px;width:min(100%,350px)}
  .scene{width:min(100%,350px)}
  .qtext{font-size:clamp(15px,3.8vw,20px)}
  .qcard{min-height:unset}
  .board{min-height:98px;padding:12px 8px;gap:7px}
  .tile{border-radius:4px}
  .msgline{font-size:13px;padding:10px 12px;min-height:40px}
  .keys{gap:5px;row-gap:6px}
  .key{min-height:43px;max-width:none;font-size:18px}
  .solve{min-height:50px}
  .panel{margin-top:16px}
  /* During a letter guess, shrink the wheel so the alphabet appears sooner. */
  body[data-phase="guess"] .wheelbox{max-width:700px;flex-direction:row;flex-wrap:nowrap;align-items:center;gap:12px;justify-content:center}
  body[data-phase="guess"] .wheelstage{width:clamp(113px,30vw,160px);flex:0 0 clamp(113px,30vw,160px)}
  body[data-phase="guess"] .scene{flex:1;min-width:0;width:auto}
  body[data-phase="guess"] .spinbtn{display:none}
}
@media (max-width:430px){
  .topbtns .ghost{font-size:11px;padding:6px 8px}
  .brand{gap:9px}
  .brand-mark{width:39px;height:39px}
  .brand-name{font-size:18px}
  .brand-sub{letter-spacing:.08em}
  .qmeta span{font-size:9px;padding:4px 6px}
  .qtext{font-size:16px}
  .board{min-height:87px}
  .tile{border-bottom-width:2px}
  .word{gap:3px}
  .boardline{gap:6px}
  .key{font-size:17px;min-height:42px}
  .hero h1{font-size:43px}
  .hero-emblem{width:112px}
}
@media (prefers-reduced-motion:reduce){.wheelstage::before{animation:none}}
