:root{
  --bg:#07102f;--bg2:#0d1746;--panel:#111d55;--panel2:#0c1746;
  --frame:#5477ed;--frame2:#3550bd;--tile:#17306f;--tile2:#10265f;
  --text:#fff;--muted:#bfc9ee;--accent:#8067ff;--gap:5px;--pad:10px;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;min-height:100%;background:radial-gradient(circle at 50% 0,#162878 0,#09123b 46%,#050a24 100%);font-family:Inter,"SF Pro Rounded","PingFang SC","Microsoft YaHei",sans-serif;color:var(--text)}
body{overflow-x:hidden}button{font:inherit}.hidden{display:none!important}
.site-shell{width:min(1180px,100%);margin:0 auto;padding:14px 16px 28px}
.compact-hero{padding:12px 14px;border-radius:20px;background:rgba(15,27,84,.78);border:1px solid rgba(255,255,255,.06);box-shadow:0 12px 26px rgba(0,0,0,.16),inset 0 1px 0 rgba(255,255,255,.06);backdrop-filter:blur(12px);margin-bottom:14px}
.brand-line{display:flex;align-items:center;justify-content:space-between;gap:12px}.brand-copy{display:flex;align-items:center;gap:10px}.brand-dot{width:14px;height:14px;border-radius:50%;background:linear-gradient(180deg,#a18cff,#6377ff);box-shadow:0 0 16px rgba(115,129,255,.7)}.brand-copy strong{display:block;font-size:18px;letter-spacing:.06em}.brand-copy small{display:block;margin-top:2px;color:var(--muted);font-size:10px;letter-spacing:.08em}.hero-actions{display:flex;gap:8px}.icon-btn{width:40px;height:40px;border:1px solid rgba(255,255,255,.07);border-radius:13px;background:rgba(255,255,255,.07);color:#fff;cursor:pointer;box-shadow:inset 0 1px 0 rgba(255,255,255,.06)}
.quick-row{display:grid;grid-template-columns:1fr 1fr auto;gap:8px;margin-top:10px}.quick-stat{padding:9px 11px;border-radius:14px;background:rgba(255,255,255,.05);display:flex;justify-content:space-between;align-items:center;gap:8px}.quick-stat span{font-size:10px;color:var(--muted)}.quick-stat b{font-size:12px}.mini-btn{border:0;border-radius:14px;padding:0 16px;background:linear-gradient(180deg,#765fff,#5541d8);color:#fff;font-weight:800;cursor:pointer}
.game-layout{display:grid;grid-template-columns:minmax(0,1fr) 280px;gap:16px;align-items:start}.game-card{padding:16px;border-radius:24px;background:linear-gradient(180deg,rgba(15,28,87,.9),rgba(9,19,62,.92));border:1px solid rgba(255,255,255,.06);box-shadow:0 18px 42px rgba(0,0,0,.22),inset 0 1px 0 rgba(255,255,255,.05)}
.game-head{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;margin-bottom:10px}.eyebrow{font-size:11px;color:#c8d2ff}.game-head h1{margin:4px 0 2px;font-size:30px;letter-spacing:-.04em}.game-head p{margin:0;color:var(--muted);font-size:12px}.move-card{min-width:84px;padding:10px 12px;border-radius:16px;background:rgba(255,255,255,.07);text-align:center}.move-card small{display:block;color:var(--muted);font-size:10px}.move-card b{display:block;font-size:28px;line-height:1;margin-top:4px}
.goal-row{display:flex;gap:8px;flex-wrap:wrap;min-height:34px;margin-bottom:10px}.goal-pill{display:flex;align-items:center;gap:7px;padding:7px 9px;border-radius:999px;background:rgba(255,255,255,.06);font-size:11px}.goal-pill .dot{width:14px;height:14px;border-radius:50%}.goal-pill em{font-style:normal;color:var(--muted)}
.board-wrap{display:flex;justify-content:center}.board{position:relative;width:min(100%,650px);aspect-ratio:1;border-radius:30px;padding:var(--pad);background:linear-gradient(180deg,var(--frame),var(--frame2));box-shadow:0 24px 56px rgba(0,0,0,.35),inset 0 2px 0 rgba(255,255,255,.2),inset 0 -4px 10px rgba(0,0,0,.18);overflow:hidden}.grid{position:absolute;inset:var(--pad);display:grid;grid-template-columns:repeat(8,1fr);grid-template-rows:repeat(8,1fr);gap:var(--gap)}.cell{border-radius:10px;background:linear-gradient(180deg,var(--tile),var(--tile2));box-shadow:inset 0 1px 0 rgba(255,255,255,.035),inset 0 -1px 0 rgba(0,0,0,.08)}
.controls{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-top:12px}.control-btn{height:58px;border:1px solid rgba(255,255,255,.07);border-radius:18px;background:linear-gradient(180deg,#2e6ce7,#214cbc);color:#fff;cursor:pointer;box-shadow:0 10px 18px rgba(15,40,125,.22),inset 0 1px 0 rgba(255,255,255,.14)}.control-btn.primary{background:linear-gradient(180deg,#8069ff,#5e46dc)}.control-btn span{display:block;font-size:22px;line-height:1}.control-btn small{display:block;margin-top:3px;font-size:10px;color:#eef2ff}
.side-panel{display:flex;flex-direction:column;gap:12px}.panel-block{padding:14px;border-radius:20px;background:rgba(15,27,84,.76);border:1px solid rgba(255,255,255,.06);box-shadow:0 12px 26px rgba(0,0,0,.14),inset 0 1px 0 rgba(255,255,255,.05)}.panel-title{display:flex;justify-content:space-between;gap:10px;align-items:center}.panel-title b{font-size:13px}.panel-title span{font-size:11px;color:var(--muted)}.progress-track{height:7px;margin-top:10px;border-radius:999px;background:rgba(255,255,255,.08);overflow:hidden}.progress-track i{display:block;height:100%;width:0;background:linear-gradient(90deg,#83b3ff,#bfa6ff);border-radius:inherit;transition:width .25s}.rule-chips{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}.rule-chips span{font-size:10px;padding:6px 8px;border-radius:999px;background:rgba(255,255,255,.06);color:#dce5ff}.help-copy{margin:9px 0 0;color:var(--muted);font-size:11px;line-height:1.65}.stats-block{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.stats-block div{padding:9px 8px;border-radius:14px;background:rgba(255,255,255,.05);text-align:center}.stats-block span{display:block;font-size:9px;color:var(--muted)}.stats-block b{display:block;margin-top:4px;font-size:17px}
.toast{position:absolute;left:50%;bottom:14px;transform:translate(-50%,8px);opacity:0;padding:8px 11px;border-radius:999px;background:rgba(5,10,36,.84);border:1px solid rgba(255,255,255,.06);font-size:11px;transition:.2s;pointer-events:none}.toast.show{opacity:1;transform:translate(-50%,0)}
.modal{position:fixed;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;padding:18px;background:rgba(3,8,28,.56);backdrop-filter:blur(10px)}.sheet{width:min(94vw,900px);max-height:88vh;overflow:auto;border-radius:26px;padding:16px;background:linear-gradient(180deg,#101d68,#091650);border:1px solid rgba(255,255,255,.07);box-shadow:0 28px 70px rgba(0,0,0,.38)}.sheet-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;margin-bottom:14px}.sheet-head h2{margin:0;font-size:24px}.sheet-head p{margin:5px 0 0;font-size:11px;color:var(--muted)}.close-btn{width:40px;height:40px;border:0;border-radius:13px;background:rgba(255,255,255,.07);color:#fff;font-size:24px;cursor:pointer}
.level-groups{display:grid;gap:12px}.level-group{padding:12px;border-radius:18px;background:rgba(255,255,255,.045);border:1px solid rgba(255,255,255,.05)}.level-group-head{display:flex;justify-content:space-between;gap:10px;margin-bottom:8px}.level-group-head b{font-size:13px}.level-group-head span{font-size:10px;color:var(--muted)}.level-grid{display:grid;grid-template-columns:repeat(10,minmax(0,1fr));gap:6px}.level-chip{height:42px;border:0;border-radius:11px;background:linear-gradient(180deg,#294fc9,#1d3aa2);color:#fff;font-size:12px;font-weight:800;cursor:pointer}.level-chip.current{background:linear-gradient(180deg,#896eff,#674de3);box-shadow:0 0 0 2px rgba(193,174,255,.2)}.level-chip.passed::after{content:'✓';display:block;font-size:8px;opacity:.7}
.skin-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.skin-option{border:1px solid rgba(255,255,255,.07);border-radius:18px;background:rgba(255,255,255,.05);padding:10px;color:#fff;text-align:left;cursor:pointer}.skin-option.active{box-shadow:0 0 0 2px rgba(158,139,255,.28);background:rgba(123,96,255,.13)}.skin-option b{display:block;margin-top:8px;font-size:12px}.skin-option span{display:block;margin-top:3px;color:var(--muted);font-size:9px}.preview{display:block;height:72px;border-radius:12px}.preview.neon{background:linear-gradient(135deg,#172c7a,#734dff)}.preview.aurora{background:linear-gradient(135deg,#0d5c67,#4f7de7)}.preview.sunset{background:linear-gradient(135deg,#6a3c8d,#d0814f)}.preview.ice{background:linear-gradient(135deg,#bfeeff,#689adb)}
.win-card{width:min(92vw,360px);padding:24px;border-radius:26px;background:linear-gradient(180deg,#f5f7ff,#e6eaff);color:#16204f;text-align:center;box-shadow:0 28px 70px rgba(0,0,0,.35)}.win-icon{width:64px;height:64px;margin:0 auto 10px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(180deg,#8b71ff,#5d47dd);color:#fff;font-size:30px}.win-card h2{margin:0;font-size:28px}.stars{margin:10px 0 6px;font-size:25px;color:#ffb928;letter-spacing:3px}.win-card p{margin:0 0 16px;color:#53608f}.win-actions{display:grid;gap:8px}.action-btn{height:46px;border:0;border-radius:15px;background:#d9e0ff;color:#34428c;font-weight:800;cursor:pointer}.action-btn.primary{background:linear-gradient(180deg,#7c65ff,#5b44dd);color:#fff}
.entity{position:absolute;display:grid;place-items:center;z-index:5;will-change:transform,opacity,filter}.arrow{border:0;border-radius:11px;background:linear-gradient(180deg,#fffdf8,#e8e1d5);box-shadow:0 5px 10px rgba(0,0,0,.24),inset 0 1px 0 #fff;cursor:pointer;overflow:hidden}.arrow::before{content:"";width:48%;height:48%;background:linear-gradient(180deg,#7995ff,#4e68e9);clip-path:polygon(50% 0,100% 46%,69% 46%,69% 100%,31% 100%,31% 46%,0 46%);transform:rotate(var(--rot))}.arrow.nudge{background:linear-gradient(180deg,#c99bff,#8754ec);box-shadow:0 0 0 2px rgba(202,157,255,.2),0 6px 12px rgba(77,39,154,.24)}.arrow.nudge::before{background:#fff;transform:rotate(var(--rot)) scale(.78)}.arrow.nudge::after{content:'1';position:absolute;right:3px;top:3px;width:13px;height:13px;border-radius:50%;display:grid;place-items:center;background:#fff;color:#7544d5;font-size:8px;font-weight:900}.arrow.hammer{background:linear-gradient(180deg,#ffd873,#efa030)}.arrow.hammer::before{background:#71400e}.arrow.blocked{animation:shake .28s}.arrow.hint{animation:pulse .9s ease-in-out 2}
.ball{border-radius:50%;box-shadow:0 8px 14px rgba(0,0,0,.27),inset -5px -7px 9px rgba(0,0,0,.18),inset 4px 4px 7px rgba(255,255,255,.24)}.ball::before{content:"";position:absolute;left:18%;top:14%;width:33%;height:19%;border-radius:50%;background:rgba(255,255,255,.72);filter:blur(.4px)}.ball.orange{background:radial-gradient(circle at 36% 30%,#ffe3aa 0,#ffb341 21%,#ff9516 52%,#db6900 100%)}.ball.pink{background:radial-gradient(circle at 36% 30%,#ffd6ef 0,#ff7adb 24%,#f237bd 58%,#9b198b 100%)}.ball.cyan{background:radial-gradient(circle at 36% 30%,#d8ffff 0,#82ebff 24%,#1ccedb 58%,#0c7489 100%)}.hole{z-index:2;border-radius:50%;background:radial-gradient(circle,#030305 18%,#000 64%,#151515 100%);box-shadow:0 0 0 4px var(--ring),0 5px 10px rgba(0,0,0,.35),inset 0 7px 10px rgba(0,0,0,.66)}.stone{z-index:4;background:url('../assets/stone.png') center/100% 100% no-repeat;filter:drop-shadow(0 6px 7px rgba(0,0,0,.3))}.stone.cracking{background-image:url('../assets/stone_cracked.png')}.wall{z-index:4;border-radius:9px;background:linear-gradient(180deg,#6c7380,#424853)}.brake{z-index:3;border-radius:9px;background:linear-gradient(180deg,#ffd972,#e9ab36);transform:rotate(45deg) scale(.72);box-shadow:0 5px 9px rgba(86,55,10,.2),inset 0 1px 0 rgba(255,255,255,.5)}.brake::before{content:"";width:34%;height:34%;border-radius:50%;background:#fff5c9}.turn{z-index:3;border-radius:50%;background:linear-gradient(180deg,#9af1d2,#50c69c);color:#176f55;font-size:17px;font-weight:950}.portal{z-index:2;border-radius:50%;background:radial-gradient(circle,#10164b 28%,#0c123f 56%,transparent 58%);box-shadow:0 0 0 3px #52dff4,0 0 10px rgba(82,223,244,.42)}.portal::before{content:"";position:absolute;inset:18%;border-radius:50%;border:1px dashed rgba(255,255,255,.55);animation:spin 3s linear infinite}.ball-shadow{position:absolute;z-index:4;border-radius:50%;pointer-events:none;background:radial-gradient(ellipse at center,rgba(0,0,0,.34),rgba(0,0,0,0) 72%);filter:blur(2px);opacity:.22}.trail{position:absolute;z-index:4;pointer-events:none;filter:blur(4px);opacity:0}.shard{position:absolute;z-index:23;border-radius:3px;background:linear-gradient(180deg,#d8dde2,#96a0aa);pointer-events:none}.dust{position:absolute;z-index:22;border-radius:50%;background:rgba(192,202,211,.7);filter:blur(3px);pointer-events:none}.flash{position:absolute;z-index:21;border-radius:50%;background:radial-gradient(circle,rgba(255,255,255,.58),rgba(255,255,255,0) 62%);pointer-events:none}.tile-shard{position:absolute;z-index:24;border-radius:2px;background:#eee8dc;pointer-events:none}
body[data-skin="aurora"]{--frame:#3db7ad;--frame2:#247987;--tile:#135260;--tile2:#0e414d;background:radial-gradient(circle at 50% 0,#1f756d 0,#0a3341 48%,#061d28 100%)}
body[data-skin="sunset"]{--frame:#a65fba;--frame2:#77438e;--tile:#58365f;--tile2:#472b51;background:radial-gradient(circle at 50% 0,#6c3d83 0,#2d234f 48%,#160f2e 100%)}
body[data-skin="ice"]{--frame:#9bd8ff;--frame2:#5c92cf;--tile:#d0e8f5;--tile2:#afd2e7;color:#122743;background:linear-gradient(180deg,#dff5ff,#b8d8ed)}
body[data-skin="ice"] .compact-hero,body[data-skin="ice"] .game-card,body[data-skin="ice"] .panel-block{background:rgba(238,249,255,.76);color:#12304c;border-color:rgba(39,84,118,.08)}body[data-skin="ice"] .brand-copy small,body[data-skin="ice"] .game-head p,body[data-skin="ice"] .eyebrow,body[data-skin="ice"] .help-copy,body[data-skin="ice"] .panel-title span,body[data-skin="ice"] .rule-chips span{color:#4c6c83}
@media(max-width:900px){.game-layout{grid-template-columns:1fr}.side-panel{display:grid;grid-template-columns:1fr 1fr}.stats-block{grid-column:1/-1}.board{width:min(100%,620px)}}
@media(max-width:640px){.site-shell{padding:10px}.compact-hero{padding:10px 11px;margin-bottom:10px}.brand-copy strong{font-size:16px}.quick-row{grid-template-columns:1fr 1fr auto}.game-card{padding:12px;border-radius:20px}.game-head h1{font-size:25px}.board{border-radius:24px}.controls{gap:8px}.control-btn{height:54px}.side-panel{grid-template-columns:1fr}.stats-block{grid-column:auto}.level-grid{grid-template-columns:repeat(5,1fr)}.skin-grid{grid-template-columns:repeat(2,1fr)}.sheet{padding:13px}.game-head{align-items:center}.move-card{min-width:72px}.goal-row{margin-bottom:8px}}
@keyframes shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-3px)}75%{transform:translateX(3px)}}@keyframes pulse{0%,100%{box-shadow:0 5px 10px rgba(0,0,0,.24),inset 0 1px 0 #fff}50%{box-shadow:0 0 0 4px rgba(145,174,255,.25),0 7px 14px rgba(0,0,0,.26)}}@keyframes spin{to{transform:rotate(360deg)}}


/* V22 visual / motion enhancement - logic unchanged */
:root{--spark:#8bb8ff;--glass:rgba(255,255,255,.08)}
html,body{background:
 radial-gradient(circle at 50% -8%,rgba(79,117,255,.35) 0,rgba(79,117,255,.08) 22%,transparent 44%),
 radial-gradient(circle at 12% 72%,rgba(99,68,255,.13),transparent 34%),
 radial-gradient(circle at 88% 58%,rgba(41,205,255,.08),transparent 30%),
 linear-gradient(180deg,#071032 0,#050b25 100%);background-attachment:fixed}
.site-shell{position:relative}
.site-shell::before,.site-shell::after{content:"";position:fixed;pointer-events:none;z-index:-1;border-radius:50%;filter:blur(50px);opacity:.42}
.site-shell::before{width:260px;height:260px;left:-100px;top:28%;background:rgba(91,84,255,.22);animation:ambientFloat 8s ease-in-out infinite}
.site-shell::after{width:320px;height:320px;right:-140px;top:52%;background:rgba(43,190,255,.15);animation:ambientFloat 9s ease-in-out infinite reverse}
.compact-hero{background:linear-gradient(180deg,rgba(18,34,105,.86),rgba(10,22,69,.82));box-shadow:0 14px 36px rgba(0,0,0,.22),0 0 0 1px rgba(126,151,255,.04),inset 0 1px 0 rgba(255,255,255,.09);position:relative;overflow:hidden}
.compact-hero::after{content:"";position:absolute;left:-10%;right:-10%;top:-28px;height:70px;background:linear-gradient(90deg,transparent,rgba(151,172,255,.12),transparent);transform:skewY(-4deg);animation:heroSheen 6s ease-in-out infinite;pointer-events:none}
.brand-dot{animation:brandPulse 2.6s ease-in-out infinite}
.icon-btn,.mini-btn,.control-btn{transition:transform .18s cubic-bezier(.2,.8,.2,1),filter .18s,box-shadow .18s}
.icon-btn:hover,.mini-btn:hover,.control-btn:hover{filter:brightness(1.08);transform:translateY(-1px)}
.icon-btn:active,.mini-btn:active,.control-btn:active{transform:translateY(1px) scale(.98)}
.game-card{background:linear-gradient(180deg,rgba(17,32,98,.94),rgba(7,17,58,.96));box-shadow:0 24px 60px rgba(0,0,0,.3),0 0 0 1px rgba(112,145,255,.035),inset 0 1px 0 rgba(255,255,255,.07);position:relative;overflow:hidden}
.game-card::before{content:"";position:absolute;inset:-80px -100px auto;height:180px;background:radial-gradient(circle at 50% 0,rgba(104,139,255,.15),transparent 68%);pointer-events:none}
.game-head h1{text-shadow:0 0 22px rgba(117,145,255,.15)}
.move-card{background:linear-gradient(180deg,rgba(255,255,255,.095),rgba(255,255,255,.045));box-shadow:inset 0 1px 0 rgba(255,255,255,.08),0 9px 20px rgba(0,0,0,.12)}
.move-card b{font-variant-numeric:tabular-nums;text-shadow:0 0 18px rgba(139,164,255,.35);transition:transform .16s ease}
.goal-pill{box-shadow:inset 0 1px 0 rgba(255,255,255,.07);backdrop-filter:blur(5px)}
.goal-pill .dot{box-shadow:0 0 12px currentColor,inset 0 1px 2px rgba(255,255,255,.5);animation:goalDot 2.4s ease-in-out infinite}
.board-wrap{position:relative;padding:7px}
.board-wrap::before{content:"";position:absolute;width:min(88%,590px);aspect-ratio:1;left:50%;top:50%;transform:translate(-50%,-49%);border-radius:36px;background:radial-gradient(circle at 50% 45%,rgba(82,122,255,.22),rgba(82,122,255,.05) 52%,transparent 70%);filter:blur(22px);animation:boardAura 4s ease-in-out infinite;pointer-events:none}
.board{border-radius:32px;box-shadow:0 30px 72px rgba(0,0,0,.46),0 0 42px rgba(74,112,255,.16),inset 0 2px 0 rgba(255,255,255,.22),inset 0 -5px 13px rgba(0,0,0,.24);transform:translateZ(0);isolation:isolate}
.board::before{content:"";position:absolute;inset:5px;border-radius:27px;border:1px solid rgba(255,255,255,.08);box-shadow:inset 0 0 28px rgba(130,156,255,.055);z-index:1;pointer-events:none}
.board::after{content:"";position:absolute;left:8%;right:8%;top:4px;height:2px;border-radius:999px;background:linear-gradient(90deg,transparent,rgba(255,255,255,.7),transparent);opacity:.42;z-index:2;pointer-events:none}
.cell{position:relative;overflow:hidden;background:linear-gradient(180deg,color-mix(in srgb,var(--tile) 93%,#fff 7%),var(--tile2));box-shadow:inset 0 1px 0 rgba(255,255,255,.055),inset 0 -2px 4px rgba(0,0,0,.11),0 1px 0 rgba(255,255,255,.012)}
.cell::after{content:"";position:absolute;inset:0;background:linear-gradient(135deg,rgba(255,255,255,.035),transparent 45%);pointer-events:none}
.entity{transform:translateZ(0)}
.arrow{border:1px solid rgba(255,255,255,.52);background:linear-gradient(145deg,#fffdf9 0,#f6f2e9 42%,#ddd7ca 100%);box-shadow:0 8px 16px rgba(0,0,0,.31),0 1px 2px rgba(255,255,255,.5),inset 0 2px 2px #fff,inset 0 -3px 5px rgba(110,99,78,.18);transition:filter .15s,transform .15s}
.arrow:hover{filter:brightness(1.08);box-shadow:0 10px 20px rgba(0,0,0,.34),0 0 16px rgba(119,148,255,.2),inset 0 2px 2px #fff}
.arrow::before{filter:drop-shadow(0 2px 2px rgba(52,72,171,.35));}
.arrow::after{content:"";position:absolute;inset:8%;border-radius:10px;background:linear-gradient(135deg,rgba(255,255,255,.35),transparent 35%);pointer-events:none}
.arrow.nudge{border-color:rgba(240,214,255,.68);box-shadow:0 0 0 2px rgba(197,139,255,.18),0 9px 20px rgba(75,34,153,.34),0 0 20px rgba(181,109,255,.18),inset 0 2px 2px rgba(255,255,255,.42);animation:nudgeGlow 2.1s ease-in-out infinite}
.arrow.nudge::after{content:'1';inset:auto 4px 4px auto;width:15px;height:15px;border-radius:50%;display:grid;place-items:center;background:#fff;color:#7d3edb;font-size:9px;font-weight:950;box-shadow:0 2px 6px rgba(0,0,0,.18)}
.arrow.hammer{border-color:rgba(255,235,178,.65);box-shadow:0 0 0 2px rgba(255,206,96,.13),0 9px 20px rgba(125,77,13,.33),0 0 18px rgba(255,184,57,.14),inset 0 2px 2px rgba(255,255,255,.4)}
.ball{box-shadow:0 12px 20px rgba(0,0,0,.34),inset -7px -9px 12px rgba(0,0,0,.2),inset 5px 6px 9px rgba(255,255,255,.27),0 0 13px color-mix(in srgb,currentColor 20%,transparent);animation:ballBreath 3s ease-in-out infinite}
.ball::after{content:"";position:absolute;inset:8%;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(255,255,255,.13);pointer-events:none}
.ball.orange{color:#ff9b16}.ball.pink{color:#f23abc}.ball.cyan{color:#21cbd8}
.hole{box-shadow:0 0 0 4px var(--ring),0 0 18px color-mix(in srgb,var(--ring) 46%,transparent),0 7px 14px rgba(0,0,0,.4),inset 0 8px 15px rgba(0,0,0,.76);animation:holePulse 2.2s ease-in-out infinite}
.hole::after{content:"";position:absolute;inset:-8%;border-radius:50%;border:1px solid color-mix(in srgb,var(--ring) 45%,transparent);opacity:.45;animation:holeRing 1.9s ease-out infinite}
.stone{filter:drop-shadow(0 9px 9px rgba(0,0,0,.38));transform-origin:50% 62%}
.stone::after{content:"";position:absolute;inset:8%;border-radius:40%;background:linear-gradient(135deg,rgba(255,255,255,.18),transparent 35%);mix-blend-mode:screen;opacity:.42;pointer-events:none}
.stone.cracking{filter:drop-shadow(0 10px 10px rgba(0,0,0,.38)) brightness(1.08)}
.brake{animation:brakePulse 2.2s ease-in-out infinite}
.turn{box-shadow:0 7px 15px rgba(23,102,77,.25),0 0 18px rgba(89,225,178,.15);animation:turnBreath 2.5s ease-in-out infinite}
.portal{box-shadow:0 0 0 3px #52dff4,0 0 16px rgba(82,223,244,.64),0 0 34px rgba(82,223,244,.18),inset 0 0 15px rgba(46,206,234,.34);animation:portalBreathe 2s ease-in-out infinite}
.portal::after{content:"";position:absolute;inset:-12%;border-radius:50%;border:1px solid rgba(113,231,249,.3);animation:portalRing 1.8s ease-out infinite}
.ball-shadow{filter:blur(3px);opacity:.3}
.trail{filter:blur(5px);mix-blend-mode:screen}
.shard{box-shadow:0 5px 10px rgba(0,0,0,.22),inset 0 1px 0 rgba(255,255,255,.22)}
.dust{background:rgba(190,202,217,.76);filter:blur(4px)}
.flash{background:radial-gradient(circle,rgba(255,255,255,.92) 0,rgba(170,205,255,.38) 27%,rgba(255,255,255,0) 68%);mix-blend-mode:screen}
.tile-shard{box-shadow:0 3px 7px rgba(0,0,0,.16),0 0 6px rgba(255,255,255,.2)}
.control-btn{height:62px;border-radius:19px;box-shadow:0 13px 22px rgba(15,40,125,.28),0 0 18px rgba(54,110,255,.09),inset 0 2px 0 rgba(255,255,255,.17),inset 0 -2px 5px rgba(0,0,0,.12)}
.control-btn.primary{box-shadow:0 13px 22px rgba(72,48,171,.3),0 0 18px rgba(126,91,255,.1),inset 0 2px 0 rgba(255,255,255,.18),inset 0 -2px 5px rgba(0,0,0,.12)}
.panel-block{background:linear-gradient(180deg,rgba(18,31,94,.83),rgba(10,21,68,.82));box-shadow:0 14px 32px rgba(0,0,0,.18),inset 0 1px 0 rgba(255,255,255,.065)}
.toast{box-shadow:0 12px 28px rgba(0,0,0,.28),inset 0 1px 0 rgba(255,255,255,.09);backdrop-filter:blur(10px)}
.win-card{box-shadow:0 32px 88px rgba(0,0,0,.4),0 0 50px rgba(104,131,255,.12);overflow:hidden}
.win-card::before{content:"";position:absolute;inset:-120px -80px auto;height:220px;background:radial-gradient(circle,rgba(133,156,255,.28),transparent 66%);pointer-events:none}
.win-icon{box-shadow:0 14px 28px rgba(77,55,191,.32),0 0 26px rgba(126,103,255,.22);animation:winPop .5s cubic-bezier(.2,.85,.25,1.2)}

.board.impact{animation:boardImpact .2s ease-out}
.board.success{animation:boardSuccess .55s ease-out}
.impact-ring{position:absolute;z-index:30;border-radius:50%;border:2px solid rgba(255,255,255,.8);pointer-events:none;mix-blend-mode:screen}
.spark{position:absolute;z-index:31;width:4px;height:10px;border-radius:999px;background:linear-gradient(180deg,#fff,#a9c8ff);pointer-events:none;box-shadow:0 0 6px rgba(177,207,255,.7)}
.ambient-particle{position:absolute;z-index:2;width:3px;height:3px;border-radius:50%;background:rgba(207,223,255,.75);box-shadow:0 0 7px rgba(152,188,255,.6);pointer-events:none;animation:ambientParticle var(--dur) linear forwards}

@keyframes ambientFloat{0%,100%{transform:translate3d(0,0,0) scale(1)}50%{transform:translate3d(12px,-16px,0) scale(1.08)}}
@keyframes heroSheen{0%,65%,100%{transform:translateX(-30%) skewY(-4deg);opacity:0}78%{opacity:.7}90%{transform:translateX(38%) skewY(-4deg);opacity:0}}
@keyframes brandPulse{0%,100%{box-shadow:0 0 14px rgba(115,129,255,.55)}50%{box-shadow:0 0 24px rgba(132,151,255,.95)}}
@keyframes goalDot{0%,100%{transform:scale(1)}50%{transform:scale(1.08)}}
@keyframes boardAura{0%,100%{opacity:.55;transform:translate(-50%,-49%) scale(.98)}50%{opacity:.95;transform:translate(-50%,-49%) scale(1.025)}}
@keyframes nudgeGlow{0%,100%{filter:brightness(1);transform:scale(1)}50%{filter:brightness(1.1);transform:scale(1.015)}}
@keyframes ballBreath{0%,100%{filter:brightness(1)}50%{filter:brightness(1.04)}}
@keyframes holePulse{0%,100%{filter:brightness(1)}50%{filter:brightness(1.14)}}
@keyframes holeRing{0%{transform:scale(.8);opacity:.55}100%{transform:scale(1.25);opacity:0}}
@keyframes brakePulse{0%,100%{filter:brightness(1)}50%{filter:brightness(1.12)}}
@keyframes turnBreath{0%,100%{filter:brightness(1)}50%{filter:brightness(1.1)}}
@keyframes portalBreathe{0%,100%{filter:brightness(1)}50%{filter:brightness(1.18)}}
@keyframes portalRing{0%{transform:scale(.75);opacity:.65}100%{transform:scale(1.2);opacity:0}}
@keyframes boardImpact{0%,100%{transform:translate(0,0)}20%{transform:translate(-2px,1px)}45%{transform:translate(2px,-1px)}70%{transform:translate(-1px,0)}}
@keyframes boardSuccess{0%{filter:brightness(1)}40%{filter:brightness(1.18)}100%{filter:brightness(1)}}
@keyframes winPop{0%{transform:scale(.6) rotate(-8deg);opacity:0}70%{transform:scale(1.08) rotate(2deg);opacity:1}100%{transform:scale(1) rotate(0)}}
@keyframes ambientParticle{0%{transform:translateY(0) scale(.6);opacity:0}15%{opacity:.65}100%{transform:translateY(-44px) scale(1.2);opacity:0}}

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


/* V23 stronger visual feedback */
body::before{content:"";position:fixed;inset:-10% -8%;pointer-events:none;background:radial-gradient(circle at 20% 10%,rgba(112,137,255,.18),transparent 30%),radial-gradient(circle at 80% 20%,rgba(179,106,255,.12),transparent 28%),radial-gradient(circle at 50% 100%,rgba(54,122,255,.16),transparent 34%);filter:blur(18px);z-index:0}
.app, .game-shell{position:relative;z-index:1}
.game-card{box-shadow:0 28px 72px rgba(0,0,0,.34),0 0 0 1px rgba(112,145,255,.05),0 0 50px rgba(74,112,255,.08),inset 0 1px 0 rgba(255,255,255,.08)}
.board-wrap::before{background:radial-gradient(circle at 50% 45%,rgba(108,144,255,.32),rgba(82,122,255,.1) 54%,transparent 72%);filter:blur(26px)}
.board{box-shadow:0 32px 84px rgba(0,0,0,.5),0 0 54px rgba(88,124,255,.18),inset 0 2px 0 rgba(255,255,255,.24),inset 0 -6px 15px rgba(0,0,0,.25)}
.cell{box-shadow:inset 0 1px 0 rgba(255,255,255,.07),inset 0 -2px 5px rgba(0,0,0,.14),0 0 0 1px rgba(255,255,255,.01)}
.arrow{box-shadow:0 10px 20px rgba(0,0,0,.34),0 0 12px rgba(255,255,255,.05),inset 0 2px 2px #fff,inset 0 -3px 5px rgba(110,99,78,.18)}
.arrow.nudge{box-shadow:0 0 0 2px rgba(197,139,255,.24),0 12px 24px rgba(75,34,153,.38),0 0 26px rgba(181,109,255,.24),inset 0 2px 2px rgba(255,255,255,.42)}
.arrow.hammer{box-shadow:0 0 0 2px rgba(255,206,96,.16),0 12px 24px rgba(125,77,13,.36),0 0 22px rgba(255,184,57,.18),inset 0 2px 2px rgba(255,255,255,.42)}
.ball{box-shadow:0 14px 24px rgba(0,0,0,.38),inset -9px -10px 13px rgba(0,0,0,.22),inset 5px 6px 10px rgba(255,255,255,.29),0 0 18px color-mix(in srgb,currentColor 24%,transparent)}
.hole{box-shadow:0 0 0 4px var(--ring),0 0 22px color-mix(in srgb,var(--ring) 56%,transparent),0 0 42px color-mix(in srgb,var(--ring) 22%,transparent),0 9px 16px rgba(0,0,0,.42),inset 0 8px 15px rgba(0,0,0,.8)}
.portal{box-shadow:0 0 0 3px #52dff4,0 0 22px rgba(82,223,244,.74),0 0 48px rgba(82,223,244,.22),inset 0 0 18px rgba(46,206,234,.4)}
.turn,.brake{filter:drop-shadow(0 0 10px rgba(120,255,220,.12))}
.stone{filter:drop-shadow(0 12px 12px rgba(0,0,0,.42))}
.trail{filter:blur(6px) saturate(1.15);mix-blend-mode:screen}
.spark{width:5px;height:12px;box-shadow:0 0 8px rgba(177,207,255,.85)}
.impact-ring{border-width:3px;box-shadow:0 0 14px rgba(255,255,255,.2)}
.ambient-particle{width:4px;height:4px;box-shadow:0 0 10px rgba(152,188,255,.78)}
.icon-btn,.mini-btn,.control-btn{box-shadow:0 14px 28px rgba(0,0,0,.2),inset 0 1px 0 rgba(255,255,255,.08)}
.control-btn{height:64px}
.goal-pill,.panel-block,.move-card,.sheet-card{backdrop-filter:blur(8px)}
.toast{background:rgba(15,23,68,.88)}
.win-card{box-shadow:0 36px 100px rgba(0,0,0,.44),0 0 66px rgba(104,131,255,.14)}
@keyframes boardImpact{0%,100%{transform:translate(0,0)}18%{transform:translate(-3px,1px)}42%{transform:translate(3px,-2px)}66%{transform:translate(-2px,1px)}84%{transform:translate(1px,-1px)}}
@keyframes holePulse{0%,100%{filter:brightness(1)}50%{filter:brightness(1.22)}}
@keyframes boardSuccess{0%{filter:brightness(1)}34%{filter:brightness(1.24)}100%{filter:brightness(1)}}


/* ===== V25 art pack ===== */
html,body{
  background:
    linear-gradient(180deg,rgba(5,10,36,.55),rgba(5,10,36,.82)),
    radial-gradient(circle at 50% 0,#162878 0,#09123b 46%,#050a24 100%);
}
body::before{
  content:"";position:fixed;inset:0;pointer-events:none;z-index:0;
  background:radial-gradient(circle at 50% 18%,rgba(136,193,255,.18),transparent 28%),radial-gradient(circle at 15% 82%,rgba(91,255,236,.08),transparent 24%),radial-gradient(circle at 86% 74%,rgba(211,111,255,.08),transparent 24%);
}
.site-shell{position:relative;z-index:1}
.compact-hero{
  background:linear-gradient(180deg,rgba(10,20,74,.88),rgba(10,18,65,.84));
  border:1px solid rgba(170,210,255,.16);
  box-shadow:0 18px 44px rgba(0,0,0,.28),0 0 36px rgba(92,133,255,.12),inset 0 1px 0 rgba(255,255,255,.12);
}
.compact-hero::before{
  content:"";position:absolute;inset:2px;background:none center/100% 100% no-repeat;opacity:.78;pointer-events:none;
}
.compact-hero > *{position:relative;z-index:1}
.brand-copy strong{font-size:20px;text-shadow:0 0 14px rgba(150,198,255,.25)}
.brand-copy small{color:#d8e6ff;opacity:.95}
.quick-stat{
  background:linear-gradient(180deg,rgba(255,255,255,.12),rgba(255,255,255,.06));
  border:1px solid rgba(192,223,255,.12);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.16),0 10px 20px rgba(0,0,0,.12);
  backdrop-filter:blur(8px);
}
.game-card{
  background:linear-gradient(180deg,rgba(11,24,82,.9),rgba(7,16,57,.96));
  border:1px solid rgba(191,219,255,.11);
  box-shadow:0 26px 70px rgba(0,0,0,.38),0 0 42px rgba(83,131,255,.13),inset 0 1px 0 rgba(255,255,255,.11);
}
.game-card::after{
  content:"";position:absolute;inset:6px;border-radius:20px;pointer-events:none;opacity:.24;
  background:radial-gradient(circle at 50% 0,rgba(120,165,255,.18),transparent 68%);
  mix-blend-mode:screen;
}
.board-wrap::before{filter:blur(26px);background:radial-gradient(circle at 50% 48%,rgba(114,166,255,.32),rgba(79,119,255,.12) 46%,transparent 69%)}
.board{
  background:linear-gradient(180deg,var(--frame),var(--frame2));
  box-shadow:0 34px 90px rgba(0,0,0,.52),0 0 60px rgba(89,133,255,.22),inset 0 2px 0 rgba(255,255,255,.22),inset 0 -8px 16px rgba(0,0,0,.28);
}
.board::before{border:1px solid rgba(214,234,255,.14);box-shadow:inset 0 0 36px rgba(130,156,255,.095)}
.panel-block{
  position:relative;overflow:hidden;
  background:linear-gradient(180deg,rgba(16,30,92,.83),rgba(9,19,64,.82));
  border:1px solid rgba(188,221,255,.09);
}
.panel-block::before{
  content:"";position:absolute;left:0;right:0;top:0;height:72px;pointer-events:none;opacity:.42;
  background:linear-gradient(180deg,rgba(110,150,255,.12),transparent);
}
.panel-block > *{position:relative;z-index:1}
.mini-btn,.control-btn,.action-btn{
  position:relative;border:0;background:transparent;color:#fff;text-shadow:0 1px 0 rgba(0,0,0,.25);
}
.mini-btn::before,.control-btn::before,.action-btn::before{
  content:"";position:absolute;inset:0;z-index:0;pointer-events:none;
  background:linear-gradient(180deg,#3b76ee,#244db9);border-radius:18px;
  filter:drop-shadow(0 10px 18px rgba(28,66,165,.28));
}
.control-btn.primary::before,.action-btn.primary::before{background:linear-gradient(180deg,#8268ff,#5b45d7);border-radius:18px;filter:drop-shadow(0 12px 22px rgba(72,48,171,.28))}
.mini-btn > *, .control-btn > *, .action-btn > *{position:relative;z-index:1}
.mini-btn{min-width:108px;font-weight:900;letter-spacing:.03em}
.icon-btn{
  background:linear-gradient(180deg,rgba(255,255,255,.12),rgba(255,255,255,.07));
  border:1px solid rgba(194,226,255,.16);
  box-shadow:0 12px 24px rgba(0,0,0,.2),0 0 14px rgba(112,154,255,.13),inset 0 1px 0 rgba(255,255,255,.16);
  backdrop-filter:blur(8px);
}
.icon-btn:hover,.mini-btn:hover,.control-btn:hover,.action-btn:hover{transform:translateY(-2px) scale(1.01);filter:brightness(1.08)}
.sheet,.win-card{
  position:relative;overflow:hidden;
  background:rgba(10,17,56,.82);
  border:1px solid rgba(201,225,255,.1);
}
.sheet::before,.win-card::before{
  content:"";position:absolute;inset:0;pointer-events:none;border:1px solid rgba(202,224,255,.12);border-radius:inherit;box-shadow:inset 0 1px 0 rgba(255,255,255,.08),inset 0 0 40px rgba(100,140,255,.06);
}
.sheet > *, .win-card > *{position:relative;z-index:1}
.sheet{padding:30px 28px 24px;box-shadow:0 34px 80px rgba(0,0,0,.42),0 0 42px rgba(96,143,255,.18)}
.win-card{padding:34px 26px 26px;background:rgba(9,16,58,.5);color:#eaf2ff;box-shadow:0 34px 88px rgba(0,0,0,.48),0 0 52px rgba(104,131,255,.18)}
.win-card h2{color:#fff;text-shadow:0 0 14px rgba(136,169,255,.3)}
.win-card p{color:#d5e2ff}
.action-btn{height:52px;font-weight:900;color:#f5f8ff}
.action-btn:not(.primary){color:#eaf2ff}
.sheet-head h2,.panel-title b,.game-head h1{letter-spacing:.01em}
.toast{background:linear-gradient(180deg,rgba(18,28,78,.92),rgba(10,16,54,.92));border-color:rgba(196,218,255,.12)}
@media (max-width: 768px){
  html,body{background-attachment:scroll}
  .sheet{padding:24px 18px 18px}
  .win-card{padding:30px 20px 22px}
}


/* ===== V26 chapter motivation rebuild ===== */
.mission-block{padding-bottom:16px}
.stage-kicker{font-size:11px;letter-spacing:.18em;color:#d8e5ff;text-transform:uppercase;opacity:.92}
.mission-headline{margin-top:6px;font-size:28px;font-weight:900;letter-spacing:-.03em;text-shadow:0 0 18px rgba(136,169,255,.18)}
.mission-progress{margin-top:2px;color:#cbd9ff;font-size:12px}
.objective-card{margin-top:12px;padding:12px 12px 10px;border-radius:18px;background:linear-gradient(180deg,rgba(255,255,255,.095),rgba(255,255,255,.045));border:1px solid rgba(194,225,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 10px 20px rgba(0,0,0,.12)}
.objective-label{font-size:10px;color:#cbd9ff;letter-spacing:.08em;text-transform:uppercase}
.objective-route{margin-top:6px;font-size:14px;font-weight:800;color:#fff}
.hook-text{margin-top:7px;font-size:12px;line-height:1.6;color:#d7e5ff}
.challenge-list{display:grid;gap:8px;margin-top:10px}
.challenge-item{display:flex;gap:10px;align-items:center;padding:10px 12px;border-radius:16px;background:linear-gradient(180deg,rgba(255,255,255,.08),rgba(255,255,255,.04));border:1px solid rgba(195,220,255,.08);box-shadow:inset 0 1px 0 rgba(255,255,255,.08)}
.challenge-item b{display:block;font-size:12px}
.challenge-item small{display:block;margin-top:2px;color:#cdd8fb;font-size:10px}
.challenge-icon{width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:rgba(255,255,255,.1);font-size:13px;font-weight:900;color:#fff;box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 0 14px rgba(117,145,255,.14)}
.challenge-item.done .challenge-icon{background:linear-gradient(180deg,#ffdd72,#ffb936);color:#5b3800;box-shadow:0 0 16px rgba(255,194,67,.36)}
.challenge-item.fail{opacity:.58}
.challenge-item.fail .challenge-icon{background:rgba(255,103,142,.16);color:#ffd7e0}
.mechanics-block .rule-chips{margin-top:10px}
.level-group-head{align-items:flex-end}
.level-chip{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px}
.level-chip span{display:block;line-height:1}
.level-chip em{display:block;font-style:normal;font-size:8px;opacity:.85;color:#ffe18f}
.praise{position:absolute;left:50%;top:14%;transform:translate(-50%,8px) scale(.92);opacity:0;pointer-events:none;z-index:40;padding:10px 16px;border-radius:999px;background:linear-gradient(180deg,rgba(15,25,82,.92),rgba(8,16,54,.94));border:1px solid rgba(194,220,255,.16);color:#fff;font-weight:900;letter-spacing:.06em;text-transform:uppercase;box-shadow:0 18px 36px rgba(0,0,0,.3),0 0 24px rgba(122,154,255,.16)}
.praise.show{animation:praisePop .9s cubic-bezier(.18,.78,.22,1) forwards}
.praise.perfect{background:linear-gradient(180deg,rgba(67,43,130,.94),rgba(19,22,80,.96));box-shadow:0 18px 36px rgba(0,0,0,.32),0 0 32px rgba(174,137,255,.24)}
.praise.good{background:linear-gradient(180deg,rgba(16,48,115,.94),rgba(10,18,68,.96))}
.praise.bad{background:linear-gradient(180deg,rgba(90,29,58,.92),rgba(40,11,29,.96));color:#ffd7e6}
.win-kicker{font-size:11px;letter-spacing:.18em;text-transform:uppercase;color:#d9e5ff;opacity:.96;margin-bottom:6px}
.win-sub{margin:10px 0 0;color:#d7e2ff !important;line-height:1.6;font-size:12px}
.win-pills{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-top:10px}
.win-pill{padding:6px 9px;border-radius:999px;font-size:11px;background:rgba(255,255,255,.08);color:#dbe6ff;border:1px solid rgba(255,255,255,.08)}
.win-pill.ok{background:rgba(255,214,96,.18);color:#fff1b7;border-color:rgba(255,214,96,.28)}
.win-pill.off{opacity:.58}
@keyframes praisePop{0%{opacity:0;transform:translate(-50%,12px) scale(.88)}18%{opacity:1;transform:translate(-50%,-2px) scale(1.04)}72%{opacity:1;transform:translate(-50%,-8px) scale(1)}100%{opacity:0;transform:translate(-50%,-18px) scale(.98)}}
@media (max-width: 768px){
  .mission-headline{font-size:24px}
  .hook-text{font-size:11px}
  .challenge-item{padding:9px 10px}
}


/* ===== V28 stability / responsive refactor ===== */
.button-label{position:relative;z-index:3;display:inline-flex;align-items:center;justify-content:center;width:100%;height:100%;pointer-events:none;color:inherit;font:inherit;font-weight:inherit;line-height:1}
.mini-btn,.control-btn,.action-btn{isolation:isolate;overflow:hidden;color:#fff !important}
.mini-btn::before,.control-btn::before,.action-btn::before{z-index:-1 !important}
.action-btn{display:flex !important;align-items:center;justify-content:center;min-height:52px;color:#eef4ff !important;font-weight:900 !important;text-indent:0 !important;font-size:15px !important;line-height:1 !important}
.action-btn.primary{color:#fff !important}
.win-actions{display:grid;grid-template-columns:1fr;gap:10px;width:100%}
.win-card{width:min(92vw,420px) !important;max-height:min(92dvh,720px);overflow:auto !important;padding:30px 26px 26px !important}
.win-card p{overflow-wrap:anywhere}
.win-pills{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-top:12px}
.win-pill{padding:7px 10px;border-radius:999px;font-size:11px;background:rgba(255,255,255,.08);color:#dbe6ff;border:1px solid rgba(255,255,255,.08);white-space:nowrap}
.win-pill.ok{background:rgba(255,214,96,.17);color:#fff1b7;border-color:rgba(255,214,96,.28)}
.win-pill.off{opacity:.55}

/* Desktop */
@media (min-width:1100px){
 .site-shell{width:min(1220px,calc(100% - 32px));padding:14px 0 30px}
 .game-layout{grid-template-columns:minmax(640px,1fr) 300px;gap:18px}
 .board{width:min(100%,680px)}
 .side-panel{position:sticky;top:14px}
 .level-grid{grid-template-columns:repeat(10,minmax(0,1fr))}
}
/* Tablet */
@media (min-width:700px) and (max-width:1099px){
 .site-shell{width:min(900px,100%);padding:12px 14px 28px}
 .game-layout{grid-template-columns:1fr;gap:14px}
 .board{width:min(78vw,650px)}
 .side-panel{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 .stats-block{grid-column:1/-1}
 .level-grid{grid-template-columns:repeat(8,minmax(0,1fr))}
}
/* Mobile */
@media (max-width:699px){
 :root{--gap:4px;--pad:8px}
 html,body{min-width:0;overflow-x:hidden}
 .site-shell{width:100%;padding:8px 8px 20px}
 .compact-hero{padding:10px;border-radius:17px;margin-bottom:8px}
 .brand-copy strong{font-size:16px}.brand-copy small{font-size:8px}
 .icon-btn{width:36px;height:36px;border-radius:12px}
 .quick-row{grid-template-columns:1fr 1fr;gap:6px}.quick-row .mini-btn{grid-column:1/-1;min-height:42px}
 .game-layout{display:flex;flex-direction:column;gap:10px}
 .game-card{padding:10px;border-radius:20px;width:100%;min-width:0}
 .game-head{align-items:center;margin-bottom:8px}.game-head h1{font-size:24px}.game-head p{font-size:10px;max-width:66vw}
 .move-card{min-width:72px;padding:8px 10px}.move-card b{font-size:24px}
 .goal-row{margin-bottom:7px;min-height:30px}.goal-pill{padding:6px 8px;font-size:10px}
 .board-wrap{padding:3px;width:100%}.board{width:100%;max-width:none;border-radius:24px}.cell{border-radius:8px}
 .controls{gap:7px;margin-top:9px}.control-btn{height:54px;border-radius:15px}.control-btn span{font-size:20px}
 .side-panel{width:100%;display:flex;flex-direction:column;gap:8px}.panel-block{padding:11px;border-radius:17px}
 .mission-headline{font-size:22px}.objective-card{padding:10px}.hook-text,.help-copy{font-size:10px;line-height:1.5}
 .challenge-list{gap:6px}.challenge-item{padding:8px 9px}.challenge-icon{width:25px;height:25px}
 .stats-block{display:grid;grid-template-columns:repeat(3,1fr)}
 .modal{padding:10px;align-items:center}.sheet{width:100%;max-height:92dvh;padding:18px 12px 14px;border-radius:20px}
 .sheet-head h2{font-size:20px}.level-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:6px}.level-chip{height:44px}
 .skin-grid{grid-template-columns:repeat(2,1fr)}
 .win-card{width:min(94vw,390px) !important;padding:24px 18px 18px !important;border-radius:22px !important}
 .win-icon{width:58px;height:58px;font-size:27px}.win-card h2{font-size:27px}.stars{font-size:23px}.win-card p{font-size:13px}
 .action-btn{height:50px !important;min-height:50px !important;font-size:15px !important}
}
@media (max-width:390px){
 .site-shell{padding-left:5px;padding-right:5px}.game-card{padding:7px}.compact-hero{padding:8px}.board-wrap{padding:1px}
 .level-grid{grid-template-columns:repeat(4,minmax(0,1fr))}
}


/* ===== V30 chapter-map bug fix =====
   V29 had a later `.sheet,.win-card { overflow:hidden; }` rule that overrode
   the original scrollable sheet. All chapters were rendered, but Chapter 5+
   was clipped below the modal viewport. */
.level-sheet{
  width:min(96vw,1180px) !important;
  max-height:calc(100dvh - 28px) !important;
  overflow-x:hidden !important;
  overflow-y:auto !important;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  scrollbar-gutter:stable;
}
.level-sheet .sheet-head{
  position:sticky;
  top:-1px;
  z-index:20;
  padding:4px 4px 12px;
  margin-bottom:10px;
  background:linear-gradient(180deg,rgba(15,26,78,.98) 0%,rgba(15,26,78,.94) 76%,rgba(15,26,78,0) 100%);
  backdrop-filter:blur(12px);
}
.level-sheet .close-btn{
  flex:0 0 auto;
}
.level-groups{
  padding-bottom:12px;
}
.level-group{
  scroll-margin-top:96px;
}
.level-chip.current{
  scroll-margin-block:160px;
}

@media (max-width:900px){
  .level-sheet{
    width:calc(100vw - 20px) !important;
    max-height:calc(100dvh - 20px) !important;
    padding:18px 14px 16px !important;
  }
}
@media (max-width:640px){
  .modal{
    padding:6px !important;
    align-items:center !important;
  }
  .level-sheet{
    width:calc(100vw - 12px) !important;
    max-height:calc(100dvh - 12px) !important;
    border-radius:18px !important;
    padding:14px 10px 12px !important;
  }
  .level-sheet .sheet-head{
    padding:2px 2px 10px;
  }
  .level-grid{
    grid-template-columns:repeat(5,minmax(0,1fr)) !important;
  }
}


/* ===== Route Pop 1.0 · Mobile-first front-end refactor ===== */
:root{
  --safe-top:env(safe-area-inset-top,0px);
  --safe-right:env(safe-area-inset-right,0px);
  --safe-bottom:env(safe-area-inset-bottom,0px);
  --safe-left:env(safe-area-inset-left,0px);
}
html{height:100%;text-size-adjust:100%;-webkit-text-size-adjust:100%}
body.mobile-first-build{min-height:100dvh;overscroll-behavior-y:none;touch-action:pan-y;background-attachment:fixed}
button,.arrow{touch-action:manipulation;-webkit-user-select:none;user-select:none}
.arrow,.control-btn,.icon-btn,.mini-btn,.action-btn,.level-chip,.skin-option{transition:transform .12s cubic-bezier(.2,.8,.2,1),filter .14s ease,box-shadow .14s ease}
.arrow:active,.arrow.is-pressed{transform:scale(.91)!important;filter:brightness(1.12)}
.control-btn:active,.control-btn.is-pressed,.icon-btn:active,.icon-btn.is-pressed,.mini-btn:active,.mini-btn.is-pressed,.action-btn:active,.action-btn.is-pressed{transform:translateY(1px) scale(.965)!important;filter:brightness(1.08)}
.level-chip:active,.level-chip.is-pressed,.skin-option:active,.skin-option.is-pressed{transform:scale(.96)!important}

@media (max-width:699px){
  body.mobile-first-build{background:radial-gradient(circle at 50% -6%,#172a79 0,#09143f 44%,#050a24 100%)}
  .site-shell{
    width:100%;max-width:none;margin:0;
    padding:calc(6px + var(--safe-top)) calc(7px + var(--safe-right)) calc(86px + var(--safe-bottom)) calc(7px + var(--safe-left));
  }
  /* App bar rather than a desktop card */
  .compact-hero{
    position:sticky;top:0;z-index:50;margin:0 -1px 7px;padding:7px 9px 8px;
    border-radius:0 0 16px 16px;
    background:linear-gradient(180deg,rgba(8,17,58,.96),rgba(10,22,70,.90));
    backdrop-filter:blur(18px) saturate(1.12);
    box-shadow:0 8px 22px rgba(0,0,0,.18),inset 0 -1px 0 rgba(255,255,255,.055);
  }
  .brand-line{min-height:38px}.brand-copy{gap:8px}.brand-dot{width:10px;height:10px}
  .brand-copy strong{font-size:15px;letter-spacing:.055em}.brand-copy small{font-size:8px;margin-top:1px;letter-spacing:.065em}
  .hero-actions{gap:6px}.icon-btn{width:36px;height:36px;border-radius:12px;font-size:16px}
  /* Current-level strip remains, but becomes thumb-friendly and compact */
  .quick-row{display:grid;grid-template-columns:1fr 1fr 92px;gap:5px;margin-top:5px}
  .quick-stat{min-height:36px;padding:6px 8px;border-radius:11px;display:block}
  .quick-stat span{display:block;font-size:9px}.quick-stat b{display:block;margin-top:2px;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .quick-row .mini-btn{grid-column:auto!important;min-height:36px!important;padding:0 8px;border-radius:11px;font-size:11px}

  .game-layout{display:flex;flex-direction:column;gap:8px}
  .game-card{
    width:100%;padding:8px 7px 7px;border-radius:18px;
    background:linear-gradient(180deg,rgba(13,26,82,.91),rgba(8,17,57,.94));
    box-shadow:0 14px 32px rgba(0,0,0,.25),inset 0 1px 0 rgba(255,255,255,.055);
  }
  .game-head{min-height:48px;align-items:center;margin:0 2px 5px;gap:8px}
  .eyebrow{font-size:9px}.game-head h1{font-size:21px;margin:2px 0 1px;letter-spacing:-.025em}.game-head p{font-size:10px;line-height:1.25;max-width:68vw}
  .move-card{min-width:62px;padding:6px 8px;border-radius:13px}.move-card small{font-size:8px}.move-card b{font-size:22px;margin-top:2px}
  .goal-row{min-height:28px;gap:5px;margin:0 2px 6px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}.goal-row::-webkit-scrollbar{display:none}
  .goal-pill{flex:0 0 auto;padding:5px 7px;font-size:10px}.goal-pill .dot{width:11px;height:11px}
  .board-wrap{width:100%;padding:0;display:block}
  .board{
    width:100%;max-width:none;aspect-ratio:1;border-radius:22px;
    box-shadow:0 18px 46px rgba(0,0,0,.38),0 0 30px rgba(85,125,255,.11),inset 0 2px 0 rgba(255,255,255,.16),inset 0 -5px 12px rgba(0,0,0,.2);
  }
  .cell{border-radius:7px}
  .arrow{border-radius:9px}.entity{will-change:transform,opacity}

  /* Controls are always reachable with the thumb. */
  .controls{
    position:fixed;left:calc(7px + var(--safe-left));right:calc(7px + var(--safe-right));bottom:calc(6px + var(--safe-bottom));z-index:55;
    display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin:0;padding:7px;
    border:1px solid rgba(255,255,255,.075);border-radius:19px;
    background:linear-gradient(180deg,rgba(12,24,76,.94),rgba(6,14,50,.96));
    backdrop-filter:blur(18px) saturate(1.15);box-shadow:0 14px 34px rgba(0,0,0,.38),inset 0 1px 0 rgba(255,255,255,.08);
  }
  .control-btn{height:50px;min-height:50px;border-radius:13px;gap:2px}.control-btn span{font-size:20px}.control-btn small{font-size:10px}

  /* Game information follows play, rather than competing with it. */
  .side-panel{width:100%;display:grid;grid-template-columns:1fr;gap:7px}
  .panel-block{padding:10px 11px;border-radius:15px;background:linear-gradient(180deg,rgba(14,28,83,.78),rgba(8,18,59,.82))}
  .mission-block{order:1}.challenge-block{order:2}.mechanics-block{order:3}.stats-block{order:4}
  .mission-headline{font-size:20px;margin-top:3px}.stage-kicker{font-size:9px}.mission-progress{font-size:10px}
  .progress-track{height:6px;margin-top:7px}
  .objective-card{margin-top:8px;padding:9px 10px;border-radius:13px}.objective-label{font-size:9px}.objective-route{font-size:12px;margin-top:4px}.hook-text{font-size:10px;line-height:1.45;margin-top:4px}
  .challenge-list{grid-template-columns:repeat(3,1fr);gap:5px;margin-top:7px}.challenge-item{min-width:0;padding:7px 6px;border-radius:12px;gap:5px}.challenge-icon{width:22px;height:22px;flex:0 0 auto;font-size:10px}.challenge-item b{font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.challenge-item small{font-size:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .rule-chips{gap:5px!important}.rule-chips span{font-size:9px!important;padding:5px 7px!important}.help-copy{font-size:10px;line-height:1.45}
  .stats-block{grid-template-columns:repeat(3,1fr)!important}.stats-block div{padding:3px}.stats-block span{font-size:9px}.stats-block b{font-size:15px}

  .modal{padding:5px!important;align-items:flex-end!important}
  .sheet{width:100%!important;max-height:90dvh!important;border-radius:22px 22px 13px 13px!important;padding:14px 10px calc(12px + var(--safe-bottom))!important}
  .sheet-head{align-items:center}.sheet-head h2{font-size:18px}.sheet-head p{font-size:10px;line-height:1.4}.close-btn{width:40px;height:40px;min-width:40px}
  .level-sheet{width:100%!important;max-height:92dvh!important}.level-sheet .sheet-head{top:-14px!important;margin:-14px -10px 8px!important;padding:14px 10px 10px!important;border-radius:22px 22px 0 0}
  .level-group{padding:10px;border-radius:14px}.level-group-head{gap:6px}.level-group-head b{font-size:12px}.level-group-head span{font-size:9px}
  .level-grid{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:5px!important}.level-chip{height:42px!important;border-radius:11px!important;font-size:13px!important}
  .skin-grid{grid-template-columns:repeat(2,1fr)!important;gap:7px}.skin-option{min-height:88px}
  .win-modal{align-items:center!important}.win-card{width:calc(100vw - 20px)!important;max-height:88dvh!important;padding:22px 16px calc(17px + var(--safe-bottom))!important;border-radius:22px!important}.win-icon{width:54px;height:54px;font-size:26px}.win-card h2{font-size:25px}.stars{font-size:21px}.win-card p{font-size:12px}.action-btn{min-height:48px!important;height:48px!important}
}
@media (max-width:380px){
  .site-shell{padding-left:4px;padding-right:4px}.compact-hero{padding-left:7px;padding-right:7px}.quick-row{grid-template-columns:1fr 1fr 82px}.quick-row .mini-btn{font-size:10px}.game-card{padding-left:5px;padding-right:5px}.challenge-item small{display:none}.level-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}
/* Landscape phones: keep board usable, avoid giant vertical page. */
@media (max-height:520px) and (orientation:landscape){
  .site-shell{padding-bottom:68px}.compact-hero{position:static}.quick-row{display:none}.game-layout{display:grid;grid-template-columns:minmax(0,62vh) 1fr;gap:8px}.game-card{padding:6px}.game-head{min-height:38px}.game-head h1{font-size:18px}.goal-row{display:none}.board{width:min(62vh,100%)}.side-panel{max-height:calc(100dvh - 18px);overflow:auto}.controls{left:auto;width:240px;right:calc(6px + var(--safe-right));padding:5px}.control-btn{height:42px;min-height:42px}.mechanics-block,.stats-block{display:none}
}

/* ===== Route Pop 1.0 · mobile game polish ===== */
.runtime-meta{display:none!important}
.nav-btn{font-size:19px;font-weight:900;letter-spacing:-.05em}

@media (max-width:699px){
  body.mobile-first-build{
    background:
      radial-gradient(circle at 50% -12%,rgba(54,86,190,.72) 0,rgba(16,32,101,.48) 24%,transparent 48%),
      linear-gradient(180deg,#091238 0%,#070e2e 56%,#050a22 100%);
  }
  .site-shell{
    padding:calc(4px + var(--safe-top)) calc(5px + var(--safe-right)) calc(82px + var(--safe-bottom)) calc(5px + var(--safe-left));
  }
  .compact-hero{
    position:sticky;top:0;z-index:60;
    margin:0 0 5px;padding:6px 8px;
    min-height:52px;border-radius:0 0 17px 17px;
    background:linear-gradient(180deg,rgba(7,15,51,.96),rgba(8,19,66,.88));
    border:1px solid rgba(174,204,255,.08);border-top:0;
    box-shadow:0 10px 24px rgba(0,0,0,.23),inset 0 -1px 0 rgba(255,255,255,.055);
  }
  .brand-line{min-height:40px;gap:8px}
  .brand-copy{gap:8px;min-width:0}
  .brand-dot{width:11px;height:11px;box-shadow:0 0 15px rgba(126,147,255,.82)}
  .brand-copy strong{font-size:18px;line-height:1;letter-spacing:.065em;white-space:nowrap}
  .brand-copy small{display:none}
  .hero-actions{gap:5px;flex:0 0 auto}
  .icon-btn{
    width:40px;height:40px;min-width:40px;border-radius:13px;font-size:18px;
    background:linear-gradient(180deg,rgba(255,255,255,.12),rgba(255,255,255,.055));
    border:1px solid rgba(190,218,255,.13);
    box-shadow:0 7px 15px rgba(0,0,0,.18),inset 0 1px 0 rgba(255,255,255,.14);
  }

  .game-layout{display:block}
  .game-card{
    width:100%;padding:5px 3px 4px;border-radius:20px;
    background:linear-gradient(180deg,rgba(13,25,78,.78),rgba(7,16,55,.82));
    border:1px solid rgba(177,208,255,.075);
    box-shadow:0 15px 36px rgba(0,0,0,.27),inset 0 1px 0 rgba(255,255,255,.05);
    overflow:visible;
  }
  .game-card::after{opacity:.12}
  .game-head{
    min-height:48px;margin:0 5px 5px;padding:2px 2px 0;
    align-items:center;gap:8px;
  }
  .eyebrow{font-size:12px;font-weight:800;letter-spacing:.08em;color:#aebeff}
  .game-head h1{font-size:26px;line-height:1;margin:3px 0 0;letter-spacing:-.035em}
  .game-head p{display:none}
  .move-card{
    min-width:68px;padding:7px 10px;border-radius:15px;
    background:linear-gradient(180deg,rgba(255,255,255,.11),rgba(255,255,255,.05));
    border:1px solid rgba(255,255,255,.07);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.11),0 7px 18px rgba(0,0,0,.13)
  }
  .move-card small{font-size:12px;font-weight:700;color:#cbd6ff}
  .move-card b{font-size:25px;margin-top:2px}

  .goal-row{
    min-height:30px;margin:0 5px 6px;gap:6px;
    flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;
  }
  .goal-row::-webkit-scrollbar{display:none}
  .goal-pill{
    flex:0 0 auto;min-height:30px;padding:5px 9px;border-radius:999px;
    font-size:12px;font-weight:800;
    background:linear-gradient(180deg,rgba(255,255,255,.09),rgba(255,255,255,.045));
    border:1px solid rgba(255,255,255,.065);
    box-shadow:inset 0 1px 0 rgba(255,255,255,.08);
  }
  .goal-pill .dot{width:13px;height:13px;box-shadow:0 0 10px currentColor}
  .goal-pill em{display:none}

  .board-wrap{width:100%;padding:0;position:relative}
  .board-wrap::before{
    content:"";position:absolute;inset:6% 4%;border-radius:28px;pointer-events:none;
    background:radial-gradient(circle at 50% 44%,rgba(99,139,255,.30),rgba(96,111,255,.08) 52%,transparent 72%);
    filter:blur(25px);opacity:.9
  }
  .board{
    width:100%;max-width:none;aspect-ratio:1;border-radius:25px;
    box-shadow:0 24px 58px rgba(0,0,0,.46),0 0 38px rgba(81,119,255,.13),inset 0 2px 0 rgba(255,255,255,.18),inset 0 -6px 15px rgba(0,0,0,.24);
    transform:translateZ(0);isolation:isolate;
  }
  .board::after{
    content:"";position:absolute;inset:7px;border-radius:19px;z-index:1;pointer-events:none;
    border:1px solid rgba(207,226,255,.06);
    background:linear-gradient(130deg,rgba(255,255,255,.035),transparent 26%,transparent 72%,rgba(141,126,255,.035));
  }
  .grid{z-index:2}
  .cell{border-radius:8px;box-shadow:inset 0 1px 0 rgba(255,255,255,.05),inset 0 -2px 4px rgba(0,0,0,.13)}
  .arrow{border-radius:9px;box-shadow:0 6px 12px rgba(0,0,0,.30),inset 0 1px 0 #fff}
  .arrow.nudge::after{font-size:12px;width:17px;height:17px;right:3px;top:3px}
  .turn{font-size:18px}
  .portal{box-shadow:0 0 0 3px #52dff4,0 0 18px rgba(82,223,244,.58),inset 0 0 12px rgba(46,206,234,.28)}
  .hole{box-shadow:0 0 0 4px var(--ring),0 0 18px color-mix(in srgb,var(--ring) 46%,transparent),0 6px 12px rgba(0,0,0,.38),inset 0 7px 10px rgba(0,0,0,.66)}

  /* Mobile is play-first: informational desktop panels stay off the board screen. */
  .side-panel{display:none!important}

  .controls{
    position:fixed;left:calc(6px + var(--safe-left));right:calc(6px + var(--safe-right));bottom:calc(5px + var(--safe-bottom));z-index:70;
    display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin:0;padding:7px;
    border-radius:20px;border:1px solid rgba(177,209,255,.09);
    background:linear-gradient(180deg,rgba(10,22,72,.95),rgba(5,13,46,.97));
    backdrop-filter:blur(19px) saturate(1.15);
    box-shadow:0 18px 38px rgba(0,0,0,.42),inset 0 1px 0 rgba(255,255,255,.075);
  }
  .control-btn{
    height:56px;min-height:56px;border-radius:15px;
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  }
  .control-btn::before{border-radius:15px!important}
  .control-btn span{font-size:22px;line-height:1}
  .control-btn small{font-size:12px;font-weight:800;line-height:1.1;margin:0;color:#f2f5ff}

  .toast{bottom:16px;font-size:12px;line-height:1.35;padding:8px 11px;max-width:82%;white-space:normal;text-align:center}
  .praise{font-size:12px;padding:9px 14px;top:12%}

  .modal{padding:5px!important;align-items:flex-end!important}
  .sheet{
    width:100%!important;max-height:91dvh!important;
    border-radius:24px 24px 14px 14px!important;
    padding:15px 11px calc(13px + var(--safe-bottom))!important;
  }
  .sheet-head h2{font-size:21px;line-height:1.2}
  .sheet-head p{display:none}
  .close-btn{width:42px;height:42px;min-width:42px;font-size:25px}
  .level-group{padding:10px;border-radius:15px}
  .level-group-head{align-items:center;gap:7px}
  .level-group-head b{font-size:13px;line-height:1.3}
  .level-group-head span{font-size:12px;white-space:nowrap}
  .level-grid{grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:6px!important}
  .level-chip{height:46px!important;border-radius:12px!important;font-size:14px!important}
  .level-chip.passed::after{font-size:12px}
  .level-chip em{font-size:12px}

  .skin-grid{grid-template-columns:repeat(2,1fr)!important;gap:8px}
  .skin-option{padding:10px;min-height:104px}
  .skin-option b,.skin-option span{font-size:12px}

  .win-modal{align-items:center!important}
  .win-card{
    width:calc(100vw - 18px)!important;max-height:88dvh!important;
    padding:22px 16px calc(16px + var(--safe-bottom))!important;border-radius:24px!important
  }
  .win-icon{width:58px;height:58px;font-size:28px}
  .win-kicker{font-size:12px}
  .win-card h2{font-size:27px}
  .stars{font-size:24px}
  .win-card p,.win-sub,.win-pill{font-size:12px!important}
  .win-sub{display:none}
  .action-btn{height:52px!important;min-height:52px!important;font-size:15px!important;border-radius:16px!important}
}

@media (max-width:380px){
  .site-shell{padding-left:3px;padding-right:3px}
  .compact-hero{padding-left:6px;padding-right:6px}
  .brand-copy strong{font-size:17px}
  .icon-btn{width:38px;height:38px;min-width:38px}
  .game-card{padding-left:2px;padding-right:2px}
  .game-head{margin-left:5px;margin-right:5px}
  .game-head h1{font-size:24px}
  .move-card{min-width:64px}
  .goal-pill{font-size:12px;padding-left:8px;padding-right:8px}
  .level-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}

@media (max-height:520px) and (orientation:landscape){
  .compact-hero{position:static;min-height:44px;padding:3px 7px;margin-bottom:4px}
  .brand-line{min-height:36px}.brand-copy strong{font-size:16px}.icon-btn{width:36px;height:36px;min-width:36px}
  .site-shell{padding-bottom:60px}
  .game-layout{display:grid;grid-template-columns:minmax(0,62vh) 1fr;gap:8px}
  .game-card{padding:4px}.game-head{min-height:36px;margin-bottom:3px}.game-head h1{font-size:19px}.eyebrow{font-size:12px}
  .goal-row{display:none}.board{width:min(62vh,100%)}
  .side-panel{display:block!important;max-height:calc(100dvh - 10px);overflow:auto}
  .mission-block,.mechanics-block,.stats-block{display:none!important}
  .challenge-block{display:block!important}
  .challenge-item b,.challenge-item small,.panel-title b,.panel-title span{font-size:12px!important}
  .controls{left:auto;width:248px;right:calc(5px + var(--safe-right));padding:5px}.control-btn{height:44px;min-height:44px}.control-btn small{font-size:12px}
}


/* ===== Route Pop mobile readability + stronger controls ===== */
@media (max-width: 768px){
  /* All visible text on mobile: 12px minimum */
  .brand-copy strong{font-size:18px!important}
  .brand-copy small,
  .quick-stat span,.quick-stat b,.quick-row .mini-btn,
  .eyebrow,.game-head p,.move-card small,
  .goal-pill,.goal-pill em,
  .panel-title b,.panel-title span,.stage-kicker,.mission-progress,
  .objective-label,.objective-route,.hook-text,
  .challenge-item b,.challenge-item small,
  .rule-chips span,.help-copy,.stats-block span,
  .toast,.praise,.sheet-head p,.level-group-head span,
  .skin-option b,.skin-option span,.win-kicker,.win-card p,.win-sub,.win-pill,
  .level-chip em,.level-chip.passed::after{font-size:12px!important}

  /* Top utility icons: ~50% larger visual glyphs */
  .icon-btn{width:46px!important;height:46px!important;min-width:46px!important;border-radius:15px!important;font-size:27px!important;line-height:1!important}
  .nav-btn{font-size:28px!important}

  /* Bottom main controls: bigger icon + stronger thumb target */
  .control-btn{height:62px!important;min-height:62px!important;border-radius:17px!important}
  .control-btn span{font-size:34px!important;line-height:.9!important;font-weight:800!important}
  .control-btn small{font-size:12px!important;margin-top:4px!important;font-weight:800!important}
  .controls{gap:10px!important;padding-top:7px!important;padding-bottom:max(7px,var(--safe-bottom))!important}

  .close-btn{width:46px!important;height:46px!important;min-width:46px!important;font-size:30px!important}
  .game-head h1{font-size:26px!important}
  .move-card b{font-size:27px!important}
  .sheet-head h2{font-size:22px!important}
  .level-group-head b{font-size:13px!important}
  .level-chip{font-size:14px!important;min-height:48px!important}
  .action-btn{font-size:15px!important;min-height:54px!important}
}
@media (max-width: 390px){
  .icon-btn{width:43px!important;height:43px!important;min-width:43px!important;font-size:25px!important}
  .control-btn{height:58px!important;min-height:58px!important}
  .control-btn span{font-size:32px!important}
}

/* Route Pop 300 · new puzzle language */
.spring-pad{z-index:4;border-radius:24%;background:linear-gradient(145deg,#fff7bd,#ffcf45 54%,#ff9c2b);box-shadow:inset 0 2px 0 #fff9,0 5px 12px #0005;transform:rotate(var(--rot));}
.spring-pad:before{content:"➜";position:absolute;inset:0;display:grid;place-items:center;font-size:clamp(18px,5.4vw,30px);font-weight:1000;color:#7a3b00;text-shadow:0 1px #fff9;}
.one-way{z-index:3;border-radius:18%;background:linear-gradient(145deg,#1d2d6d,#132050);border:2px solid #839bff99;box-shadow:inset 0 0 14px #5a78ff44;transform:rotate(var(--rot));}
.one-way:before{content:"➤";position:absolute;inset:0;display:grid;place-items:center;font-size:clamp(17px,5vw,28px);color:#b7c7ff;}
.sticky-tile{z-index:2;border-radius:28%;background:radial-gradient(circle at 38% 32%,#d8ff9b,#77d65d 46%,#358d4d 72%);box-shadow:inset 0 0 0 3px #eaffb955,0 0 12px #63e98d44;opacity:.92}
.sticky-tile:after{content:"";position:absolute;width:28%;height:28%;border-radius:50%;background:#efffc966;left:18%;top:16%;box-shadow:18px 14px 0 #efffc944}
.ice-tile{z-index:1;border-radius:20%;background:linear-gradient(135deg,#dffcffcc,#77dff0aa 45%,#4b91e8aa);border:1px solid #c9ffffbb;box-shadow:inset 0 0 12px #fff9}
.ice-tile:after{content:"";position:absolute;inset:22% 12%;border-top:2px solid #fff9;border-bottom:1px solid #fff6;transform:skew(-22deg)}
.color-gate{z-index:3;border-radius:18%;border:3px solid var(--gate);background:linear-gradient(180deg,#101942aa,#0d1339aa);box-shadow:inset 0 0 10px var(--gate),0 0 11px color-mix(in srgb,var(--gate) 55%,transparent)}
.color-gate:before,.color-gate:after{content:"";position:absolute;top:8%;bottom:8%;width:16%;border-radius:10px;background:var(--gate);box-shadow:0 0 9px var(--gate)}.color-gate:before{left:13%}.color-gate:after{right:13%}
.floor-switch{z-index:2;border-radius:50%;transform:scale(.62);background:radial-gradient(circle,#b8ffd6 0 26%,#35c477 28% 58%,#147343 60%);box-shadow:0 0 0 5px #183f38aa,0 0 12px #35e98b66}.floor-switch.on{filter:brightness(1.35);box-shadow:0 0 0 5px #1a5140aa,0 0 20px #63ffa6}
.gate-door{z-index:6;border-radius:16%;background:linear-gradient(90deg,#6f7fca 0 16%,#263565 17% 31%,#7e91e5 32% 46%,#263565 47% 61%,#7486d5 62% 77%,#263565 78%);box-shadow:inset 0 0 0 2px #d8e0ff55,0 4px 10px #0006;transition:.22s ease}.gate-door.open{opacity:.12;transform:scale(.7);pointer-events:none}
.cracked-stone{z-index:6;background:url('../assets/stone_cracked.png') center/contain no-repeat;filter:drop-shadow(0 5px 5px #0008)}.cracked-stone.damaged{filter:brightness(1.12) drop-shadow(0 5px 5px #0008);animation:stoneWarn .8s ease-in-out infinite alternate}@keyframes stoneWarn{to{transform:scale(1.035)}}
@media(max-width:640px){.spring-pad:before,.one-way:before{font-size:22px!important}.rule-chips span,.goal-pill,.goal-pill em,.goal-pill b,.chapter-pill,.top-action{font-size:12px!important}}
.fragile-tile{z-index:2;border-radius:18%;background:linear-gradient(145deg,#43599b,#263a78);box-shadow:inset 0 0 0 2px #a9bbff45,0 3px 9px #0005;overflow:hidden}
.fragile-tile:before,.fragile-tile:after{content:"";position:absolute;height:2px;background:#c9d5ff88;transform-origin:left center;border-radius:2px}.fragile-tile:before{width:54%;left:22%;top:38%;transform:rotate(27deg)}.fragile-tile:after{width:42%;left:35%;top:57%;transform:rotate(-34deg)}
.fragile-tile.used{background:radial-gradient(circle at 50% 50%,#111936 0 24%,#1b2857 26% 52%,#31447e 54%);box-shadow:inset 0 0 0 2px #788acb55}.fragile-tile.used:before,.fragile-tile.used:after{background:#0b1029;width:72%;left:14%;top:50%}
/* Mobile readability lock: visible copy never below 12px. */
@media (max-width:900px){
  .brand-copy small,.quick-stat span,.quick-stat b,.eyebrow,.game-head p,.move-card small,
  .goal-pill,.goal-pill em,.control-btn small,.panel-title span,.rule-chips span,.help-copy,
  .stats-block span,.toast,.sheet-head p,.level-group-head span,.skin-option span,.stage-kicker,
  .objective-label,.challenge-item small,.win-kicker,.win-pill,.hook-text,.mission-progress,
  .challenge-item b,.level-group-head b,.quick-row .mini-btn{font-size:12px!important}
  .control-btn span{font-size:34px!important;line-height:.9!important}
  .icon-btn{font-size:22px!important}
  .challenge-icon{font-size:14px!important}
  .level-chip.passed::after{font-size:12px!important}
  .arrow.nudge::after{font-size:12px!important;width:18px!important;height:18px!important}
}

/* Route Pop 1.0 · Premium gameplay art pass
   Functional geometry is unchanged; these rules only improve mechanism legibility and polish. */
.wall{
  z-index:4;border-radius:18%!important;
  background:url('../assets/mechanisms/bumper.png') center/100% 100% no-repeat!important;
  box-shadow:none!important;
  filter:drop-shadow(0 7px 8px rgba(3,8,34,.34));
}
.spring-pad{
  z-index:4;border:0!important;border-radius:18%!important;
  background:url('../assets/mechanisms/spring.png') center/100% 100% no-repeat!important;
  box-shadow:none!important;transform:rotate(var(--rot));filter:drop-shadow(0 7px 7px rgba(25,12,2,.28));
}
.spring-pad::before{content:none!important}
.one-way{
  z-index:3;border:0!important;border-radius:18%!important;
  background:url('../assets/mechanisms/oneway.png') center/100% 100% no-repeat!important;
  box-shadow:none!important;transform:rotate(var(--rot));filter:drop-shadow(0 5px 7px rgba(0,8,40,.28));
}
.one-way::before{content:none!important}
.sticky-tile{
  z-index:2;border:0!important;border-radius:18%!important;
  background:url('../assets/mechanisms/sticky.png') center/100% 100% no-repeat!important;
  box-shadow:none!important;opacity:1!important;filter:drop-shadow(0 4px 7px rgba(10,48,25,.28));
}
.sticky-tile::after{content:none!important}
.ice-tile{
  z-index:1;border:0!important;border-radius:18%!important;
  background:url('../assets/mechanisms/ice.png') center/100% 100% no-repeat!important;
  box-shadow:none!important;filter:drop-shadow(0 3px 6px rgba(24,104,170,.25));
}
.ice-tile::after{content:none!important}
.floor-switch{
  z-index:2;border-radius:18%!important;transform:none!important;
  background:url('../assets/mechanisms/switch.png') center/100% 100% no-repeat!important;
  box-shadow:none!important;filter:drop-shadow(0 4px 7px rgba(10,42,48,.28));
  transition:filter .18s ease,transform .18s cubic-bezier(.2,.85,.25,1.2);
}
.floor-switch.on{filter:brightness(1.18) drop-shadow(0 0 10px rgba(94,255,196,.52));transform:scale(.98)!important}
.gate-door{
  z-index:6;border-radius:18%!important;
  background:url('../assets/mechanisms/door.png') center/100% 100% no-repeat!important;
  box-shadow:none!important;filter:drop-shadow(0 6px 8px rgba(4,8,35,.34));
  transition:opacity .2s ease,transform .24s cubic-bezier(.2,.8,.25,1),filter .2s ease!important;
}
.gate-door.open{opacity:.07!important;transform:scale(.34,.86)!important;filter:blur(2px) brightness(1.4)!important}
.fragile-tile{
  z-index:2;border:0!important;border-radius:18%!important;
  background:url('../assets/mechanisms/fragile.png') center/100% 100% no-repeat!important;
  box-shadow:none!important;filter:drop-shadow(0 4px 6px rgba(3,8,30,.27));overflow:visible!important;
}
.fragile-tile::before,.fragile-tile::after{content:none!important}
.fragile-tile.used{background:radial-gradient(circle at 50% 50%,rgba(4,8,28,.88) 0 25%,rgba(25,39,84,.72) 28% 51%,rgba(70,88,157,.22) 54%,transparent 67%)!important;filter:none!important}
.color-gate{
  z-index:3;border:2px solid color-mix(in srgb,var(--gate) 90%,white)!important;border-radius:22%!important;
  background:linear-gradient(180deg,rgba(15,25,70,.82),rgba(8,14,48,.9))!important;
  box-shadow:inset 0 0 0 2px color-mix(in srgb,var(--gate) 26%,transparent),0 0 14px color-mix(in srgb,var(--gate) 42%,transparent)!important;
}
.color-gate::before,.color-gate::after{top:12%!important;bottom:12%!important;width:12%!important;border-radius:999px!important;box-shadow:0 0 10px var(--gate)!important}
.color-gate::before{left:16%!important}.color-gate::after{right:16%!important}
.hole{
  z-index:3!important;
  background:radial-gradient(circle at 50% 48%,#000 0 42%,#050713 48%,#121937 58%,transparent 61%)!important;
  box-shadow:0 0 0 3px var(--ring),0 0 14px color-mix(in srgb,var(--ring) 65%,transparent),0 0 30px color-mix(in srgb,var(--ring) 25%,transparent),inset 0 4px 9px rgba(255,255,255,.06)!important;
}
.hole::before{content:"";position:absolute;inset:16%;border-radius:50%;background:radial-gradient(circle at 50% 62%,rgba(54,63,110,.18),#000 66%);box-shadow:inset 0 8px 10px rgba(0,0,0,.9)}
.hole::after{inset:4%!important;border:2px solid color-mix(in srgb,var(--ring) 50%,transparent)!important;opacity:.52!important}
.arrow{
  border-radius:18%!important;
  background:linear-gradient(155deg,#fffef9 0%,#f6f1e8 54%,#dcd4c7 100%)!important;
  box-shadow:0 7px 13px rgba(4,8,30,.30),inset 0 2px 1px rgba(255,255,255,.95),inset 0 -2px 3px rgba(126,111,86,.12)!important;
  transition:transform .10s cubic-bezier(.2,.8,.3,1),filter .12s ease!important;
}
.arrow:hover{filter:brightness(1.035)}
.arrow:active{transform:translateY(2px) scale(.91)!important;filter:brightness(.97)}
.arrow::before{width:46%!important;height:46%!important;filter:drop-shadow(0 2px 1px rgba(36,52,132,.16))}
.ball{animation:ballBreath 3.4s ease-in-out infinite!important;filter:saturate(1.04)}
.portal{background:radial-gradient(circle,#02051b 0 24%,#10184f 28% 46%,transparent 50%)!important;box-shadow:0 0 0 3px #62e9ff,0 0 17px rgba(78,227,255,.55),inset 0 0 12px rgba(95,131,255,.55)!important}
.portal::before{border:2px dashed rgba(220,252,255,.72)!important;animation:spin 2.2s linear infinite!important}

@keyframes mechanismPop{0%{transform:scale(.86);opacity:0}65%{transform:scale(1.045);opacity:1}100%{transform:scale(1);opacity:1}}
.board.level-enter .wall,.board.level-enter .stone,.board.level-enter .spring-pad,.board.level-enter .one-way,.board.level-enter .gate-door,.board.level-enter .color-gate{animation:mechanismPop .28s cubic-bezier(.2,.8,.25,1.15) both}

@media(max-width:900px){
  /* Hard readability floor requested for the mobile game. */
  .site-shell,.site-shell button,.site-shell small,.site-shell span,.site-shell em,.site-shell p,
  .modal,.modal button,.modal small,.modal span,.modal em,.modal p{font-size:max(12px,1em)}
  .control-btn span{font-size:36px!important}.icon-btn{font-size:26px!important}
}
\n/* WordPress platform integration: compact account + leaderboard surface */\n.account-sheet{width:min(92vw,520px)!important;max-height:min(78vh,680px)!important;overflow:auto!important}\n.account-summary{display:flex;align-items:center;gap:12px;padding:13px 2px 16px;border-bottom:1px solid rgba(255,255,255,.08)}\n.account-avatar{width:46px;height:46px;flex:0 0 46px;border-radius:15px;display:grid;place-items:center;font-size:20px;font-weight:900;color:#fff;background:linear-gradient(145deg,var(--frame),var(--frame2));box-shadow:inset 0 1px 0 rgba(255,255,255,.28),0 8px 18px rgba(0,0,0,.22)}\n.account-copy{min-width:0;flex:1}.account-copy b{display:block;font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.account-copy span{display:block;margin-top:3px;font-size:12px;color:var(--muted)}\n.account-login{min-width:92px;min-height:42px}.account-login:disabled{opacity:.52;cursor:default}\n.leaderboard-head{display:flex;align-items:center;justify-content:space-between;padding:17px 2px 9px}.leaderboard-head b{font-size:14px}.rank-refresh{border:0;background:rgba(255,255,255,.08);color:inherit;border-radius:10px;min-height:36px;padding:0 13px;font-size:12px;font-weight:800;cursor:pointer}\n.leaderboard-list{display:grid;gap:7px;padding-bottom:4px}.rank-row{min-height:46px;display:grid;grid-template-columns:30px minmax(0,1fr) auto;align-items:center;gap:8px;padding:8px 11px;border-radius:13px;background:rgba(255,255,255,.055);border:1px solid rgba(255,255,255,.06)}\n.rank-row>b{font-size:13px;color:#c9d5ff}.rank-row>span{font-size:13px;font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.rank-row>em{font-style:normal;font-size:12px;color:#fff;font-weight:850}.rank-empty{padding:24px 12px;text-align:center;color:var(--muted);font-size:12px}\n@media(max-width:640px){.account-sheet{width:calc(100vw - 12px)!important;max-height:calc(100dvh - 12px)!important}.account-summary{gap:10px}.account-avatar{width:42px;height:42px;flex-basis:42px;font-size:18px}.account-copy b{font-size:14px}.account-copy span,.rank-refresh,.rank-row>b,.rank-row>span,.rank-row>em,.rank-empty{font-size:12px!important}.account-login{min-width:86px;padding-inline:10px!important}}\n

/* Header utility icon cleanup: consistent minimalist SVG icons */
.icon-btn{display:grid;place-items:center;padding:0}
.icon-btn svg{width:22px;height:22px;display:block;stroke:currentColor;fill:none;stroke-width:1.85;stroke-linecap:round;stroke-linejoin:round;opacity:.96;pointer-events:none}
.icon-btn#levelBtn svg rect{fill:none}
.icon-btn#accountBtn svg path:first-child{fill:none}
.icon-btn#skinBtn svg path,.icon-btn#soundBtn svg path{fill:none}
.icon-btn#soundBtn svg circle{fill:currentColor;stroke:none}
@media (max-width:640px){.icon-btn svg{width:24px;height:24px}}


/* Apple-minimal top utility controls */
.hero-actions{gap:10px!important}
.icon-btn{width:58px!important;height:58px!important;min-width:58px!important;border-radius:18px!important;background:rgba(255,255,255,.055)!important;border:1px solid rgba(255,255,255,.13)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.08)!important;color:rgba(255,255,255,.96)!important;backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}
.icon-btn:hover{background:rgba(255,255,255,.08)!important;filter:none!important;transform:none!important}
.icon-btn:active,.icon-btn.is-pressed{transform:scale(.94)!important;background:rgba(255,255,255,.11)!important}
.icon-btn svg{width:33px!important;height:33px!important;display:block;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;opacity:.98;pointer-events:none}
.icon-btn#levelBtn svg rect{fill:none}
.icon-btn#accountBtn svg circle,.icon-btn#accountBtn svg path,.icon-btn#skinBtn svg path,.icon-btn#soundBtn svg path{fill:none}
.sound-off-icon{display:none!important}
#soundBtn.sound-off .sound-on-icon{display:none!important}
#soundBtn.sound-off .sound-off-icon{display:block!important}
@media(max-width:640px){.hero-actions{gap:7px!important}.icon-btn{width:50px!important;height:50px!important;min-width:50px!important;border-radius:16px!important}.icon-btn svg{width:34px!important;height:34px!important}}
@media(max-width:390px){.icon-btn{width:46px!important;height:46px!important;min-width:46px!important}.icon-btn svg{width:31px!important;height:31px!important}}


/* ===== Route Pop 1.0.0 · Header centering + mobile chapter map polish ===== */

/* Header icons: precise optical centering */
.hero-actions{
  align-items:center!important;
}
.icon-btn{
  position:relative!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:0!important;
  line-height:0!important;
  vertical-align:middle!important;
}
.icon-btn svg{
  position:absolute!important;
  left:50%!important;
  top:50%!important;
  transform:translate(-50%,-50%)!important;
  transform-origin:center center!important;
  margin:0!important;
}

/* Chapter map desktop/tablet refinement */
.level-sheet{
  padding:20px!important;
}
.level-sheet .sheet-head{
  align-items:center!important;
  padding:6px 6px 16px!important;
}
.level-sheet .sheet-head h2{
  font-size:28px!important;
  line-height:1.15!important;
  letter-spacing:-.02em!important;
}
.level-sheet .sheet-head p{
  font-size:13px!important;
  line-height:1.5!important;
  margin-top:7px!important;
}
.level-group{
  padding:14px!important;
  border-radius:20px!important;
}
.level-group-head{
  min-height:34px!important;
  align-items:center!important;
  margin-bottom:10px!important;
}
.level-group-head b{
  font-size:15px!important;
  line-height:1.25!important;
}
.level-group-head span{
  font-size:13px!important;
  line-height:1.25!important;
}
.level-chip{
  min-height:48px!important;
  height:48px!important;
  font-size:14px!important;
  border-radius:13px!important;
}
.level-chip em,
.level-chip.passed::after{
  font-size:12px!important;
}

/* Mobile: make the chapter selector feel like a native game screen, not a desktop modal */
@media(max-width:768px){
  .modal{
    padding:0!important;
    align-items:flex-end!important;
  }

  .level-sheet{
    width:100%!important;
    max-height:94dvh!important;
    border-radius:28px 28px 0 0!important;
    padding:0 14px calc(18px + var(--safe-bottom))!important;
    box-shadow:0 -18px 52px rgba(0,0,0,.42)!important;
  }

  .level-sheet .sheet-head{
    top:0!important;
    margin:0 -14px 14px!important;
    padding:18px 16px 14px!important;
    min-height:82px!important;
    border-radius:28px 28px 0 0!important;
    background:linear-gradient(180deg,rgba(15,26,78,.995),rgba(15,26,78,.96))!important;
    border-bottom:1px solid rgba(255,255,255,.06)!important;
  }

  .level-sheet .sheet-head > div{
    min-width:0!important;
    padding-right:8px!important;
  }

  .level-sheet .sheet-head h2{
    font-size:25px!important;
    line-height:1.14!important;
    letter-spacing:-.025em!important;
    white-space:normal!important;
  }

  .level-sheet .sheet-head p{
    display:block!important;
    margin:6px 0 0!important;
    font-size:13px!important;
    line-height:1.4!important;
    color:rgba(217,224,255,.68)!important;
  }

  .level-sheet .close-btn{
    width:46px!important;
    height:46px!important;
    min-width:46px!important;
    border-radius:50%!important;
    font-size:26px!important;
    display:grid!important;
    place-items:center!important;
    line-height:1!important;
  }

  .level-groups{
    display:grid!important;
    gap:12px!important;
    padding:0 0 8px!important;
  }

  .level-group{
    padding:13px!important;
    border-radius:18px!important;
    background:rgba(255,255,255,.05)!important;
  }

  .level-group-head{
    min-height:38px!important;
    margin-bottom:10px!important;
    align-items:center!important;
  }

  .level-group-head b{
    font-size:16px!important;
    line-height:1.2!important;
  }

  .level-group-head span{
    font-size:13px!important;
    line-height:1.2!important;
  }

  .level-grid{
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:8px!important;
  }

  .level-chip{
    min-height:52px!important;
    height:52px!important;
    border-radius:14px!important;
    font-size:16px!important;
    font-weight:850!important;
    gap:1px!important;
  }

  .level-chip em,
  .level-chip.passed::after{
    font-size:12px!important;
    line-height:1!important;
  }
}

@media(max-width:390px){
  .level-sheet{
    padding-left:10px!important;
    padding-right:10px!important;
  }

  .level-sheet .sheet-head{
    margin-left:-10px!important;
    margin-right:-10px!important;
    padding-left:13px!important;
    padding-right:13px!important;
  }

  .level-sheet .sheet-head h2{
    font-size:23px!important;
  }

  .level-sheet .sheet-head p{
    font-size:12px!important;
  }

  .level-grid{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    gap:7px!important;
  }

  .level-chip{
    height:54px!important;
    min-height:54px!important;
    font-size:16px!important;
  }
}


/* ===== Chapter Map 2.0 · spacious mobile game navigation ===== */
.level-sheet{width:min(96vw,1040px)!important;padding:20px!important;border-radius:30px!important;background:linear-gradient(180deg,#111e64 0%,#0a1549 100%)!important}
.level-sheet .sheet-head{align-items:center!important;margin-bottom:18px!important;padding:4px 4px 16px!important}
.map-title small{display:block;font-size:12px;font-weight:900;letter-spacing:.16em;color:#8fa4ff;margin-bottom:4px}
.map-title h2{font-size:30px!important;line-height:1.08!important;letter-spacing:-.035em!important;margin:0!important}
.map-title p{display:block!important;font-size:13px!important;margin:6px 0 0!important;color:rgba(224,229,255,.68)!important}
.level-groups{gap:16px!important}
.level-group{padding:18px!important;border-radius:24px!important;background:linear-gradient(180deg,rgba(255,255,255,.055),rgba(255,255,255,.028))!important;border:1px solid rgba(255,255,255,.07)!important}
.level-group-head{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:14px!important;margin-bottom:14px!important;min-height:48px!important}
.chapter-title-wrap{display:grid;grid-template-columns:auto auto 1fr;align-items:baseline;gap:7px 10px;min-width:0}
.chapter-title-wrap small{grid-column:1/4;font-size:11px;font-weight:900;letter-spacing:.15em;color:#91a3ff}
.chapter-title-wrap b{font-size:20px!important;line-height:1.1!important;letter-spacing:-.02em}
.chapter-tag{font-size:13px!important;color:rgba(225,231,255,.65)!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chapter-progress-badge{position:relative;min-width:82px;height:44px;padding:0 11px;display:flex;align-items:center;justify-content:center;gap:3px;border-radius:14px;background:rgba(255,255,255,.07);overflow:hidden;color:#fff}
.chapter-progress-badge strong{font-size:18px;line-height:1}.chapter-progress-badge span{font-size:12px!important;opacity:.7}.chapter-progress-badge i{position:absolute;left:0;bottom:0;height:3px;width:var(--p);background:linear-gradient(90deg,#7b63ff,#56b9ff)}
.level-grid{grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:10px!important}
.level-chip{position:relative!important;min-width:0!important;height:76px!important;padding:8px 6px!important;border-radius:18px!important;background:linear-gradient(180deg,#315bd8,#2445b7)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 8px 16px rgba(3,9,35,.14)!important;display:grid!important;grid-template-rows:1fr auto auto!important;place-items:center!important;gap:1px!important;overflow:hidden!important}
.level-chip .level-num{font-size:22px!important;line-height:1!important;font-weight:900!important;letter-spacing:-.02em!important}
.level-chip .level-stars{font-size:13px!important;line-height:1!important;font-style:normal!important;color:#ffdf78!important;letter-spacing:1px!important;white-space:nowrap!important;max-width:100%!important}
.level-chip .empty-stars{color:rgba(255,255,255,.28)!important;font-size:18px!important}
.level-chip .level-state{font-size:10px!important;line-height:1!important;font-weight:900!important;letter-spacing:.1em!important;color:rgba(230,236,255,.65)!important}
.level-chip.passed::after{content:none!important}
.level-chip.current{background:linear-gradient(180deg,#8b72ff,#654de8)!important;box-shadow:0 0 0 3px rgba(195,180,255,.18),0 10px 24px rgba(90,65,220,.3)!important}
.level-chip.current .level-state{color:#fff!important}
.level-chip:active{transform:scale(.965)!important}

@media(max-width:900px){
 .level-grid{grid-template-columns:repeat(5,minmax(0,1fr))!important}
 .level-chip{height:72px!important}
}

@media(max-width:640px){
 .modal{padding:0!important;align-items:flex-end!important}
 .level-sheet{width:100%!important;max-height:95dvh!important;padding:0 14px calc(18px + var(--safe-bottom))!important;border-radius:28px 28px 0 0!important}
 .level-sheet .sheet-head{position:sticky!important;top:0!important;z-index:30!important;margin:0 -14px 15px!important;padding:18px 16px 14px!important;min-height:86px!important;border-radius:28px 28px 0 0!important;background:linear-gradient(180deg,rgba(17,30,100,.995),rgba(17,30,100,.965))!important;border-bottom:1px solid rgba(255,255,255,.06)!important}
 .map-title small{font-size:12px!important}.map-title h2{font-size:28px!important}.map-title p{font-size:13px!important}
 .level-groups{gap:14px!important}
 .level-group{padding:15px!important;border-radius:22px!important}
 .level-group-head{min-height:54px!important;margin-bottom:13px!important}
 .chapter-title-wrap{grid-template-columns:auto 1fr;gap:4px 8px}
 .chapter-title-wrap small{grid-column:1/3;font-size:12px!important}
 .chapter-title-wrap b{font-size:19px!important}
 .chapter-tag{font-size:12px!important}
 .chapter-progress-badge{min-width:76px;height:46px;border-radius:14px}
 .chapter-progress-badge strong{font-size:18px}.chapter-progress-badge span{font-size:12px!important}
 .level-grid{grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:9px!important}
 .level-chip{height:78px!important;border-radius:17px!important;padding:8px 4px!important}
 .level-chip .level-num{font-size:22px!important}
 .level-chip .level-stars{font-size:12px!important;letter-spacing:0!important}
 .level-chip .level-state{font-size:10px!important}
}

@media(max-width:390px){
 .level-sheet{padding-left:10px!important;padding-right:10px!important}
 .level-sheet .sheet-head{margin-left:-10px!important;margin-right:-10px!important;padding-left:13px!important;padding-right:13px!important}
 .map-title h2{font-size:25px!important}
 .level-group{padding:12px!important}
 .level-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:8px!important}
 .level-chip{height:80px!important}
 .level-chip .level-num{font-size:23px!important}
 .chapter-progress-badge{min-width:70px;padding:0 9px}
}


/* ===== Route Pop native WebGL board layer ===== */
.webgl-board-canvas{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  z-index:0;
  pointer-events:none;
  display:block;
  border-radius:inherit;
}
.webgl-active .board{
  background:transparent!important;
}
.webgl-active .board::before,
.webgl-active .board::after{
  z-index:1!important;
}
.webgl-active .grid{
  z-index:2!important;
}
.webgl-active .cell{
  background:transparent!important;
  box-shadow:none!important;
}
.webgl-active .cell::after{
  display:none!important;
}
.webgl-active .entity,
.webgl-active .toast,
.webgl-active .praise{
  z-index:5;
}

/* Win popup: always optical center on desktop and mobile */
.win-modal{
  align-items:center!important;
  justify-content:center!important;
  padding:
    max(14px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left))!important;
}
.win-modal .win-card{
  position:relative!important;
  left:auto!important;
  right:auto!important;
  top:auto!important;
  bottom:auto!important;
  margin:auto!important;
  transform:none!important;
  max-height:min(88dvh,680px)!important;
  overflow:auto!important;
}
@media(max-width:640px){
  .win-modal{
    align-items:center!important;
    justify-content:center!important;
  }
  .win-modal .win-card{
    width:min(calc(100vw - 24px),390px)!important;
    max-height:calc(100dvh - 32px)!important;
    margin:auto!important;
  }
}


/* ===== Route Pop · motion polish + local/cloud progress reader ===== */
.progress-loader{
  position:fixed;
  inset:0;
  z-index:9999;
  display:grid;
  place-items:center;
  padding:24px;
  background:rgba(7,15,48,.86);
  backdrop-filter:blur(18px) saturate(1.08);
  opacity:1;
  visibility:visible;
  transition:opacity .32s ease,visibility .32s ease;
}
.progress-loader.is-done{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
}
.progress-loader-card{
  width:min(88vw,360px);
  padding:24px 22px 20px;
  border:1px solid rgba(255,255,255,.10);
  border-radius:24px;
  background:linear-gradient(180deg,rgba(34,48,110,.96),rgba(19,31,82,.96));
  box-shadow:0 24px 70px rgba(0,0,0,.34),inset 0 1px rgba(255,255,255,.08);
}
.progress-loader-brand{
  display:flex;
  align-items:center;
  gap:9px;
  margin-bottom:20px;
  color:rgba(237,241,255,.74);
  font-size:12px;
  font-weight:800;
  letter-spacing:.14em;
}
.progress-loader-brand i{
  width:10px;height:10px;border-radius:50%;
  background:#8391ff;
  box-shadow:0 0 16px rgba(131,145,255,.72);
}
.progress-loader-title{
  color:#fff;
  font-size:23px;
  font-weight:850;
  letter-spacing:-.025em;
}
.progress-loader-text{
  min-height:20px;
  margin-top:7px;
  color:rgba(222,228,255,.68);
  font-size:13px;
  line-height:1.45;
}
.progress-loader-track{
  position:relative;
  height:6px;
  margin-top:18px;
  overflow:hidden;
  border-radius:999px;
  background:rgba(255,255,255,.08);
}
.progress-loader-track i{
  display:block;
  width:8%;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg,#7484ff,#a98cff);
  box-shadow:0 0 18px rgba(130,142,255,.42);
  transition:width .34s cubic-bezier(.2,.8,.2,1);
}
.progress-loader-meta{
  display:flex;
  justify-content:space-between;
  margin-top:10px;
  color:rgba(214,221,255,.54);
  font-size:12px;
}

/* Page entrance: concise, not flashy */
.site-shell{
  animation:routeShellIn .42s cubic-bezier(.18,.78,.22,1) both;
}
.compact-hero{
  animation:routeHeaderIn .38s .04s cubic-bezier(.18,.78,.22,1) both;
}
.game-card{
  animation:routeCardIn .44s .06s cubic-bezier(.18,.78,.22,1) both;
}
.side-panel{
  animation:routeCardIn .44s .11s cubic-bezier(.18,.78,.22,1) both;
}
@keyframes routeShellIn{
  from{opacity:.68}
  to{opacity:1}
}
@keyframes routeHeaderIn{
  from{opacity:0;transform:translateY(-7px)}
  to{opacity:1;transform:none}
}
@keyframes routeCardIn{
  from{opacity:0;transform:translateY(9px) scale(.994)}
  to{opacity:1;transform:none}
}

/* Modal motion */
.modal:not(.hidden) .sheet,
.modal:not(.hidden) .win-card{
  animation:routeModalIn .28s cubic-bezier(.18,.84,.22,1) both;
}
@keyframes routeModalIn{
  from{opacity:0;transform:translateY(10px) scale(.975)}
  to{opacity:1;transform:none}
}

/* Keep successful clear centered while feeling more responsive */
.win-modal:not(.hidden) .win-icon{
  animation:routeWinIcon .42s cubic-bezier(.16,.9,.22,1.18) both;
}
@keyframes routeWinIcon{
  0%{transform:scale(.72);opacity:0}
  68%{transform:scale(1.08);opacity:1}
  100%{transform:scale(1)}
}

/* Account progress sync */
.account-sync-card{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:10px 0 14px;
  padding:13px 14px;
  border:1px solid rgba(255,255,255,.07);
  border-radius:16px;
  background:rgba(255,255,255,.045);
}
.account-sync-copy{
  display:grid;
  gap:3px;
  min-width:0;
}
.account-sync-copy b{
  font-size:14px;
  color:#fff;
}
.account-sync-copy span{
  font-size:12px;
  color:var(--muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.account-sync-side{
  display:flex;
  align-items:center;
  gap:9px;
}
.sync-dot{
  width:9px;height:9px;border-radius:50%;
  background:#8893b8;
  box-shadow:0 0 0 4px rgba(136,147,184,.08);
  transition:.2s ease;
}
.sync-dot.local{background:#70b8ff}
.sync-dot.syncing{background:#ffc968;box-shadow:0 0 0 4px rgba(255,201,104,.10)}
.sync-dot.cloud{background:#65e4aa;box-shadow:0 0 0 4px rgba(101,228,170,.10)}
.sync-dot.offline{background:#ff8da7}
.sync-progress-btn{
  min-width:52px;
  min-height:36px;
  font-size:12px!important;
}
.sync-progress-btn:disabled{
  opacity:.55;
  cursor:default;
}

@media(max-width:640px){
  .progress-loader{
    padding:18px;
  }
  .progress-loader-card{
    width:min(92vw,350px);
    border-radius:22px;
    padding:22px 20px 18px;
  }
  .progress-loader-title{font-size:22px}
  .progress-loader-text,.progress-loader-meta{font-size:12px}
  .account-sync-card{padding:12px}
}

@media(prefers-reduced-motion:reduce){
  .site-shell,.compact-hero,.game-card,.side-panel,
  .modal:not(.hidden) .sheet,.modal:not(.hidden) .win-card,
  .win-modal:not(.hidden) .win-icon{
    animation:none!important;
  }
}


/* ===== Hint/toast position: top of board, auto-hide after 2s ===== */
.toast{
  top:14px!important;
  bottom:auto!important;
  left:50%!important;
  transform:translate(-50%,-8px)!important;
  z-index:80!important;
  max-width:min(86%,520px)!important;
  padding:9px 13px!important;
  font-size:12px!important;
  line-height:1.35!important;
  white-space:normal!important;
  text-align:center!important;
}
.toast.show{
  transform:translate(-50%,0)!important;
}
@media(max-width:640px){
  .toast{
    top:10px!important;
    max-width:88%!important;
    padding:9px 12px!important;
    font-size:12px!important;
  }
}


/* Rank-sync fix: progress sync never blocks gameplay */
.progress-loader{display:none!important;pointer-events:none!important}
.account-sync-card{position:relative}
.account-sync-copy span{min-height:18px}


/* ===== Critical boot/render fallback fix =====
   The normal board stays visible even when WebGL is unavailable or initializes late.
   WebGL is enhancement only; it can no longer make the first level blank. */
.webgl-board-canvas{
  z-index:3!important;
  opacity:.08!important;
  mix-blend-mode:screen;
}
.webgl-active .board{
  background:linear-gradient(180deg,var(--frame),var(--frame2))!important;
}
.webgl-active .grid{
  z-index:2!important;
}
.webgl-active .cell{
  background:linear-gradient(180deg,color-mix(in srgb,var(--tile) 93%,#fff 7%),var(--tile2))!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.055),inset 0 -2px 4px rgba(0,0,0,.11),0 1px 0 rgba(255,255,255,.012)!important;
}
.webgl-active .cell::after{
  display:block!important;
}
.webgl-active .entity,
.webgl-active .toast,
.webgl-active .praise{
  z-index:5!important;
}
.no-webgl .webgl-board-canvas{
  display:none!important;
}


/* Cloud progress sync removed: nothing may block the game UI. */
.progress-loader,.account-sync-card{display:none!important;pointer-events:none!important}


/* ===== 1.2.2 mobile control dock positioning fix =====
   A transformed ancestor turns position:fixed into card-relative positioning.
   Keep the mobile game card out of that containing-block path so the controls
   stay at the phone viewport bottom instead of covering the board. */
@media (max-width:768px){
  .game-card{
    animation:none!important;
    transform:none!important;
  }
  .site-shell{
    padding-bottom:calc(104px + var(--safe-bottom))!important;
  }
  .controls{
    position:fixed!important;
    left:calc(10px + var(--safe-left))!important;
    right:calc(10px + var(--safe-right))!important;
    bottom:calc(10px + var(--safe-bottom))!important;
    width:auto!important;
    z-index:40!important;
    margin:0!important;
    padding:8px!important;
    gap:10px!important;
    border-radius:20px!important;
    background:linear-gradient(180deg,rgba(10,22,72,.97),rgba(5,13,46,.985))!important;
    box-shadow:0 18px 42px rgba(0,0,0,.48),inset 0 1px 0 rgba(255,255,255,.09)!important;
  }
}

@media (max-height:520px) and (orientation:landscape){
  .game-card{animation:none!important;transform:none!important}
  .controls{
    left:auto!important;
    right:calc(8px + var(--safe-right))!important;
    bottom:calc(8px + var(--safe-bottom))!important;
    width:min(248px,44vw)!important;
    padding:6px!important;
  }
}


/* ===== 1.2.3 portrait board centering =====
   The board itself, rather than the surrounding copy, owns the visual center. */
@media (max-width:768px) and (orientation:portrait){
  .board-wrap{
    position:fixed!important;
    inset:0!important;
    z-index:10!important;
    width:100vw!important;
    height:100dvh!important;
    padding:0!important;
    display:grid!important;
    place-items:center!important;
    pointer-events:none!important;
  }
  .board-wrap::before{display:none!important}
  .board{
    width:min(calc(100vw - 20px),calc(100dvh - 204px))!important;
    max-width:650px!important;
    margin:0!important;
    pointer-events:auto!important;
  }
}

@media (max-width:768px) and (orientation:portrait) and (max-height:600px){
  .goal-row{display:none!important}
  .game-head{min-height:40px!important;margin-bottom:0!important}
  .game-head h1{font-size:22px!important}
}
