@font-face{font-family:'Titan One';src:url('assets/fonts/titanone.woff2') format('woff2');font-weight:400;font-style:normal;font-display:block}
@font-face{font-family:'Rubik Mono One';src:url('assets/fonts/rubikmono.woff2') format('woff2');font-weight:400;font-style:normal;font-display:block}
@font-face{font-family:'Nunito';src:url('assets/fonts/nunito.woff2') format('woff2');font-weight:400;font-style:normal;font-display:block}
@font-face{font-family:'Nunito';src:url('assets/fonts/nunito.woff2') format('woff2');font-weight:700;font-style:normal;font-display:block}
@font-face{font-family:'Nunito';src:url('assets/fonts/nunito.woff2') format('woff2');font-weight:900;font-style:normal;font-display:block}

:root{
  --ink:#2B1B4D;
  --ink-soft:rgba(43,27,77,.62);
  --gold:#FFD447;
  --pink:#FF4E88;
  --cyan:#3DD8FF;
  --violet:#7C4DFF;
  --mint:#5CF08C;
  --cream:#FFF7F0;
}

*{box-sizing:border-box}
html,body{height:100%;margin:0;overflow:hidden}
body{
  position:fixed;inset:0;
  background:#2B1B4D;
  font-family:'Nunito',system-ui,sans-serif;
  -webkit-user-select:none;user-select:none;
  -webkit-tap-highlight-color:transparent;
  touch-action:none;
  color:var(--cream);
}
button{font-family:inherit}
.hidden{display:none !important}

#bg{
  position:fixed;inset:0;z-index:0;
  background:url('assets/elements/field_backdrop_bright.webp') center center / cover no-repeat;
  transform:scale(1.015);
}
#vignette{
  position:fixed;inset:0;z-index:2;pointer-events:none;
  background:
    radial-gradient(120% 92% at 50% 46%, rgba(24,10,52,0) 42%, rgba(20,8,45,.34) 100%),
    linear-gradient(to bottom, rgba(24,10,52,.10), rgba(24,10,52,0) 22%, rgba(24,10,52,0) 74%, rgba(24,10,52,.18));
}
#game{position:fixed;inset:0;z-index:1}
#game canvas{display:block;width:100%;height:100%;touch-action:none}

/* ---------------- HUD ---------------- */
#hud{
  position:fixed;z-index:10;left:0;right:0;top:0;
  transition:opacity .2s ease;
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;
  align-items:start;justify-items:center;
  gap:clamp(4px,1.1vw,18px);
  padding:calc(8px + env(safe-area-inset-top)) clamp(10px,2.2vw,28px) 0;
  pointer-events:none;
}
#scoreWrap{
  position:relative;justify-self:start;
  width:clamp(74px,8.6vw,112px);
  aspect-ratio:414/417;
}
#bestWrap{
  position:relative;justify-self:end;
  width:clamp(64px,7.4vw,100px);
  aspect-ratio:301/251;
}
.plate img{
  position:absolute;inset:0;width:100%;height:100%;object-fit:contain;
  filter:drop-shadow(0 4px 0 rgba(24,10,52,.25));
}
.plateText{
  position:absolute;inset:0;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  padding-top:4%;
}
.plateLabel{
  display:flex;align-items:center;gap:2px;
  font-weight:900;font-size:clamp(7px,1vw,11px);
  letter-spacing:.16em;line-height:1;
  color:var(--gold);
  text-shadow:0 1px 0 var(--ink);
}
.crown{display:inline-block;width:1.15em;height:1.15em;flex:none;vertical-align:-.2em}
.crown svg{display:block;width:100%;height:100%}
.plateNum{
  font-family:'Rubik Mono One','Nunito',monospace;
  font-size:clamp(17px,2.25vw,29px);
  line-height:1.08;
  letter-spacing:-.045em;
  font-variant-numeric:tabular-nums;
  color:var(--cream);
  text-shadow:0 2px 0 var(--ink), 0 0 8px rgba(24,10,52,.55);
  margin-top:2%;
  white-space:nowrap;
}
#bestWrap .plateNum{font-size:clamp(13px,1.65vw,22px)}

#timerWrap{
  position:relative;
  justify-self:center;
  height:min(clamp(40px,8.2vh,74px), 13vw);
  aspect-ratio:492/125;
  max-width:100%;
}
#timerTrack{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;filter:drop-shadow(0 4px 0 rgba(24,10,52,.22))}
#timerInner{
  position:absolute;left:5.2%;right:5.2%;top:17%;bottom:17%;
  border-radius:999px;overflow:hidden;
}
#timerDrain{
  position:absolute;right:0;top:0;bottom:0;width:0%;
  background:rgba(22,9,46,.78);
  border-radius:0 999px 999px 0;
  transition:width .18s linear;
}
#timerText{
  position:absolute;inset:0;z-index:2;
  display:flex;align-items:center;justify-content:center;gap:.18em;
  padding-bottom:6%;
  font-family:'Rubik Mono One',monospace;
  font-size:clamp(17px,2.1vw,28px);
  color:#fff;
  text-shadow:0 2px 0 var(--ink), 0 0 7px rgba(43,27,77,.55);
  letter-spacing:-.03em;
  font-variant-numeric:tabular-nums;
}
#timerText .s{font-size:.55em;opacity:.9;margin-top:.15em}
#timerWrap.danger #timerText{animation:timerPulse .8s ease-in-out infinite}
#comboRow{
  position:absolute;left:50%;top:calc(100% + 5px);transform:translateX(-50%);
  width:min(100%,420px);min-width:200px;
  display:flex;align-items:center;gap:6px;
}
#levelChip{
  flex:none;
  white-space:nowrap;
  font-weight:900;font-size:clamp(8px,1vw,11px);
  letter-spacing:.14em;text-transform:uppercase;
  color:var(--cream);
  background:rgba(43,27,77,.5);
  border:1.5px solid rgba(255,247,240,.42);
  border-radius:999px;
  padding:2px 8px;
  text-shadow:0 1px 0 var(--ink);
}
#comboBar{
  position:relative;flex:1;min-width:60px;
  height:clamp(14px,1.7vw,18px);
  border-radius:999px;overflow:hidden;
  background:rgba(43,27,77,.62);
  border:2px solid var(--cream);
  box-shadow:0 2px 0 rgba(24,10,52,.35), inset 0 2px 3px rgba(0,0,0,.35);
}
#comboFill{
  position:absolute;left:0;top:0;bottom:0;width:0%;
  border-radius:999px;
  background:linear-gradient(90deg,#FFE066,#FFD447 40%,#FF8A3D 75%,#FF4E88);
  box-shadow:inset 0 3px 0 rgba(255,255,255,.55);
  transition:width .14s ease-out;
}
.cbLabel{
  position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  font-weight:900;font-size:clamp(7px,.8vw,9px);letter-spacing:.2em;
  color:#fff;text-shadow:0 1px 0 var(--ink),0 0 3px var(--ink);
}
#comboCount{
  flex:none;min-width:3.6em;text-align:left;
  font-family:'Rubik Mono One',monospace;font-size:clamp(9px,1.05vw,12px);
  color:var(--gold);text-shadow:0 1px 0 var(--ink),0 0 4px var(--ink);
}
#comboRow.max #comboBar{animation:barGlow .5s ease-in-out infinite alternate}
@keyframes barGlow{from{box-shadow:0 0 0 rgba(255,212,71,0)}to{box-shadow:0 0 14px rgba(255,212,71,.95),0 0 4px #fff}}

/* combo badge */
#comboWrap{
  position:absolute;left:0;top:calc(100% + 6px);
  width:78%;
  aspect-ratio:384/406;
  pointer-events:none;
  opacity:0;transform:scale(.62) rotate(-6deg);
  transition:opacity .16s ease, transform .2s cubic-bezier(.2,1.5,.4,1);
  filter:drop-shadow(0 4px 0 rgba(24,10,52,.28));
}
#comboWrap.show{opacity:1;transform:scale(1) rotate(0deg)}
#comboWrap.bump{animation:comboBump .34s cubic-bezier(.2,1.6,.4,1)}
#comboWrap img{
  position:absolute;inset:0;width:100%;height:100%;object-fit:contain;
  filter:blur(1.5px) brightness(.86) saturate(1.35);
}
#comboWrap::before{
  content:'';position:absolute;inset:13%;border-radius:50%;
  background:radial-gradient(circle at 38% 28%, #FFFDF8, #FFF0DC 62%, #F4D9BE 100%);
  border:clamp(2px,.28vw,3.5px) solid var(--ink);
  box-shadow:inset 0 -4px 0 rgba(43,27,77,.18), 0 2px 0 rgba(43,27,77,.2);
}
#comboNum{
  position:absolute;inset:13%;
  display:flex;align-items:center;justify-content:center;
  font-family:'Titan One',sans-serif;
  font-size:clamp(17px,2.1vw,27px);
  color:var(--pink);
  -webkit-text-stroke:clamp(1.5px,.24vw,3px) var(--ink);
  paint-order:stroke fill;
  text-shadow:0 3px 0 rgba(43,27,77,.32);
  letter-spacing:-.02em;
  transform:translateY(1%);
}

/* ---------------- taps + help ---------------- */
#tapsWrap{
  position:fixed;z-index:11;left:50%;
  transition:opacity .2s ease;
  bottom:calc(10px + env(safe-area-inset-bottom));
  transform:translateX(-50%);
  display:flex;align-items:center;justify-content:center;
  gap:clamp(2px,.62vw,6px);
  padding:5px clamp(7px,1vw,12px);
  border-radius:999px;
  background:rgba(43,27,77,.30);
  border:2px solid rgba(255,247,240,.34);
  box-shadow:0 4px 0 rgba(24,10,52,.18);
  pointer-events:none;
  max-width:calc(100vw - 108px);
}
.pip{
  width:clamp(14px,1.75vw,24px);
  aspect-ratio:1;
  flex:none;
  transition:opacity .25s ease, transform .25s ease;
}
.pip img{
  display:block;width:100%;height:100%;object-fit:contain;
  animation:pipBob 2.8s ease-in-out infinite;
  filter:drop-shadow(0 2px 0 rgba(24,10,52,.2));
  transition:filter .3s ease, opacity .3s ease, transform .3s ease;
}
.pip.spent img{
  filter:grayscale(1) brightness(.55);
  opacity:.34;
  transform:scale(.76);
  animation:none;
}
#helpLine{
  position:fixed;z-index:11;left:50%;
  transition:opacity .2s ease;
  bottom:calc(10px + env(safe-area-inset-bottom) + 34px);
  transform:translateX(-50%);
  white-space:nowrap;
  font-weight:900;font-size:clamp(8px,1.02vw,12px);
  letter-spacing:.07em;
  color:var(--cream);
  text-shadow:0 2px 0 var(--ink), 0 0 9px rgba(24,10,52,.65);
  pointer-events:none;
  opacity:.94;
}

/* ---------------- sound ---------------- */
#soundBtn{
  position:fixed;z-index:60;
  right:calc(10px + env(safe-area-inset-right));
  bottom:calc(10px + env(safe-area-inset-bottom));
  width:clamp(44px,4.6vw,58px);
  aspect-ratio:1;
  padding:0;cursor:pointer;
  display:flex;align-items:center;justify-content:center;
  border:4px solid var(--ink);border-radius:50%;
  background:radial-gradient(circle at 36% 28%,#FFF4B8,#FFD447 52%,#F5A524);
  box-shadow:0 4px 0 rgba(24,10,52,.45), inset 0 2px 0 rgba(255,255,255,.7);
  line-height:0;
  transition:transform .12s ease;
}
#soundBtn svg.speaker{width:62%;height:62%;display:block}
#soundBtn .cross{display:none}
#soundBtn.muted .waves{display:none}
#soundBtn.muted .cross{display:inline}
#soundBtn.muted{background:radial-gradient(circle at 36% 28%,#F4EEFF,#C9B8E8 52%,#9C86C8)}
#soundBtn:active{transform:translateY(2px) scale(.95)}

/* ---------------- start screen ---------------- */
#startScreen{
  position:fixed;inset:0;z-index:30;
  display:flex;align-items:center;justify-content:center;
  padding:clamp(8px,2vh,26px) 14px;
  cursor:pointer;
  background:radial-gradient(90% 80% at 50% 44%, rgba(24,10,52,0) 32%, rgba(24,10,52,.28) 100%);
  transition:opacity .25s ease, transform .25s ease;
}
#startScreen.leaving{opacity:0;transform:scale(1.04);pointer-events:none}
.startInner{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;width:min(94vw,780px);
  gap:clamp(2px,.8vh,10px);
}
#titleWrap{position:relative;display:flex;align-items:center;justify-content:center;animation:titleFloat 4.8s ease-in-out infinite}
#titleText{
  margin:0;display:flex;flex-direction:column;align-items:center;
  font-family:'Titan One',sans-serif;font-weight:400;
  line-height:.92;letter-spacing:.02em;
  font-size:min(15vh,13.5vw,124px);
}
#titleText .tl{
  display:block;
  -webkit-text-stroke:.14em var(--ink);paint-order:stroke fill;
  filter:drop-shadow(0 .08em 0 rgba(24,10,52,.40));
}
#titleText .t1{color:#FF6FB1}
#titleText .t2{color:var(--gold);font-size:1.08em}
#titleWrap{flex-direction:column}
#mascot{
  position:relative;
  font-size:min(13vh,15vw,110px);line-height:1;
  margin-bottom:-.12em;
  font-family:'Segoe UI Emoji','Apple Color Emoji','Noto Color Emoji',sans-serif;
  filter:drop-shadow(0 5px 0 rgba(24,10,52,.35));
  animation:mascotBop 1.6s ease-in-out infinite;
  z-index:1;
}
@keyframes mascotBop{0%,100%{transform:rotate(-6deg) scale(1)}50%{transform:rotate(6deg) scale(1.1)}}
.tagline{
  margin:0;
  font-weight:900;font-size:clamp(11px,1.75vh,16px);
  letter-spacing:.18em;text-transform:uppercase;
  color:var(--cream);
  text-shadow:0 2px 0 var(--ink), 0 0 10px rgba(24,10,52,.6);
  opacity:.92;
}
#startBtn{
  position:relative;
  width:clamp(100px,15vh,150px);
  aspect-ratio:1;
  margin:clamp(1px,.7vh,8px) 0 0;
  padding:0;border:0;background:none;cursor:pointer;
  line-height:0;
}
#startBtn .playFace{
  position:absolute;inset:0;border-radius:50%;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2%;
  border:clamp(4px,.7vh,6px) solid var(--ink);
  background:radial-gradient(circle at 36% 26%,#FFF6C0,#FFD447 48%,#F5A524);
  box-shadow:0 8px 0 rgba(24,10,52,.36), inset 0 4px 0 rgba(255,255,255,.65), inset 0 -6px 0 rgba(200,110,20,.35);
  transition:transform .12s ease;
}
#startBtn .playFace svg{width:44%;height:44%;margin-left:8%}
#startBtn .playWord{
  font-family:'Titan One',sans-serif;line-height:1;
  font-size:clamp(16px,2.9vh,28px);letter-spacing:.06em;color:var(--ink);
}
#startBtn:active .playFace{transform:translateY(3px) scale(.97)}
#startBtn::after{
  content:'';position:absolute;inset:-7%;border-radius:50%;
  border:3px solid rgba(255,212,71,.55);
  animation:ringPulse 1.9s ease-out infinite;
  pointer-events:none;
}
.startPrompt{
  font-family:'Titan One',sans-serif;
  font-size:clamp(24px,5.2vh,48px);
  line-height:1;
  color:var(--gold);
  -webkit-text-stroke:clamp(5px,.7vh,8px) var(--ink);
  paint-order:stroke fill;
  text-shadow:0 5px 0 rgba(24,10,52,.38);
  letter-spacing:.03em;
  animation:promptPulse 1.7s ease-in-out infinite;
}
.howto{
  list-style:none;display:flex;flex-wrap:wrap;justify-content:center;
  gap:clamp(4px,.7vw,9px);
  margin:clamp(2px,.9vh,9px) 0 0;padding:0;
}
.howto li{
  font-weight:900;font-size:clamp(10px,1.5vh,15px);
  letter-spacing:.04em;
  color:var(--cream);
  background:rgba(43,27,77,.52);
  border:1.5px solid rgba(255,247,240,.44);
  border-radius:999px;
  padding:clamp(2px,.45vh,5px) clamp(7px,.9vw,12px);
  text-shadow:0 1px 0 var(--ink);
  white-space:nowrap;
}
.howto b{color:var(--gold);letter-spacing:.06em}
.startBest{
  display:flex;align-items:center;gap:6px;
  margin-top:clamp(2px,.7vh,7px);
  font-weight:900;font-size:clamp(10px,1.45vh,14px);
  letter-spacing:.14em;
  color:var(--cream);
  text-shadow:0 2px 0 var(--ink);
  opacity:.94;
}
.startBest .crown{width:1.3em;height:1.3em;vertical-align:-.25em}
.startBest span{font-family:'Rubik Mono One',monospace;color:var(--gold);letter-spacing:0;font-size:1.08em}

/* ---------------- end screen ---------------- */
#endScreen{
  position:fixed;inset:0;z-index:31;
  display:none;align-items:center;justify-content:center;
  padding:18px;
  background:radial-gradient(72% 72% at 50% 50%, rgba(24,10,52,.55), rgba(20,8,45,.80));
  -webkit-backdrop-filter:blur(2.5px);backdrop-filter:blur(2.5px);
}
#endScreen.show{display:flex;animation:fadeIn .3s ease-out}
.endInner{
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;width:min(92vw,620px);
  gap:clamp(2px,.7vh,8px);
}
#endTitle{
  font-family:'Titan One',sans-serif;
  font-size:clamp(30px,7.2vh,72px);
  line-height:.98;
  color:var(--gold);
  -webkit-text-stroke:clamp(7px,1.1vh,12px) var(--ink);
  paint-order:stroke fill;
  text-shadow:0 8px 0 rgba(20,8,45,.45);
  transform:rotate(-2deg);
}
#endReason{
  font-weight:900;font-size:clamp(11px,1.7vh,16px);
  line-height:1.3;
  color:var(--cream);
  text-shadow:0 2px 0 var(--ink);
  max-width:44ch;
  opacity:.94;
}
.endScore{
  display:flex;align-items:baseline;justify-content:center;gap:.45em;
  margin-top:clamp(1px,.6vh,7px);
}
.endScore span{
  font-weight:900;font-size:clamp(9px,1.3vh,13px);
  letter-spacing:.2em;color:var(--gold);
  text-shadow:0 2px 0 var(--ink);
}
.endScore b{
  font-family:'Rubik Mono One',monospace;
  font-weight:400;
  font-size:clamp(36px,8.4vh,88px);
  line-height:1;
  color:#fff;
  letter-spacing:-.04em;
  text-shadow:0 5px 0 var(--ink), 0 0 18px rgba(124,77,255,.5);
  font-variant-numeric:tabular-nums;
}
.endBest{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:center;
  font-weight:900;font-size:clamp(9px,1.35vh,13px);
  letter-spacing:.14em;color:var(--cream);
  text-shadow:0 2px 0 var(--ink);
}
.endBest span{font-family:'Rubik Mono One',monospace;color:var(--gold);letter-spacing:0}
#newBest{
  font-style:normal;
  font-family:'Titan One',sans-serif;
  letter-spacing:.04em;
  font-size:clamp(11px,1.6vh,17px);
  color:var(--ink);
  background:linear-gradient(180deg,#FFE985,#FFB92E);
  border:2px solid var(--ink);
  border-radius:999px;
  padding:2px 10px 3px;
  transform:rotate(-3deg);
  box-shadow:0 3px 0 rgba(20,8,45,.4);
  animation:newBestWiggle 1.5s ease-in-out infinite;
}
#restartBtn{
  width:clamp(82px,12.5vh,128px);
  aspect-ratio:1;
  margin-top:clamp(2px,.8vh,9px);
  padding:0;border:0;background:none;cursor:pointer;
  line-height:0;
  filter:drop-shadow(0 8px 0 rgba(20,8,45,.35));
  transition:transform .12s ease;
}
#restartBtn img{width:100%;height:100%;object-fit:contain}
#restartBtn:active{transform:translateY(3px) scale(.96)}
.endPrompt{
  font-weight:900;font-size:clamp(9px,1.3vh,12px);
  letter-spacing:.18em;color:var(--cream);
  text-shadow:0 2px 0 var(--ink);
  opacity:.85;
}

/* ---------------- mind blown banner ---------------- */
#mindBanner{
  position:fixed;z-index:25;left:50%;top:50%;
  width:min(88vw,760px);
  aspect-ratio:603/533;
  transform:translate(-50%,-50%);
  pointer-events:none;
  display:none;
  will-change:transform,opacity;
}
#mindBanner .burst{position:absolute;inset:5% 4%}
#mindBanner .burst .b1,#mindBanner .burst .b2{position:absolute;inset:0}
#mindBanner .burst .b1{
  clip-path:polygon(50.0% 4.0%,59.1% 13.2%,71.7% 8.6%,73.7% 22.7%,89.1% 21.3%,86.9% 33.6%,98.7% 39.8%,88.0% 50.0%,98.7% 60.2%,86.9% 66.4%,89.1% 78.7%,73.7% 77.3%,71.7% 91.4%,59.1% 86.8%,50.0% 96.0%,41.5% 84.1%,28.3% 91.4%,24.4% 79.5%,10.9% 78.7%,15.8% 65.2%,1.3% 60.2%,9.0% 50.0%,1.3% 39.8%,15.8% 34.8%,10.9% 21.3%,24.4% 20.5%,28.3% 8.6%,41.5% 15.9%);
  background:var(--ink);
  transform:scale(1.04);
}
#mindBanner .burst .b1::after{
  content:'';position:absolute;inset:2.2%;
  clip-path:polygon(50.0% 4.0%,59.1% 13.2%,71.7% 8.6%,73.7% 22.7%,89.1% 21.3%,86.9% 33.6%,98.7% 39.8%,88.0% 50.0%,98.7% 60.2%,86.9% 66.4%,89.1% 78.7%,73.7% 77.3%,71.7% 91.4%,59.1% 86.8%,50.0% 96.0%,41.5% 84.1%,28.3% 91.4%,24.4% 79.5%,10.9% 78.7%,15.8% 65.2%,1.3% 60.2%,9.0% 50.0%,1.3% 39.8%,15.8% 34.8%,10.9% 21.3%,24.4% 20.5%,28.3% 8.6%,41.5% 15.9%);
  background:radial-gradient(circle at 50% 45%,#FFF6B0,#FFD447 50%,#FFA92E);
}
#mindBanner .burst .b2{
  clip-path:polygon(54.9% 9.8%,61.2% 20.5%,73.4% 15.7%,74.0% 27.9%,87.3% 28.5%,82.1% 39.7%,93.7% 45.5%,83.8% 53.5%,91.5% 63.4%,78.8% 66.6%,81.1% 78.6%,68.1% 76.5%,64.5% 88.2%,53.8% 81.1%,45.1% 90.2%,38.8% 79.5%,26.6% 84.3%,26.0% 72.1%,12.7% 71.5%,17.9% 60.3%,6.3% 54.5%,16.2% 46.5%,8.5% 36.6%,21.2% 33.4%,18.9% 21.4%,31.9% 23.5%,35.5% 11.8%,46.2% 18.9%);
  background:radial-gradient(circle at 50% 45%,#FF9ACB,#FF4E88 55%,#C92A70);
  transform:scale(.9);
  animation:burstPulse .9s ease-in-out infinite alternate;
}
@keyframes burstPulse{from{transform:scale(.88)}to{transform:scale(.94)}}
#mindBanner .bannerText{
  position:absolute;inset:0;
  display:flex;flex-direction:column;align-items:center;justify-content:center;
  transform:rotate(-2.2deg);
  padding-bottom:2%;
  text-align:center;
}
#mindBanner .bannerText::before{display:none}
#mindBanner .big,#mindBanner .sub{position:relative;z-index:1}
#mindBanner .big{
  font-family:'Titan One',sans-serif;
  font-size:clamp(34px,7.4vw,88px);
  line-height:.92;
  color:var(--gold);
  -webkit-text-stroke:clamp(8px,1.2vw,13px) var(--ink);
  paint-order:stroke fill;
  text-shadow:0 9px 0 rgba(43,27,77,.5), 0 0 26px rgba(255,78,136,.45);
  white-space:nowrap;
}
#mindBanner .sub{
  margin-top:clamp(1px,.6vh,7px);
  font-family:'Titan One',sans-serif;
  font-size:clamp(11px,1.7vw,20px);
  letter-spacing:.09em;
  color:#fff;
  -webkit-text-stroke:clamp(3px,.5vw,6px) var(--ink);
  paint-order:stroke fill;
  text-shadow:0 3px 0 rgba(43,27,77,.4);
}

/* ---------------- level toast ---------------- */
#levelToast{
  position:fixed;z-index:12;left:50%;top:17%;
  transform:translate(-50%,-8px);
  text-align:center;pointer-events:none;
  opacity:0;
}
#levelToast.show{animation:toastIn 2.05s ease forwards}
#levelToast .t1{
  font-family:'Titan One',sans-serif;
  font-size:clamp(20px,3.6vh,40px);
  color:#fff;
  -webkit-text-stroke:clamp(5px,.8vh,9px) var(--ink);
  paint-order:stroke fill;
  text-shadow:0 5px 0 rgba(43,27,77,.35);
}
#levelToast .t2{
  font-weight:900;font-size:clamp(9px,1.25vh,12px);
  letter-spacing:.16em;text-transform:uppercase;
  color:var(--gold);
  text-shadow:0 2px 0 var(--ink);
}

/* ---------------- flash + pause ---------------- */
#flash{position:fixed;inset:0;z-index:20;pointer-events:none;opacity:0}
#pauseScreen{
  position:fixed;inset:0;z-index:32;
  display:none;align-items:center;justify-content:center;flex-direction:column;
  background:rgba(20,8,45,.66);
  -webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);
  cursor:pointer;
}
#pauseScreen.show{display:flex;animation:fadeIn .2s ease}
#pauseScreen .p1{
  font-family:'Titan One',sans-serif;
  font-size:clamp(32px,6vh,64px);
  color:var(--gold);
  -webkit-text-stroke:clamp(6px,1vh,11px) var(--ink);
  paint-order:stroke fill;
  text-shadow:0 6px 0 rgba(20,8,45,.4);
}
#pauseScreen .p2{
  margin-top:8px;
  font-weight:900;font-size:clamp(10px,1.5vh,14px);
  letter-spacing:.2em;color:var(--cream);
  text-shadow:0 2px 0 var(--ink);
  animation:promptPulse 1.5s ease-in-out infinite;
}

/* ---------------- animations ---------------- */
@keyframes titleFloat{0%,100%{transform:translateY(0) rotate(-.5deg)}50%{transform:translateY(-8px) rotate(.5deg)}}
@keyframes ringPulse{0%{transform:scale(.92);opacity:.8}70%{transform:scale(1.22);opacity:0}100%{transform:scale(1.22);opacity:0}}
@keyframes promptPulse{0%,100%{transform:scale(1)}50%{transform:scale(1.045)}}
@keyframes pipBob{0%,100%{transform:translateY(0)}50%{transform:translateY(-2px)}}
@keyframes comboBump{0%{transform:scale(1) rotate(0)}35%{transform:scale(1.35) rotate(-9deg)}70%{transform:scale(.94) rotate(5deg)}100%{transform:scale(1) rotate(0)}}
@keyframes bannerIn{0%{opacity:0;transform:translate(-50%,-50%) scale(.45) rotate(-9deg)}55%{opacity:1;transform:translate(-50%,-50%) scale(1.12) rotate(1deg)}100%{opacity:1;transform:translate(-50%,-50%) scale(1) rotate(0)}}
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes toastIn{0%{opacity:0;transform:translate(-50%,10px) scale(.9)}12%{opacity:1;transform:translate(-50%,0) scale(1.04)}22%{transform:translate(-50%,0) scale(1)}78%{opacity:1}100%{opacity:0;transform:translate(-50%,-8px) scale(.98)}}
@keyframes timerPulse{0%,100%{transform:scale(1);color:#fff}50%{transform:scale(1.14);color:#FFD447}}
@keyframes newBestWiggle{0%,100%{transform:rotate(-3deg) scale(1)}50%{transform:rotate(2deg) scale(1.05)}}

/* ---------------- compact layouts ---------------- */
@media (max-width:560px){
  #hud{padding:calc(6px + env(safe-area-inset-top)) 7px 0;gap:4px}
  #scoreWrap{width:clamp(64px,19vw,80px)}
  #bestWrap{width:clamp(54px,16vw,68px)}
  #timerWrap{height:min(clamp(38px,8vh,54px),13vw)}
  .plateLabel{font-size:7px;letter-spacing:.1em}
  .plateNum{font-size:clamp(14px,4.1vw,21px)}
  #bestWrap .plateNum{font-size:clamp(11px,3.1vw,16px)}
  #levelChip{font-size:7px;padding:2px 6px}
  #comboWrap{width:78%}
  #comboNum{font-size:clamp(17px,5vw,25px)}
  #tapsWrap{max-width:calc(100vw - 96px);gap:2px;padding:4px 6px;bottom:calc(8px + env(safe-area-inset-bottom))}
  .pip{width:clamp(13px,3.4vw,18px)}
  #helpLine{font-size:8.8px;bottom:calc(8px + env(safe-area-inset-bottom) + 30px)}
  #soundBtn{width:clamp(38px,10.5vw,46px);right:calc(6px + env(safe-area-inset-right));bottom:calc(6px + env(safe-area-inset-bottom))}
  #titleText{font-size:min(12vh,17vw)}
  .howto li{font-size:10px;padding:3px 9px}
  .startPrompt{font-size:clamp(26px,4.4vh,40px)}
  #startBtn{width:clamp(90px,13vh,118px)}
}

@media (min-width:700px){
  #timerWrap{width:min(46vw,560px);height:auto;aspect-ratio:8/1;max-width:none}
  #timerTrack{object-fit:fill}
}
@media (max-height:560px) and (min-width:561px){
  #titleText{font-size:min(13vh,10vw)}
  .tagline{display:none}
  #startBtn{width:clamp(66px,15vh,100px)}
  .startPrompt{font-size:clamp(17px,4.4vh,28px)}
  .howto li{font-size:10px;padding:2px 9px}
  .startBest{font-size:10px}
  #startScreen{padding-top:2px;padding-bottom:2px}
}
@media (max-width:340px){
  #helpLine{font-size:8px;letter-spacing:.04em}
  #tapsWrap{max-width:calc(100vw - 84px);gap:1px;padding:4px 5px}
  .pip{width:12px}
  #soundBtn{width:36px}
}
@media (max-width:300px){
  #hud{gap:3px;padding-left:5px;padding-right:5px}
  #scoreWrap{width:56px}
  #bestWrap{width:46px}
  #timerWrap{height:36px}
  .plateNum{font-size:13px}
  #bestWrap .plateNum{font-size:10px}
  #tapsWrap{max-width:calc(100vw - 74px)}
  .pip{width:11px}
  #helpLine{font-size:7.4px}
  #soundBtn{width:32px}
}
@media (max-height:430px){
  #titleText{font-size:min(14vh,10vw)}
  #startBtn{width:clamp(68px,17vh,96px)}
  .startPrompt{font-size:clamp(20px,6vh,30px)}
  .howto{margin-top:1px}
  .howto li{font-size:8.5px;padding:2px 7px}
  .startBest{margin-top:0}
  #endTitle{font-size:clamp(26px,8vh,46px)}
  .endScore b{font-size:clamp(28px,10vh,58px)}
  #restartBtn{width:clamp(64px,15vh,92px)}
}


/* screens keep the field clean */
body.phase-start #hud,
body.phase-start #tapsWrap,
body.phase-start #helpLine,
body.phase-end #hud,
body.phase-end #tapsWrap,
body.phase-end #helpLine{opacity:0;pointer-events:none}



/* ---------------- how to play ---------------- */
#howtoScreen{
  position:fixed;inset:0;z-index:45;
  display:none;align-items:center;justify-content:center;
  padding:calc(8px + env(safe-area-inset-top)) 10px calc(8px + env(safe-area-inset-bottom));
  background:radial-gradient(80% 80% at 50% 50%, rgba(43,20,92,.62), rgba(20,8,45,.86));
  -webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);
}
#howtoScreen.show{display:flex;animation:fadeIn .25s ease-out}
.howtoCard{
  position:relative;
  width:min(96vw,980px);max-height:100%;
  display:flex;flex-direction:column;align-items:center;
  gap:clamp(6px,1.6vh,16px);
  padding:clamp(10px,2.4vh,26px) clamp(10px,2vw,28px) clamp(12px,2.4vh,24px);
  border-radius:clamp(22px,3vw,36px);
  background:linear-gradient(170deg,#8A5CFF 0%,#6A3BE0 46%,#B03FA8 100%);
  border:clamp(4px,.5vw,6px) solid var(--ink);
  box-shadow:0 10px 0 rgba(20,8,45,.45), inset 0 3px 0 rgba(255,255,255,.28);
  animation:cardIn .42s cubic-bezier(.2,1.4,.35,1);
}
#howtoTitle{
  margin:0;
  font-family:'Titan One',sans-serif;font-weight:400;
  font-size:clamp(26px,6vh,56px);line-height:1;
  color:var(--gold);
  -webkit-text-stroke:clamp(5px,.9vh,9px) var(--ink);paint-order:stroke fill;
  text-shadow:0 5px 0 rgba(20,8,45,.4);
  letter-spacing:.03em;
}
.steps{
  list-style:none;margin:0;padding:0;width:100%;
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  gap:clamp(8px,1.4vw,18px);
}
.step{
  position:relative;
  display:flex;flex-direction:column;align-items:center;justify-content:flex-start;
  gap:clamp(4px,1vh,10px);
  padding:clamp(10px,2vh,20px) clamp(6px,1vw,14px) clamp(10px,1.8vh,18px);
  background:rgba(43,27,77,.42);
  border:3px solid rgba(255,247,240,.5);
  border-radius:clamp(18px,2.4vw,28px);
  text-align:center;
}
.stepNum{
  position:absolute;left:-8px;top:-10px;
  width:clamp(30px,4.6vh,42px);aspect-ratio:1;
  display:flex;align-items:center;justify-content:center;
  font-family:'Titan One',sans-serif;font-size:clamp(17px,2.8vh,25px);
  color:var(--ink);
  background:radial-gradient(circle at 38% 30%,#FFF0A0,#FFD447 55%,#F5A524);
  border:3px solid var(--ink);border-radius:50%;
  box-shadow:0 3px 0 rgba(20,8,45,.4);
}
.step p{
  margin:0;
  font-family:'Titan One',sans-serif;
  font-size:clamp(17px,3.3vh,30px);line-height:1.12;
  color:var(--cream);
  -webkit-text-stroke:clamp(3px,.5vh,5px) var(--ink);paint-order:stroke fill;
  text-shadow:0 3px 0 rgba(20,8,45,.35);
}
.step p b{font-weight:400;color:var(--gold)}
.step p .inl{width:1.15em;height:1.15em;object-fit:contain;vertical-align:-.22em;filter:drop-shadow(0 2px 0 rgba(20,8,45,.35))}
.stepIcon{position:relative;width:100%;height:clamp(64px,15vh,128px)}
.stepIcon img{object-fit:contain}

/* step 1: a finger taps a bubble */
.iconTap .tapBubble{position:absolute;left:50%;top:66%;height:58%;transform:translate(-50%,-50%)}
.iconTap .tapRing{
  position:absolute;left:50%;top:66%;width:62%;aspect-ratio:1;max-height:110%;
  border:4px solid #fff;border-radius:50%;
  transform:translate(-50%,-50%) scale(.2);opacity:0;
  box-shadow:0 0 10px rgba(255,255,255,.9);
  animation:tapRing 1.6s ease-out infinite;
}
.iconTap .tapRing{width:auto;height:90%}
.iconTap .tapHand{
  position:absolute;left:50%;top:-6%;height:78%;
  transform:translate(-36%,-6%);
  filter:drop-shadow(0 4px 0 rgba(20,8,45,.35));
  animation:tapPress 1.6s ease-in-out infinite;
}

/* step 2: a row of bubbles pop one after another */
.iconChain{display:flex;align-items:center;justify-content:center;gap:2%}
.iconChain .cb{position:relative;height:56%;aspect-ratio:1;flex:none}
.iconChain .cb img{position:absolute;inset:0;width:100%;height:100%;animation:chainPop 3s ease-in-out infinite;animation-delay:calc(var(--i) * .22s)}
.iconChain .cb i{
  position:absolute;left:50%;top:50%;width:100%;height:100%;
  border:4px solid #fff;border-radius:50%;
  box-shadow:0 0 10px rgba(255,255,255,.9);
  transform:translate(-50%,-50%) scale(.2);opacity:0;
  animation:chainRing 3s ease-out infinite;animation-delay:calc(var(--i) * .22s);
}

/* step 3: bomb, lightbulb, x20 */
.iconRules{display:flex;align-items:center;justify-content:center;gap:6%}
.iconRules .ri{position:relative;height:66%;aspect-ratio:1;display:flex;align-items:center;justify-content:center}
.iconRules .ri img{width:100%;height:100%;filter:drop-shadow(0 3px 0 rgba(20,8,45,.35))}
.iconRules .bomb::after{
  content:'';position:absolute;left:-6%;right:-6%;top:46%;height:12%;
  background:#FF3B3B;border:3px solid var(--ink);border-radius:999px;
  transform:rotate(-40deg);
}
.iconRules .bomb img{animation:bombShake 1.2s ease-in-out infinite}
.iconRules .gold img{animation:goldGlow 1.6s ease-in-out infinite}
.iconRules .x20{
  height:auto;aspect-ratio:auto;
  font-family:'Titan One',sans-serif;font-size:clamp(20px,4.4vh,40px);
  color:var(--pink);
  -webkit-text-stroke:clamp(4px,.6vh,6px) var(--ink);paint-order:stroke fill;
  background:radial-gradient(circle at 38% 28%,#FFFDF8,#FFF0DC 62%,#F4D9BE);
  border:3px solid var(--ink);border-radius:999px;
  padding:.1em .45em .16em;
  transform:rotate(-6deg);
  animation:promptPulse 1.4s ease-in-out infinite;
}

#howtoPlay{
  font-family:'Titan One',sans-serif;
  font-size:clamp(22px,4.6vh,40px);line-height:1;
  color:var(--ink);
  padding:.42em 1.3em .5em;
  min-height:48px;
  background:linear-gradient(180deg,#FFF09A 0%,#FFD447 45%,#FFA92E 100%);
  border:clamp(4px,.5vw,5px) solid var(--ink);border-radius:999px;
  box-shadow:0 7px 0 var(--ink), inset 0 3px 0 rgba(255,255,255,.7);
  cursor:pointer;position:relative;
  transition:transform .1s ease, box-shadow .1s ease;
}
#howtoPlay::after{
  content:'';position:absolute;inset:-9px;border-radius:999px;
  border:4px solid rgba(255,240,154,.9);
  animation:btnRing 1.5s ease-out infinite;pointer-events:none;
}
#howtoPlay:active{transform:translateY(5px);box-shadow:0 2px 0 var(--ink), inset 0 3px 0 rgba(255,255,255,.7)}
#howtoPlay:focus-visible{outline:4px solid #fff;outline-offset:4px}
.howtoKeys{
  font-weight:900;font-size:clamp(11px,1.6vh,14px);letter-spacing:.12em;text-transform:uppercase;
  color:var(--cream);text-shadow:0 2px 0 var(--ink);opacity:.9;margin-top:2px;
}

/* narrow screens: the steps stack, icon beside text */
@media (max-width:640px){
  .howtoCard{gap:8px;padding:12px 10px 14px}
  .steps{grid-template-columns:1fr;gap:12px}
  .step{flex-direction:row;padding:8px 12px 8px 14px;gap:10px;text-align:left}
  .stepIcon{width:38%;flex:none;height:clamp(58px,11vh,96px)}
  .step p{font-size:clamp(17px,5.2vw,24px);flex:1}
  .stepNum{left:-6px;top:-8px;width:30px;font-size:17px}
  .stepIcon{width:40%;overflow:visible}
  .iconChain{gap:3%}
  .iconChain .cb{height:auto;width:22%}
  .iconRules{gap:4%}
  .iconRules .ri{height:auto;width:30%}
  .iconRules .x20{width:auto;font-size:clamp(14px,4.4vw,20px);padding:.1em .3em .14em}
  #howtoTitle{font-size:clamp(26px,9vw,40px);white-space:nowrap}
  #howtoPlay{font-size:clamp(22px,7.4vw,32px);white-space:nowrap}
}
@media (max-height:460px) and (min-width:641px){
  .howtoCard{gap:6px;padding:8px 14px 10px}
  .stepIcon{height:clamp(48px,17vh,80px)}
  .step{padding:8px 6px}
  .step p{font-size:clamp(14px,4.6vh,22px)}
  #howtoTitle{font-size:clamp(20px,7vh,34px)}
  #howtoPlay{font-size:clamp(18px,6vh,28px)}
  .howtoKeys{display:none}
}

/* ---------------- ? and pause buttons ---------------- */
#helpBtn,#pauseBtn{
  position:fixed;z-index:60;
  left:calc(10px + env(safe-area-inset-left));
  bottom:calc(10px + env(safe-area-inset-bottom));
  width:clamp(44px,4.6vw,58px);aspect-ratio:1;
  padding:0;cursor:pointer;
  display:none;align-items:center;justify-content:center;
  border:4px solid var(--ink);border-radius:50%;
  background:radial-gradient(circle at 36% 28%,#FFF4B8,#FFD447 52%,#F5A524);
  box-shadow:0 4px 0 rgba(24,10,52,.45), inset 0 2px 0 rgba(255,255,255,.7);
  color:var(--ink);
  font-family:'Titan One',sans-serif;font-size:clamp(24px,2.6vw,32px);line-height:1;
  transition:transform .1s ease;
}
#helpBtn:active,#pauseBtn:active{transform:translateY(2px) scale(.95)}
#pauseBtn svg{width:52%;height:52%;fill:var(--ink)}
body.phase-start #helpBtn{display:flex}
body.phase-play #pauseBtn{display:flex}
body.howto-open #helpBtn,body.howto-open #pauseBtn,body.is-paused #pauseBtn{display:none}
.helpPill{
  margin-top:clamp(14px,3vh,26px);
  display:flex;align-items:center;gap:.5em;
  font-family:'Titan One',sans-serif;font-size:clamp(16px,2.6vh,24px);
  color:var(--ink);
  padding:.3em .9em .3em .3em;min-height:44px;
  background:linear-gradient(180deg,#FFF09A,#FFD447 50%,#FFA92E);
  border:4px solid var(--ink);border-radius:999px;
  box-shadow:0 5px 0 var(--ink);
  cursor:pointer;
}
.helpPill .q{
  width:1.5em;height:1.5em;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:var(--ink);color:var(--gold);
}
.helpPill:active{transform:translateY(3px);box-shadow:0 2px 0 var(--ink)}

/* ---------------- level 1 hint ---------------- */
#tapHint{
  position:fixed;z-index:14;left:0;top:0;
  width:0;height:0;
  pointer-events:none;
  opacity:0;
  transition:opacity .3s ease;
  will-change:transform;
}
#tapHint.show{opacity:1}
#tapHint .hintHand{
  position:absolute;left:0;top:0;
  width:clamp(64px,11vh,100px);
  transform:translate(-49%,-100%);
}
#tapHint .hintHand svg{display:block;width:100%;height:auto;filter:drop-shadow(0 5px 0 rgba(20,8,45,.4));animation:hintPress 1s ease-in-out infinite;transform-origin:50% 100%}
#tapHint .hintRing{
  position:absolute;left:0;top:0;width:clamp(60px,10vh,96px);aspect-ratio:1;
  border:5px solid #fff;border-radius:50%;
  box-shadow:0 0 14px rgba(255,255,255,.95), inset 0 0 10px rgba(255,212,71,.8);
  transform:translate(-50%,-50%) scale(.4);opacity:0;
  animation:hintRing 1s ease-out infinite;
}
#tapHint .hintText{
  position:absolute;left:0;top:0;
  transform:translate(-50%,calc(-100% - clamp(82px,13.6vh,124px)));
  white-space:nowrap;
  font-family:'Titan One',sans-serif;font-size:clamp(22px,4.2vh,36px);line-height:1;
  color:var(--gold);
  -webkit-text-stroke:clamp(5px,.8vh,8px) var(--ink);paint-order:stroke fill;
  text-shadow:0 4px 0 rgba(20,8,45,.4);
}
#tapHint .hintText span{display:inline-block;animation:promptPulse 1s ease-in-out infinite}
#tapHint.done .hintText span{animation:none}
#tapHint.below .hintText{transform:translate(-50%,clamp(40px,6vh,60px))}
#tapHint.done .hintHand,#tapHint.done .hintRing{display:none}
#tapHint.done .hintText{color:#fff;transform:translate(-50%,-50%);animation:none}
#tapHint.fade{opacity:0;transition:opacity .9s ease}

@keyframes cardIn{0%{transform:scale(.8);opacity:0}100%{transform:scale(1);opacity:1}}
@keyframes tapPress{0%,30%{transform:translate(-36%,-18%)}45%{transform:translate(-36%,4%)}60%,100%{transform:translate(-36%,-18%)}}
@keyframes tapRing{0%,42%{transform:translate(-50%,-50%) scale(.2);opacity:0}46%{opacity:1}85%,100%{transform:translate(-50%,-50%) scale(1.35);opacity:0}}
@keyframes chainPop{0%,28%{transform:scale(1);opacity:1}33%{transform:scale(1.25);opacity:1}38%{transform:scale(0);opacity:0}84%{transform:scale(0);opacity:0}95%,100%{transform:scale(1);opacity:1}}
@keyframes chainRing{0%,31%{transform:translate(-50%,-50%) scale(.2);opacity:0}34%{opacity:1}52%,100%{transform:translate(-50%,-50%) scale(1.9);opacity:0}}
@keyframes bombShake{0%,100%{transform:rotate(-5deg)}50%{transform:rotate(5deg)}}
@keyframes goldGlow{0%,100%{transform:scale(1);filter:drop-shadow(0 0 0 rgba(255,212,71,0)) drop-shadow(0 3px 0 rgba(20,8,45,.35))}50%{transform:scale(1.08);filter:drop-shadow(0 0 12px rgba(255,212,71,.95)) drop-shadow(0 3px 0 rgba(20,8,45,.35))}}
@keyframes hintPress{0%,100%{transform:translateY(-12px) scale(1)}50%{transform:translateY(0) scale(.94)}}
@keyframes hintRing{0%,40%{transform:translate(-50%,-50%) scale(.35);opacity:0}50%{opacity:1}100%{transform:translate(-50%,-50%) scale(1.3);opacity:0}}
@keyframes btnRing{0%{transform:scale(.96);opacity:.9}100%{transform:scale(1.12);opacity:0}}

/* combo badge: a clean dark disc with the multiplier, as in the reference */
#comboWrap img{display:none}
#comboWrap::before{
  inset:6%;
  background:radial-gradient(circle at 36% 28%,#5A4380,#2B1B4D 60%,#1A0F33);
  border:clamp(3px,.34vw,4px) solid var(--cream);
  box-shadow:0 4px 0 rgba(24,10,52,.4), inset 0 3px 0 rgba(255,255,255,.18);
}
#comboNum{inset:6%;color:#fff;-webkit-text-stroke:0;text-shadow:0 3px 0 rgba(0,0,0,.35);font-size:clamp(20px,2.5vw,32px)}

/* clear icons */
#bestWrap .crown{width:2em;height:2em;margin-right:2px}
#bestWrap .trophy [stroke="#2B1B4D"]{stroke:#FFF7F0}
.startBest{font-size:clamp(12px,1.9vh,18px)}
@media (max-height:500px){#mascot{font-size:min(11vh,12vw,80px)}}
