/* ================= TOKENS ================= */
:root{
  --ink:#0B0B0D;
  --wall:#141416;
  --ivory:#F5F1E8;
  --ivory-dim:#E7E1D3;
  --gold-1:#E6D3A3;
  --gold-2:#C8A96A;
  --gold-3:#8A6E3A;
  --silver:#9A9A9E;
  --blood:#7A2A22;
  --gold-grad:linear-gradient(135deg,#E6D3A3 0%,#C8A96A 46%,#8A6E3A 100%);
  --r-sm:10px;
  --r-md:14px;
  --r-lg:22px;
  --shadow-deep:0 26px 70px rgba(0,0,0,.75);
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  background:var(--ink);
  color:var(--ivory);
  font-family:'Tajawal',system-ui,-apple-system,'Segoe UI',sans-serif;
  -webkit-font-smoothing:antialiased;
  -webkit-tap-highlight-color:transparent;
  overscroll-behavior:none;
  overflow:hidden;
  user-select:none;
  -webkit-user-select:none;
}
button{font-family:inherit;color:inherit;}
input{font-family:inherit;}

.stage{
  position:relative;
  height:100vh;
  height:100dvh;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  isolation:isolate;
}

/* ================= BACKGROUND ================= */
.bg{position:absolute;inset:0;z-index:0;pointer-events:none;overflow:hidden;}

.bg-wall{
  position:absolute;inset:-4%;
  background:
    radial-gradient(120% 60% at 50% -6%, #241f18 0%, #17171a 42%, #101013 72%, #0a0a0c 100%);
}
.bg-lines{
  position:absolute;inset:0;
  background:repeating-linear-gradient(90deg,
    rgba(200,169,106,.055) 0px,
    rgba(200,169,106,.055) 1px,
    transparent 1px,
    transparent 64px);
  mask-image:linear-gradient(to bottom, rgba(0,0,0,.9), rgba(0,0,0,.15) 62%, transparent 88%);
  -webkit-mask-image:linear-gradient(to bottom, rgba(0,0,0,.9), rgba(0,0,0,.15) 62%, transparent 88%);
}

.arch{
  position:absolute;
  left:50%;
  bottom:16%;
  width:min(760px,124vw);
  transform:translateX(-50%);
  opacity:.42;
  filter:drop-shadow(0 0 22px rgba(200,169,106,.18));
}

.halo{
  position:absolute;
  left:50%;top:38%;
  width:min(620px,120vw);
  aspect-ratio:1;
  transform:translate(-50%,-50%);
  background:radial-gradient(circle, rgba(200,169,106,.16) 0%, rgba(200,169,106,.06) 42%, transparent 68%);
  filter:blur(6px);
}

.beam{
  position:absolute;
  top:-14%;
  width:30vw;
  max-width:340px;
  height:130%;
  background:linear-gradient(to bottom, rgba(230,211,163,.20), rgba(230,211,163,.07) 46%, transparent 78%);
  filter:blur(16px);
  opacity:.7;
  clip-path:polygon(44% 0, 56% 0, 100% 100%, 0% 100%);
  transform-origin:top center;
}
.beam-l{left:12%;transform:rotate(10deg);}
.beam-r{right:12%;transform:rotate(-10deg);}

.dust{position:absolute;inset:0;}
.dust i{
  position:absolute;
  width:3px;height:3px;
  border-radius:50%;
  background:rgba(230,211,163,.8);
  box-shadow:0 0 6px rgba(230,211,163,.65);
  animation:floatUp linear infinite;
  opacity:0;
}
@keyframes floatUp{
  0%{transform:translate3d(0,20px,0) scale(.4);opacity:0;}
  12%{opacity:.75;}
  80%{opacity:.5;}
  100%{transform:translate3d(14px,-170px,0) scale(1);opacity:0;}
}

.floor{
  position:absolute;left:0;right:0;bottom:0;height:26%;
  background:
    linear-gradient(to bottom, rgba(11,11,13,0) 0%, rgba(11,11,13,.85) 42%, #050506 100%),
    radial-gradient(70% 120% at 50% 0%, rgba(200,169,106,.14), transparent 70%);
}

.vignette{
  position:absolute;inset:0;
  background:radial-gradient(ellipse 78% 68% at 50% 44%, transparent 38%, rgba(0,0,0,.62) 82%, rgba(0,0,0,.86) 100%);
}

.noise{
  position:absolute;inset:0;
  opacity:.045;
  mix-blend-mode:overlay;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ================= HUD ================= */
.hud{
  position:relative;
  z-index:3;
  flex:0 0 auto;
  padding:10px 14px 0;
}
.hud-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.stat{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:1px;
  min-width:66px;
  padding:3px 12px;
  border-radius:12px;
  border:1px solid rgba(200,169,106,.26);
  background:rgba(18,18,20,.72);
  backdrop-filter:blur(6px);
  -webkit-backdrop-filter:blur(6px);
}
.stat-label{
  font-size:10px;
  letter-spacing:.06em;
  color:var(--silver);
  line-height:1.2;
}
.stat-num{
  font-family:'Reem Kufi',sans-serif;
  font-size:19px;
  font-weight:700;
  color:var(--gold-1);
  line-height:1.15;
  transition:transform .18s ease;
}
.stat-num.pop{transform:scale(1.22);}

.round-pill{
  font-size:13px;
  font-weight:700;
  color:var(--gold-1);
  padding:7px 14px;
  border-radius:999px;
  border:1px solid rgba(200,169,106,.34);
  background:linear-gradient(180deg, rgba(200,169,106,.16), rgba(200,169,106,.05));
  white-space:nowrap;
}

.strikes{
  display:flex;
  align-items:center;
  gap:5px;
  padding:6px 10px;
  border-radius:12px;
  border:1px solid rgba(200,169,106,.2);
  background:rgba(18,18,20,.72);
}
.pip{display:block;width:17px;height:17px;}
.pip svg{width:100%;height:100%;fill:none;}
.pip path{
  stroke:rgba(154,154,158,.4);
  stroke-width:2.8;
  stroke-linecap:round;
  transition:stroke .22s ease;
}
.pip.used path{stroke:var(--blood);filter:drop-shadow(0 0 6px rgba(122,42,34,.95));}
.pip.used{animation:pipPop .34s cubic-bezier(.3,1.6,.5,1);}
@keyframes pipPop{0%{transform:scale(.6);}60%{transform:scale(1.28);}100%{transform:scale(1);}}

.timer-track{
  margin:9px auto 0;
  max-width:640px;
  height:5px;
  border-radius:999px;
  background:rgba(255,255,255,.06);
  overflow:hidden;
  box-shadow:inset 0 0 0 1px rgba(200,169,106,.12);
}
.timer-fill{
  height:100%;
  width:100%;
  border-radius:999px;
  background:linear-gradient(90deg,#8A6E3A,#C8A96A 40%,#E6D3A3);
  transform-origin:right center;
  transform:scaleX(1);
  will-change:transform;
  box-shadow:0 0 12px rgba(200,169,106,.55);
}
.timer-fill.danger{animation:timerPulse .62s ease-in-out infinite;}
@keyframes timerPulse{
  0%,100%{opacity:1;box-shadow:0 0 12px rgba(200,169,106,.55);}
  50%{opacity:.5;box-shadow:0 0 4px rgba(200,169,106,.2);}
}

/* ================= BOARD ================= */
.board-wrap{
  position:relative;
  z-index:2;
  flex:1 1 auto;
  min-height:0;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  padding:10px 14px 4px;
  overflow:hidden;
}

.board{
  width:100%;
  max-width:600px;
  border-radius:var(--r-lg);
  padding:3px;
  background:var(--gold-grad);
  box-shadow:var(--shadow-deep), 0 0 0 1px rgba(230,211,163,.16), 0 0 70px rgba(200,169,106,.14);
  position:relative;
  will-change:transform,opacity;
}
.board::after{
  content:'';
  position:absolute;
  inset:3px;
  border-radius:calc(var(--r-lg) - 3px);
  border:1px solid rgba(230,211,163,.42);
  pointer-events:none;
  z-index:2;
}
.board-inner{
  position:relative;
  border-radius:calc(var(--r-lg) - 4px);
  background:linear-gradient(180deg,#111113 0%,#0a0a0c 100%);
  padding:12px 12px 14px;
  overflow:hidden;
}
.board-inner::before{
  content:'';
  position:absolute;
  inset:0;
  background:radial-gradient(90% 60% at 50% 0%, rgba(200,169,106,.10), transparent 70%);
  pointer-events:none;
}

.board-out{animation:boardOut .34s ease-in forwards;}
.board-in{animation:boardIn .46s cubic-bezier(.2,.8,.3,1) forwards;}
@keyframes boardOut{
  to{transform:translateX(7%) scale(.97);opacity:0;filter:blur(3px);}
}
@keyframes boardIn{
  from{transform:translateX(-7%) scale(.97);opacity:0;filter:blur(3px);}
  to{transform:translateX(0) scale(1);opacity:1;filter:blur(0);}
}

.q-label{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  margin-bottom:8px;
}
.q-label::before,.q-label::after{
  content:'';
  height:1px;
  width:36px;
  background:linear-gradient(90deg,transparent,rgba(200,169,106,.7));
}
.q-label::after{background:linear-gradient(90deg,rgba(200,169,106,.7),transparent);}
.q-label span{
  font-size:10px;
  letter-spacing:.22em;
  color:var(--gold-2);
  text-transform:uppercase;
}

.q-text{
  margin:0 0 12px;
  font-family:'Reem Kufi','Tajawal',sans-serif;
  font-size:clamp(16px,4.4vw,23px);
  font-weight:600;
  line-height:1.5;
  text-align:center;
  color:var(--ivory);
  text-wrap:balance;
  min-height:2.6em;
  display:flex;
  align-items:center;
  justify-content:center;
  position:relative;
  z-index:1;
}

/* -------- slots -------- */
.slots{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:8px;
  position:relative;
  z-index:1;
}
@media (min-width:520px){
  .slots{grid-template-columns:repeat(4,minmax(0,1fr));}
}

.slot{
  position:relative;
  height:46px;
  perspective:640px;
}
.slot-inner{
  position:relative;
  width:100%;
  height:100%;
  transform-style:preserve-3d;
  transition:transform .58s cubic-bezier(.36,.06,.24,1);
}
.slot.revealed .slot-inner{transform:rotateX(180deg);}

.slot-face{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:0 8px;
  border-radius:var(--r-sm);
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;
  overflow:hidden;
}
.slot-front{
  background:linear-gradient(180deg,#1a1a1d 0%,#101012 100%);
  border:1px solid rgba(200,169,106,.34);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.035);
}
.slot-num{
  font-family:'Reem Kufi',sans-serif;
  font-size:16px;
  font-weight:600;
  color:rgba(200,169,106,.62);
}
.slot-back{
  transform:rotateX(180deg);
  background:linear-gradient(180deg,#F5F1E8 0%,#E7E1D3 100%);
  border:1px solid rgba(138,110,58,.55);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7), 0 2px 10px rgba(0,0,0,.35);
}
.slot-text{
  font-size:clamp(11px,3vw,13.5px);
  font-weight:700;
  color:#1b1710;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  flex:1 1 auto;
  text-align:right;
  min-width:0;
}
.pts{
  flex:0 0 auto;
  width:23px;height:23px;
  border-radius:50%;
  background:var(--gold-grad);
  color:#141008;
  font-size:11px;
  font-weight:800;
  display:grid;
  place-items:center;
  box-shadow:0 0 0 1px rgba(138,110,58,.4), 0 0 10px rgba(200,169,106,.4);
  font-feature-settings:"tnum";
}
.slot.faint{opacity:.42;}
.slot.faint .slot-back{filter:grayscale(.45);}
.slot.empty .slot-back{opacity:.6;}

.board-reflection{
  width:78%;
  max-width:470px;
  height:42px;
  margin-top:-6px;
  border-radius:50%/22px;
  background:linear-gradient(to bottom, rgba(200,169,106,.26), rgba(200,169,106,0) 78%);
  filter:blur(15px);
  opacity:.42;
  pointer-events:none;
  flex:0 0 auto;
}

/* ================= DOCK ================= */
.dock{
  position:relative;
  z-index:3;
  flex:0 0 auto;
  padding:8px 14px 14px;
  background:linear-gradient(to top, rgba(8,8,10,.98) 30%, rgba(8,8,10,0));
}
.dock form{
  display:flex;
  gap:8px;
  max-width:600px;
  margin:0 auto;
}
.answer-input{
  flex:1 1 auto;
  min-width:0;
  height:52px;
  padding:0 16px;
  font-size:16px;
  color:var(--ivory);
  background:rgba(20,20,22,.9);
  border:1px solid rgba(200,169,106,.34);
  border-radius:var(--r-md);
  outline:none;
  transition:border-color .18s ease, box-shadow .18s ease, background .18s ease;
  user-select:text;
  -webkit-user-select:text;
}
.answer-input::placeholder{color:rgba(154,154,158,.75);}
.answer-input:focus{
  border-color:rgba(230,211,163,.8);
  box-shadow:0 0 0 3px rgba(200,169,106,.18), 0 0 26px rgba(200,169,106,.14);
  background:rgba(26,26,28,.95);
}
.answer-input:disabled{opacity:.45;}
.answer-input.shake{animation:shake .34s cubic-bezier(.36,.07,.19,.97);}
@keyframes shake{
  10%,90%{transform:translateX(-2px);}
  20%,80%{transform:translateX(4px);}
  30%,50%,70%{transform:translateX(-7px);}
  40%,60%{transform:translateX(7px);}
}

.send-btn{
  flex:0 0 auto;
  min-width:96px;
  height:52px;
  padding:0 18px;
  border:0;
  border-radius:var(--r-md);
  background:var(--gold-grad);
  color:#161009;
  font-size:16px;
  font-weight:800;
  letter-spacing:.01em;
  cursor:pointer;
  box-shadow:0 8px 22px rgba(200,169,106,.24), inset 0 1px 0 rgba(255,255,255,.4);
  transition:transform .12s ease, box-shadow .18s ease, filter .18s ease;
}
.send-btn:active{transform:translateY(1px) scale(.985);box-shadow:0 4px 12px rgba(200,169,106,.2);}
.send-btn:disabled{filter:grayscale(.6) brightness(.6);box-shadow:none;cursor:default;}

/* ================= HOST ================= */
.host{
  display:none;
  position:absolute;
  z-index:1;
  left:2%;
  bottom:74px;
  width:150px;
  opacity:.9;
  pointer-events:none;
  transform-origin:bottom center;
}
.host svg{width:100%;height:auto;display:block;
  filter:drop-shadow(0 0 14px rgba(200,169,106,.3));}
@media (min-width:900px){
  .host{display:block;}
}

#hostBody{animation:breathe 4.6s ease-in-out infinite;transform-box:view-box;transform-origin:80px 300px;}
@keyframes breathe{0%,100%{transform:translateY(0) scaleY(1);}50%{transform:translateY(-3px) scaleY(1.006);}}

#hostHead{transform-box:view-box;transform-origin:80px 78px;}
#hostArmL,#hostArmR{transform-box:view-box;}
#hostArmL{transform-origin:50px 106px;}
#hostArmR{transform-origin:110px 106px;}

.host.talk #hostArmR{animation:hostTalk 1.1s ease-in-out 2;}
@keyframes hostTalk{
  0%,100%{transform:rotate(0deg);}
  40%{transform:rotate(-24deg);}
  70%{transform:rotate(6deg);}
}
.host.approve #hostHead{animation:hostNod .7s ease-in-out 2;}
@keyframes hostNod{
  0%,100%{transform:rotate(0deg);}
  40%{transform:rotate(9deg);}
}
.host.approve #hostArmR{animation:hostLift .8s ease-out 1;}
@keyframes hostLift{
  0%{transform:rotate(0deg);}55%{transform:rotate(-40deg);}100%{transform:rotate(0deg);}
}
.host.cringe{animation:hostCringe .6s ease-out 1;}
@keyframes hostCringe{
  0%{transform:translateX(0) rotate(0deg);}
  45%{transform:translateX(16px) rotate(3deg);}
  100%{transform:translateX(0) rotate(0deg);}
}
.host.celebrate #hostArmL{animation:hostUpL .9s cubic-bezier(.3,1.4,.5,1) forwards;}
.host.celebrate #hostArmR{animation:hostUpR .9s cubic-bezier(.3,1.4,.5,1) forwards;}
@keyframes hostUpL{to{transform:rotate(118deg);}}
@keyframes hostUpR{to{transform:rotate(-118deg);}}

/* ================= OVERLAYS ================= */
.overlay{
  position:fixed;
  inset:0;
  z-index:40;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:20px 18px;
  background:rgba(6,6,8,.82);
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  overflow-y:auto;
  animation:fadeIn .28s ease-out;
}
.overlay.hidden{display:none;}
@keyframes fadeIn{from{opacity:0;}to{opacity:1;}}

.start-card,.result-card{
  width:100%;
  max-width:420px;
  margin:auto;
  text-align:center;
  border-radius:var(--r-lg);
  padding:26px 22px 22px;
  background:linear-gradient(180deg,rgba(24,24,26,.96) 0%,rgba(11,11,13,.98) 100%);
  border:1px solid rgba(200,169,106,.32);
  box-shadow:var(--shadow-deep), 0 0 0 1px rgba(230,211,163,.07) inset, 0 0 90px rgba(200,169,106,.10);
  position:relative;
  animation:cardIn .42s cubic-bezier(.2,.9,.3,1);
}
@keyframes cardIn{
  from{opacity:0;transform:translateY(18px) scale(.98);}
  to{opacity:1;transform:none;}
}

.crest{width:74px;height:74px;margin:0 auto 12px;opacity:.92;}
.crest svg{width:100%;height:100%;}

.title{
  margin:0;
  font-family:'Reem Kufi','Tajawal',sans-serif;
  font-size:clamp(26px,8vw,36px);
  font-weight:700;
  line-height:1.25;
  background:linear-gradient(180deg,#F3E6C4 0%,#E6D3A3 34%,#C8A96A 66%,#8A6E3A 100%);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  filter:drop-shadow(0 2px 14px rgba(200,169,106,.32));
}
.subtitle{
  margin:4px 0 20px;
  font-size:12.5px;
  letter-spacing:.16em;
  color:var(--silver);
}

.rules{
  display:flex;
  justify-content:center;
  gap:8px;
  margin-bottom:16px;
}
.rule{
  flex:1 1 0;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:2px;
  padding:9px 4px;
  border-radius:12px;
  border:1px solid rgba(200,169,106,.2);
  background:rgba(200,169,106,.05);
}
.rule-n{
  font-family:'Reem Kufi',sans-serif;
  font-size:19px;
  font-weight:700;
  color:var(--gold-1);
  line-height:1;
}
.rule span:last-child{font-size:10.5px;color:var(--silver);}

.hint{
  margin:0 0 18px;
  font-size:13px;
  line-height:1.7;
  color:rgba(245,241,232,.62);
}

.btn-gold{
  display:block;
  width:100%;
  min-height:54px;
  border:0;
  border-radius:var(--r-md);
  background:var(--gold-grad);
  color:#171208;
  font-size:17px;
  font-weight:800;
  cursor:pointer;
  box-shadow:0 10px 28px rgba(200,169,106,.26), inset 0 1px 0 rgba(255,255,255,.42);
  transition:transform .12s ease, box-shadow .18s ease, filter .18s ease;
}
.btn-gold:active{transform:translateY(1px) scale(.99);box-shadow:0 5px 14px rgba(200,169,106,.22);}
.btn-gold:focus-visible{outline:2px solid #E6D3A3;outline-offset:3px;}

.best-line{
  margin:12px 0 0;
  font-size:12.5px;
  color:var(--silver);
}
.best-line strong{color:var(--gold-1);font-weight:800;}

/* ---------- result ---------- */
.result-card{padding-top:24px;}
.res-eyebrow{
  margin:0 0 2px;
  font-size:11px;
  letter-spacing:.2em;
  color:var(--gold-2);
}
.res-score{
  font-family:'Reem Kufi',sans-serif;
  font-size:clamp(58px,19vw,86px);
  font-weight:700;
  line-height:1;
  background:linear-gradient(180deg,#FBF3DE 0%,#E6D3A3 38%,#C8A96A 72%,#8A6E3A 100%);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  filter:drop-shadow(0 4px 26px rgba(200,169,106,.4));
  font-feature-settings:"tnum";
  animation:scoreIn .6s cubic-bezier(.2,1.2,.4,1);
}
@keyframes scoreIn{
  from{opacity:0;transform:scale(.7);}
  to{opacity:1;transform:scale(1);}
}
.res-rating{
  margin:2px 0 12px;
  font-size:14px;
  font-weight:700;
  color:rgba(245,241,232,.78);
}
.res-bar{
  height:4px;
  border-radius:999px;
  background:rgba(255,255,255,.07);
  overflow:hidden;
  margin-bottom:4px;
}
.res-bar-fill{
  height:100%;
  width:0%;
  border-radius:999px;
  background:var(--gold-grad);
  transition:width .9s cubic-bezier(.2,.8,.3,1);
}

.lb{
  margin-top:18px;
  padding-top:16px;
  border-top:1px solid rgba(200,169,106,.16);
  text-align:right;
}
.lb-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom:9px;
  font-size:12.5px;
  font-weight:700;
  color:var(--gold-1);
}
.lb-join{
  border:1px solid rgba(200,169,106,.42);
  background:transparent;
  color:var(--gold-1);
  font-size:11.5px;
  font-weight:700;
  padding:7px 12px;
  border-radius:999px;
  cursor:pointer;
}
.lb-join.hidden{display:none;}
.lb-list{display:flex;flex-direction:column;gap:5px;max-height:184px;overflow-y:auto;}
.lb-row{
  display:flex;
  align-items:center;
  gap:9px;
  padding:7px 10px;
  border-radius:9px;
  background:rgba(255,255,255,.035);
  font-size:12.5px;
}
.lb-row.you{background:rgba(200,169,106,.13);border:1px solid rgba(200,169,106,.3);}
.lb-rank{
  width:20px;flex:0 0 auto;
  font-family:'Reem Kufi',sans-serif;
  font-weight:700;
  color:var(--gold-2);
  text-align:center;
}
.lb-handle{flex:1 1 auto;color:rgba(245,241,232,.85);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.lb-score{flex:0 0 auto;font-weight:800;color:var(--gold-1);font-feature-settings:"tnum";}
.lb-note{margin:0;font-size:12px;color:var(--silver);line-height:1.6;padding:6px 0;}
.lb-fine{font-size:10.5px;color:rgba(154,154,158,.7);margin-top:8px;}

/* ================= TOAST ================= */
.toast{
  position:fixed;
  right:50%;
  top:96px;
  transform:translate(50%,-12px);
  z-index:50;
  padding:9px 20px;
  border-radius:999px;
  background:linear-gradient(135deg,rgba(230,211,163,.95),rgba(200,169,106,.95));
  color:#171208;
  font-size:13.5px;
  font-weight:800;
  box-shadow:0 12px 34px rgba(0,0,0,.5), 0 0 34px rgba(200,169,106,.4);
  opacity:0;
  pointer-events:none;
  transition:opacity .24s ease, transform .24s cubic-bezier(.2,1.4,.4,1);
}
.toast.show{opacity:1;transform:translate(50%,0);}

/* ================= STRIKE FLASH ================= */
.strike-flash{
  position:fixed;
  inset:0;
  z-index:35;
  display:grid;
  place-items:center;
  pointer-events:none;
  opacity:0;
  visibility:hidden;
}
.strike-flash svg{
  width:min(66vw,300px);
  height:min(66vw,300px);
  overflow:visible;
}
.strike-flash line{
  stroke:var(--blood);
  stroke-width:9;
  stroke-linecap:round;
  stroke-dasharray:96;
  stroke-dashoffset:96;
  filter:drop-shadow(0 0 20px rgba(122,42,34,1)) drop-shadow(0 0 46px rgba(150,58,46,.7));
}
.strike-flash.show{
  visibility:visible;
  animation:flashLife 1s ease-out forwards;
}
.strike-flash.show line{animation:drawX .34s cubic-bezier(.3,.1,.2,1) forwards;}
.strike-flash.show line:nth-child(2){animation-delay:.13s;}
@keyframes drawX{to{stroke-dashoffset:0;}}
@keyframes flashLife{
  0%{opacity:0;}
  12%{opacity:1;}
  62%{opacity:1;}
  100%{opacity:0;}
}

/* ================= PARTICLES ================= */
.spark{
  position:fixed;
  width:6px;height:6px;
  border-radius:50%;
  background:radial-gradient(circle,#FBF3DE,#C8A96A);
  box-shadow:0 0 10px rgba(230,211,163,.9);
  pointer-events:none;
  z-index:36;
  animation:sparkFly .72s cubic-bezier(.15,.7,.3,1) forwards;
}
@keyframes sparkFly{
  0%{transform:translate(0,0) scale(1);opacity:1;}
  100%{transform:translate(var(--dx),var(--dy)) scale(.2);opacity:0;}
}

/* ================= COMPACT HEIGHTS ================= */
@media (max-height:640px){
  .hud{padding-top:7px;}
  .stat{padding:2px 10px;min-width:60px;}
  .stat-num{font-size:17px;}
  .round-pill{font-size:12px;padding:6px 11px;}
  .q-text{min-height:2.2em;margin-bottom:9px;}
  .slot{height:42px;}
  .board-reflection{height:30px;opacity:.3;}
  .dock{padding-bottom:10px;}
  .answer-input,.send-btn{height:48px;}
}
@media (max-height:520px){
  .overlay{padding:12px;}
  .start-card,.result-card{padding:18px 16px 16px;}
  .crest{display:none;}
  .arch{opacity:.22;}
  .host{display:none;}
  .subtitle{margin-bottom:12px;}
  .hint{margin-bottom:12px;font-size:12px;}
  .rules{margin-bottom:12px;}
}
@media (max-height:470px){
  .slots{grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;}
  .slot{height:36px;}
  .q-text{font-size:14px;min-height:0;margin-bottom:7px;}
  .q-label{display:none;}
  .board-inner{padding:8px;}
  .board-reflection{display:none;}
  .answer-input,.send-btn{height:44px;}
  .stat-label{display:none;}
  .stat{padding:3px 10px;}
}
@media (max-height:400px){
  .hud{padding-top:5px;}
  .timer-track{margin-top:6px;}
  .dock{padding:5px 12px 8px;}
  .answer-input,.send-btn{height:40px;font-size:15px;}
  .slot{height:32px;}
  .slots{gap:5px;}
}

/* ================= REDUCED MOTION ================= */
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration:.001ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.001ms !important;
  }
  .dust{display:none;}
  .beam{opacity:.4;}
}