:root { color-scheme:dark; --pink:#ffa5be; --gold:#ffe085; --ink:#211427; --mint:#96efcd; font-family:system-ui,sans-serif; color:#fff2df; background:#160f20; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; overflow:hidden; }
button,input,a { -webkit-tap-highlight-color:transparent; }
button { font:800 13px/1.2 system-ui,sans-serif; cursor:pointer; border:1px solid #ffffff26; color:#fff1df; border-radius:14px; min-height:44px; padding:10px 16px; background:#372338; }
button:hover { filter:brightness(1.12); }
button:active { transform:translateY(1px); }
button:disabled { opacity:.5; cursor:default; }
:focus-visible { outline:3px solid var(--mint); outline-offset:3px; }
button small { display:block; font-size:10px; opacity:.8; margin-top:3px; }
.primary { background:linear-gradient(#ffe997,#f4b443); color:#3e2415; border-color:#ffdfa1; box-shadow:0 4px 0 #9c5827; }
.secondary { background:#3c293b; }
.page { position:fixed; left:var(--view-x,0px); top:var(--view-y,0px); width:var(--view-w,100%); height:var(--view-h,100dvh); padding:max(6px,env(safe-area-inset-top)) max(10px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(10px,env(safe-area-inset-left)); display:flex; flex-direction:column; gap:8px; background:radial-gradient(ellipse at 40% 20%,#382139,#160f20 70%); overflow:hidden; }
.page:fullscreen { left:0; top:0; }
.touch-layout[data-game-phase="playing"][data-game-paused="false"] .page:not(:has(.overlay:not([hidden]))) { touch-action:none; user-select:none; }
.game-header { display:flex; align-items:center; justify-content:space-between; flex:none; gap:12px; height:46px; }
.brand { color:var(--pink); text-decoration:none; font-size:22px; font-weight:950; line-height:1; display:flex; align-items:center; gap:9px; }
.brand span { font-size:13px; letter-spacing:.13em; }
.brand b { color:var(--gold); }
.game-header nav { display:flex; gap:8px; }
.icon-button { display:grid; place-items:center; flex:none; width:44px; height:44px; padding:10px; }
.icon-button svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:2.5; stroke-linecap:round; stroke-linejoin:round; }
.pause-control { display:flex; gap:8px; align-items:center; }
.pause-control b { font-size:17px; }
.play-shell { display:flex; flex-direction:column; flex:1; min-height:0; gap:10px; }
.hud { display:flex; flex:none; align-items:center; justify-content:space-around; gap:12px; padding:10px 14px; background:#26192bbf; border:1px solid #ffffff16; border-radius:18px; }
.hud small { display:block; font-size:10px; color:#d9bbd0; font-weight:750; }
.hud strong { display:block; font-size:22px; line-height:1.1; }
.hud-level { text-align:center; }
.hud-level>span { font-size:9px; letter-spacing:.1em; font-weight:800; color:var(--pink); }
.hud-level strong { color:var(--gold); }
.hud-lives { text-align:center; }
.hud-status { display:contents; }
#hud-lives { color:var(--pink); font-size:20px; white-space:nowrap; }
.abilities { display:flex; gap:8px; }
.ability { position:relative; padding:6px 8px 10px; border:1px solid #ffffff22; background:#140d1b; border-radius:10px; overflow:hidden; min-width:88px; }
.ability>span { font-size:10px; font-weight:850; }
.ability small { font-size:9px; }
.ability i { position:absolute; bottom:0; left:0; height:4px; width:var(--ready,100%); background:var(--gold); }
#hud-fart i { background:var(--mint); }
#hud-special { max-width:140px; color:var(--gold); order:1; }
.board-space { flex:1; min-width:0; min-height:0; display:flex; align-items:center; justify-content:center; touch-action:none; }
.screen-wrap { position:relative; flex:none; width:var(--board-w,100%); height:var(--board-h,100%); border-radius:12px; box-shadow:0 10px 34px #0006; overflow:hidden; }
#game { display:block; width:100%; height:100%; touch-action:none; outline:none; }
#game-notice { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); margin:0; padding:0; pointer-events:none; }
.hud-level small { min-height:24px; max-width:210px; }
.overlay { position:absolute; z-index:5; top:0; left:0; width:100%; height:var(--view-h,100%); max-height:100%; display:flex; align-items:safe center; justify-content:center; padding:clamp(10px,2vw,24px); background:#110b19dc; overflow:auto; overscroll-behavior:contain; touch-action:pan-y; }
.panel,.leaderboard-card,.score-entry-card,.editor-card { flex:none; width:min(100%,680px); min-width:0; max-height:100%; overflow:auto; padding:clamp(18px,3vw,30px); background:linear-gradient(145deg,#40243b,#211628); border:1px solid #eeb3ab66; border-radius:24px; box-shadow:0 20px 65px #0007; text-align:center; }
h1,h2,p { margin-top:0; }
h1 { font-size:clamp(38px,6vw,68px); line-height:.93; font-weight:1000; letter-spacing:-.055em; color:var(--pink); margin-bottom:16px; }
h1 em { font-style:normal; color:var(--gold); }
h2 { color:var(--gold); font-size:clamp(25px,4vw,40px); line-height:1.1; margin-bottom:16px; }
p { font-size:14px; line-height:1.5; }
.eyebrow { color:var(--pink); font-size:10px; font-weight:850; letter-spacing:.17em; margin-bottom:12px; }
.small { font-size:11px; color:#dcc5d4; margin:16px 0 0; }
.button-row { display:flex; flex-wrap:wrap; justify-content:center; gap:10px; margin:12px 0; }
.title-card { width:min(100%,950px); display:flex; align-items:flex-start; padding:0; overflow:auto; }
.title-art { width:42%; min-width:0; object-fit:cover; align-self:stretch; border-radius:24px 0 0 24px; }
.title-copy { padding:26px; flex:1; }
.title-copy .pvsb-cookie-note { font-size:9px; line-height:1.4; max-width:380px; margin:16px auto 0; opacity:.65; }
.mobile-hint { display:none; }
.touch-layout .mobile-hint { display:block; }
.touch-layout .keyboard-hint { display:none; }
.title-copy .mobile-hint,.keyboard-hint { font-size:12px; color:var(--mint); }
html[data-game-phase="menu"] .pause-control { display:none; }
html[data-game-phase="menu"] .play-shell { visibility:hidden; }
html[data-game-phase="menu"] .game-header { z-index:6; }
html[data-game-phase="menu"] .title-screen { padding-top:64px; }
html:has(.leaderboard-overlay:not([hidden])) .game-header { visibility:hidden; }
html:has(.editor-screen:not([hidden])) .game-header { visibility:hidden; }
#pause-screen { z-index:8; }
.pause-card { max-width:610px; }
#pause-help { text-align:left; padding:12px 0; border-block:1px solid #ffffff24; }
#pause-help p,.enemy-guide { font-size:13px; line-height:1.5; }
.enemy-guide { list-style:none; padding:0; margin:16px 0; display:grid; gap:10px; }
.enemy-guide li { display:grid; grid-template-columns:100px 1fr; gap:12px; align-items:center; padding:12px; background:#140d1b80; border:1px solid #ffffff16; border-radius:14px; }
.enemy-guide canvas { width:100%; height:auto; }
.enemy-guide b { display:block; color:var(--gold); font-size:16px; margin-bottom:4px; }
.enemy-guide p { margin:0; }
.enemy-guide strong { color:var(--mint); }
#gesture-practice { display:none; }
.touch-layout .title-help #gesture-practice { display:inline-flex; }
.title-help #help-button,.title-help .pause-card>.button-row:last-of-type,.title-help .pause-card>.small { display:none; }
@media (max-width:500px) {
 .enemy-guide li { grid-template-columns:76px 1fr; gap:8px; padding:10px 8px; }
}
#practice-card { position:relative; z-index:4; flex:none; align-self:center; width:min(100%,550px); background:#28172ef5; border:2px solid var(--mint); border-radius:18px; padding:12px 16px; display:flex; align-items:center; gap:14px; box-shadow:0 6px 24px #0007; }
.page:has(#practice-card:not([hidden])) .hud { display:none; }
#practice-card p { margin:4px 0 0; font-weight:800; }
#practice-card .eyebrow { font-size:9px; color:var(--mint); }
.story-screen { background-size:cover; background-position:center; }
.death-screen { background-image:url('assets/rip-pig.png'); }
.death-screen.retry-screen { background-image:url('assets/try-again.png'); }
.victory-screen { background-image:url('assets/truffle-triumph.png'); }
.story-shade { position:absolute; inset:0; background:linear-gradient(#160d1b33,#160d1bd9); pointer-events:none; }
.grave-copy,.victory-copy { position:relative; background:#22162de8; width:min(100%,560px); }
.stats { display:flex; flex-wrap:wrap; gap:10px; justify-content:center; margin-bottom:16px; font-size:12px; font-weight:800; }
.leaderboard-overlay { z-index:12; }
.score-entry-card { max-width:510px; }
#initials-form { display:flex; flex-direction:column; align-items:center; gap:16px; }
label { font-weight:800; font-size:12px; letter-spacing:.08em; }
input { max-width:100%; border:2px solid var(--mint); background:#140e1c; color:#fff; border-radius:14px; padding:10px 12px; font:800 20px system-ui,sans-serif; }
#initials-input { width:210px; font-size:42px; text-align:center; letter-spacing:.18em; text-transform:uppercase; }
#score-entry-skip { margin-top:14px; }
.board-message,.board-source { font-size:12px; color:#e7d1de; line-height:1.5; }
.board-message:empty { display:none; }
.score-list { padding:0; margin:16px 0; list-style:none; counter-reset:rank; }
.score-list li { display:grid; grid-template-columns:24px 55px minmax(60px,1fr) minmax(80px,auto); gap:8px; align-items:center; padding:8px; border-bottom:1px solid #ffffff17; font-size:12px; text-align:left; }
.score-list li::before { counter-increment:rank; content:counter(rank); color:var(--gold); font-weight:900; }
.score-number { text-align:right; font-weight:850; }
.score-initials { font-weight:900; color:var(--mint); }
.score-detail { font-size:10px; text-align:right; }
.score-list .empty-score { display:block; text-align:center; }
.score-list .empty-score::before { content:none; }
.reset-form { display:grid; gap:12px; margin-top:14px; }
.editor-card { max-width:760px; }
.editor-head h2 { margin:0; }
.editor-sub { font-size:12px; }
.editor-tools { display:flex; flex-wrap:wrap; justify-content:center; gap:6px; margin:12px 0; }
.editor-tools button { padding:8px; }
.editor-tools b { margin-right:4px; }
.editor-tools span { font-size:10px; }
.editor-tools .on { border-color:var(--gold); background:#634530; }
.editor-grid { display:grid; grid-template-columns:repeat(15,1fr); width:min(100%,600px); margin:auto; gap:2px; touch-action:none; background:#160d1c; padding:4px; border-radius:8px; }
.editor-grid button { min-width:0; min-height:0; padding:0; border-radius:3px; aspect-ratio:56/44; font-size:clamp(9px,2vw,18px); background:#7c4b35; border:0; }
.editor-grid [data-cell="tunnel"] { background:#180e1d; }
.editor-grid [data-cell="rock"] { background:#55474e; }
.editor-grid .locked { box-shadow:inset 0 0 0 2px var(--mint); }
.editor-check { color:var(--pink); font-size:11px; margin-top:12px; }
.editor-check.good { color:var(--mint); }
.mobile-status { position:absolute; z-index:20; left:50%; bottom:14px; transform:translateX(-50%); max-width:90%; width:max-content; padding:10px 16px; margin:0; border-radius:12px; color:var(--gold); background:#28192df5; pointer-events:none; font-size:12px; opacity:0; }
.mobile-status.visible { opacity:1; }
@media (orientation:portrait) {
 .hud { flex-wrap:wrap; gap:8px 12px; padding:9px; }
 .hud-level { flex:1 0 32%; }
 .hud-score,.hud-lives { flex:1; }
 .abilities { justify-content:center; }
 #hud-special { max-width:120px; }
 .title-card { flex-direction:column; max-width:470px; }
 .title-art { width:100%; max-height:150px; object-position:50% 38%; border-radius:24px 24px 0 0; }
 .title-copy { padding:20px; }
 h1 { font-size:46px; }
}
@media (orientation:landscape) and (max-height:650px) {
 .page { gap:5px; }
 .play-shell { flex-direction:row; gap:8px; }
 .hud { flex-direction:column; width:140px; gap:7px; padding:8px; justify-content:space-evenly; }
 .hud strong { font-size:18px; }
 .hud-level>span,#hud-map { font-size:9px; }
 .abilities { flex-direction:column; width:100%; gap:5px; }
 .ability { padding:4px 8px 8px; }
 .ability span,.ability small { display:inline; font-size:9px; }
 .ability small { float:right; }
 #hud-lives { font-size:17px; }
 #hud-special { font-size:9px; }
 .title-copy { padding:16px 22px; }
 h1 { font-size:43px; margin-bottom:10px; }
 .title-copy>p { margin-bottom:8px; font-size:12px; }
 .button-row { gap:7px; margin:10px 0; }
 .title-copy .small { font-size:10px; margin-top:10px; }
 .title-copy .pvsb-cookie-note { margin-top:10px; }
 .title-art { width:34%; }
 .title-copy { min-width:0; padding:14px 18px; }
 .title-copy .eyebrow,.title-copy>.small { display:none; }
 .title-copy h1 { display:flex; flex-wrap:wrap; justify-content:center; gap:0 .3em; font-size:clamp(28px,4.8vw,43px); }
 .title-copy h1 br { display:none; }
 .title-copy .button-row { margin:8px 0; }
 .panel,.leaderboard-card,.score-entry-card,.editor-card { padding:16px 22px; border-radius:18px; }
 .title-card { padding:0; }
 .score-entry-card h2 { margin-bottom:8px; }
 .score-entry-card p { margin-bottom:10px; }
 #initials-form { gap:10px; }
 #initials-input { font-size:28px; padding:5px; }
}
@media (orientation:landscape) and (max-height:350px) {
 .title-copy { padding:10px 14px; }
 .title-copy h1 { font-size:30px; margin-bottom:6px; }
 .title-copy>h1+p { display:none; }
 .title-copy .mobile-hint,.title-copy .keyboard-hint { font-size:11px; line-height:1.4; }
 .title-copy .button-row { gap:6px; margin:6px 0; }
 .title-copy button { font-size:11px; padding:8px 12px; }
 .title-copy .pvsb-cookie-note { margin-top:7px; font-size:8px; }
}
@media (max-width:380px) {
 .brand span { font-size:11px; }
 .title-copy { padding:15px; }
 .title-art { max-height:105px; }
 .hud strong { font-size:18px; }
 button { padding:9px 12px; }
 .score-list li { gap:4px; grid-template-columns:20px 40px minmax(50px,1fr) 80px; }
}
@media (pointer:fine) and (min-width:1000px) and (min-height:600px) and (orientation:landscape) {
 .page { gap:10px; padding:12px 20px; }
 .game-header { height:46px; }
 html[data-game-phase="playing"] .game-header { width:min(100%,var(--board-w),1600px); align-self:center; }
 .brand span { font-size:15px; }
 .play-shell { flex-direction:column; gap:12px; }
 .hud { display:grid; grid-template-columns:minmax(130px,1fr) minmax(155px,.8fr) minmax(160px,1fr) auto; align-self:center; width:min(100%,var(--board-w),1600px); height:104px; gap:clamp(12px,1.5vw,28px); padding:12px 20px; border-color:#dca4bc36; background:linear-gradient(110deg,#362239,#241829); }
 .hud-level { text-align:left; min-width:0; }
 .hud-level>span { font-size:11px; letter-spacing:.13em; }
 .hud strong { font-size:clamp(26px,2vw,34px); font-variant-numeric:tabular-nums; line-height:1.2; }
 .hud small { font-size:12px; line-height:1.3; }
 .hud-level small { min-height:0; max-width:280px; margin-top:2px; }
 .hud-score { padding-left:clamp(12px,1.5vw,28px); border-left:1px solid #ffffff24; }
 .hud-score>small:first-child { font-size:11px; letter-spacing:.1em; }
 .hud-status { display:flex; flex-direction:column; align-items:center; gap:4px; min-width:0; }
 #hud-lives { display:block; font-size:26px; line-height:1.1; margin-bottom:4px; }
 #hud-special { max-width:220px; font-size:11px; text-align:center; }
 #hud-special:empty { display:none; }
 .abilities { flex-direction:row; width:auto; gap:10px; }
 .ability { min-width:100px; padding:10px 12px 13px; border-radius:12px; }
 .ability>span { display:block; font-size:13px; }
 .ability small { display:block; float:none; font-size:11px; margin-top:4px; }
 .ability i { height:5px; }
 .pause-card { padding:32px; }
 .pause-card>.button-row { display:grid; grid-auto-flow:column; grid-auto-columns:1fr; margin:16px 0; gap:12px; }
 .pause-card button { min-height:48px; font-size:14px; }
 .pause-card>.button-row:first-of-type button { min-height:54px; }
 .pause-card>.button-row:last-of-type { padding-top:20px; border-top:1px solid #ffffff24; margin-top:24px; }
 #pause-help p,.enemy-guide { font-size:14px; }
}
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation:none!important; transition:none!important; scroll-behavior:auto!important; } }

.page:fullscreen .overlay { top:var(--view-y,0px); left:var(--view-x,0px); width:min(100%,var(--view-w,100%)); }
