:root {
  font-family: ui-rounded,"SF Pro Rounded",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:#effff9;background:#082b3b;font-synthesis:none;
  --teal:#70e2d1;--deep:#082b3b;--board:#113b51;
  --g:clamp(3px,.8vw,5px)
}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;min-height:100svh;background:radial-gradient(ellipse at 28% 0%,#1d7085 0%,#0d4256 32%,#082b3b 73%,#052130 100%)}
button,a{font:inherit;-webkit-tap-highlight-color:transparent}
button{cursor:pointer}a{color:inherit}
button:focus-visible,a:focus-visible{outline:3px solid #fbe8a4;outline-offset:3px}
.adventure-shell{width:min(100%,490px);min-height:100svh;margin:auto;padding:max(18px,env(safe-area-inset-top)) 16px max(18px,env(safe-area-inset-bottom));position:relative;overflow:hidden}
.adventure-header{display:flex;align-items:center;gap:12px;margin-bottom:14px;position:relative;z-index:1}
.adventure-header h1{font-size:23px;line-height:1;margin:4px 0 0;letter-spacing:-.6px}
.eyebrow,.chapter{font-size:9px;font-weight:850;letter-spacing:2px;color:#a8ead9}
.back,.icon-button{flex:0 0 44px;display:grid;place-items:center;width:44px;height:44px;border:1px solid #8ad9d35c;border-radius:14px;background:#ffffff15;text-decoration:none;font-size:30px;font-weight:600;color:#e0faf7}
.icon-button{margin-left:auto;font-size:22px}
.map-screen{min-height:calc(100svh - 95px);display:flex;flex-direction:column}
.reef-scene{position:relative;height:180px;border-radius:26px;overflow:hidden;margin:2px 0 19px;background:radial-gradient(circle at 20% 0%,#c5fcecbd,transparent 35%),linear-gradient(150deg,#429eae 0%,#19738c 37%,#073c59 83%);border:1px solid #9ef1df55;box-shadow:0 20px 30px #001e3580,inset 0 1px #fff6}
.reef-scene:after{content:'';position:absolute;inset:auto 0 0;height:33%;background:linear-gradient(transparent,#d8b18355)}
.sunlight{position:absolute;inset:0;background:repeating-linear-gradient(115deg,#ffffff00 0 36px,#e6ffff12 37px 65px,#ffffff00 67px 150px);transform:rotate(-8deg);animation:float 15s ease-in-out infinite alternate}
.fish{position:absolute;right:15%;top:28%;font-size:51px;filter:drop-shadow(0 10px 8px #003951)}
.coral{position:absolute;bottom:-16px;left:7%;font-size:96px}.shell{position:absolute;right:12%;bottom:0;font-size:55px;z-index:1}
.bubbles{position:absolute;left:49%;top:19%;font-size:38px;letter-spacing:8px;opacity:.55}
.map-intro{text-align:center}
.map-intro h2{margin:8px 0 6px;font-size:28px;letter-spacing:-1px}
.map-intro p{font-size:13px;line-height:1.5;color:#c2e3e5;max-width:340px;margin:0 auto 15px}
.chapter-progress{display:flex;justify-content:center;align-items:center;gap:11px;padding:10px;border:1px solid #70e2d143;border-radius:13px;background:#ffffff0b;margin-bottom:15px}
.chapter-progress strong{font-size:17px}.chapter-progress span{font-size:12px;color:#bedfdd}
.map-path{display:grid;gap:10px}
.level-card{display:flex;align-items:center;gap:12px;padding:12px 13px;border:1px solid #7cdccb53;border-radius:17px;background:linear-gradient(110deg,#ffffff20,#ffffff09);color:white;text-align:left;min-height:73px;box-shadow:inset 0 1px #ffffff14}
.level-card.locked{opacity:.48;filter:saturate(.55)}
.level-card:disabled{cursor:default}
.level-badge{display:grid;place-items:center;width:43px;height:43px;flex:none;border:1px solid #aae9df7a;border-radius:14px;background:linear-gradient(140deg,#4badd1,#127083);font-size:20px;font-weight:900}
.level-card strong{display:block;font-size:14px;margin-bottom:4px}
.level-card small{display:block;font-size:11px;color:#acd8dd;line-height:1.2}
.level-status{margin-left:auto;font-size:17px;white-space:nowrap}
.map-note{text-align:center;color:#8dbcc8;font-size:11px;line-height:1.6;margin:17px auto 11px;max-width:300px}
.classic-link{text-align:center;margin:auto auto 0;text-decoration:none;color:#91ddd6;font-size:13px;padding:15px}
.game-screen{display:flex;flex-direction:column;min-height:calc(100svh - 102px)}
.game-topline{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:1px 0 11px}
.game-topline span{font-weight:750;font-size:14px;text-align:center}
.text-button{border:0;background:transparent;padding:10px 6px;color:#9ee6db;font-size:12px}
.objective{border:1px solid #8bf0dc54;border-radius:17px;background:#001f3070;padding:13px 15px;box-shadow:inset 0 1px #ffffff18}
.objective-top,.objective-bottom{display:flex;align-items:center;justify-content:space-between;gap:10px}
.objective-top{font-size:13px;font-weight:700}.objective-top span:last-child{font-variant-numeric:tabular-nums;color:#f9df9e}
.objective-bottom{font-size:11px;color:#c6e5e7}.objective-bottom b{color:white;font-size:13px}
.meter{height:7px;border-radius:20px;background:#ffffff20;margin:10px 0;overflow:hidden}
#goal-meter{display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,#63dccc,#fce6a3);transition:width .25s ease}
.play-field{display:flex;justify-content:center;align-items:center;flex:1;min-height:0;margin-top:16px}
.board-frame{border-radius:22px;padding:8px;width:100%;background:linear-gradient(135deg,#86e9d2aa,#0b516b 35%,#68c8cb 85%,#347389);border:1px solid #aaf9e677;box-shadow:0 12px 25px #00162777,0 2px 0 #ffffff33,inset 0 2px #e3fff555}
.game-board{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));aspect-ratio:1;gap:var(--g);width:100%;touch-action:none;background:#073145;border-radius:14px;padding:var(--g)}
.tile{position:relative;border:0;border-radius:7px;min-width:0;min-height:0;background:linear-gradient(140deg,#1e5971,#114057);box-shadow:inset 0 1px 3px #001f30b0}
.tile.hole{background:radial-gradient(circle,#082f45,#072537 70%);outline:1px dashed #5ba6ab35;box-shadow:none}
.tile.has-star:after{content:'★';color:#ffe690;text-shadow:0 0 6px #f8d978,0 0 12px #ff9c3a;position:absolute;inset:0;display:grid;place-items:center;font-size:clamp(16px,5vw,27px);z-index:2;pointer-events:none}
.tile .gem,.mini .gem,#touch-piece .gem{position:absolute;inset:0;border-radius:7px;background:linear-gradient(140deg,#d2ffdc,#64ca9d 42%,#269d84);box-shadow:inset 0 2px 2px #ffffff8f,inset -2px -2px 4px #04344376,0 1px 3px #001b32;border:1px solid #d6ffdf70}
.tile .gem.c1,.mini .gem.c1,#touch-piece .gem.c1{background:linear-gradient(140deg,#bdedff,#4ec4ed 40%,#1885c2)}
.tile .gem.c2,.mini .gem.c2,#touch-piece .gem.c2{background:linear-gradient(140deg,#fff2b9,#ffcc69 40%,#e6953b)}
.tile .gem.c3,.mini .gem.c3,#touch-piece .gem.c3{background:linear-gradient(140deg,#ffcece,#f18198 45%,#af597b)}
.tile.preview:before{content:'';position:absolute;inset:0;background:#d5fdd17d;border:2px solid #ddffd0;border-radius:7px;z-index:4}
.tile.invalid:before{content:'';position:absolute;inset:0;background:#fa746a66;border:2px solid #f48c8c;border-radius:7px;z-index:4}
.tile.to-clear{box-shadow:inset 0 0 6px #fff3a0,0 0 12px #d5efae}
.play-hint{text-align:center;color:#aed9d9;font-size:11px;line-height:1.4;margin:15px 3px 10px}
.piece-tray{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin-bottom:4px;touch-action:none}
.piece-slot{height:92px;display:grid;place-items:center;padding:8px;border-radius:17px;border:1px solid #86d9d15b;background:linear-gradient(135deg,#bde9e91f,#03516460);color:white;touch-action:none}
.piece-slot.selected{outline:3px solid #fbe5a4}
.piece-slot.used{opacity:.28}
.mini{position:relative;pointer-events:none}
.mini .gem{position:absolute;inset:auto;width:var(--s);height:var(--s);left:calc(var(--x)*(var(--s) + 3px));top:calc(var(--y)*(var(--s) + 3px))}
.skip-button{align-self:center;background:transparent;color:#90c9cf;border:0;font-size:11px;padding:12px}
#touch-piece{display:none;position:fixed;z-index:50;pointer-events:none;opacity:.92;filter:drop-shadow(0 8px 5px #001926)}
#touch-piece.dragging{display:block}
#touch-piece.invalid{opacity:.45}
.result-screen{min-height:calc(100svh - 100px);display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center}
.result-illustration{font-size:105px;filter:drop-shadow(0 12px 13px #001c2c80);margin-bottom:15px}
.result-screen h2{font-size:34px;line-height:1.05;margin:12px 0}
.result-stars{font-size:54px;letter-spacing:5px;color:#ffdc80;text-shadow:0 3px 14px #ecb05e45;margin:5px 0 10px}
.result-screen p{font-size:14px;line-height:1.6;color:#b3dadd;max-width:320px}
.result-buttons{width:min(100%,305px);display:grid;gap:12px;margin-top:25px}
.primary-button,.secondary-button{border-radius:15px;padding:15px 13px;font-size:15px;font-weight:800;border:1px solid #bef7df}
.primary-button{background:linear-gradient(135deg,#c1f6d7,#74dac1);color:#0b3d4a;box-shadow:0 4px 0 #248a7e}
.secondary-button{background:#ffffff1a;color:#eafff4;border-color:#95dccb66}
.notice{position:fixed;bottom:calc(21px + env(safe-area-inset-bottom));left:50%;transform:translate(-50%,20px);opacity:0;pointer-events:none;background:#e8fff0;color:#124d4d;padding:12px 17px;border-radius:15px;font-size:12px;font-weight:750;transition:opacity .2s,transform .2s;z-index:65;width:max-content;max-width:min(360px,90vw);text-align:center;box-shadow:0 5px 20px #00192460}
.notice.show{opacity:1;transform:translate(-50%,0)}
#help-dialog{background:#0e3b4d;color:#edfffa;border:1px solid #9deee191;border-radius:20px;width:min(350px,calc(100% - 35px));padding:0}
#help-dialog::backdrop{background:#001824ae}
.help-dialog-content{padding:24px}
.help-dialog-content h2{margin:0 0 12px}
.help-dialog-content p{font-size:13px;color:#c6e7e5;line-height:1.6}
.help-dialog-content .primary-button{width:100%;margin-top:8px}
@keyframes float{from{transform:translateX(-15px) rotate(-8deg)}to{transform:translateX(15px) rotate(-7deg)}}
@media(max-height:760px){.adventure-shell{padding-top:max(10px,env(safe-area-inset-top))}.adventure-header{margin-bottom:5px}.game-screen{min-height:calc(100svh - 85px)}.play-field{margin-top:8px}.board-frame{width:min(100%,calc(100svh - 360px));min-width:min(100%,310px)}.piece-slot{height:77px}.play-hint{margin:8px 0}.reef-scene{height:130px}.map-intro h2{font-size:24px}.map-intro p{font-size:12px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

.in-telegram .adventure-shell{min-height:var(--mini-height,100svh);padding-top:max(18px,env(safe-area-inset-top),var(--mini-safe-top,0px));padding-bottom:max(18px,env(safe-area-inset-bottom),var(--mini-safe-bottom,0px));padding-left:max(16px,var(--mini-safe-left,0px));padding-right:max(16px,var(--mini-safe-right,0px))}
.in-telegram.mini-compact .piece-slot{height:76px}

/* Reef chapter: distinct light, coral, twilight and abyss stages. */
html[data-scene="lagoon"] body{background:radial-gradient(ellipse at 20% 0%,#297f98 0%,#0f4f69 35%,#082b3b 82%)}
html[data-scene="coral"] body{background:radial-gradient(ellipse at 65% 5%,#246f91 0%,#104b72 36%,#082c44 85%)}
html[data-scene="twilight"] body{background:radial-gradient(ellipse at 10% 0%,#254d85 0%,#122d5c 46%,#081c39 90%)}
html[data-scene="wreck"] body{background:radial-gradient(ellipse at 80% 0%,#29486b 0%,#122e4a 47%,#07172d 95%)}
html[data-scene="abyss"] body,html[data-scene="boss"] body{background:radial-gradient(ellipse at 50% -10%,#24365d 0%,#101c3e 42%,#070b20 96%)}
html[data-scene="healed"] body{background:radial-gradient(ellipse at 35% 0%,#5baea4 0%,#1d6989 47%,#0c3b58 95%)}
.reef-scene{isolation:isolate;transition:background .4s}
html[data-scene="coral"] .reef-scene{background:radial-gradient(circle at 70% 0%,#6bd9e477,transparent 36%),linear-gradient(145deg,#3597a6,#125d86 53%,#08324c)}
html[data-scene="twilight"] .reef-scene{background:radial-gradient(circle at 15% 0%,#9eebd744,transparent 43%),linear-gradient(155deg,#286b92,#154369 44%,#0a264f)}
html[data-scene="wreck"] .reef-scene{background:radial-gradient(circle at 50% 0%,#62bbad55,transparent 46%),linear-gradient(155deg,#235775,#0f335b 60%,#0a203a)}
html[data-scene="abyss"] .reef-scene,html[data-scene="boss"] .reef-scene{background:radial-gradient(circle at 50% 10%,#5e678c88,transparent 43%),linear-gradient(155deg,#203759,#0f203f 62%,#060f26)}
html[data-scene="healed"] .reef-scene{background:radial-gradient(circle at 28% 0%,#bbffe2c7,transparent 45%),linear-gradient(155deg,#4fc5b8,#258b9c 55%,#106682)}
.reef-rock{position:absolute;bottom:-60px;width:180px;height:105px;border-radius:50%;transform:rotate(-15deg);background:radial-gradient(ellipse at 50% 18%,#91d4b8,#226985 65%,#07415c 90%);box-shadow:0 5px 17px #002b3f88;z-index:0}
.reef-rock.one{left:-44px}.reef-rock.two{right:-85px;transform:rotate(14deg);background:radial-gradient(ellipse at 50% 18%,#8ac3ab,#2c7a92 70%,#104763)}
.sea-glow{position:absolute;top:-70px;left:22%;width:90px;height:270px;transform:rotate(22deg);background:linear-gradient(90deg,transparent,#dbffff35,transparent);filter:blur(11px);opacity:.6;z-index:0}
.fish,.fish-two,.seaweed,.shell,.coral,.ship,.kraken-tease{z-index:2;position:absolute}
.fish{animation:reef-fish 8s ease-in-out infinite alternate}
.fish-two{left:48%;top:54%;right:auto;font-size:29px;opacity:.75;animation:reef-fish-small 11s ease-in-out infinite alternate}
.coral{filter:drop-shadow(0 7px 7px #082d4480)}
.seaweed{font-size:67px;left:40%;bottom:-30px;opacity:.65;transform:rotate(-12deg)}
.shell{filter:drop-shadow(0 7px 7px #062c4380)}
.ship,.kraken-tease{display:none}
.ship{font-size:95px;right:23%;top:25%;opacity:.33;transform:rotate(-17deg);filter:grayscale(.8) drop-shadow(0 8px 12px #011831)}
.kraken-tease{font-size:88px;right:10%;top:23%;filter:drop-shadow(0 0 14px #7f62ca7c);opacity:.67}
html[data-scene="wreck"] .ship{display:block}
html[data-scene="abyss"] .kraken-tease,html[data-scene="boss"] .kraken-tease{display:block}
html[data-scene="abyss"] .fish-two,html[data-scene="boss"] .fish-two{opacity:.15}
html[data-scene="healed"] .fish-two{opacity:1}
html[data-scene="healed"] .coral{filter:drop-shadow(0 0 15px #d3ffe8)}
@keyframes reef-fish{from{transform:translate(0,0)}to{transform:translate(-35px,8px)}}
@keyframes reef-fish-small{from{transform:translate(-16px,0)}to{transform:translate(15px,-17px)}}
.level-card.boss-level{border-color:#c0a0ef9c;background:linear-gradient(110deg,#4b357970,#12243e65);box-shadow:inset 0 1px #fbd3ff28,0 0 25px #694bc929}
.boss-level .level-badge{background:linear-gradient(145deg,#9a72d0,#422e78);border-color:#e4befa}
.boss-level strong{color:#f4e7ff}
.cell-decoration{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none;font-size:clamp(15px,5.4vw,28px);line-height:1;z-index:3;filter:drop-shadow(0 2px 2px #002c42ab)}
.tile .cell-decoration.pearl{filter:drop-shadow(0 0 5px #fff9d5a0)}
.tile .cell-decoration.coral{font-size:clamp(19px,6.2vw,33px)}
.tile .cell-decoration.jelly{filter:drop-shadow(0 0 6px #f0b8ffac);animation:jelly-bob 2.8s ease-in-out infinite}
.tile .cell-decoration.tentacle{font-size:clamp(23px,6.8vw,38px);filter:drop-shadow(0 0 8px #a873e8);animation:tentacle-bob 1.7s ease-in-out infinite alternate}
.tile:has(.coral){background:linear-gradient(145deg,#9d645c,#643c60)}
.tile:has(.jelly){background:linear-gradient(145deg,#784f96,#405b8b)}
.tile:has(.tentacle){background:linear-gradient(145deg,#513e81,#291d56);box-shadow:inset 0 0 12px #e6baff66}
@keyframes jelly-bob{50%{transform:translateY(-2px)}}
@keyframes tentacle-bob{to{transform:rotate(8deg) scale(1.05)}}
.board-frame{isolation:isolate;position:relative;overflow:hidden}
.board-ambience{position:absolute;inset:0;pointer-events:none;z-index:0;overflow:hidden}
.board-ambience span{position:absolute;color:#f1ffe0;font-size:26px;opacity:.24;animation:ambience-glow 3.2s ease-in-out infinite alternate}
.board-ambience span:nth-child(1){top:5%;left:13%}.board-ambience span:nth-child(2){bottom:6%;right:8%;animation-delay:-1.5s}.board-ambience span:nth-child(3){top:45%;right:2%;animation-delay:-2.2s}
.game-board{position:relative;z-index:1}
@keyframes ambience-glow{to{opacity:.5;transform:translateY(-6px)}}
html[data-scene="boss"] .board-frame{border-color:#c9a0fb;box-shadow:0 12px 35px #05041ca8,0 0 20px #b968ef66,inset 0 2px #f0c5ff55;background:linear-gradient(145deg,#9870d3,#38235c 43%,#5e4c9c 88%)}
html[data-scene="boss"] .board-ambience{background:radial-gradient(circle at 50% 30%,#8652c078,transparent 72%)}
html[data-scene="boss"] .objective{border-color:#b792db}
.boss-health{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:11px;padding-top:9px;border-top:1px solid #f2d5ff33;font-size:11px;letter-spacing:1px;color:#edc9ff}
.boss-health strong{font-size:17px;letter-spacing:3px;color:#fb829c;text-shadow:0 0 6px #ea72a75a}
.result-illustration{max-width:100%;font-size:clamp(55px,12vw,102px)}
.game-screen .objective-top{font-size:12px}
@media(max-height:740px){.adventure-header h1{font-size:21px}.objective{padding:10px 13px}.boss-health{margin-top:7px;padding-top:6px}.play-hint{font-size:10px}}
@media(prefers-reduced-motion:reduce){.fish,.fish-two,.tile .cell-decoration.jelly,.tile .cell-decoration.tentacle,.board-ambience span{animation:none}}

.boss-showcase{display:flex;align-items:center;gap:12px;min-height:60px;margin:9px 2px -1px;padding:7px 13px;border-radius:16px;background:radial-gradient(circle at 15% 50%,#7d46b970,#32224f70 62%,#150f3685);border:1px solid #b88dec89;box-shadow:inset 0 1px #e8ccff55,0 0 18px #8153b837}
.boss-showcase .boss-face{font-size:44px;line-height:1;display:inline-block;filter:drop-shadow(0 3px 12px #c789ee88);animation:kraken-sway 2.5s ease-in-out infinite alternate}
.boss-showcase strong{display:block;font-size:12px;color:#f1e7ff}
.boss-showcase small{display:block;font-size:10px;line-height:1.4;color:#d0b9e4;margin-top:4px}
.boss-spark{margin-left:auto;font-size:23px;opacity:.5}
html[data-boss-phase="1"] .boss-showcase{background:radial-gradient(circle at 20% 30%,#a14c9370,#32224f70 62%,#150f3685)}
html[data-boss-phase="2"] .boss-showcase{border-color:#ea86a4;box-shadow:0 0 25px #cb477e50,inset 0 1px #f7bdd955}
.boss-showcase.hit{animation:boss-impact .38s ease-out}
@keyframes boss-impact{0%,100%{transform:translateX(0)}25%{transform:translateX(3px)}60%{transform:translateX(-3px)}}
@keyframes kraken-sway{to{transform:rotate(7deg) scale(1.035)}}
@media(max-height:740px){.boss-showcase{min-height:49px;margin:5px 2px 0;padding:5px 9px}.boss-showcase .boss-face{font-size:33px}.boss-showcase small{font-size:9px}.boss-showcase strong{font-size:11px}}
@media(prefers-reduced-motion:reduce){.boss-showcase .boss-face,.boss-showcase.hit{animation:none}}


/* Illustration pass v3: layered handcrafted vector art instead of emoji scenery. */
html{--world-art:url('art/scene-lagoon.svg');--scene-accent:#d4f0cd;--scene-glow:#72dace}
html[data-scene="lagoon"]{--world-art:url('art/scene-lagoon.svg');--scene-accent:#e3f7bf;--scene-glow:#75e8d8}
html[data-scene="coral"]{--world-art:url('art/scene-coral.svg');--scene-accent:#ffccb3;--scene-glow:#77d8e0}
html[data-scene="twilight"]{--world-art:url('art/scene-twilight.svg');--scene-accent:#c4b5fa;--scene-glow:#7b9ddb}
html[data-scene="wreck"]{--world-art:url('art/scene-wreck.svg');--scene-accent:#dfc89d;--scene-glow:#83c8d1}
html[data-scene="abyss"]{--world-art:url('art/scene-abyss.svg');--scene-accent:#c6b6f0;--scene-glow:#8580ce}
html[data-scene="boss"]{--world-art:url('art/scene-boss.svg');--scene-accent:#e5b0f5;--scene-glow:#b679dc}
html[data-scene="healed"]{--world-art:url('art/scene-healed.svg');--scene-accent:#f9efb9;--scene-glow:#84f6cf}
body{isolation:isolate;background:#082b3b!important}
body::before{content:"";position:fixed;inset:-2px;z-index:-1;pointer-events:none;background:var(--world-art) center center / cover no-repeat;opacity:1;transition:background-image .15s}
body::after{content:"";position:fixed;inset:0;z-index:-1;pointer-events:none;background:linear-gradient(180deg,#051e3c2e 0%,#0b2a3f32 47%,#03172fb0 100%)}
.adventure-shell{z-index:1}
.adventure-header{margin-bottom:15px;gap:9px}
.adventure-header h1{font-size:clamp(20px,5vw,25px);text-shadow:0 2px 12px #00172f98}
.adventure-header .eyebrow{color:#b8f0e4;text-shadow:0 1px 8px #092c49}
.audio-button{margin-left:auto}
.audio-button[aria-pressed="false"]{opacity:.65}
.icon-button{flex:0 0 42px;height:42px;width:42px;margin-left:0;font-size:20px}
.back,.icon-button{background:linear-gradient(145deg,#d8fff92e,#81bbd51e);border:1px solid #cef9de75;box-shadow:0 4px 14px #03203756,inset 0 1px #ffffff50;backdrop-filter:blur(7px)}
.map-screen{padding-bottom:8px}
.reef-scene{height:205px;background:#12475d url('art/reef-map.svg') center center/cover no-repeat!important;box-shadow:0 15px 45px #001e32a0,inset 0 1px 1px #fff8;border:2px solid #cbf5cfaa;border-radius:26px;overflow:hidden}
.reef-scene::after{display:none!important}
.reef-sheen{position:absolute;inset:-25% auto -30% -35%;width:34%;background:linear-gradient(90deg,transparent,#fff7 49%,transparent);transform:rotate(29deg);opacity:.45;animation:reef-shine 11s ease-in-out infinite;pointer-events:none}
.reef-label{position:absolute;left:14px;top:13px;padding:7px 11px;border:1px solid #ffffff44;border-radius:20px;background:#062c4480;backdrop-filter:blur(6px);font-size:8px;font-weight:850;letter-spacing:1.45px;color:#ebfff9;box-shadow:0 2px 12px #031d3466}
@keyframes reef-shine{0%,37%,100%{transform:translateX(-220%) rotate(29deg)}55%{transform:translateX(760%) rotate(29deg)}}
.map-intro{padding:3px 5px 0}
.map-intro h2{font-size:clamp(26px,7vw,32px);color:#fff9e3;text-shadow:0 3px 14px #062e4470}
.chapter{color:#e5f6d8;text-shadow:0 2px 8px #092d47}
.map-intro p{color:#e6f9f1;text-shadow:0 1px 5px #082b48d9}
.chapter-progress{background:linear-gradient(145deg,#185a6ac4,#123c57d0);border:1px solid #d5f6cb70;backdrop-filter:blur(9px);box-shadow:0 8px 20px #07263e45,inset 0 1px #ffffff22}
.chapter-progress strong{color:#ffedb5;text-shadow:0 0 10px #e6d5925c}
.chapter-progress span{color:#d5f1ee}
.level-card{position:relative;overflow:hidden;min-height:78px;padding:11px;border:1px solid #bbefdd65;background:linear-gradient(110deg,#123f55eb,#133d59dc);box-shadow:0 7px 20px #00182b55,inset 0 1px #ffffff30;backdrop-filter:blur(8px);border-radius:18px}
.level-card::after{content:"";position:absolute;inset:0;pointer-events:none;border-radius:inherit;background:linear-gradient(115deg,#fff0 72%,#b5e6de1a)}
.level-card:not(.locked):active{transform:scale(.987)}
.level-card:hover:not(:disabled){border-color:#ffe6b6a0;background-color:#ffffff08}
.level-card.locked{opacity:.72;filter:saturate(.65)}
.level-badge{position:relative;isolation:isolate;width:56px;height:56px;border-radius:13px;border:1px solid #e2ffe7a8;background-image:linear-gradient(155deg,#042d5470,#041a3180),var(--level-art);background-position:center;background-size:cover;color:#fff7db;font-size:23px;text-shadow:0 2px 4px #062e45;box-shadow:0 5px 11px #00192d91,inset 0 1px #ffffff70}
.level-card strong{font-size:14px;font-weight:850;color:#fff9df}
.level-card small{color:#d4eee6;font-size:11px}
.level-status{color:#ffe59c;text-shadow:0 1px 10px #ae944760}
.boss-level .level-badge{border-color:#e9abf7}
.map-note{color:#d1e5dd;text-shadow:0 1px 4px #021629}
.classic-link{color:#d9f5e8;text-shadow:0 1px 4px #021629}
.game-screen{position:relative;isolation:isolate}
.game-screen::before{content:"";position:absolute;inset:8px -15px 0;z-index:-1;pointer-events:none;background:linear-gradient(180deg,#0d35473d 0%,#061c3460 62%,#05192d45 100%);border-radius:24px}
.game-topline{padding:1px 5px}
.game-topline span{color:#fff5d9;text-shadow:0 2px 6px #01263e}
.text-button{color:#d4f8f0;text-shadow:0 1px 6px #062a3e}
.objective{background:linear-gradient(135deg,#10485ee5,#092e49ec);border:1px solid #cbf5dd99;box-shadow:0 9px 22px #031e307a,inset 0 1px #fff5;backdrop-filter:blur(8px);border-radius:20px}
.objective-top{color:#f8ffee}
.objective-bottom{color:#cbebdf}
.objective-bottom b{color:#fff2c7}
.meter{height:8px;background:#072b439e}
#goal-meter{background:linear-gradient(90deg,#7cedd2,#ffde98);box-shadow:0 0 10px #fff3be70}
.play-field{position:relative}
.board-frame{position:relative;padding:9px;border:1px solid #d2ffefbc;background:linear-gradient(145deg,#cefff2e8,#549cafa1 38%,#2e6378c7 73%,#e8ffe6ad 100%);box-shadow:0 14px 40px #00172aa8,0 0 22px #9feee21f,inset 0 2px #fff6;border-radius:25px}
.board-frame::before{content:"";position:absolute;inset:-4px;border-radius:28px;pointer-events:none;border:1px solid #d6f3e858;box-shadow:0 0 18px #cffcf42e}
.game-board{background:linear-gradient(140deg,#052944d9,#0a4260c5);box-shadow:inset 0 0 22px #011d33cf,0 1px 1px #ffffff41;border:1px solid #d7faf05b}
.tile{background:linear-gradient(142deg,#518ca09e,#1a5876b7 55%,#0b3957da);border:1px solid #b5e3df25;box-shadow:inset 1px 2px 3px #b4eeeb13,inset -2px -2px 3px #001e37a8;border-radius:8px}
.tile.hole{background:linear-gradient(145deg,#07233acc,#050f29ec);border:1px dashed #70b5bf45;box-shadow:inset 0 0 9px #000c1eb4}
.tile .gem,.mini .gem,#touch-piece .gem{border-radius:9px;border:1px solid #effff4a3;box-shadow:inset 0 3px 3px #fff8,inset -3px -3px 5px #07547799,0 3px 5px #011b34bb;filter:saturate(1.11)}
.tile .gem::before,.mini .gem::before,#touch-piece .gem::before{content:"";position:absolute;inset:12% 18% 53% 13%;border-radius:60% 70% 30% 40%;background:#ffffff9e;filter:blur(1px);transform:rotate(-18deg)}
.tile.has-star::after{content:"";inset:5%;background:url('art/star.svg') center/contain no-repeat;filter:drop-shadow(0 0 4px #fff5b4);z-index:4}
.cell-decoration{inset:7%;width:86%;height:86%;display:block;font-size:0!important;line-height:0;background:transparent center/contain no-repeat;filter:drop-shadow(0 2px 3px #000b2055)!important}
.cell-decoration.pearl{background-image:url('art/pearl.svg')}
.cell-decoration.coral{background-image:url('art/coral.svg')}
.cell-decoration.jelly{background-image:url('art/jelly.svg')}
.cell-decoration.tentacle{background-image:url('art/tentacle.svg')}
.tile .cell-decoration.jelly{animation:jelly-bob 2.8s ease-in-out infinite}
.tile .cell-decoration.tentacle{animation:tentacle-bob 1.7s ease-in-out infinite alternate}
.piece-slot{border:1px solid #bfeee880;background:linear-gradient(145deg,#2f7488b0,#0e415bcc);box-shadow:inset 0 2px 1px #ffffff2b,0 5px 15px #001b3360;backdrop-filter:blur(5px)}
.piece-slot.selected{outline:3px solid #ffebbc;box-shadow:0 0 17px #ffeeaa66}
.piece-slot.used{opacity:.48;background:#12374c99}
.play-hint{color:#d3eddf;text-shadow:0 1px 5px #041b2c;max-width:370px;align-self:center}
.boss-showcase{background:linear-gradient(110deg,#43265adf,#151f45da);border:1px solid #e4b9ffb8;box-shadow:0 5px 20px #05021c9a,inset 0 1px #ffffff52}
.boss-showcase .boss-face{width:47px;height:47px;flex:none;display:block;background:url('art/kraken.svg') center/contain no-repeat;filter:drop-shadow(0 0 8px #d6a5fb7e)}
.boss-showcase .boss-spark{color:#ead5fa}
.boss-health>span{display:inline-flex;align-items:center;gap:5px}
.boss-health>span::before{content:"";width:19px;height:19px;display:inline-block;background:url('art/kraken.svg') center/contain no-repeat}
.result-screen{position:relative;isolation:isolate}
.result-screen::before{content:"";position:absolute;inset:0 -14px;z-index:-1;pointer-events:none;background:radial-gradient(ellipse at 50% 35%,#4ab3ad65,transparent 68%)}
.result-illustration{width:175px;height:165px;margin-bottom:12px;background:url('art/pearl.svg') center/contain no-repeat;filter:drop-shadow(0 9px 19px #06162b8a)}
.result-illustration.boss-victory{width:300px;height:190px;border-radius:25px;background:url('art/reef-map.svg') center/cover no-repeat;border:2px solid #c3f6b8a8;box-shadow:0 10px 32px #021726ad}
.result-screen h2{color:#fff7da;text-shadow:0 3px 15px #041727}
.result-screen p{color:#e2f7e8;text-shadow:0 1px 8px #021a2c}
.result-stars{color:#ffe9a4;text-shadow:0 0 20px #fff7bb75,0 3px 8px #082f42}
.primary-button{background:linear-gradient(145deg,#fdf3c7,#6ce6c1);border:1px solid #eaffdd;color:#0b3e4b;box-shadow:0 4px 0 #337f80,0 6px 14px #001b2f78}
.secondary-button{background:linear-gradient(145deg,#0b476cb0,#0a2b52c9);border-color:#d5f7e4a3;color:#e6fff1}
.notice{border:1px solid #daffeea8;background:linear-gradient(140deg,#faffef,#c5f9e5);box-shadow:0 9px 26px #001b32a8}
@media(max-height:740px){.reef-scene{height:154px}.level-card{min-height:71px}.board-frame{padding:7px}.game-topline{margin-bottom:6px}.game-screen::before{inset:0 -13px}.play-hint{margin:7px 0 8px}}
@media(prefers-reduced-motion:reduce){.reef-sheen{animation:none}}


/* Lightweight feedback: animated border only, never flashes the playing cells. */
.game-board.line-flash{animation:sea-line-flash .44s ease-out}
@keyframes sea-line-flash{0%{box-shadow:inset 0 0 0 #fff0,0 0 0 #fff0}28%{box-shadow:inset 0 0 20px #b5ffe7c7,0 0 22px #c3fff2a3}100%{box-shadow:inset 0 0 22px #011d33cf,0 1px 1px #ffffff41}}
.board-frame{--board-decoration:url('art/pearl.svg');overflow:visible}
html[data-scene="coral"] .board-frame{--board-decoration:url('art/coral.svg')}
html[data-scene="twilight"] .board-frame{--board-decoration:url('art/jelly.svg')}
html[data-scene="wreck"] .board-frame{--board-decoration:url('art/pearl.svg')}
html[data-scene="abyss"] .board-frame{--board-decoration:url('art/tentacle.svg')}
html[data-scene="boss"] .board-frame{--board-decoration:url('art/kraken.svg')}
.board-frame::after{content:"";position:absolute;right:-19px;bottom:-22px;width:60px;height:65px;background:var(--board-decoration) center/contain no-repeat;filter:drop-shadow(0 6px 9px #001b31ab);pointer-events:none;z-index:4;transform:rotate(12deg)}
html[data-scene="boss"] .board-frame::after{width:82px;height:82px;right:-24px;bottom:-27px}
@media(max-width:370px){.board-frame::after{width:45px;height:49px;right:-11px;bottom:-16px}}
@media(prefers-reduced-motion:reduce){.game-board.line-flash{animation:none}}

@media(max-width:390px){
  .adventure-header{gap:6px}
  .adventure-header h1{font-size:19px;letter-spacing:-.7px}
  .adventure-header .eyebrow{font-size:8px;letter-spacing:1px}
  .adventure-header .back,.adventure-header .icon-button{flex:0 0 37px;width:37px;height:37px}
  .adventure-shell{padding-left:13px;padding-right:13px}
  .reef-scene{height:170px}
}
@media(max-width:350px){
  .adventure-header h1{font-size:17px}
  .adventure-header .eyebrow{font-size:7px;letter-spacing:.7px}
  .adventure-header .back,.adventure-header .icon-button{flex:0 0 34px;width:34px;height:34px}
  .level-card{padding:8px}.level-badge{width:48px;height:48px}
  .map-intro h2{font-size:25px}
}


/* Sprint 4 — calm, living underwater environment (no layout blocking). */
.marine-overlay,.burst-layer{position:fixed;inset:0;pointer-events:none;overflow:hidden}
.marine-overlay{z-index:0;isolation:isolate}
.burst-layer{z-index:35}
.caustic-light{position:absolute;inset:-15% -35%;background:
  repeating-linear-gradient(110deg,transparent 0 48px,#c8fff01a 50px 82px,transparent 84px 170px),
  repeating-linear-gradient(64deg,transparent 0 84px,#cafff00e 87px 107px,transparent 109px 197px);
  opacity:.4;filter:blur(15px);mix-blend-mode:screen;
  animation:undersea-caustics 23s ease-in-out infinite alternate}
.ambient-bubbles{position:absolute;inset:0}
.ambient-bubble{position:absolute;left:var(--left);bottom:-30px;
  width:var(--size);height:var(--size);border:1px solid #c5ffff98;
  border-radius:50%;background:radial-gradient(circle at 32% 25%,#ffffff9c 0 12%,#a1ffff20 32%,transparent 75%);
  box-shadow:inset 1px 1px 3px #deffff82,0 0 8px #72d3e633;opacity:0;
  animation:air-rise var(--duration) linear var(--delay) infinite}
@keyframes undersea-caustics{
  from{transform:translate3d(-4%,0,0) rotate(-4deg)}
  to{transform:translate3d(4%,3%,0) rotate(4deg)}
}
@keyframes air-rise{
  0%{transform:translate3d(0,0,0) scale(.6);opacity:0}
  8%{opacity:.36}
  30%{transform:translate3d(var(--drift),-32vh,0) scale(1);opacity:.5}
  80%{opacity:.23}
  100%{transform:translate3d(0,-120vh,0) scale(1.2);opacity:0}
}
.burst-bubble{position:fixed;display:block;width:9px;height:9px;border:1.5px solid #f2fffcbb;
  border-radius:50%;background:radial-gradient(circle at 35% 25%,#fff9,#a5ffff44 60%,transparent);
  box-shadow:0 0 8px #c1fff4a1;transform:translate(-50%,-50%);
  animation:burst-rise 820ms ease-out var(--delay,0ms) both}
.burst-bubble.boss{width:12px;height:12px;border-color:#eec9ffb0;box-shadow:0 0 11px #d6a8ffb0}
@keyframes burst-rise{
  0%{opacity:0;transform:translate(-50%,-50%) scale(.4)}
  20%{opacity:.85}
  100%{opacity:0;transform:translate(calc(-50% + var(--dx)),calc(-50% + var(--dy))) scale(1.4)}
}
/* Make touch-friendly boss placement unambiguous. A hint never applies a move. */
.play-guidance{display:flex;align-items:center;justify-content:center;gap:7px;margin:8px 0 7px;min-height:39px}
.play-guidance .play-hint{flex:1;min-width:0;font-size:10.5px;line-height:1.35;margin:0 4px 0 0;text-align:left}
.hint-action{flex:none;min-height:36px;max-width:140px;border:1px solid #fff2beab;border-radius:12px;
  padding:7px 11px;color:#15394c;font-size:11px;font-weight:800;background:linear-gradient(145deg,#f8eec8,#c6ead4);
  box-shadow:0 4px 12px #031f3891, inset 0 1px #fff9}
.hint-action:active{transform:translateY(1px)}
.tile.hint-cell{outline:3px solid #fff0a5;outline-offset:-3px;z-index:3;box-shadow:inset 0 0 14px #ffe49cbd,0 0 11px #fff0b099;
  animation:hint-glow 900ms ease-in-out infinite alternate}
.tile.hint-target{box-shadow:inset 0 0 13px #9df4e9bd,0 0 9px #a0fbe39e}
@keyframes hint-glow{to{box-shadow:inset 0 0 6px #fff4c9bd,0 0 15px #fff9bcdb}}
/* Boss is visible BEHIND the actual game grid; never intercepts pointer events. */
.kraken-specter{position:absolute;top:-70px;right:-7px;width:132px;height:130px;z-index:0;
  pointer-events:none;opacity:.82;filter:drop-shadow(0 8px 16px #120c39b0)}
.kraken-figure{position:absolute;inset:0;background:url('art/kraken.svg') center/contain no-repeat;transform-origin:50% 80%;
  animation:kraken-breathe 3.8s ease-in-out infinite}
.kraken-glare{position:absolute;top:42%;left:30%;width:42%;height:14%;
  background:radial-gradient(ellipse,#dfb1ff6b,transparent 72%);filter:blur(9px);
  animation:kraken-eyes 3.4s ease-in-out infinite alternate}
.squid-shadow{position:absolute;inset:auto 4% -7% 12%;height:17px;border-radius:50%;background:#06051e99;
  filter:blur(9px);animation:squid-shadow 3.8s ease-in-out infinite}
@keyframes kraken-breathe{0%,100%{transform:translateY(4px) rotate(-2deg) scale(.98)}
  50%{transform:translateY(-6px) rotate(3deg) scale(1.04)}}
@keyframes kraken-eyes{to{opacity:.45;filter:blur(12px)}}
@keyframes squid-shadow{50%{transform:scale(.8);opacity:.4}}
.game-screen.boss-mode .play-field{isolation:isolate}
.game-screen.boss-mode .board-frame{position:relative;z-index:1}
.game-screen.boss-mode .boss-showcase{max-height:58px}
.game-screen.boss-mode .play-guidance{margin:7px 0 6px}
.game-screen.boss-hit .kraken-figure,.game-screen.boss-defeated .kraken-figure{
  animation:kraken-hit-shake .72s cubic-bezier(.32,.1,.35,1) both}
.game-screen.boss-hit .board-frame{animation:board-thump .55s ease-out both}
.game-screen.boss-defeated .kraken-specter{animation:kraken-vanish 1s ease-out both}
.game-screen.boss-defeated .board-frame{box-shadow:0 0 40px #efffd9b0,inset 0 2px 9px #fff8}
@keyframes kraken-hit-shake{
  0%,100%{transform:translate(0,0) rotate(0) scale(1)}
  15%,42%,64%{transform:translate(-6px,-4px) rotate(-8deg) scale(1.07)}
  29%,53%{transform:translate(7px,3px) rotate(7deg) scale(1.03)}
}
@keyframes board-thump{0%,100%{transform:translateX(0)}22%{transform:translateX(-3px)}48%{transform:translateX(3px)}}
@keyframes kraken-vanish{
  0%{transform:scale(1);opacity:.85}
  40%{transform:scale(1.12) rotate(9deg);opacity:.7}
  100%{transform:translateY(130px) scale(.65) rotate(-15deg);opacity:0}
}
.boss-impact{position:absolute;inset:0;pointer-events:none}
.game-screen.boss-mode .boss-showcase .boss-face{animation:kraken-breathe 3.8s ease-in-out infinite}
@media(max-height:820px){
  .game-screen.boss-mode .board-frame{width:min(100%,max(276px,calc(100svh - 430px)));min-width:0}
  .game-screen.boss-mode .boss-showcase{min-height:48px;margin:6px 2px 0;padding:5px 9px}
  .game-screen.boss-mode .boss-showcase .boss-face{height:36px;width:36px}
  .game-screen.boss-mode .play-field{margin-top:5px}
  .game-screen.boss-mode .piece-slot{height:69px}
  .game-screen.boss-mode .play-guidance{margin:4px 0 3px;min-height:32px}
}
@media(max-width:360px){
  .kraken-specter{width:105px;height:108px;top:-46px;right:0}
  .hint-action{padding:6px 8px;font-size:10px}
  .play-guidance .play-hint{font-size:9.5px}
}
@media(prefers-reduced-motion:reduce){
  .caustic-light,.ambient-bubble,.burst-bubble,.tile.hint-cell,.kraken-figure,.kraken-glare,
  .squid-shadow,.game-screen.boss-hit .kraken-figure,.game-screen.boss-defeated .kraken-figure,
  .game-screen.boss-hit .board-frame,.game-screen.boss-defeated .kraken-specter,
  .game-screen.boss-mode .boss-showcase .boss-face{animation:none!important}
  .ambient-bubble{opacity:.15}
}

/* Regression fix: the old 82px Kraken decoration covered the winning
   bottom-right board cell (7,7), even though it did not receive pointer events. */
.game-screen.boss-mode .board-frame::after{display:none!important}


/* Reef identity v5: four sea-carved block materials, same collision geometry. */
.tile .gem,.mini .gem,#touch-piece .gem{
  position:absolute;isolation:isolate;
  border-radius:9px;border:1px solid #ebfff7ac;
  box-shadow:inset 0 2px 2px #ffffffa8,inset -2px -3px 7px #092f6591,
    0 2px 5px #001a36a6,0 0 7px #8ae0e838;
}
.tile .gem::after,.mini .gem::after,#touch-piece .gem::after{
  content:"";position:absolute;inset:11%;
  background:var(--marine-glyph) center/contain no-repeat;
  opacity:.60;mix-blend-mode:screen;
  filter:drop-shadow(0 1px 1px #02465c7a);
  pointer-events:none;
}
.tile .gem.c0,.mini .gem.c0,#touch-piece .gem.c0{
  --marine-glyph:url('art/glyph-current.svg');
  background:radial-gradient(circle at 20% 12%,#f7ffe5b8,transparent 39%),
    linear-gradient(145deg,#a3f8d8 0%,#34beaf 42%,#118d9e 82%,#0a536e 100%);
}
.tile .gem.c1,.mini .gem.c1,#touch-piece .gem.c1{
  --marine-glyph:url('art/glyph-bubbles.svg');
  background:radial-gradient(circle at 26% 16%,#ffffff99,transparent 38%),
    linear-gradient(145deg,#b6f8ff 0%,#58cbe7 42%,#2981c2 78%,#1d3f8e 100%);
}
.tile .gem.c2,.mini .gem.c2,#touch-piece .gem.c2{
  --marine-glyph:url('art/glyph-shell.svg');
  background:radial-gradient(circle at 21% 15%,#ffffdda6,transparent 36%),
    linear-gradient(145deg,#fff3bb 0%,#f3d28e 39%,#efaa68 78%,#aa636d 100%);
}
.tile .gem.c3,.mini .gem.c3,#touch-piece .gem.c3{
  --marine-glyph:url('art/glyph-jelly.svg');
  background:radial-gradient(circle at 24% 17%,#ffeaf29f,transparent 40%),
    linear-gradient(145deg,#f6d5ff 0%,#c18aef 43%,#815ac6 80%,#544082 100%);
}
.mini .gem{border-radius:7px;box-shadow:inset 0 2px #fff9,inset -1px -3px 6px #002e5b80,0 2px 4px #00172c80}
.mini .gem::after{opacity:.74;inset:12%}
.piece-slot{position:relative;overflow:hidden;
  background:linear-gradient(145deg,#447e97b5,#0c3d63d9 79%);
  border:1px solid #c7efdc9c;box-shadow:0 5px 17px #02162e80,inset 0 1px 3px #ffffdb47;
}
.piece-slot::before{content:"";position:absolute;inset:-50%;pointer-events:none;
  background:radial-gradient(ellipse at 32% 27%,#b6f6ff40,transparent 39%),
   radial-gradient(circle at 76% 73%,#efffec1e,transparent 25%);
}
.piece-slot .mini{filter:drop-shadow(0 2px 7px #0c1b5f77)}
html[data-scene="twilight"] .piece-slot,html[data-scene="boss"] .piece-slot{
  border-color:#dfc6f6bd;background:linear-gradient(145deg,#465d9dc0,#181c52da)}
/* The visible side limbs are 1:1 with the three board targets.
   Keep overlays outside the interactive tiles as much as possible. */
.boss-limb-stage{position:absolute;inset:0;z-index:3;pointer-events:none;overflow:visible}
.boss-limb{display:block;position:absolute;width:69px;height:170px;
  background:url('art/kraken-arm.svg') center/contain no-repeat;
  pointer-events:none;opacity:.93;filter:drop-shadow(0 8px 11px #080b3485);
  transform-origin:50% 85%;animation:outer-limb-sway 3.8s ease-in-out infinite alternate;
}
.boss-limb-left{top:-30px;left:-31px;--rest:rotate(-27deg);--tuck:translate(-71px,108px) rotate(-38deg)}
.boss-limb-right{top:21%;right:-30px;--rest:scaleX(-1) rotate(-13deg);--tuck:translate(76px,117px) rotate(36deg)}
.boss-limb-low{bottom:-34px;left:-37px;--rest:rotate(39deg);--tuck:translate(-62px,140px) rotate(48deg)}
@keyframes outer-limb-sway{
  from{transform:var(--rest) translateY(2px) scale(.96)}
  to{transform:var(--rest) translateY(-7px) scale(1.04)}
}
.boss-limb.is-gone{opacity:0!important;visibility:hidden;animation:none!important}
.boss-limb.is-retracting{
  animation:tentacle-strike-and-retreat 1.08s cubic-bezier(.27,.06,.62,1) both!important;
}
@keyframes tentacle-strike-and-retreat{
  0%{transform:var(--rest) translate(0,0) scale(1);opacity:1}
  14%{transform:var(--rest) translate(-8px,-13px) rotate(-9deg) scale(1.11);opacity:1;
    filter:drop-shadow(0 0 17px #ffb9f5c0)}
  30%{transform:var(--rest) translate(8px,3px) rotate(8deg) scale(1.02);opacity:1}
  48%{transform:var(--rest) translate(0,0) scale(.96);opacity:.91}
  100%{transform:var(--rest) var(--tuck) scale(.48);opacity:0;
    filter:blur(3px) drop-shadow(0 3px 6px #7943b99b)}
}
.boss-limb-counter{display:block;margin-top:3px;color:#ffd2ef;font-size:10px;font-weight:750}
.game-screen.boss-mode .kraken-specter{width:175px;height:150px;right:-4px;top:-85px;opacity:.9;
  filter:drop-shadow(0 0 20px #a14dcaa6)}
.game-screen.boss-mode .boss-showcase{box-shadow:0 5px 18px #16083e88,inset 0 1px #fff5;
  background:linear-gradient(115deg,#40306cda,#192448d8 64%,#533473dd)}
.game-screen.boss-mode .board-frame::after{display:none!important}
@media(max-width:390px){
  .boss-limb{width:58px;height:138px}
  .boss-limb-left{left:-26px;top:-22px}
  .boss-limb-right{right:-27px}
  .boss-limb-low{left:-28px;bottom:-29px}
  .game-screen.boss-mode .kraken-specter{width:137px;height:130px;top:-63px}
}
@media(max-height:760px){
  .boss-limb{height:130px;width:55px}
  .boss-limb-left{top:-14px}.boss-limb-low{bottom:-20px}
  .game-screen.boss-mode .kraken-specter{width:120px;height:116px;top:-40px}
}
/* At low-motion settings the three remaining tentacles still visibly vanish,
   but without shaking or travel. */
@media(prefers-reduced-motion:reduce){
  .boss-limb{animation:none!important;transform:var(--rest)}
  .boss-limb.is-retracting{animation:none!important;opacity:0!important}
}


/* Distinct underwater waypoints for the full chapter; adjust the palette without
   changing the layout, grid geometry or difficulty. */
.level-atmosphere{font-size:9px;font-weight:850;line-height:1.5;text-transform:uppercase;
  letter-spacing:1.7px;color:#b8f7db;margin-bottom:7px;text-shadow:0 1px 7px #071a38}
html[data-level="1"] .objective{border-color:#a5f9d8}
html[data-level="2"] .objective{border-color:#fee49cd1}
html[data-level="3"] .objective{border-color:#b6d9f7c4}
html[data-level="4"] .objective{border-color:#f7d7ebc4}
html[data-level="5"] .objective{border-color:#ffbdabc4}
html[data-level="6"] .objective{border-color:#c6b4fec4}
html[data-level="7"] .objective{border-color:#abccf6c4}
html[data-level="8"] .objective{border-color:#e9c59dc4}
html[data-level="9"] .objective{border-color:#a898f2c4}
html[data-level="10"] .objective{border-color:#e5a8f8}
html[data-level="10"] .level-atmosphere{color:#ead1ff}
html[data-level="10"] .marine-overlay .caustic-light{opacity:.22}
html[data-level="9"] .marine-overlay .caustic-light{opacity:.27}
@media(max-height:760px){.level-atmosphere{font-size:8px;margin-bottom:4px}}


/* V6 ISOLATED ART PASS. A new stylesheet URL forces a fresh fetch when the
 * new HTML route is deployed. This is intentionally a cinematic re-layout,
 * not another subtle color adjustment to the old mockup. */
html[data-scene="boss"]{--world-art:url('art/scene-twilight.svg')!important;
  --scene-accent:#fcbbec;--scene-glow:#6cf5ff}
html[data-scene="boss"] body::after{background:linear-gradient(180deg,#02244f75 0%,#041d4561 47%,#032448b8 100%)}
.game-screen.boss-mode{background:transparent}
.game-screen.boss-mode::before{background:linear-gradient(180deg,#00345326,#001a3240 80%,#06243930)}
.boss-portrait{position:relative;display:block;height:clamp(104px,15svh,143px);margin:6px 0 4px;
  border-radius:24px;border:1.5px solid #a0faffbb;
  background:#061f43 url('art/kraken-face-v6.svg') center 54%/cover no-repeat;
  isolation:isolate;overflow:hidden;
  box-shadow:0 10px 27px #00152ba1,0 0 18px #35e8f073,inset 0 2px 3px #fff6}
.boss-portrait::before{content:"";position:absolute;inset:0;pointer-events:none;
  border-radius:inherit;background:linear-gradient(180deg,#07193926,transparent 42%,#1c7faf27 100%)}
.boss-portrait::after{content:"";position:absolute;inset:-20% -50%;pointer-events:none;
  background:linear-gradient(112deg,transparent 30%,#a9f9ff17 42%,transparent 52%,#8afcf71c 67%,transparent 75%);
  animation:boss-hero-sheen 11s ease-in-out infinite alternate}
@keyframes boss-hero-sheen{to{transform:translateX(20%)}}
.boss-portrait-phase{position:absolute;bottom:7px;left:12px;z-index:2;padding:4px 10px;
  border-radius:15px;background:#071b40ba;border:1px solid #a3f4f66e;
  font-size:10px;letter-spacing:.5px;font-weight:800;color:#fff4d9;
  text-shadow:0 1px 4px #021f34;backdrop-filter:blur(4px)}
.boss-portrait-version{position:absolute;z-index:2;right:10px;bottom:9px;
  padding:3px 8px;border-radius:12px;background:#022c56cb;border:1px solid #9ef4e6a2;
  color:#d8fff4;font-size:10px;letter-spacing:1px;font-weight:900;
  box-shadow:0 0 12px #5fe9e862}
/* Replaces the redundant tiny cartoon panel with a full-scale dramatic face. */
.game-screen.boss-mode .boss-showcase{display:none!important}
.game-screen.boss-mode .kraken-specter{display:none!important}
.game-screen.boss-mode .objective{padding:9px 13px 8px;border-color:#8cebf3b3;
  background:linear-gradient(130deg,#0c4567ef,#06345ce9);
  box-shadow:0 3px 13px #02142f88,inset 0 1px #b4ffff58}
.game-screen.boss-mode .objective-top{font-size:12px}
.game-screen.boss-mode .objective-bottom{font-size:10px}
.game-screen.boss-mode .boss-health{margin-top:5px;padding-top:5px;border-color:#8ff2fc43}
.game-screen.boss-mode #boss-hits{color:#ff91c2}
.game-screen.boss-mode .meter{height:7px;margin:7px 0}
.game-screen.boss-mode #goal-meter{background:linear-gradient(90deg,#ffa5cc,#e963b0,#e291f4);box-shadow:0 0 13px #f67bd29b}
.game-screen.boss-mode .game-topline{margin:0 0 2px}
.game-screen.boss-mode .play-field{flex:0 0 auto;margin:3px 0 0;justify-content:center}
.game-screen.boss-mode .board-frame{width:min(100%,clamp(242px,calc(100svh - 454px),348px));min-width:0;
  padding:6px;border-radius:23px;border:2px solid #acffffbd;
  background:linear-gradient(138deg,#b5ffffe8,#2ba5dbe0 40%,#174c88df 78%,#ccfaffbc)!important;
  box-shadow:0 0 26px #34ffff4c,0 9px 28px #011d42b9,inset 0 1px 6px #ecffffcc!important;
  z-index:1}
.game-screen.boss-mode .board-frame::before{border-color:#d2ffff98;box-shadow:0 0 14px #83eaff7e}
.game-screen.boss-mode .game-board{background:linear-gradient(135deg,#0d7795d2,#08486bd9)!important;
  border-color:#abfaffba;box-shadow:inset 0 0 18px #04344da9}
.game-screen.boss-mode .tile{border:1px solid #a2f7fc5c;border-radius:7px;
  background:radial-gradient(circle at 28% 14%,#9eeeff2a,transparent 70%),
    linear-gradient(150deg,#278fb4a9,#0e5c83a8 56%,#134470cd);
  box-shadow:inset 0 1px 3px #f7ffff26,inset -1px -2px 3px #0229457b}
.game-screen.boss-mode .tile.hole{background:linear-gradient(130deg,#01172ccf,#02122ecf)}
.game-screen.boss-mode .play-guidance{margin:6px 0 4px;min-height:34px}
.game-screen.boss-mode .piece-tray{gap:7px;margin-bottom:0}
.game-screen.boss-mode .piece-slot{height:70px;border:1px solid #a7f6e9a1;
  background:linear-gradient(130deg,#145f84dd,#113b70d5)!important;
  box-shadow:0 4px 13px #00192b75,inset 0 2px #e2ffff44}
.game-screen.boss-mode .mini .gem::after{opacity:.86}
.game-screen.boss-mode .skip-button{padding:6px}
.game-screen.boss-mode .boss-limb-stage{z-index:3;pointer-events:none;overflow:visible}
.game-screen.boss-mode .boss-limb{width:clamp(60px,15vw,92px);height:clamp(130px,29vw,205px);
  filter:drop-shadow(0 7px 16px #0b1549c7) drop-shadow(0 0 9px #d780ff71)}
.game-screen.boss-mode .boss-limb-left{top:-18px;left:-51px}
.game-screen.boss-mode .boss-limb-right{top:18%;right:-49px}
.game-screen.boss-mode .boss-limb-low{bottom:-28px;left:-48px}
.game-screen.boss-hit .boss-portrait{animation:boss-hero-hit .65s ease-out}
.game-screen.boss-defeated .boss-portrait{animation:boss-hero-fade 1.05s ease-in forwards}
@keyframes boss-hero-hit{
  0%,100%{filter:brightness(1);transform:translateX(0)}
  18%,54%{filter:brightness(1.5);transform:translateX(-3px)}
  36%,68%{filter:brightness(.9);transform:translateX(3px)}
}
@keyframes boss-hero-fade{
  0%{filter:brightness(1);opacity:1}
  58%{filter:brightness(2.1) saturate(0.8);opacity:.8}
  100%{filter:brightness(2.4);opacity:0;transform:translateY(23px)}
}
@media(max-height:780px){
  .game-screen.boss-mode .boss-portrait{height:105px}
  .game-screen.boss-mode .board-frame{width:min(100%,clamp(237px,calc(100svh - 425px),329px))}
  .game-screen.boss-mode .piece-slot{height:65px}
  .game-screen.boss-mode .play-field{margin-top:1px}
  .game-screen.boss-mode .play-guidance{margin:4px 0 2px}
}
@media(max-height:675px){
  .game-screen.boss-mode .boss-portrait{height:81px}
  .game-screen.boss-mode .board-frame{width:min(100%,clamp(220px,calc(100svh - 375px),290px))}
  .game-screen.boss-mode .piece-slot{height:58px}
  .game-screen.boss-mode .objective{padding:6px 10px}
}
@media(max-width:355px){
  .game-screen.boss-mode .boss-limb-left{left:-30px}
  .game-screen.boss-mode .boss-limb-right{right:-30px}
  .game-screen.boss-mode .boss-limb-low{left:-25px}
  .boss-portrait-phase{font-size:9px}
}
@media(prefers-reduced-motion:reduce){
  .boss-portrait::after,.game-screen.boss-hit .boss-portrait,
  .game-screen.boss-defeated .boss-portrait{animation:none!important}
}


/* Actual chosen boss concept, cropped to the glowing eyes, is used as art.
   Keep the hand-built vector drawing as the offline SVG fallback. */
.boss-portrait{
  background-image:url('art/kraken-reference-v6.svg'),url('art/kraken-face-v6.svg');
  background-position:center center,center center;
  background-size:cover,cover;
  background-repeat:no-repeat,no-repeat;
}


/* Chapter II layout: a continuous underwater scene, with the play area in front.
   Side gutters reserve real space for all three boss limbs on narrow screens. */
html[data-screen="game-screen"] .adventure-shell{padding:8px 10px max(8px,env(safe-area-inset-bottom));overflow:visible}
html[data-screen="game-screen"] .adventure-header{display:none}
html[data-screen="game-screen"] body{overflow-x:hidden}
.game-screen{min-height:calc(100svh - 20px);gap:0}
.game-screen .game-topline{position:relative;z-index:5;margin:0 0 5px;min-height:40px}
.level-heading{text-align:center;display:grid;gap:2px}
.level-heading #level-title{font-size:9px;letter-spacing:1.7px;text-transform:uppercase;color:#b9e7e6}
.level-heading strong{font-size:19px;letter-spacing:-.5px;text-shadow:0 2px 8px #00152e}
.game-screen .objective,.game-screen.boss-mode .objective{background:#052c49a8;border:1px solid #c6f6e04a;padding:8px 11px;border-radius:16px;box-shadow:inset 0 1px #d0fff71c;backdrop-filter:blur(8px);position:relative;z-index:4}
.game-screen .level-atmosphere,.game-screen .objective-top{display:none}
.edition-note{font-size:8px;text-transform:uppercase;letter-spacing:1.2px;color:#c8e4df;margin-bottom:4px}
.goal-details{display:flex;flex-wrap:wrap;gap:5px}
.goal-chip{font-size:12px;font-weight:750;color:#fff4c8;background:#143e51b0;border:1px solid #acdcd939;border-radius:8px;padding:3px 7px;white-space:nowrap}
.goal-chip.complete{color:#baffd1;background:#12595b;border-color:#9affc4}
.game-screen .meter,.game-screen.boss-mode .meter{height:4px;margin:6px 0}
.game-screen .objective-bottom{font-size:10px}
.game-screen .boss-health{position:absolute;right:12px;top:7px;margin:0;padding:0;border:0}
.game-screen .boss-health>span{display:none}
.game-screen .boss-health strong{font-size:11px;letter-spacing:0}
.game-screen.boss-mode .goal-details{padding-right:60px}
.level-panorama{height:clamp(100px,16svh,145px);position:relative;margin:0 -10px -12px;overflow:hidden;isolation:isolate}
.panorama-art{position:absolute;inset:0;background:var(--waypoint) center 45%/cover no-repeat;mask-image:linear-gradient(black 72%,transparent);-webkit-mask-image:linear-gradient(black 72%,transparent)}
.panorama-caption{position:absolute;left:21px;right:21px;bottom:20px;display:flex;justify-content:space-between;align-items:center;text-shadow:0 2px 5px #001b3d;font-size:9px;letter-spacing:1px;text-transform:uppercase;color:#e1fff3;z-index:1}
.panorama-caption strong{font-weight:750}.panorama-caption span{border:1px solid #c9f8f666;border-radius:20px;padding:3px 8px;background:#00274077}
.fish-school{position:absolute;inset:0;pointer-events:none;animation:shoal-drift 14s ease-in-out infinite alternate}
.fish-school i{position:absolute;left:17%;top:28%;width:18px;height:8px;border-radius:60% 80% 80% 60%;background:#f3e5acaa;box-shadow:inset -3px 0 #75e0d9}
.fish-school i::before{content:'';position:absolute;left:-5px;top:0;border-left:6px solid #c6e7cc;border-top:4px solid transparent;border-bottom:4px solid transparent}
.fish-school i:nth-child(2){left:11%;top:37%;transform:scale(.6)}.fish-school i:nth-child(3){left:9%;top:19%;transform:scale(.4)}
@keyframes shoal-drift{to{transform:translateX(62%) translateY(10px)}}
.game-screen .play-field,.game-screen.boss-mode .play-field{flex:0 0 auto;margin:0;padding:6px 12px 0;position:relative}
.game-screen .board-frame,.game-screen.boss-mode .board-frame{width:min(100%,calc(100svh - 315px),410px);min-width:0;padding:5px;border-radius:20px;overflow:visible;border:2px solid #b0ffffa8;background:linear-gradient(135deg,#78cfd7bb,#164c7188 35%,#68ccd2a8)!important;box-shadow:0 0 16px #56dfeb42,inset 0 1px 5px #e7ffff77,0 8px 24px #001a3566!important}
.game-screen .board-frame::before{inset:-3px;border-radius:22px;pointer-events:none}
.game-screen .board-ambience{border-radius:16px}
.game-screen .game-board,.game-screen.boss-mode .game-board{padding:3px;gap:3px;border-radius:14px;background:#063c53a8!important;border:1px solid #91eff48a;box-shadow:inset 0 0 16px #002d49a8}
.game-screen .tile,.game-screen.boss-mode .tile{border-radius:6px;border:1px solid #9ce9f84a;background:radial-gradient(ellipse at 22% 15%,#b0fff124,transparent 65%),linear-gradient(135deg,#16738f77,#09567599);box-shadow:inset 0 1px 2px #d7fff326,inset 0 -2px 3px #002d4050}
.game-screen .tile.hole,.game-screen.boss-mode .tile.hole{background:radial-gradient(ellipse at 50% 100%,#176c7a70,#001d3399);border-color:#153346;outline:0;box-shadow:inset 0 3px 10px #001426aa}
html[data-level="3"] .tile.hole{border-color:#85e2e83b;box-shadow:inset 0 0 7px #70e4ed4a}
html[data-level="7"] .tile.hole{background:url('art/waypoint-7.svg') 15% 80%/400% 200%}
html[data-level="8"] .tile.hole{border:0;background:transparent;box-shadow:none;opacity:.2}
html[data-scene="twilight"] .tile{background:linear-gradient(135deg,#45578488,#17375aa8);border-color:#bac5fa45}
html[data-level="9"] .game-board{box-shadow:0 0 20px #b48aff25,inset 0 0 16px #00152d}
.object-strength{position:absolute;bottom:0;left:0;right:0;z-index:5;color:#fff3c8;font-size:12px;letter-spacing:1px;text-shadow:0 1px 3px #100c38;line-height:1;pointer-events:none}
.game-screen .play-guidance,.game-screen.boss-mode .play-guidance{display:flex;align-items:center;gap:8px;min-height:36px;margin:7px 0 5px;padding:0 5px}
.game-screen .play-hint{font-size:9px;line-height:1.35;flex:1;text-align:left;margin:0;color:#d3efeb}
.game-screen .hint-action{font-size:11px;border-radius:20px;padding:8px 12px;white-space:nowrap}
.game-screen .piece-tray{gap:0;margin:0 7px;border:1px solid #b6fbf25f;border-radius:22px;background:linear-gradient(130deg,#2a8391a8,#073d63df);box-shadow:inset 0 2px 3px #d5ffff43,0 9px 22px #001a37a6;overflow:hidden}
.game-screen .piece-slot,.game-screen.boss-mode .piece-slot{height:76px;min-height:60px;border:0;border-right:1px solid #b2f4ed33;border-radius:0;background:transparent!important;box-shadow:none}
.game-screen .piece-slot:last-child{border-right:0}.game-screen .piece-slot.selected{outline:0;background:#a1fff52b!important;box-shadow:inset 0 0 0 2px #f2e4a9}
.game-screen .mini .gem{border-radius:5px}.game-screen .mini .gem::after{opacity:.4}
.game-screen .skip-button{padding:8px 0 4px;font-size:10px}
.game-screen.boss-mode .boss-portrait{height:clamp(106px,18svh,175px);margin:-5px -10px -18px;border:0;border-radius:0;background-size:cover;background-position:center 58%;box-shadow:none;overflow:hidden;mask-image:linear-gradient(black 77%,transparent);-webkit-mask-image:linear-gradient(black 77%,transparent)}
.game-screen.boss-mode .boss-portrait-phase{bottom:25px;left:20px;font-size:9px;border:0;background:#092746ab;padding:3px 8px}
.game-screen.boss-mode .boss-portrait-version{bottom:26px;right:17px;font-size:8px;padding:2px 5px}
.game-screen.boss-mode .play-field{padding:7px 30px 5px;overflow:visible;z-index:2}
.game-screen.boss-mode .board-frame{width:min(100%,calc(100svh - 330px),390px)}
.game-screen.boss-mode .boss-limb-stage{inset:0;overflow:visible;z-index:3;pointer-events:none}
.game-screen.boss-mode .boss-limb{width:28px;height:116px;background-size:100% 100%;transform-origin:50% 85%;filter:drop-shadow(0 0 5px #ec9afc8a);--rest:rotate(0deg);--tuck:translateY(100px)}
.game-screen.boss-mode .boss-limb-left{left:0;top:3%;--rest:rotate(0deg);--tuck:translate(-12px,80px)}
.game-screen.boss-mode .boss-limb-right{right:0;top:30%;--rest:scaleX(-1);--tuck:translate(-12px,80px)}
.game-screen.boss-mode .boss-limb-low{left:0;bottom:0;top:auto;--rest:rotate(0deg);--tuck:translate(-12px,80px)}
.game-screen .cell-decoration.coral{background-size:94%}.game-screen .cell-decoration.jelly{background-size:90%}
.game-screen .gem::after{opacity:.38}
.level-card{position:relative;overflow:hidden;min-height:102px;padding:16px 12px;border-radius:21px;background:linear-gradient(90deg,#062b43f5 0%,#06304ac9 65%,#06304a33)}
.level-card>div,.level-card>.level-badge,.level-card>.level-status{position:relative;z-index:2}
.level-card>div{max-width:65%}.level-card small{color:#cee9df;line-height:1.4;font-size:10px;max-width:190px}
.map-vignette{position:absolute;inset:0 0 0 30%;z-index:0;background-position:center;background-size:cover;opacity:.62;mask-image:linear-gradient(90deg,transparent,black);-webkit-mask-image:linear-gradient(90deg,transparent,black)}
.level-card.locked{opacity:.62;filter:saturate(.55)}.level-card .level-status{font-size:12px;color:#ffe4a1}
@media(max-height:650px){.game-screen .board-frame{width:min(100%,max(235px,calc(100svh - 300px)))}.level-panorama{height:88px}.game-screen.boss-mode .boss-portrait{height:100px}.game-screen .piece-slot,.game-screen.boss-mode .piece-slot{height:64px}.game-screen.boss-mode .boss-limb{height:96px}.game-screen .play-guidance{margin:4px 0}}
@media(prefers-reduced-motion:reduce){.fish-school{animation:none}.panorama-art{transition:none}}
/* No decorative shell may cover an interactive corner, on any level. */
.game-screen .board-frame::after{display:none!important}
.game-screen .play-hint{font-size:10px}

/* Painted Kraken limbs: full-size scene artwork behind the board, never tiny
   symbols. The opaque board protects every cell; the curls frame its edges. */
.game-screen.boss-mode .play-field{isolation:isolate}
.game-screen.boss-mode .boss-limb-stage{z-index:0;clip-path:inset(-130px -10px 0);pointer-events:none}
.game-screen.boss-mode .board-frame{z-index:2;background:linear-gradient(135deg,#8adee7,#226c91 35%,#72cbd0)!important}
.game-screen.boss-mode .game-board{background:#074860!important}
.game-screen.boss-mode .boss-limb{
 width:clamp(142px,39vw,200px);height:clamp(213px,58.5vw,300px);
 background:url('art/kraken-limb-painted-v8.webp') center/contain no-repeat;
 opacity:1;filter:drop-shadow(0 0 7px #72efff4d);
 transform-origin:30% 85%;animation:painted-limb-sway 5s ease-in-out infinite alternate;
}
.game-screen.boss-mode .boss-limb-left{left:-28px;top:-110px;bottom:auto;--rest:rotate(-5deg);--tuck:translate(-70px,170px) rotate(-22deg)}
.game-screen.boss-mode .boss-limb-right{right:-39px;top:23%;left:auto;bottom:auto;--rest:scaleX(-1) rotate(-9deg);--tuck:translate(-80px,160px) rotate(-25deg);animation-delay:-1.8s}
.game-screen.boss-mode .boss-limb-low{left:-47px;bottom:-39px;top:auto;right:auto;--rest:rotate(41deg);--tuck:translate(-90px,170px) rotate(70deg);animation-delay:-3.2s}
@keyframes painted-limb-sway{from{transform:var(--rest) translateY(1px)}to{transform:var(--rest) translateY(-5px) rotate(2deg)}}
.game-screen.boss-mode .boss-limb.is-retracting{animation:tentacle-strike-and-retreat 1.08s cubic-bezier(.27,.06,.62,1) both!important}
@media(max-height:650px){.game-screen.boss-mode .boss-limb{width:132px;height:198px}.game-screen.boss-mode .boss-limb-left{top:-100px}}
@media(prefers-reduced-motion:reduce){.game-screen.boss-mode .boss-limb{animation:none!important;transform:var(--rest)}}
/* Keep the thick bases inside the viewport as they wrap behind the glass. */
.game-screen.boss-mode .boss-limb{mask-image:linear-gradient(black 82%,transparent);-webkit-mask-image:linear-gradient(black 82%,transparent)}
.game-screen.boss-mode .boss-limb-right{right:-3px}
.game-screen.boss-mode .boss-limb-low{left:-5px;bottom:-22px;--rest:rotate(7deg);--tuck:translate(-90px,170px) rotate(40deg)}
.game-screen.boss-mode .boss-limb-right{transform-origin:50% 85%;top:-65px;--rest:scaleX(-1) rotate(-4deg)}
.game-screen.boss-mode .boss-limb-low{transform-origin:50% 50%;bottom:-32px;--rest:scaleY(-1);--tuck:translate(-70px,150px) rotate(25deg)}
.game-screen.boss-mode .boss-limb-stage{clip-path:inset(-130px -10px -25px)}
.game-screen.boss-mode .play-guidance{position:relative;z-index:4;background:#07324bd9;border-radius:12px}
.game-screen.boss-mode .boss-limb-low{left:-124px;bottom:-35px;width:180px;height:270px;transform-origin:50% 50%;--rest:rotate(90deg);--tuck:translate(-100px,150px) rotate(125deg)}
/* A real foreground cove below the grid gives the third curl room to read. */
.game-screen.boss-mode .play-field{margin-bottom:62px}
.game-screen.boss-mode .boss-limb-stage{clip-path:inset(-130px -10px -95px)}
.game-screen.boss-mode .boss-limb-low{left:-86px;bottom:-106px}
.game-screen.boss-mode .board-frame{width:min(100%,calc(100svh - 395px),390px)}
@media(max-height:720px){.game-screen.boss-mode .boss-portrait{height:106px}.game-screen.boss-mode .play-field{margin-bottom:55px}}
