/* Premium Glossy Royal Sapphire, Crisp Vivid Colors & Curved Pillow-3D Presentation */
:root{
  --bg:#0c1b54;
  --gold:#ffd754;
  --gold-deep:#d88b1c;
  --display:"Fredoka","Noto Sans JP","BIZ UDPGothic","Yu Gothic UI","Meiryo",sans-serif;
  --body:"Fredoka","Noto Sans JP","BIZ UDPGothic","Yu Gothic UI","Meiryo",sans-serif;
  --num:"Fredoka","Noto Sans JP",sans-serif;
}
body{
  background:radial-gradient(circle at 50% 45%,#1d4ed8 0%,#122b7a 55%,#091542 100%);
  font-family:var(--body);
  font-synthesis:none;
  text-rendering:optimizeLegibility;
}

/* --- HUD Top Bar: Reference-Style Single Row (Left: Menu+Stars, Center: Huge Timer, Right: Level Pill) --- */
#hud{
  padding-top:calc(env(safe-area-inset-top,0px) + 12px);
  gap:0;
}
#hud .top{
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:10px;
}
.hud-left{
  display:flex;
  align-items:center;
  gap:8px;
  justify-self:start;
}
#starsNow{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:36px;
  padding:2px 10px 4px;
  border-radius:18px;
  background:linear-gradient(180deg,#0b194b,#071033);
  border:2px solid #3b82f6;
  box-shadow:inset 0 2px 5px rgba(0,0,0,.7),0 3px 0 #050b24;
  color:#facc15;
  font-size:.95rem;
  letter-spacing:.06em;
  text-shadow:0 2px 0 #9a4e08;
}
#starsNow:empty{
  display:none;
}

/* --- Center Huge Timer Capsule (Reference 00:07 Style) --- */
.timer{
  position:relative;
  justify-self:center;
  min-width:152px;
  height:54px;
  background:linear-gradient(180deg,#060f33 0%,#0b1a54 100%);
  border:3.5px solid #2563eb;
  border-radius:20px;
  overflow:hidden;
  box-shadow:
    inset 0 4px 8px rgba(0,0,0,.85),
    inset 0 -2px 4px rgba(96,165,250,.25),
    0 5px 0 #061038,
    0 10px 22px rgba(2,6,23,.65);
}
#tfill{
  position:absolute;
  inset:4px auto 4px 4px;
  max-width:calc(100% - 8px);
  background:linear-gradient(180deg,rgba(37,99,235,.45) 0%,rgba(29,78,216,.28) 100%);
  border-radius:13px;
  box-shadow:inset 0 1px 2px rgba(147,197,253,.35);
}
#tfill:after{
  display:none;
}
.timer.low{
  border-color:#ef4444;
  animation:timer-pulse .45s ease-in-out infinite alternate;
}
.timer.low #tfill{
  background:linear-gradient(180deg,rgba(239,68,68,.55),rgba(185,28,28,.35));
}
@keyframes timer-pulse{
  from{filter:brightness(1)}
  to{filter:brightness(1.22) drop-shadow(0 0 10px #ef4444)}
}
#ttext{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  font-family:var(--num);
  color:#ffffff;
  font-size:2.15rem;
  font-weight:700;
  letter-spacing:.04em;
  line-height:1;
  -webkit-text-stroke:3px #1d4ed8;
  paint-order:stroke fill;
  text-shadow:
    0 3px 0 #091542,
    0 0 14px rgba(59,130,246,.85);
}
.timer.low #ttext{
  -webkit-text-stroke:3px #dc2626;
  text-shadow:0 3px 0 #450a0a,0 0 14px rgba(239,68,68,.9);
}

/* --- Right Stage Pill (Reference "Level 185" Style) --- */
#lvl{
  justify-self:end;
  position:relative;
  overflow:hidden;
  display:inline-flex;
  align-items:baseline;
  justify-content:center;
  gap:5px;
  min-width:106px;
  height:42px;
  box-sizing:border-box;
  padding:0 14px;
  border:2.5px solid #3b82f6;
  border-radius:999px;
  background:linear-gradient(180deg,#153084 0%,#0b1b54 100%);
  box-shadow:
    inset 0 2px 3px rgba(147,197,253,.35),
    inset 0 -3px 6px rgba(3,7,26,.75),
    0 4px 0 #061038,
    0 8px 16px rgba(2,6,23,.55);
  color:#ffffff;
  text-shadow:0 2px 0 #061038;
  font-family:var(--num);
  font-weight:700;
  font-size:1.28rem;
  line-height:37px;
  letter-spacing:.02em;
  white-space:nowrap;
}
#lvl:before{
  content:"";
  position:absolute;
  top:2px;left:10%;right:10%;height:42%;
  border-radius:999px;
  background:linear-gradient(180deg,rgba(255,255,255,.22),rgba(255,255,255,0));
  pointer-events:none;
}
#lvl small{
  display:inline;
  font-family:var(--num);
  color:#93c5fd;
  letter-spacing:.08em;
  font-size:.74rem;
  font-weight:700;
  margin:0;
  text-shadow:0 1.5px 0 #061038;
}

/* --- Bottom Dock & Reference-Style 3D Double-Bezel Cushioned Arcade Buttons --- */
#dock{
  gap:26px;
  padding-bottom:calc(env(safe-area-inset-bottom,0px) + 18px);
}
.tool{
  font-family:var(--display);
  color:#ffffff;
  font-size:0;
  gap:0;
  transition:transform .12s cubic-bezier(.2,.9,.3,1.35);
}
.tool:hover:not(:disabled){
  transform:translateY(-2px);
}
/* Outer Dark Casing + Bright Rim + Inner Glossy Convex Cushion (Matching Uploaded Image) */
.sq{
  position:relative;
  isolation:isolate;
  overflow:visible;
  width:74px;
  height:74px;
  box-sizing:border-box;
  border-radius:22px;
  border:3px solid #143605;
  background:linear-gradient(180deg,#a3e635 0%,#4d9c0f 55%,#255c05 100%);
  box-shadow:
    0 6px 0 #0e2903,
    0 8px 0 2px #050d26,
    0 14px 24px rgba(2,6,23,.75),
    inset 0 2px 1px rgba(255,255,255,.65);
  transition:transform .09s cubic-bezier(.2,.8,.3,1.2),box-shadow .09s ease;
}
/* Inner convex pillow pad */
.sq:before{
  content:"";
  position:absolute;
  inset:5px;
  border-radius:15px;
  background:
    radial-gradient(115% 90% at 50% 15%,#bef264 0%,#65a30d 45%,#3f7c08 88%,#285404 100%);
  box-shadow:
    inset 0 4px 5px rgba(255,255,255,.65),
    inset 0 -5px 7px rgba(15,46,3,.75),
    0 2px 3px rgba(10,32,2,.5);
  z-index:0;
  pointer-events:none;
}
/* Crisp top glass sheen on the inner cushion */
.sq:after{
  content:"";
  position:absolute;
  top:7px;left:11px;right:11px;
  height:34%;
  border-radius:11px 11px 40% 40% / 11px 11px 60% 60%;
  background:linear-gradient(180deg,rgba(255,255,255,.55) 0%,rgba(255,255,255,.04) 100%);
  z-index:0;
  pointer-events:none;
}
.sq svg{
  position:relative;
  z-index:1;
  width:38px;
  height:38px;
  filter:drop-shadow(0 3px 2px rgba(12,38,3,.65));
}
.tool.accent .sq{
  border:3px solid #4a1d04;
  background:linear-gradient(180deg,#fef08a 0%,#f59e0b 55%,#9a3412 100%);
  box-shadow:
    0 6px 0 #5c1f06,
    0 8px 0 2px #050d26,
    0 14px 24px rgba(2,6,23,.75),
    inset 0 2px 1px rgba(255,255,255,.8);
}
.tool.accent .sq:before{
  background:
    radial-gradient(115% 90% at 50% 15%,#fef9c3 0%,#facc15 40%,#ea580c 88%,#9a3412 100%);
  box-shadow:
    inset 0 4px 5px rgba(255,255,255,.85),
    inset 0 -5px 7px rgba(124,45,18,.75),
    0 2px 3px rgba(92,31,6,.5);
}
/* Active press state */
.tool:active:not(:disabled) .sq{
  transform:translateY(5px);
  box-shadow:
    0 1px 0 #0e2903,
    0 3px 0 2px #050d26,
    0 6px 12px rgba(2,6,23,.6);
}
.tool.accent:active:not(:disabled) .sq{
  transform:translateY(5px);
  box-shadow:
    0 1px 0 #5c1f06,
    0 3px 0 2px #050d26,
    0 6px 12px rgba(2,6,23,.6);
}
/* Top-left Menu button (Sapphire Blue double-bezel cushion) */
.sq.small{
  width:48px;
  height:48px;
  border-radius:16px;
  border:2.5px solid #08184d;
  background:linear-gradient(180deg,#93c5fd 0%,#2563eb 55%,#1e3a8a 100%);
  box-shadow:
    0 4px 0 #09184f,
    0 6px 0 1.5px #040b24,
    0 8px 16px rgba(2,6,23,.65),
    inset 0 1.5px 1px rgba(255,255,255,.7);
}
.sq.small:before{
  inset:4px;
  border-radius:11px;
  background:radial-gradient(115% 90% at 50% 15%,#60a5fa 0%,#2563eb 48%,#1d4ed8 90%);
  box-shadow:
    inset 0 3px 4px rgba(255,255,255,.65),
    inset 0 -4px 5px rgba(10,24,78,.75);
}
.sq.small:after{
  top:5px;left:8px;right:8px;height:32%;
  border-radius:8px 8px 40% 40%;
}
.sq.small svg{
  width:24px;
  height:24px;
  filter:drop-shadow(0 2px 1px rgba(7,16,52,.7));
}

/* --- Curved Pillow 3D Action Buttons (.btn) --- */
.btn{
  position:relative;
  overflow:hidden;
  font-family:var(--display);
  font-weight:700;
  letter-spacing:.06em;
  border-radius:999px;
  border:2.5px solid #93c5fd;
  background:
    radial-gradient(125% 100% at 50% 12%,#60a5fa 0%,#2563eb 48%,#1d4ed8 85%,#1e3a8a 100%);
  box-shadow:
    inset 0 4px 6px rgba(255,255,255,.82),
    inset 0 -7px 9px rgba(10,24,78,.72),
    0 5px 0 #0f236b,
    0 9px 18px rgba(4,9,32,.48);
  color:#ffffff;
  text-shadow:0 1px 1px rgba(7,16,52,.65);
  transition:transform .1s cubic-bezier(.2,.8,.3,1.2),box-shadow .1s ease;
}
.btn:before{
  content:"";
  position:absolute;
  top:2px;left:8%;right:8%;height:45%;
  border-radius:999px;
  background:linear-gradient(180deg,rgba(255,255,255,.68),rgba(255,255,255,.04));
  pointer-events:none;
}
.btn.primary{
  border-color:#fef08a;
  background:
    radial-gradient(125% 100% at 50% 12%,#fef08a 0%,#facc15 36%,#f59e0b 78%,#b45309 100%);
  color:#451a03;
  text-shadow:0 1px 0 rgba(255,255,255,.85);
  box-shadow:
    inset 0 4px 6px rgba(255,255,255,.92),
    inset 0 -7px 9px rgba(146,56,4,.65),
    0 5px 0 #853a05,
    0 9px 20px rgba(4,9,32,.5);
}
.btn:active:not(:disabled){
  transform:translateY(4px) scale(.98,.96);
  box-shadow:
    inset 0 4px 7px rgba(0,0,0,.45),
    inset 0 -2px 4px rgba(255,255,255,.4),
    0 1px 0 #0f236b,
    0 3px 8px rgba(4,9,32,.35);
}
.btn.primary:active:not(:disabled){
  box-shadow:
    inset 0 4px 7px rgba(130,48,4,.55),
    inset 0 -2px 4px rgba(255,255,255,.5),
    0 1px 0 #853a05,
    0 3px 8px rgba(4,9,32,.35);
}

/* --- Toast Banner: Curved Glossy Pill --- */
#toast{
  font-family:var(--body);
  background:
    radial-gradient(120% 100% at 50% 10%,#ffffff 0%,#f0f7ff 75%,#dbeafe 100%);
  color:#1e3a8a;
  font-weight:700;
  font-size:.9rem;
  letter-spacing:.04em;
  padding:11px 22px;
  border-radius:999px;
  border:2.5px solid #3b82f6;
  box-shadow:
    inset 0 3px 4px #fff,
    inset 0 -4px 6px rgba(37,99,235,.2),
    0 5px 0 #1d4ed8,
    0 12px 28px rgba(4,9,32,.6);
  animation:toast-pop .25s cubic-bezier(.2,.9,.3,1.3);
}
#toast.bad{
  background:radial-gradient(120% 100% at 50% 10%,#ffffff 0%,#ffe4e6 80%,#fecdd3 100%);
  border-color:#e11d48;
  color:#9f1239;
  box-shadow:inset 0 3px 4px #fff,inset 0 -4px 6px rgba(225,29,72,.22),0 5px 0 #be123c,0 12px 28px rgba(32,4,14,.6);
}
@keyframes toast-pop{
  from{transform:translateX(-50%) scale(.75);opacity:0}
  to{transform:translateX(-50%) scale(1);opacity:1}
}

/* --- Title Screen: Deep Glossy Sapphire Arena --- */
#titleScreen{
  background:
    radial-gradient(circle at 50% 36%,#2563eb 0%,#15358d 48%,#091645 92%);
}
#titleScreen .image-title{
  filter:drop-shadow(0 20px 38px rgba(3,8,28,.75));
}
.title-controls{
  background:linear-gradient(180deg,rgba(18,38,104,.96),rgba(9,20,62,.99));
  border:3px solid #60a5fa;
  border-radius:32px;
  padding:18px 15px 16px;
  box-shadow:
    inset 0 4px 6px rgba(255,255,255,.28),
    inset 0 -6px 10px rgba(4,9,32,.65),
    0 9px 0 #071033,
    0 22px 48px rgba(2,5,20,.78);
}
.title-keyvisual{
  margin-bottom:-18%;
}
#bStart{
  min-height:62px;
  border-radius:999px;
  border:3px solid #fef08a;
  background:
    radial-gradient(120% 100% at 50% 12%,#fef08a 0%,#facc15 36%,#f59e0b 78%,#b45309 100%);
  color:#451a03;
  font-family:var(--display);
  font-size:18px;
  font-weight:700;
  letter-spacing:.06em;
  box-shadow:
    inset 0 5px 8px rgba(255,255,255,.95),
    inset 0 -8px 10px rgba(146,56,4,.65),
    0 6px 0 #7c2d12,
    0 14px 26px rgba(0,0,0,.55);
}
#bStart:before{
  top:3px;left:7%;right:7%;height:46%;
  border-radius:999px;
  background:linear-gradient(180deg,rgba(255,255,255,.8),rgba(255,255,255,.05));
}
#bSuperHard{
  position:relative;
  overflow:hidden;
  width:100%;
  min-height:48px;
  background:
    radial-gradient(120% 100% at 50% 12%,#e879f9 0%,#a855f7 38%,#7e22ce 78%,#581c87 100%);
  color:#fff;
  font-family:var(--display);
  font-weight:700;
  border:2.5px solid #f0abfc;
  border-radius:999px;
  box-shadow:
    inset 0 4px 6px rgba(255,255,255,.82),
    inset 0 -7px 9px rgba(59,7,100,.75),
    0 5px 0 #3b0764,
    0 10px 20px rgba(0,0,0,.45);
  font-size:14px;
  letter-spacing:.06em;
  text-shadow:0 1px 1px #3b0764;
}
/* --- Menu & Fail Modal Cards: Crisp Royal Dialogs & Reference-Style 3D Cushioned Stage Tiles --- */
.ov{
  background:radial-gradient(ellipse at 50% 35%,rgba(23,58,158,.78),rgba(7,15,48,.94));
  backdrop-filter:blur(8px);
  -webkit-backdrop-filter:blur(8px);
}
#ovMenu .card, #ovFail .card{
  border:4px solid #1d4ed8;
  border-radius:34px;
  background:linear-gradient(160deg,#ffffff 0%,#f8fafc 65%,#eff6ff 100%);
  box-shadow:
    inset 0 4px 6px #fff,
    inset 0 -6px 10px rgba(37,99,235,.18),
    0 10px 0 #0f236b,
    0 0 0 4px rgba(255,255,255,.88),
    0 28px 65px rgba(4,9,32,.78);
  color:#1e3a8a;
  padding:20px 18px 22px;
  gap:12px;
  scrollbar-width:thin;
  scrollbar-color:#60a5fa transparent;
}
#ovMenu .card::-webkit-scrollbar, #ovFail .card::-webkit-scrollbar{width:6px}
#ovMenu .card::-webkit-scrollbar-thumb, #ovFail .card::-webkit-scrollbar-thumb{background:#60a5fa;border-radius:99px}
#ovMenu .card h2, #ovFail .card h2{
  position:relative;
  flex-shrink:0;
  padding:11px 14px 13px;
  margin:0 -2px;
  font:700 clamp(22px,6vw,26px)/1.3 var(--display);
  letter-spacing:.08em;
  color:#ffffff;
  background:
    radial-gradient(120% 100% at 50% 12%,#ff4d6d 0%,#e11d48 48%,#be123c 88%,#881337 100%);
  border:2.5px solid #881337;
  border-radius:20px;
  box-shadow:
    inset 0 3px 4px rgba(255,255,255,.78),
    inset 0 -5px 7px rgba(136,19,55,.7),
    0 5px 0 #5f0923,
    0 8px 16px rgba(159,18,57,.35);
  text-shadow:0 1.5px 0 #881337;
}
#ovMenu .card>*{
  flex-shrink:0;
}
#ovMenu .card p, #ovFail .card p{
  color:#1e3a8a;
  font-weight:500;
  font-size:.86rem;
  letter-spacing:.03em;
  line-height:1.65;
}
#ovMenu #lvGrid{
  gap:9px;
  padding:2px 2px 6px;
}
/* Reference-Style Double-Bezel 3D Cushioned Stage Tile (.lv) */
#ovMenu .lv{
  position:relative;
  isolation:isolate;
  overflow:visible;
  aspect-ratio:auto;
  min-height:48px;
  font-family:var(--num);
  font-size:1.25rem;
  font-weight:700;
  color:#ffffff;
  text-shadow:0 1.5px 0 #09184f;
  border:2.5px solid #08184d;
  border-radius:16px;
  background:linear-gradient(180deg,#93c5fd 0%,#2563eb 55%,#1e3a8a 100%);
  box-shadow:
    0 4px 0 #09184f,
    0 5px 0 1.5px rgba(8,24,77,.35),
    0 7px 12px rgba(4,9,32,.25),
    inset 0 1.5px 1px rgba(255,255,255,.75);
  transition:transform .09s cubic-bezier(.2,.8,.3,1.2),box-shadow .09s ease;
}
/* Inner convex pillow pad on stage tile */
#ovMenu .lv:before{
  content:"";
  position:absolute;
  inset:3.5px;
  border-radius:11px;
  background:radial-gradient(115% 90% at 50% 15%,#60a5fa 0%,#2563eb 50%,#1d4ed8 92%);
  box-shadow:
    inset 0 3px 4px rgba(255,255,255,.65),
    inset 0 -4px 5px rgba(10,24,78,.75);
  z-index:-1;
  pointer-events:none;
}
/* Crisp top glass sheen on stage tile */
#ovMenu .lv:after{
  content:"";
  position:absolute;
  top:5px;left:8px;right:8px;
  height:32%;
  border-radius:8px 8px 40% 40%;
  background:linear-gradient(180deg,rgba(255,255,255,.52),rgba(255,255,255,.04));
  z-index:-1;
  pointer-events:none;
}
/* Active / Current Stage Tile: Juicy Amber-Gold Double-Bezel Cushion */
#ovMenu .lv.cur{
  outline:none;
  border-color:#5c1f06;
  background:linear-gradient(180deg,#fef08a 0%,#f59e0b 55%,#9a3412 100%);
  color:#451a03;
  text-shadow:0 1px 0 rgba(255,255,255,.9);
  box-shadow:
    0 4px 0 #5c1f06,
    0 5px 0 1.5px rgba(92,31,6,.35),
    0 8px 14px rgba(180,83,9,.38),
    inset 0 1.5px 1px rgba(255,255,255,.85);
}
#ovMenu .lv.cur:before{
  background:radial-gradient(115% 90% at 50% 15%,#fef9c3 0%,#facc15 42%,#ea580c 90%);
  box-shadow:
    inset 0 3px 4px rgba(255,255,255,.88),
    inset 0 -4px 5px rgba(124,45,18,.7);
}
#ovMenu .lv:hover:not(:disabled){
  transform:translateY(-1.5px);
}
#ovMenu .lv:active:not(:disabled){
  transform:translateY(3.5px);
  box-shadow:0 1px 0 #09184f,0 2px 5px rgba(4,9,32,.25);
}
#ovMenu .lv.cur:active:not(:disabled){
  transform:translateY(3.5px);
  box-shadow:0 1px 0 #5c1f06,0 2px 5px rgba(92,31,6,.25);
}
#ovMenu .lv i{
  color:#fde047;
  font-size:.62rem;
  letter-spacing:.5px;
  text-shadow:0 1px 0 #061038;
  margin-top:-1px;
}
#ovMenu .lv.cur i{
  color:#ffffff;
  text-shadow:0 1px 0 #9a3412;
}

/* Stage Number Picker Card & Juicy Green Play Button */
#stageForm{
  background:linear-gradient(180deg,#eff6ff,#dbeafe)!important;
  border:2.5px solid #60a5fa!important;
  border-radius:20px!important;
  padding:11px 14px 13px!important;
  box-shadow:inset 0 2px 0 #ffffff,0 4px 0 #93c5fd!important;
  margin:2px 0!important;
}
#stageForm label{
  color:#1e3a8a!important;
  font-weight:600!important;
  font-size:13px!important;
  letter-spacing:.05em!important;
  margin-bottom:7px!important;
}
.stage-input input{
  font-family:var(--num)!important;
  font-size:23px!important;
  font-weight:700!important;
  border-radius:14px!important;
  background:#ffffff!important;
  color:#1d4ed8!important;
  border:2.5px solid #2563eb!important;
  box-shadow:inset 0 2px 4px rgba(29,78,216,.18),0 2px 0 #bfdbfe!important;
}
.stage-input .btn{
  border-radius:16px!important;
  font-family:var(--display)!important;
  font-weight:700!important;
  font-size:15px!important;
  letter-spacing:.05em!important;
  padding:12px 18px!important;
  border:2.5px solid #143605!important;
  background:radial-gradient(120% 95% at 50% 15%,#a3e635 0%,#4d9c0f 45%,#367007 88%,#1f4904 100%)!important;
  color:#ffffff!important;
  text-shadow:none!important;
  box-shadow:
    inset 0 3px 4px rgba(255,255,255,.68),
    inset 0 -5px 6px rgba(15,46,3,.75),
    0 4px 0 #0e2903,
    0 6px 12px rgba(4,9,32,.25)!important;
}
.stage-input .btn:active{
  transform:translateY(3px)!important;
  box-shadow:0 1px 0 #0e2903!important;
}

/* Settings Section & Tactile Toggle Rows */
#ovMenu .sect{
  font-family:var(--display);
  color:#1d4ed8;
  font-weight:700;
  font-size:.86rem;
  letter-spacing:.1em;
  margin:4px 0 -2px;
}
#ovMenu .tog{
  background:linear-gradient(180deg,#ffffff,#f0f7ff);
  color:#1e3a8a;
  font-weight:600;
  font-size:.96rem;
  letter-spacing:.04em;
  padding:10px 14px;
  border:2.5px solid #60a5fa;
  border-radius:18px;
  box-shadow:inset 0 2px 0 #fff,0 4px 0 #93c5fd;
  transition:transform .08s ease;
}
#ovMenu .tog:active{
  transform:translateY(2px);
  box-shadow:inset 0 2px 0 #fff,0 2px 0 #93c5fd;
}
#ovMenu .tog input{
  width:22px;
  height:22px;
  accent-color:#16a34a;
  cursor:pointer;
}

/* Bottom Action Row in Menu (Close / Return to Title) */
#ovMenu .menu-actions{
  display:flex;
  gap:10px;
  margin-top:4px;
  flex-wrap:nowrap;
}
#ovMenu .menu-actions .btn{
  flex:1;
  min-height:54px;
  font-size:17px;
  font-weight:700;
  letter-spacing:.05em;
  border-radius:999px;
}
#ovMenu .menu-actions #bClose{
  border:2.5px solid #4a1d04;
  background:radial-gradient(125% 100% at 50% 12%,#fef08a 0%,#facc15 38%,#ea580c 85%,#9a3412 100%);
  color:#3b1502;
  text-shadow:none;
  box-shadow:
    inset 0 4px 5px rgba(255,255,255,.9),
    inset 0 -6px 8px rgba(124,45,18,.65),
    0 5px 0 #5c1f06,
    0 8px 16px rgba(4,9,32,.3);
}
#ovMenu .menu-actions #bHome{
  border:2.5px solid #08184d;
  background:radial-gradient(125% 100% at 50% 12%,#60a5fa 0%,#2563eb 48%,#1d4ed8 88%,#1e3a8a 100%);
  color:#ffffff;
  text-shadow:none;
  box-shadow:
    inset 0 4px 5px rgba(255,255,255,.78),
    inset 0 -6px 8px rgba(10,24,78,.75),
    0 5px 0 #09184f,
    0 8px 16px rgba(4,9,32,.3);
}
#ovMenu .menu-actions .btn:active{
  transform:translateY(4px);
}

/* --- Result Screen: Vivid Ruby Banner, Bold Blue Numerals & Crisp Gold Reward Card --- */
.title-controls #bContinue,.title-controls #bStages{width:100%;min-height:48px;font-size:16px;border-radius:999px}
.title-audio{display:flex;gap:12px;width:100%;margin-top:4px}
.title-audio .btn{flex:1;min-width:0;min-height:42px;font-size:13px;padding:8px}
.title-audio .btn[aria-pressed="false"]{filter:saturate(.25);opacity:.8}
#ovMenu #stageForm{margin:12px 0}#ovMenu #stageForm label{margin-bottom:8px}
#ovMenu{z-index:30}
@media(max-height:700px){.title-controls{gap:8px;padding:12px}.title-controls #bStart{min-height:48px}.title-controls #bContinue,.title-controls #bStages{min-height:42px}.title-audio .btn{min-height:36px}.title-controls .title-foot{display:none}}
#ovWin{background:radial-gradient(ellipse at 50% 35%,rgba(29,78,216,.78),rgba(7,15,48,.94));backdrop-filter:blur(8px);padding:calc(env(safe-area-inset-top,0px) + 20px) 20px calc(env(safe-area-inset-bottom,0px) + 20px)}
#ovWin .victory-card{max-width:380px;gap:12px;padding:22px 20px 24px;border:4px solid #2563eb;border-radius:36px;background:linear-gradient(155deg,#ffffff,#f8fafc 65%,#eff6ff);box-shadow:inset 0 4px 6px #fff,inset 0 -6px 12px rgba(37,99,235,.2),0 10px 0 #1e3a8a,0 0 0 5px #ffffffcc,0 28px 65px #040920bb;color:#1e3a8a;overflow-x:hidden;overflow-y:auto;scrollbar-width:thin;scrollbar-color:#60a5fa transparent}
#ovWin .victory-kicker{margin:0 auto;color:#ffffff;font:700 11.5px var(--num);letter-spacing:.18em;background:linear-gradient(180deg,#2563eb,#1d4ed8);border:2px solid #93c5fd;border-radius:999px;padding:5px 18px;box-shadow:0 3px 0 #1e3a8a,inset 0 1.5px 2px rgba(255,255,255,.6)}
.victory-medal{position:relative;display:grid;place-items:center;height:68px;flex-shrink:0}
.victory-medal:before{content:"";position:absolute;width:118px;height:118px;border-radius:50%;background:radial-gradient(#facc15aa,transparent 70%)}
.victory-medal svg{position:relative;width:82px;height:78px;filter:drop-shadow(0 4px 0 #b4530966);animation:medal-bounce .65s cubic-bezier(.2,.8,.3,1.3) both}
@keyframes medal-bounce{from{transform:scale(.1) rotate(-18deg);opacity:0}to{transform:scale(1);opacity:1}}
#ovWin h2{padding:11px 6px 13px;margin:0 -8px;font:700 clamp(22px,6.2vw,28px)/1.3 var(--display);letter-spacing:.08em;color:#ffffff;background:radial-gradient(120% 100% at 50% 12%,#ff4d6d 0%,#e11d48 48%,#be123c 88%,#881337 100%);border:2.5px solid #fecdd3;border-radius:20px;box-shadow:inset 0 4px 6px rgba(255,255,255,.75),inset 0 -6px 8px rgba(136,19,55,.65),0 5px 0 #881337,0 8px 16px rgba(190,18,60,.38);text-shadow:0 1.5px 0 #881337;transform:rotate(-2deg)}
.victory-rays{inset:-80px -100px 20%;background:repeating-conic-gradient(from 0deg,#60a5fa44 0 12deg,transparent 12deg 30deg);mask-image:radial-gradient(#000,transparent 65%);opacity:.85}
#winStars{font-size:50px;gap:16px;filter:none;margin:2px 0 0}
#winStars span{color:#cbd5e1;text-shadow:0 3px 0 #94a3b8}
#winStars span.on{color:#facc15;text-shadow:0 2px 0 #fef08a,0 5px 0 #ca8a04,0 8px 12px rgba(202,138,4,.35)}
.victory-time{padding:12px 8px 10px;border:3px solid #3b82f6;border-radius:24px;background:#ffffff;box-shadow:inset 0 3px 0 #f8fafc,inset 0 -4px 6px rgba(37,99,235,.12),0 5px 0 #1d4ed8}
.victory-time>span{font:700 11px var(--num);letter-spacing:.18em;color:#2563eb}
.victory-time strong{font:700 clamp(56px,15.5vw,70px)/1.05 var(--num);letter-spacing:.02em;color:#1d4ed8;text-shadow:0 3px 0 #bfdbfe}
#ovWin #winText{color:#1e40af;font-size:11.5px;font-weight:700;margin-top:3px}
.victory-reward{padding:12px;border:3px solid #f59e0b;border-radius:24px;background:linear-gradient(135deg,#fef9c3,#fde047);box-shadow:inset 0 3px 4px #fff,inset 0 -4px 6px rgba(180,83,9,.22),0 5px 0 #d97706}
.reward-label{font-size:11.5px;color:#92400e;font-weight:700;letter-spacing:.12em}
.reward-value{margin:6px 0;gap:9px}.reward-value strong{font-family:var(--num);font-weight:700;color:#1d4ed8;font-size:42px;text-shadow:0 2px 0 #ffffff,0 4px 0 rgba(180,83,9,.25)}.reward-value>span:last-child{font-family:var(--num);font-weight:700;color:#92400e;font-size:13px}
#ovWin #coinTotal{color:#78350f;font-size:12px;font-weight:700;font-family:var(--num)}
#ovWin .row{gap:12px;margin-top:4px;flex-wrap:nowrap}
#ovWin .row .btn{
  min-height:54px;
  font-size:14.5px;
  font-weight:700;
  border-radius:999px;
  border:2.5px solid #93c5fd;
  background:radial-gradient(125% 100% at 50% 12%,#60a5fa 0%,#2563eb 48%,#1d4ed8 85%,#1e3a8a 100%);
  box-shadow:inset 0 4px 6px rgba(255,255,255,.82),inset 0 -7px 9px rgba(10,24,78,.72),0 5px 0 #0f236b,0 9px 18px rgba(4,9,32,.35);
  color:#ffffff;
  text-shadow:0 1px 1px rgba(7,16,52,.65);
  gap:6px;
}
#ovWin .row .btn svg{width:19px;height:19px;flex-shrink:0}
#ovWin .row .primary{
  flex:1.35;
  border-color:#fef08a;
  background:radial-gradient(125% 100% at 50% 12%,#fef08a 0%,#facc15 36%,#f59e0b 78%,#b45309 100%);
  color:#451a03;
  text-shadow:0 1px 0 rgba(255,255,255,.85);
  box-shadow:inset 0 4px 6px rgba(255,255,255,.92),inset 0 -7px 9px rgba(146,56,4,.65),0 5px 0 #853a05,0 9px 20px rgba(4,9,32,.38);
}
.win-confetti{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:2}
.win-confetti i{position:absolute;top:-24px;left:var(--left);width:9px;height:15px;border-radius:3px;background:var(--color);box-shadow:0 2px 4px rgba(0,0,0,.15);animation:win-confetti-fall 2.6s cubic-bezier(.15,.5,.5,1) both;animation-delay:var(--delay)}
@keyframes win-confetti-fall{0%{opacity:0;transform:translateY(-10vh) rotate(0)}10%{opacity:1}80%{opacity:1}100%{opacity:0;transform:translate(var(--sway),105vh) rotate(var(--turn))}}
@media(max-height:740px){#ovWin .victory-card{gap:9px;padding:15px 18px 18px}.victory-medal{height:48px}.victory-medal svg{width:64px;height:60px}#winStars{font-size:38px}.victory-time strong{font-size:52px}.victory-time{padding:8px}.victory-reward{padding:8px}#ovWin h2{padding:9px 3px}#ovWin .row .btn{min-height:48px}}
@media(prefers-reduced-motion:reduce){.victory-medal svg,.win-confetti i,.timer.low #tfill{animation:none}.win-confetti{display:none}}



/* Crawlable game information, visible beneath the title controls. */
.game-info{margin:4px 0 0;color:#e2e8ff;font-size:.875rem;line-height:1.6}
.info-links{display:flex;justify-content:center;flex-wrap:wrap;gap:8px 18px;font-size:.875rem;line-height:1.6;touch-action:pan-y}
.info-links a{color:#dbeafe;text-underline-offset:3px;padding:4px 0}
.info-links a:focus-visible{outline:3px solid #fde68a;outline-offset:3px}
.noscript-message{position:fixed;inset:0;z-index:100;background:#10235b;color:white;padding:32px;touch-action:pan-y}
.noscript-message a{color:#fde68a}

/* Every third stage is a labelled challenge; normal stages stay approachable. */
#lvl small{font-size:.7rem;letter-spacing:.02em}
#lvl[data-difficulty="hard"] small{color:#fde68a}
#lvl[data-difficulty="super-hard"] small{color:#f0abfc}
.lv[data-difficulty="hard"]{background:linear-gradient(#80541f,#4d3015);border:1px solid #fbbf24}
.lv[data-difficulty="super-hard"]{background:linear-gradient(#7135a0,#411e64);border:1px solid #e9a8ff}
.stage-difficulty{font-size:.625rem;line-height:1.2;color:#fff}
