/* Shared look for the daily games' screens: ink-splat pieces, tapes, shards, blob buttons, side columns, HUD bits.
   Taken from day 1 (软糖炸弹人), which still carries its own inline copy. Needs the --splat-a/b/c masks (see splats.js). */
:root{
  /* Layout: the 3D world is always the backdrop. Each screen is a scatter of separate pieces (tilted tapes, ink-blob
     buttons, small halftone shards) instead of one big panel; on wide screens the pieces sit in a left column and the
     camera frames the subject (a bear on its macaron stage, or the arena) in the space to the right. */
  --night:#1b1035;
  --night-2:#2c1c57;
  --line:#0d0720;
  --paper:#ffffff;
  --muted:#c0b6e3;
  --magenta:#ff2f92;
  --lime:#c8f533;
  --cyan:#22d3ee;
  --orange:#ff8c1a;
  --sky:#a9e4ef;
  --scrim:rgba(13,7,32,.5);
  --dots:rgba(255,255,255,.06);
  --boss:#f4f4f2;
  --leaf:#3fae4a; --gold:#ffc83d; --stem:#7a4a2a; --lilac:#c9a6ff;
  --g-straw:#e8304a; --g-apple:#5cc23c; --g-lemon:#f7c41f; --g-orange:#ff8a1f; --g-grape:#8a52d6; --g-pine:#efe2c4; --g-blue:#3d5bd9; --g-peach:#ff9ec0;
  --font-display:"ZCOOL QingKe HuangYou","Microsoft YaHei UI","PingFang SC","Hiragino Sans GB",sans-serif;
  --font-num:"Lilita One","ZCOOL QingKe HuangYou","Microsoft YaHei UI",sans-serif;
  --font-body:"Noto Sans SC","Microsoft YaHei UI","PingFang SC","Hiragino Sans GB",sans-serif;
  color-scheme:dark;
}
[hidden]{display:none!important}
html,body{height:100%}
body{margin:0;background:var(--sky);color:var(--paper);font-family:var(--font-body);font-size:14px;overflow:hidden;-webkit-tap-highlight-color:transparent;user-select:none;-webkit-user-select:none}
#app{position:fixed;inset:0;overflow:hidden;overflow:clip} /* clip: focus must never scroll the whole app */
#scene{position:absolute;inset:0;width:100%;height:100%;display:block;touch-action:none;outline:none}

/* ---------- ink pieces ---------- */
.splat{position:absolute;pointer-events:none;background:var(--c,var(--magenta));-webkit-mask:var(--splat-a) center/contain no-repeat;mask:var(--splat-a) center/contain no-repeat}
.splat.b{-webkit-mask-image:var(--splat-b);mask-image:var(--splat-b)}
.splat.c{-webkit-mask-image:var(--splat-c);mask-image:var(--splat-c)}
.deco{width:var(--w,200px);height:var(--w,200px);opacity:.96}
.tape{justify-self:start;align-self:flex-start;margin:0;padding:4px 16px 5px;font-family:var(--font-display);font-size:15px;letter-spacing:.08em;line-height:1.3;color:var(--line);background:var(--lime);transform:rotate(-3deg);clip-path:polygon(2% 10%,6% 0,95% 7%,100% 0,98% 90%,94% 100%,4% 93%,0 100%)}
.tape.pink{background:var(--magenta);color:var(--paper)}
.tape.cyan{background:var(--cyan);color:var(--line)}
.tape.orange{background:var(--orange);color:var(--line)}
.shard{position:relative;margin:0;padding:10px 16px;color:var(--paper);background-color:var(--night);background-image:radial-gradient(var(--dots) 1.4px,transparent 1.7px);background-size:11px 11px;border:3px solid var(--line);border-radius:16px 22px 14px 24px;box-shadow:0 5px 0 var(--line);transform:rotate(var(--tilt,-1deg));font-size:14px;line-height:1.6}
.shard.small{font-size:13px;padding:7px 13px;line-height:1.55}
.shard h3{margin:0 0 6px;font-family:var(--font-display);font-weight:400;font-size:19px;letter-spacing:.04em;color:var(--lime)}
.shard ul{margin:0;padding-left:1.1em}
.shard li+li{margin-top:3px}
.ink-title{position:relative;isolation:isolate;margin:0;font-family:var(--font-display);font-weight:400;font-size:clamp(38px,5.6vw,56px);line-height:1.05;color:var(--paper);-webkit-text-stroke:6px var(--line);paint-order:stroke fill;text-shadow:0 5px 0 var(--line);transform:rotate(-3deg);text-wrap:balance}
.ink-title.sm{font-size:25px;-webkit-text-stroke:5px var(--line);text-shadow:0 4px 0 var(--line);color:var(--lime);transform:rotate(-2deg)}
.ink-title>.splat{width:150%;height:260%;left:-25%;top:-80%;z-index:-1}

/* ---------- buttons ---------- */
.blob{position:relative;display:inline-grid;justify-items:center;gap:1px;font-family:var(--font-display);font-size:24px;line-height:1.1;letter-spacing:.04em;padding:12px 30px 13px;color:var(--line);background:var(--c,var(--lime));border:3.5px solid var(--line);border-radius:var(--shape,46% 54% 50% 50% / 58% 52% 48% 42%);box-shadow:0 6px 0 var(--line);transform:rotate(var(--tilt,-2deg));cursor:pointer;transition:transform .12s ease,box-shadow .12s ease}
.blob small{font-family:var(--font-body);font-weight:700;font-size:12px;letter-spacing:0;opacity:.78}
.blob:hover{transform:rotate(calc(var(--tilt,-2deg) * -1)) scale(1.05)}
.blob:active{transform:translateY(4px) rotate(var(--tilt,-2deg));box-shadow:0 2px 0 var(--line)}
.blob.lime{--c:var(--lime)}.blob.cyan{--c:var(--cyan)}.blob.orange{--c:var(--orange)}
.blob.magenta{--c:var(--magenta);color:var(--paper)}
.blob.dark{--c:var(--night);color:var(--paper)}
.blob.big{font-size:34px;padding:16px 42px 17px}
.blob:focus-visible,.icon-btn:focus-visible,.arrow:focus-visible,.char-pip:focus-visible,.map-card:focus-visible{outline:3px dashed var(--lime);outline-offset:5px}
.icon-btn{width:44px;height:44px;display:grid;place-items:center;padding:0;color:var(--paper);background:var(--night);border:3px solid var(--line);border-radius:50%;box-shadow:0 4px 0 var(--line);cursor:pointer;pointer-events:auto}
.icon-btn:hover{color:var(--lime)}
.icon-btn:active{transform:translateY(2px);box-shadow:0 2px 0 var(--line)}
.icon-btn svg{width:22px;height:22px}
kbd{font-family:var(--font-num);font-size:14px;line-height:1.4;color:var(--paper);background:var(--night-2);border:2px solid var(--line);border-bottom:4px solid var(--lime);border-radius:8px;padding:0 7px;margin-right:4px}

/* bear head icons (gear drawn on top) */
.bear .fill{fill:var(--c);stroke:var(--line);stroke-width:2.6}
.bear .snout{fill:var(--c);stroke:var(--line);stroke-width:2;filter:brightness(1.18)}
.bear .eye{fill:var(--line)}
.bear .g-leaf{fill:var(--leaf);stroke:var(--line);stroke-width:1.5;stroke-linejoin:round}
.bear .g-white{fill:var(--paper);stroke:var(--line);stroke-width:1.5}
.bear .g-red{fill:var(--g-straw)}
.bear .g-stem{fill:none;stroke:var(--stem);stroke-width:2.2;stroke-linecap:round}
.bear .g-dark{fill:var(--line)}
.bear .g-darkline{fill:none;stroke:var(--line);stroke-width:2}
.bear .g-gold{fill:var(--gold);stroke:var(--line);stroke-width:1}
.bear .g-goldline{fill:none;stroke:var(--gold);stroke-width:1.6}
.bear .g-lilac{fill:var(--lilac)}
.bear .g-cyan{fill:var(--cyan);stroke:var(--line);stroke-width:1.4}
.bear .g-flower{fill:var(--magenta);stroke:var(--line);stroke-width:1}
.bear .g-navy{fill:#1d2766;stroke:var(--line);stroke-width:1.2;stroke-linejoin:round}
.bear .g-plate{fill:#dfe6f3;stroke:var(--line);stroke-width:1}
.face{display:grid;place-items:center}

/* ---------- screens ---------- */
.screen{position:absolute;inset:0;z-index:20;overflow:hidden;overflow:clip} /* clip: focusing a button near the edge must not scroll the screen sideways */
.screen.dimmed{background:var(--scrim)}
.side-col{position:absolute;left:max(5vw,24px);top:max(5vh,20px);bottom:max(5vh,20px);width:min(440px,42vw);display:flex;flex-direction:column;gap:14px;overflow-y:auto;overflow-x:hidden;padding:8px 14px 16px 6px;box-sizing:border-box;scrollbar-width:none}
.side-col::-webkit-scrollbar{display:none}
.actions{display:flex;flex-wrap:wrap;gap:16px;align-items:center;margin-top:6px}
/* a column that runs longer than its window (a 1280×720 laptop, a game portal's frame) scrolls under its buttons:
   they always stay in view */
.side-col>.actions,.side-col .res-bottom>.actions,.side-col .char-info>.actions{position:sticky;bottom:0;z-index:3}
/* results in a window of middle height: the lifetime record gives way and the title takes one line, so the list
   and the buttons (three on a platform with rewarded ads) fit */
@media (min-width:820px) and (max-height:820px){
  #result-record{display:none}
  #scr-result .ink-title{font-size:clamp(30px,3.8vw,44px)}
  #scr-result .side-col{width:min(470px,46vw)}
  #scr-result .actions{gap:10px 14px}
  /* setup: as in a portal's small frame (the block for short windows below), so the settings and the start
     button fit without scrolling: the map pictures and the map's blurb give way (the 3D preview beside them
     shows the map), smaller words */
  #scr-setup .map-grid .map-card canvas{display:none}
  #scr-setup .map-grid .map-card{padding:6px;font-size:13px;gap:2px;min-width:0}
  #scr-setup .map-grid .map-card small{white-space:normal;line-height:1.2}
  #scr-setup #map-desc,#scr-setup #spot-desc{display:none}
  #scr-setup .setup-col{gap:8px}
  #scr-setup .ink-title.sm{font-size:18px;margin:3px 0 2px}
  #scr-setup .shard.small{font-size:12px;line-height:1.4;padding:5px 10px}
  #scr-setup .diff-row{gap:8px}
  #scr-setup .diff-row .blob{font-size:16px;padding:5px 13px 6px}
}
.corner{position:absolute;top:max(14px,env(safe-area-inset-top,0px));right:max(16px,env(safe-area-inset-right,0px));display:flex;align-items:center;gap:12px}

/* lobby */
.lobby-left{justify-content:space-between}
.logo{display:grid;gap:6px;justify-items:start}
.title{margin:4px 0 0;font-family:var(--font-display);font-weight:400;font-size:clamp(52px,6.4vw,82px);line-height:1;display:flex;flex-wrap:wrap;gap:3px}
.title span{display:inline-block;color:var(--c);-webkit-text-stroke:8px var(--line);paint-order:stroke fill;text-shadow:0 7px 0 var(--line);transform:rotate(var(--r));animation:jig 2.4s ease-in-out infinite;animation-delay:calc(var(--i) * -.33s)}
@keyframes jig{0%,100%{transform:translateY(0) rotate(var(--r))}50%{transform:translateY(-6px) rotate(calc(var(--r) * -1))}}
.subtitle{margin:6px 0 0;font-family:var(--font-num);font-size:20px;letter-spacing:.16em;color:var(--cyan);text-transform:uppercase;-webkit-text-stroke:4px var(--line);paint-order:stroke fill;transform:rotate(-2deg);transform-origin:left}
.lobby-nav{display:grid;gap:20px;justify-items:start;padding-bottom:8px}
.lobby-nav .blob:nth-child(2){margin-left:36px}
.lobby-nav .blob:nth-child(3){margin-left:12px}
.nameplate{position:absolute;right:max(8vw,28px);bottom:max(13vh,84px);isolation:isolate;display:grid;justify-items:center;gap:8px;pointer-events:none}
.nameplate>.splat{width:250px;height:210px;left:50%;top:50%;margin:-105px 0 0 -125px;z-index:-1;transform:rotate(-12deg)}
.np-name{font-family:var(--font-display);font-weight:400;font-size:clamp(42px,5vw,62px);line-height:1;color:var(--paper);-webkit-text-stroke:7px var(--line);paint-order:stroke fill;text-shadow:0 5px 0 var(--line);transform:rotate(-4deg)}
.nameplate .tape{justify-self:center}
.shard.record{font-family:var(--font-num);font-size:15px;letter-spacing:.02em;padding:6px 14px;font-variant-numeric:tabular-nums}
.shard.record b{color:var(--lime);font-weight:400}
.ticker{position:absolute;right:max(16px,env(safe-area-inset-right,0px));bottom:max(16px,env(safe-area-inset-bottom,0px));max-width:min(520px,52vw);font-size:14px;transform:rotate(-1.5deg)}
.ticker.swap{animation:tickin .45s ease}
@keyframes tickin{from{opacity:0;transform:translateY(12px) rotate(-1.5deg)}}

/* characters */
.char-info{display:flex;flex-direction:column;gap:12px;align-items:flex-start}
.quote-tag{margin:0;max-width:340px;padding:6px 14px 7px;font:400 21px/1.2 var(--font-display);color:var(--line);background:var(--paper);border:3px solid var(--line);border-radius:16px 16px 16px 4px;box-shadow:0 4px 0 var(--line);transform:rotate(var(--tilt,0deg))}
.quote-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}
.poke-hint{margin:0;padding:4px 11px;font:600 13px var(--font-body);color:var(--paper);background:rgba(42,16,48,.72);border-radius:999px}
.poke-hint::before{content:"👆 "}
.np{position:relative;isolation:isolate;margin-top:26px;padding:10px 14px 4px}
.np>.splat{width:220px;height:170px;left:-36px;top:-34px;z-index:-1;transform:rotate(8deg)}
.char-strip{list-style:none;margin:6px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:10px}
.char-pip{position:relative;width:58px;height:58px;display:grid;place-items:center;padding:0;background:var(--night);border:3px solid var(--line);border-radius:50%;box-shadow:0 4px 0 var(--line);cursor:pointer;transition:transform .12s ease}
.char-pip svg{width:44px;height:52px}
.char-pip:hover{transform:rotate(-6deg) scale(1.06)}
.char-pip.sel{background:var(--c);transform:rotate(-8deg) scale(1.14);box-shadow:0 0 0 3px var(--lime),0 6px 0 var(--line)}
.char-pip.mine::after{content:"你";position:absolute;top:-8px;right:-8px;font-family:var(--font-display);font-size:11px;line-height:1;padding:3px 5px 2px;color:var(--line);background:var(--lime);border:2px solid var(--line);border-radius:7px;transform:rotate(12deg)}
.arrow{position:absolute;top:50%;width:64px;height:64px;margin-top:-32px;font-size:24px;color:var(--line);background:var(--lime);border:3.5px solid var(--line);border-radius:48% 52% 46% 54% / 55% 45% 55% 45%;box-shadow:0 5px 0 var(--line);cursor:pointer;transition:transform .1s ease}
.arrow.prev{left:calc(max(5vw,24px) + min(440px,42vw) + 30px);transform:rotate(-8deg)}
.arrow.next{right:max(5vw,24px);transform:rotate(8deg)}
.arrow:hover{filter:brightness(1.08)}
.arrow:active{transform:translateY(3px);box-shadow:0 2px 0 var(--line)}

/* setup */
.map-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.map-card{position:relative;display:grid;gap:4px;justify-items:center;padding:6px 6px 7px;color:var(--paper);background:var(--night);border:3px solid var(--line);border-radius:14px 18px 12px 20px;box-shadow:0 4px 0 var(--line);cursor:pointer;transform:rotate(var(--tilt,0deg));transition:transform .12s ease;font-family:var(--font-display);font-size:13px;letter-spacing:.02em;white-space:nowrap}
.map-card canvas,.map-card .rot{width:100%;height:auto;aspect-ratio:15/13;border-radius:8px;border:2px solid var(--line);display:block;box-sizing:border-box}
.map-card .rot{display:grid;place-items:center;font-family:var(--font-num);font-size:34px;color:var(--line);background:repeating-linear-gradient(-45deg,var(--lime) 0 10px,var(--cyan) 10px 20px)}
.map-card:hover{transform:rotate(calc(var(--tilt,0deg) * -1)) scale(1.03)}
.map-card.sel{color:var(--line);background:var(--lime);transform:rotate(calc(var(--tilt,0deg) * -1)) scale(1.06);box-shadow:0 0 0 3px var(--magenta),0 6px 0 var(--line)}
.diff-row{display:flex;flex-wrap:wrap;gap:14px}
.diff-row .blob{font-size:20px;padding:8px 22px 9px}
.diff-row .blob[aria-pressed="false"]{--c:var(--night-2);color:var(--paper)}
.preview-tag{position:absolute;top:max(18px,env(safe-area-inset-top,0px));right:max(18px,env(safe-area-inset-right,0px))}

/* versus */
.vs-wrap{position:absolute;inset:0;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;justify-items:center;padding:0 5vw;gap:2vw}
.vs-you{position:relative;isolation:isolate;display:grid;justify-items:center;gap:10px;animation:slideL .5s cubic-bezier(.2,1.4,.4,1) both}
.vs-you>.splat{width:380px;height:380px;left:50%;top:50%;margin:-190px 0 0 -190px;z-index:-1;transform:rotate(15deg)}
.vs-you .face svg{width:150px;height:180px}
.vs-mark{position:relative;isolation:isolate;font-family:var(--font-num);font-size:104px;line-height:1;color:var(--paper);-webkit-text-stroke:9px var(--line);paint-order:stroke fill;text-shadow:0 8px 0 var(--line);transform:rotate(-8deg);animation:popin .45s .25s cubic-bezier(.2,1.8,.4,1) both}
.vs-mark>.splat{width:230px;height:230px;left:50%;top:50%;margin:-115px 0 0 -115px;z-index:-1}
.vs-foes{list-style:none;margin:0;padding:0;display:grid;gap:20px}
.vs-foes li{position:relative;isolation:isolate;display:grid;grid-template-columns:auto auto;align-items:center;gap:4px 12px;animation:slideR .45s cubic-bezier(.2,1.4,.4,1) both}
.vs-foes li:nth-child(2){animation-delay:.1s;margin-left:46px}
.vs-foes li:nth-child(3){animation-delay:.2s}
.vs-foes li>.splat{width:200px;height:160px;left:-26px;top:50%;margin-top:-80px;z-index:-1}
.vs-foes .face{grid-row:span 2}
.vs-foes .face svg{width:76px;height:92px}
.vs-foes b{font-family:var(--font-display);font-weight:400;font-size:32px;line-height:1;color:var(--paper);-webkit-text-stroke:5px var(--line);paint-order:stroke fill}
.vs-foes small{justify-self:start;font-weight:700;font-size:12px;color:var(--paper);background:var(--night);padding:1px 9px;border-radius:999px;border:2px solid var(--line)}
.vs-info{position:absolute;left:50%;bottom:max(13vh,64px);transform:translateX(-50%) rotate(-2deg);white-space:nowrap}
.vs-hint{position:absolute;left:50%;bottom:max(5vh,24px);transform:translateX(-50%);margin:0;font-weight:700;font-size:14px;color:var(--paper);-webkit-text-stroke:3px var(--line);paint-order:stroke fill;white-space:nowrap}
@keyframes slideL{from{opacity:0;transform:translateX(-90px) rotate(-10deg)}}
@keyframes slideR{from{opacity:0;transform:translateX(90px) rotate(10deg)}}
@keyframes popin{from{opacity:0;transform:scale(.2) rotate(-30deg)}}

/* how to play */
.keys{display:flex;flex-wrap:wrap;gap:8px 14px;font-size:13px}
.touch-hint{display:none;margin:0}
.touch-mode .keys{display:none}
.touch-mode .touch-hint{display:block}
.legend{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:6px 16px}
.legend li{display:flex;align-items:center;gap:6px}
.legend svg{width:22px;height:22px}

/* pause */
#pause{display:flex}
.pause-stack{margin:auto;display:grid;justify-items:center;gap:18px;padding:24px}
.pause-stack .ink-title{font-size:72px;margin-bottom:10px}
.hint{margin:6px 0 0;font-weight:700;font-size:13px;color:var(--paper);-webkit-text-stroke:3px var(--line);paint-order:stroke fill}

/* result */
.res-list{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.strip{display:flex;align-items:center;gap:10px;padding:5px 16px 5px 8px;color:var(--paper);background:var(--night);border:3px solid var(--line);border-radius:12px 18px 10px 20px;box-shadow:0 4px 0 var(--line);transform:rotate(var(--tilt,0deg));animation:slideL .4s both}
.strip:nth-child(2){animation-delay:.08s;margin-left:20px}
.strip:nth-child(3){animation-delay:.16s;margin-left:8px}
.strip:nth-child(4){animation-delay:.24s;margin-left:28px}
.strip.top{background:var(--lime);color:var(--line)}
.strip .rank{font-family:var(--font-num);font-size:24px;width:22px;text-align:center}
.strip .face svg{width:38px;height:46px}
.strip .nm{flex:1;font-weight:900;font-size:16px}
.strip .nm em{font-style:normal;margin-left:8px;font-size:12px;padding:1px 6px;border-radius:6px;background:var(--magenta);color:var(--paper);border:2px solid var(--line)}
.strip .sc{font-family:var(--font-num);font-size:30px;line-height:1;font-variant-numeric:tabular-nums}
.res-bottom{display:grid;gap:14px;margin-top:auto}
.strip .kd{display:flex;align-items:baseline;gap:1px;font-family:var(--font-num);font-size:16px;opacity:.92;font-variant-numeric:tabular-nums}
.strip .kd small{font-family:var(--font-body);font-weight:700;font-size:10px;margin:0 6px 0 1px;opacity:.75}
.team-dot{display:inline-block;width:11px;height:11px;margin-left:7px;border-radius:50%;background:var(--t);border:2px solid var(--line);vertical-align:-1px}
.earn{display:grid;gap:6px;justify-items:start}
.earn-total{font-family:var(--font-num);font-weight:400;font-size:36px;line-height:1;color:var(--lime);-webkit-text-stroke:6px var(--line);paint-order:stroke fill;text-shadow:0 4px 0 var(--line);transform:rotate(-3deg)}
.earn-total small{font-family:var(--font-display);font-size:19px;margin-left:6px}
.earn-parts{font-size:12px;font-weight:700;color:var(--paper);background:var(--night);border:2px solid var(--line);border-radius:999px;padding:2px 11px}
.earn-done{font-size:12px;font-weight:900;color:var(--line);background:var(--lime);border:2px solid var(--line);padding:2px 10px;border-radius:8px;transform:rotate(-1deg)}
/* lobby extras */
.nav-row{display:flex;flex-wrap:wrap;gap:14px;align-items:center}
.blob.sm{font-size:18px;padding:8px 18px 9px}
.name-chip{display:flex;align-items:baseline;gap:6px;padding:5px 14px;cursor:pointer;font-family:var(--font-body)}
.name-chip small{font-size:11px;color:var(--muted)}
.name-chip b{font-family:var(--font-display);font-weight:400;font-size:17px;color:var(--paper);max-width:9em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.name-chip:hover b{color:var(--lime)}
.shells{display:flex;align-items:center;gap:6px;padding:4px 14px 4px 8px}
.shells svg{width:22px;height:22px}
.shells b{font-family:var(--font-num);font-weight:400;font-size:20px;color:var(--paper);font-variant-numeric:tabular-nums}
.shells.bump{animation:bump .4s cubic-bezier(.2,1.8,.4,1)}
.daily{position:absolute;right:max(16px,env(safe-area-inset-right,0px));top:76px;width:min(290px,30vw);list-style:none;margin:0;padding:0;display:grid;gap:9px;justify-items:end}
.daily .tape{justify-self:end}
.daily .ch{display:grid;gap:4px;width:100%;box-sizing:border-box}
.daily .ch:nth-child(odd){--tilt:1deg}
.daily .ch b{font-family:var(--font-num);font-weight:400;font-size:13px;color:var(--lime)}
.daily .ch.done{opacity:.7}
.daily .ch.done b{color:var(--paper)}
.daily .bar{display:block;height:7px;border-radius:4px;background:var(--night-2);border:2px solid var(--line);overflow:hidden}
.daily .bar i{display:block;height:100%;background:var(--lime)}
.name-edit{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) rotate(-1.5deg);z-index:30;display:grid;gap:10px;padding:16px 18px;min-width:min(300px,calc(100vw - 48px));box-sizing:border-box}
.name-edit label{font-family:var(--font-display);font-size:18px;color:var(--lime)}
.name-edit input{font:700 18px var(--font-body);color:var(--line);background:var(--paper);border:3px solid var(--line);border-radius:10px;padding:8px 12px;outline:none;user-select:text;-webkit-user-select:text}
.name-edit input:focus{box-shadow:0 0 0 3px var(--lime)}
/* character stats */
.char-stats{display:grid;gap:5px}
.char-stats .row{display:grid;grid-template-columns:36px 1fr;align-items:center;gap:8px;font-weight:700;font-size:13px}
.char-stats .pips{display:flex;gap:4px}
.char-stats .pips i{width:12px;height:12px;border-radius:50%;background:transparent;border:2px solid rgba(255,255,255,.18)}
.char-stats .pips i.cap{border-color:var(--muted);background:var(--night-2)}
.char-stats .pips i.on{background:var(--lime);border-color:var(--line)}
.char-stats .note{font-size:11px;color:var(--muted);font-weight:400}
.perk b{color:var(--lime);font-family:var(--font-display);font-weight:400;font-size:16px;margin-right:6px}
.char-pip.locked svg{filter:grayscale(.75) brightness(.6)}
.char-pip.locked::before{content:"锁";position:absolute;bottom:-7px;right:-7px;z-index:1;font-family:var(--font-display);font-size:11px;line-height:1;padding:3px 5px 2px;color:var(--paper);background:var(--magenta);border:2px solid var(--line);border-radius:7px;transform:rotate(-10deg)}
/* HUD extras */
.stat .key{font-size:11px;line-height:1.2;padding:0 4px;margin:0 0 0 2px;border-bottom-width:3px}
.stat.curse{background:#4a1d7a}
.stat.curse b,.stat.trapped b{font-family:var(--font-display);font-size:16px}
.stat.trapped{padding:4px 14px;background:var(--magenta);animation:throb .45s ease-in-out infinite alternate}
.pl .tag{position:absolute;top:calc(100% + 2px);left:50%;transform:translateX(-50%);max-width:70px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px;font-weight:700;color:var(--paper);background:var(--night);border:2px solid var(--line);border-radius:6px;padding:0 5px}
.pl.trap .face{box-shadow:0 0 0 3px #ffd6f0,0 4px 0 var(--line);animation:throb .4s ease-in-out infinite alternate}
.hud.teams .pl .face{box-shadow:0 0 0 3px var(--team),0 4px 0 var(--line)}
.hud.teams .pl.trap .face{box-shadow:0 0 0 3px #ffd6f0,0 4px 0 var(--line)}
.act-btns{display:flex;align-items:flex-end;gap:12px}
.needle-btn{pointer-events:auto;touch-action:none;width:64px;height:64px;font-family:var(--font-display);font-size:20px;color:var(--line);background:#ff8fc8;border:3.5px solid var(--line);border-radius:52% 48% 56% 44% / 46% 58% 42% 54%;box-shadow:0 5px 0 var(--line);transform:rotate(6deg)}
.needle-btn:active{transform:translateY(3px) rotate(6deg);box-shadow:0 2px 0 var(--line)}
/* online */
.online-body,.room-body{display:grid;gap:12px;margin-top:auto}
.net-status{display:flex;align-items:center;gap:8px}
.net-status i{flex:none;width:11px;height:11px;border-radius:50%;background:var(--orange);border:2px solid var(--line)}
.net-status.on i{background:var(--lime)}
.net-status.err i{background:var(--magenta)}
.join-row,.srv-row{display:flex;gap:10px;align-items:center}
.join-row input,.srv-row input{box-sizing:border-box;font:400 22px var(--font-num);letter-spacing:.12em;width:130px;padding:7px 12px;color:var(--line);background:var(--paper);border:3px solid var(--line);border-radius:10px;outline:none;user-select:text;-webkit-user-select:text}
.join-row input:focus,.srv-row input:focus{box-shadow:0 0 0 3px var(--lime)}
.srv-row input{font:700 14px var(--font-body);letter-spacing:0;flex:1;min-width:0;width:auto}
.room-list{list-style:none;margin:0;padding:0;display:grid;gap:8px;max-height:32vh;overflow-y:auto;scrollbar-width:none}
.room-item{display:flex;align-items:center;gap:10px;width:100%;box-sizing:border-box;padding:6px 14px;color:var(--paper);background:var(--night);border:3px solid var(--line);border-radius:12px 18px 10px 20px;box-shadow:0 4px 0 var(--line);cursor:pointer;font:inherit;text-align:left}
.room-item:hover{background:var(--night-2)}
.room-item b{font-family:var(--font-num);font-weight:400;font-size:22px;color:var(--lime);letter-spacing:.06em}
.room-item .nm{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:900}
.room-item small{font-size:12px;font-weight:700;color:var(--muted)}
.room-item:disabled{opacity:.55;cursor:default}
.room-empty,.room-hint,.srv-note{margin:0;font-size:13px;font-weight:700;color:var(--paper);-webkit-text-stroke:3px var(--line);paint-order:stroke fill}
.server-box summary{cursor:pointer;font-weight:700;font-size:13px;color:var(--paper);-webkit-text-stroke:3px var(--line);paint-order:stroke fill}
.server-box[open]{display:grid;gap:8px}
.room-code{font-family:var(--font-num);letter-spacing:.06em;color:var(--lime)}
.seats{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.seats .strip{animation:none}
.seat .rd{font-size:12px;font-weight:900;color:var(--muted)}
.seat.ready .rd{color:var(--lime)}
.seat.me{background:var(--night-2)}
.seat.empty{opacity:.62;min-height:40px}
.seat .nm em.host{background:var(--orange);color:var(--line)}
.seat .nm em.you{background:var(--lime);color:var(--line)}
.room-me{display:flex;flex-wrap:wrap;gap:10px}
.room-settings{display:grid;gap:7px}
.set-row{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.set-row b{width:44px;font-family:var(--font-display);font-weight:400;font-size:16px;color:var(--lime);-webkit-text-stroke:4px var(--line);paint-order:stroke fill}
.chip{font:700 12px var(--font-body);padding:4px 10px;color:var(--paper);background:var(--night);border:2.5px solid var(--line);border-radius:999px;box-shadow:0 3px 0 var(--line);cursor:pointer}
.chip.on{background:var(--lime);color:var(--line)}
.chip:disabled{cursor:default}
.chip:disabled:not(.on){opacity:.55}
/* island run */
.run-body{display:grid;gap:12px;margin-top:auto}
.route{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.isle{position:relative;display:grid;justify-items:center;gap:1px;padding:7px 6px 8px;color:var(--paper);background:var(--night);border:3px solid var(--line);border-radius:14px 18px 12px 20px;box-shadow:0 4px 0 var(--line);transform:rotate(var(--tilt,0deg));font-family:var(--font-display);font-size:14px;white-space:nowrap;opacity:.72}
.isle b{font-family:var(--font-num);font-weight:400;font-size:24px;line-height:1;color:var(--muted)}
.isle.done{opacity:1;background:var(--night-2)}
.isle.done b{color:var(--lime)}
.isle.done::after{content:"过";position:absolute;top:-8px;right:-8px;font-size:11px;line-height:1;padding:3px 5px 2px;color:var(--line);background:var(--lime);border:2px solid var(--line);border-radius:7px;transform:rotate(12deg)}
.isle.now{opacity:1;color:var(--line);background:var(--lime);box-shadow:0 0 0 3px var(--magenta),0 5px 0 var(--line);transform:rotate(var(--tilt,0deg)) scale(1.07)}
.isle.now b{color:var(--line)}
.isle.king b{color:var(--magenta)}
.run-info{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.run-stats{display:flex;flex-wrap:wrap;gap:6px}
.run-stats span{font-weight:900;font-size:12px;padding:2px 9px;border-radius:999px;color:var(--paper);background:var(--night);border:2px solid var(--line)}
.run-stats span.card{color:var(--line);background:var(--c)}
.hearts{display:inline-flex;gap:3px}
.hearts i{display:block;width:24px;height:24px}
.hearts svg{width:100%;height:100%;fill:var(--night-2);stroke:var(--line);stroke-width:2.2}
.hearts i.on svg{fill:var(--magenta)}
.run-hud{display:flex;align-items:center;gap:10px;padding:3px 12px;background:var(--night);border:3px solid var(--line);border-radius:999px;box-shadow:0 4px 0 var(--line)}
.run-hud .hearts i{width:20px;height:20px}
.boss-hp{display:flex;gap:2px}
.boss-hp i{width:8px;height:13px;background:var(--lime);border:1.5px solid var(--line);border-radius:3px}
.hud.run .scorebar .team{display:none}
.cards-wrap{position:absolute;inset:0;display:grid;align-content:center;justify-items:center;gap:18px;padding:24px 16px;box-sizing:border-box;overflow-y:auto}
.cards-wrap .ink-title{font-size:clamp(36px,6vw,58px)}
.cards{display:flex;flex-wrap:wrap;justify-content:center;gap:22px}
.card-pick{width:196px;display:grid;justify-items:center;align-content:start;gap:8px;padding:18px 14px 16px;color:var(--paper);background-color:var(--night);background-image:radial-gradient(var(--dots) 1.4px,transparent 1.7px);background-size:11px 11px;border:3.5px solid var(--line);border-radius:18px 26px 16px 28px;box-shadow:0 7px 0 var(--line);transform:rotate(var(--tilt,0deg));cursor:pointer;transition:transform .14s ease;animation:popin .4s cubic-bezier(.2,1.6,.4,1) both}
.card-pick:nth-child(2){animation-delay:.08s}.card-pick:nth-child(3){animation-delay:.16s}
.card-pick:hover{transform:rotate(calc(var(--tilt,0deg) * -1)) scale(1.06)}
.card-pick:focus-visible{outline:3px dashed var(--lime);outline-offset:6px}
.card-pick .ico{width:70px;height:70px;display:grid;place-items:center;font-family:var(--font-display);font-size:34px;color:var(--line);background:var(--c);border:3.5px solid var(--line);border-radius:48% 52% 46% 54% / 55% 45% 55% 45%;box-shadow:0 4px 0 var(--line)}
.card-pick b{font-family:var(--font-display);font-weight:400;font-size:25px;line-height:1.1;-webkit-text-stroke:4px var(--line);paint-order:stroke fill}
.card-pick span:last-child{font-size:13px;line-height:1.55;color:var(--muted);text-align:center}
@media (max-width:819px) and (orientation:portrait),(max-width:819px) and (min-height:451px){ .route{grid-template-columns:repeat(6,1fr);gap:5px} .isle{font-size:0;padding:5px 2px} .isle b{font-size:18px} .card-pick{width:150px;padding:14px 10px} }
/* candy shop */
.shop-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.shop-tabs{display:flex;flex-wrap:wrap;gap:10px}
.shop-tabs .blob{font-size:17px;padding:7px 16px 8px}
.shop-tabs .blob[aria-selected="false"]{--c:var(--night-2);color:var(--paper)}
.shop-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.shop-card{position:relative;display:grid;justify-items:center;gap:4px;padding:8px 6px 7px;color:var(--paper);background:var(--night);border:3px solid var(--line);border-radius:14px 18px 12px 20px;box-shadow:0 4px 0 var(--line);cursor:pointer;transform:rotate(var(--tilt,0deg));transition:transform .12s ease;font-family:var(--font-display);font-size:14px;white-space:nowrap}
.shop-card:hover{transform:rotate(calc(var(--tilt,0deg) * -1)) scale(1.04)}
.shop-card.sel{background:var(--lime);color:var(--line);box-shadow:0 0 0 3px var(--magenta),0 6px 0 var(--line);transform:rotate(calc(var(--tilt,0deg) * -1)) scale(1.06)}
.shop-card small{font-family:var(--font-body);font-weight:900;font-size:11px;padding:1px 7px;border-radius:999px;background:var(--night-2);color:var(--paper);border:2px solid var(--line)}
.shop-card small.own{background:var(--cyan);color:var(--line)}
.shop-card small.use{background:var(--magenta)}
.shop-card .sw{width:46px;height:46px;border-radius:50%;border:3px solid var(--line);display:grid;place-items:center;font-size:22px;box-sizing:border-box}
.shop-card .sw svg{width:40px;height:48px}
.shop-card .glyph{background:var(--night-2);color:var(--lime);font-family:var(--font-display)}
.shop-card .dots{display:flex;gap:3px;align-items:center;justify-content:center;background:var(--night-2)}
.shop-card .dots i{width:8px;height:8px;border-radius:50%;border:1.5px solid var(--line)}
.shop-card:focus-visible{outline:3px dashed var(--lime);outline-offset:5px}
@media (max-width:819px) and (orientation:portrait),(max-width:819px) and (min-height:451px){ .shop-col{top:auto;max-height:64vh;justify-content:flex-start;gap:9px} .shop-grid{grid-template-columns:repeat(4,1fr);gap:8px} .shop-card .sw{width:38px;height:38px} }
@media (max-width:819px) and (orientation:portrait),(max-width:819px) and (min-height:451px){
  .daily{display:none}
  .nav-row{display:contents}
  .lobby-nav .blob small{display:none}
}

/* ---------- in-game HUD ---------- */
.hud{position:absolute;inset:0;pointer-events:none;padding-top:max(12px,env(safe-area-inset-top,0px));padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));padding-bottom:max(12px,env(safe-area-inset-bottom,0px));box-sizing:border-box;z-index:10}
.hud-top{position:relative;display:flex;justify-content:center;padding:0 104px}
.scorebar{display:flex;align-items:flex-start;gap:12px}
.team{list-style:none;margin:0;padding:0;display:flex;gap:8px}
.pl{position:relative;display:grid;justify-items:center;gap:5px;transition:opacity .2s ease}
.pl .face{position:relative;width:46px;height:46px;background:var(--night);border:3px solid var(--line);border-radius:50%;box-shadow:0 4px 0 var(--line)}
.pl .face svg{width:38px;height:44px;margin-top:-2px}
.pl .pips{display:flex;gap:3px}
.pl .pips i{width:9px;height:9px;border-radius:50%;background:var(--night);border:2px solid var(--line)}
.pl .pips i.on{background:var(--lime)}
.pl .me{position:absolute;top:-9px;left:-8px;z-index:1;font-family:var(--font-display);font-size:12px;line-height:1;padding:3px 5px 2px;color:var(--line);background:var(--lime);border:2px solid var(--line);border-radius:7px;transform:rotate(-12deg)}
.pl.out .face{background:var(--night-2)}
.pl.out .face svg{filter:grayscale(1) brightness(.5)}
.pl.out .face::before,.pl.out .face::after{content:"";position:absolute;left:50%;top:50%;width:46px;height:7px;margin:-3.5px 0 0 -23px;background:var(--magenta);border:2px solid var(--line);border-radius:4px}
.pl.out .face::before{transform:rotate(45deg)}
.pl.out .face::after{transform:rotate(-45deg)}
.center-col{display:grid;justify-items:center;gap:6px}
.timer{font-family:var(--font-num);font-size:32px;line-height:1;padding:8px 18px 6px;color:var(--paper);background:var(--night);border:3px solid var(--line);border-radius:18px 22px 16px 24px;box-shadow:0 5px 0 var(--line);font-variant-numeric:tabular-nums;min-width:66px;text-align:center;transform:rotate(-2deg)}
.timer.hot{background:var(--magenta);font-family:var(--font-display);font-size:22px;padding:9px 14px 8px;animation:throb .6s ease-in-out infinite alternate}
@keyframes throb{to{transform:rotate(2deg) scale(1.06)}}
.map-tag,.ff{font-family:var(--font-display);font-size:13px;letter-spacing:.05em;line-height:1.3;padding:3px 12px;clip-path:polygon(3% 12%,7% 0,94% 8%,100% 0,97% 88%,92% 100%,5% 92%,0 100%)}
.map-tag{color:var(--paper);background:var(--magenta);transform:rotate(2deg)}
.ff{color:var(--line);background:var(--cyan);transform:rotate(-2deg)}
.hud-buttons{position:absolute;top:0;right:0;display:flex;gap:8px;pointer-events:auto}
.stats{position:absolute;left:max(16px,env(safe-area-inset-left,0px));bottom:max(14px,env(safe-area-inset-bottom,0px));display:flex;gap:8px}
.stat{display:flex;align-items:center;gap:6px;padding:4px 14px 4px 7px;background:var(--night);border:3px solid var(--line);border-radius:999px;box-shadow:0 4px 0 var(--line)}
.stat svg{width:22px;height:22px}
.stat b{font-family:var(--font-num);font-weight:400;font-size:21px;line-height:1;color:var(--paper);font-variant-numeric:tabular-nums}
.stat.bump{animation:bump .35s cubic-bezier(.2,1.8,.4,1)}
@keyframes bump{0%{transform:scale(1)}40%{transform:scale(1.28) rotate(-6deg)}100%{transform:scale(1)}}

/* banner + popups */
.banner{position:absolute;left:50%;top:40%;transform:translate(-50%,-50%);z-index:15;pointer-events:none;isolation:isolate;display:grid;justify-items:center;gap:10px;text-align:center}
.banner .splat{width:min(78vw,480px);height:min(78vw,480px);left:50%;top:50%;margin:calc(min(78vw,480px) / -2) 0 0 calc(min(78vw,480px) / -2);transform:rotate(var(--rot,0deg)) scale(.62);z-index:-1;opacity:.96}
.banner .bt{font-family:var(--font-display);font-size:clamp(40px,9vw,84px);line-height:1.05;color:var(--paper);-webkit-text-stroke:7px var(--line);paint-order:stroke fill;text-shadow:0 7px 0 var(--line);white-space:nowrap;transform:rotate(-4deg)}
.banner .bt.num{font-family:var(--font-num);font-size:clamp(90px,17vw,160px)}
.banner .sub span{display:inline-block;font-weight:700;font-size:15px;color:var(--paper);background:var(--night);border:3px solid var(--line);border-radius:999px;padding:4px 14px;box-shadow:0 3px 0 var(--line)}
.banner.pop{animation:pop .5s cubic-bezier(.2,1.7,.4,1)}
@keyframes pop{0%{transform:translate(-50%,-50%) scale(.3) rotate(-12deg);opacity:0}100%{transform:translate(-50%,-50%) scale(1);opacity:1}}
#popups{position:absolute;inset:0;pointer-events:none;z-index:12;overflow:hidden}
.popup{position:absolute;transform:translate(-50%,-50%);font-family:var(--font-display);font-size:24px;color:var(--lime);-webkit-text-stroke:5px var(--line);paint-order:stroke fill;white-space:nowrap;animation:floatup 1.1s ease-out forwards}
.popup.warn{color:var(--magenta)}
@keyframes floatup{0%{opacity:0;transform:translate(-50%,-30%) scale(.6) rotate(-8deg)}15%{opacity:1;transform:translate(-50%,-60%) scale(1.15) rotate(-4deg)}100%{opacity:0;transform:translate(-50%,-190%) scale(1) rotate(-4deg)}}

/* touch controls */
.touch{position:absolute;left:0;right:0;bottom:0;z-index:11;display:flex;justify-content:space-between;align-items:flex-end;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));padding-bottom:max(18px,env(safe-area-inset-bottom,0px));pointer-events:none}
.dpad{display:grid;grid-template-columns:repeat(3,54px);grid-template-rows:repeat(3,54px);gap:2px;pointer-events:auto;touch-action:none}
.dpad button{font-size:20px;color:var(--paper);background:var(--night);border:3px solid var(--line);border-radius:14px;box-shadow:0 4px 0 var(--line);touch-action:none;padding:0}
.dpad button:active{color:var(--line);background:var(--lime)}
.dpad .d-up{grid-area:1/2}.dpad .d-left{grid-area:2/1}.dpad .d-right{grid-area:2/3}.dpad .d-down{grid-area:3/2}
.bomb-btn{pointer-events:auto;touch-action:none;width:96px;height:96px;font-family:var(--font-display);font-size:24px;color:var(--paper);background:var(--magenta);border:4px solid var(--line);border-radius:48% 52% 44% 56% / 55% 45% 55% 45%;box-shadow:0 6px 0 var(--line);transform:rotate(-6deg)}
.bomb-btn:active{transform:translateY(4px) rotate(-6deg);box-shadow:0 2px 0 var(--line)}
.touch-mode .stats{position:static;margin-top:10px;flex-wrap:wrap}

/* loading + boss key */
.loading{position:absolute;inset:0;display:flex;z-index:40;background-color:var(--night);background-image:radial-gradient(var(--dots) 1.4px,transparent 1.7px);background-size:11px 11px}
.loading .shard{margin:auto;display:grid;justify-items:center;gap:10px;font-weight:700;font-size:15px;text-align:center;max-width:min(340px,calc(100% - 32px))}
.dots{display:inline-flex;gap:8px;justify-content:center}
/* 快速联机: the "finding players" card (shared/quickmatch.js) */
.qm-card{position:absolute;left:50%;top:50%;z-index:45;display:grid;justify-items:center;gap:10px;box-sizing:border-box;width:min(360px,calc(100% - 40px));padding:18px 22px 20px;text-align:center;transform:translate(-50%,-50%) rotate(-1.5deg)}
.qm-card b{font-family:var(--font-display);font-weight:400;font-size:24px;line-height:1.2;color:var(--lime);-webkit-text-stroke:4px var(--line);paint-order:stroke fill}
.qm-card p{margin:0;font-size:13px;font-weight:700;color:var(--muted)}
.qm-card p:empty{display:none}
.dots i{width:16px;height:16px;border-radius:50%;border:3px solid var(--line);animation:hop 1s ease-in-out infinite}
.dots i:nth-child(1){background:var(--magenta)}.dots i:nth-child(2){background:var(--lime);animation-delay:.15s}.dots i:nth-child(3){background:var(--cyan);animation-delay:.3s}
@keyframes hop{0%,100%{transform:translateY(0)}50%{transform:translateY(-10px)}}
.boss{position:absolute;inset:0;z-index:100;background:var(--boss)}

/* ---------- narrow screens held upright: pieces stack top and bottom around the subject (a phone held sideways is
   short rather than narrow: it gets the side column, see the short-window blocks at the end) ---------- */
@media (max-width:819px) and (orientation:portrait),(max-width:819px) and (min-height:451px){
  .side-col{left:max(16px,env(safe-area-inset-left,0px));right:max(16px,env(safe-area-inset-right,0px));width:auto;top:max(14px,env(safe-area-inset-top,0px));bottom:max(14px,env(safe-area-inset-bottom,0px));justify-content:space-between}
  .logo{justify-items:center;justify-self:center;align-self:center;text-align:center}
  .title{justify-content:center;font-size:clamp(44px,13vw,62px)}
  .subtitle{transform-origin:center}
  .lobby-nav{grid-template-columns:1fr 1fr;gap:14px;justify-items:stretch}
  .lobby-nav .blob{margin-left:0!important}
  .lobby-nav .big{grid-column:1/-1}
  .nameplate{right:16px;bottom:auto;top:41%}
  .nameplate>.splat{width:180px;height:150px;margin:-75px 0 0 -90px}
  .np-name{font-size:38px}
  .ticker,.corner .record{display:none}
  .char-strip{gap:8px}
  .char-pip{width:46px;height:46px}
  .char-pip svg{width:36px;height:42px}
  .arrow{top:32%;width:52px;height:52px;margin-top:-26px;font-size:20px}
  .arrow.prev{left:16px}
  .arrow.next{right:16px}
  .setup-col{top:auto;max-height:66vh;justify-content:flex-start;gap:9px}
  .setup-col .ink-title.sm{font-size:20px}
  .setup-col .actions{margin-top:0}
  .map-grid{grid-template-columns:repeat(4,1fr);gap:8px}
  .map-card{font-size:12px;padding:5px 5px 6px}
  .map-card .rot{font-size:22px}
  .vs-wrap{grid-template-columns:1fr;grid-template-rows:auto auto auto;align-content:center;padding:10vh 16px 20vh;gap:12px}
  .vs-you>.splat{width:260px;height:260px;margin:-130px 0 0 -130px}
  .vs-you .face svg{width:104px;height:125px}
  .vs-mark{font-size:64px}
  .vs-mark>.splat{width:150px;height:150px;margin:-75px 0 0 -75px}
  .vs-foes{grid-auto-flow:column;gap:10px}
  .vs-foes li{grid-template-columns:1fr;justify-items:center;margin-left:0!important}
  .vs-foes li>.splat{width:120px;height:110px;left:50%;margin-left:-60px}
  .vs-foes .face{grid-row:auto}
  .vs-foes .face svg{width:56px;height:68px}
  .vs-foes b{font-size:20px}
  .vs-foes small{justify-self:center}
  .howto-col{justify-content:flex-start}
  .hud-top{justify-content:flex-start;padding:0 94px 0 0}
  .scorebar{gap:7px}
  .team{gap:5px}
  .pl .face{width:34px;height:34px;border-width:2.5px}
  .pl .face svg{width:28px;height:33px}
  .pl .pips i{width:7px;height:7px;border-width:1.5px}
  .pl.out .face::before,.pl.out .face::after{width:34px;height:6px;margin:-3px 0 0 -17px}
  .timer{font-size:24px;padding:6px 10px 4px;min-width:48px}
  .icon-btn{width:38px;height:38px}
  .icon-btn svg{width:19px;height:19px}
}
@media (prefers-reduced-motion:reduce){
  .title span,.dots i,.timer.hot{animation:none}
  .banner.pop,.stat.bump,.vs-you,.vs-mark,.vs-foes li,.strip,.ticker.swap{animation:none}
}
/* Short, wide windows (a game portal's frame, e.g. 836×470 or 1031×580): smaller type and buttons, and the extras that
   only fit a tall window give way. The same idea as day 1's own block; each game's page adds rules for its own screens. */
@media (max-height:620px) and (min-width:820px),(orientation:landscape) and (max-height:450px){
  .side-col{top:max(10px,env(safe-area-inset-top,0px));bottom:max(10px,env(safe-area-inset-bottom,0px));gap:8px;padding:4px 12px 6px 4px;width:min(440px,46vw)}
  .blob{font-size:19px;padding:6px 18px 7px}
  .blob.big{font-size:24px;padding:8px 24px 9px}
  .blob.sm{font-size:15px;padding:5px 13px 6px}
  .blob small{font-size:11px}
  .actions{gap:8px 12px;margin-top:0}
  .ink-title{font-size:clamp(28px,4.2vw,38px);-webkit-text-stroke:5px var(--line);text-shadow:0 4px 0 var(--line)}
  .ink-title.sm{font-size:18px;-webkit-text-stroke:4px var(--line)}
  .shard{padding:6px 12px;font-size:13px;line-height:1.45}
  .shard.small{font-size:12px;padding:5px 10px;line-height:1.45}
  .tape{font-size:14px}
  .corner{top:10px;gap:8px}
  .icon-btn{width:38px;height:38px}
  .icon-btn svg{width:19px;height:19px}
  /* lobby */
  .title{font-size:clamp(36px,5vw,52px)}
  .subtitle{font-size:16px;margin-top:2px}
  .lobby-nav{gap:7px;padding-bottom:0}
  .logo{gap:2px}
  .nav-row{gap:9px}
  .daily{top:60px;gap:5px;width:min(250px,28vw)}
  .daily .ch{padding:4px 10px;gap:3px}
  .nameplate{bottom:max(7vh,30px);right:max(6vw,24px)}
  .nameplate>.splat{width:200px;height:170px;margin:-85px 0 0 -100px}
  .np-name{font-size:38px}
  .ticker{display:none}
  .corner .record{display:none} /* the syrup jar needs the room; the record is on the results too */
  /* characters: the personality line and the stats note give way (the quote, the stats and the perk stay) */
  .char-info{gap:6px}
  #char-line,.char-stats .note{display:none}
  .np{margin-top:6px;padding:4px 12px 0}
  .np>.splat{width:170px;height:130px;top:-26px}
  .quote-row{gap:6px 10px}
  .quote-tag{font-size:16px;padding:3px 11px 4px}
  .poke-hint{font-size:11px;padding:2px 9px}
  #char-gear{display:none}
  .char-stats{gap:2px}
  .char-stats .pips i{width:10px;height:10px}
  .char-strip{gap:6px;margin-top:0}
  .char-pip{width:40px;height:40px;border-width:2.5px}
  .char-pip svg{width:32px;height:38px}
  /* setup */
  .map-grid{gap:6px}
  .map-card{padding:5px 4px;font-size:12px}
  .diff-row{gap:8px}
  .diff-row .blob{font-size:16px;padding:5px 14px 6px}
  /* versus */
  .vs-you>.splat{width:300px;height:300px;margin:-150px 0 0 -150px}
  .vs-you .face svg{width:112px;height:134px}
  .vs-mark{font-size:78px}
  .vs-foes{gap:8px}
  .vs-foes .face svg{width:58px;height:70px}
  .vs-foes b{font-size:26px}
  .vs-info{bottom:58px}
  .vs-hint{bottom:16px}
  /* result: the title on one line, the lifetime record gives way */
  #scr-result .ink-title{font-size:clamp(26px,3.6vw,34px)}
  #result-record{display:none}
  #scr-result .side-col{width:min(470px,51vw)}
  .res-list{gap:5px}
  .strip .nm{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
  .strip{padding:0 10px 0 6px}
  .strip .face svg{width:25px;height:30px}
  .strip .nm{font-size:14px}
  .strip .rank{font-size:18px}
  .strip .sc{font-size:22px}
  .res-bottom{gap:5px}
  #scr-result .actions{gap:6px 10px}
  .earn{gap:3px}
  .earn-total{font-size:24px;-webkit-text-stroke:5px var(--line)}
  .earn-parts,.earn-done{font-size:11px}
  /* how to play: two columns across the window */
  .howto-col{width:auto;right:max(24px,4vw);flex-wrap:wrap;align-content:flex-start;column-gap:18px}
  .howto-col>.shard{width:calc(50% - 9px);box-sizing:border-box}
  .howto-col>.actions{order:1}
  .howto-col .shard{font-size:12px;line-height:1.4}
  .shard h3{font-size:16px;margin-bottom:2px}
  /* pause */
  .pause-stack{gap:10px}
  .pause-stack .ink-title{font-size:54px;margin-bottom:4px}
  /* setup: the map pictures and the map's blurb give way (the 3D preview beside them shows the map) */
  #scr-setup .map-grid .map-card canvas{display:none}
  #scr-setup .map-grid .map-card{padding:6px;font-size:13px;gap:2px;min-width:0}
  #scr-setup .map-grid .map-card small{white-space:normal;line-height:1.2}
  #scr-setup #map-desc,#scr-setup #spot-desc{display:none}
  #scr-setup .setup-col{gap:5px}
  #scr-setup .ink-title.sm{font-size:16px;margin:3px 0 2px;z-index:1}
  #scr-setup .shard.small{font-size:11px;line-height:1.35;padding:4px 9px}
  #scr-setup .diff-row{gap:6px}
  #scr-setup .diff-row .blob{font-size:14px;padding:4px 11px 5px}
  /* how to play: the back button right under the tape, at the top of the first column */
  #scr-howto .howto-col>.tape{order:-2}
  #scr-howto .howto-col>.actions{order:-1}
}

/* ---------- a phone held sideways (any window this short and wide): the block above, smaller again ----------
   From about 320 tall (a small phone with the browser's bars showing) to 450. Every screen fits without scrolling:
   the pieces keep to the left column, the subject (the bear, the map, the podium) to the right; buttons stay big
   enough for a thumb; extras that need a tall window give way. Each game's page adds its own screens' rules. */
@media (orientation:landscape) and (max-height:450px){
  .side-col{left:max(14px,env(safe-area-inset-left,0px));top:max(8px,env(safe-area-inset-top,0px));bottom:max(4px,env(safe-area-inset-bottom,0px));width:min(380px,50vw);gap:5px;padding:2px 10px 2px 2px}
  /* the buttons keep the last row of a column in view (if a column ever does run long, it scrolls under them) */
  .side-col>.actions,.side-col .res-bottom>.actions,.side-col .char-info>.actions{position:sticky;bottom:0;z-index:3;padding-bottom:18px}
  .blob{font-size:17px;padding:5px 15px 6px}
  .blob.big{font-size:22px;padding:6px 22px 7px}
  .blob.sm{font-size:14px;padding:4px 11px 5px}
  .blob small{font-size:10px}
  .actions,.nav-row{gap:18px 20px}
  .tape{font-size:12px;padding:3px 12px 4px}
  .shard{font-size:12px;line-height:1.4;padding:5px 10px}
  .shard.small{font-size:11px;line-height:1.35;padding:4px 9px}
  .ink-title{font-size:clamp(22px,8vh,30px);-webkit-text-stroke:4px var(--line);text-shadow:0 3px 0 var(--line)}
  .ink-title.sm{font-size:15px;-webkit-text-stroke:3.5px var(--line)}
  /* the corner: sounds, shells and the jar, smaller; the name chip gives way (the name is on the results and over the bear) */
  .corner{top:max(6px,env(safe-area-inset-top,0px));right:max(12px,env(safe-area-inset-right,0px));gap:6px}
  .corner .name-chip{display:none}
  .icon-btn{width:34px;height:34px;border-width:2.5px;box-shadow:0 3px 0 var(--line)}
  .icon-btn>.icon-art{width:22px;height:22px}
  .shells{padding:2px 10px 2px 6px}
  .shells b{font-size:16px}
  .shells>.icon-art{width:24px;height:24px}
  /* lobby: the title smaller, today's challenges one short line each under the corner, the nameplate under them */
  .logo{gap:0}
  .title{font-size:clamp(28px,10.5vh,44px);margin:0}
  .title span{-webkit-text-stroke:6px var(--line);text-shadow:0 4px 0 var(--line)}
  .subtitle{font-size:12px;margin-top:0;-webkit-text-stroke:3px var(--line)}
  .lobby-nav{gap:16px}
  .daily{top:calc(max(6px,env(safe-area-inset-top,0px)) + 44px);width:min(210px,30vw);gap:3px}
  .daily .tape{font-size:11px;padding:2px 10px 3px}
  .daily .ch{padding:3px 8px;gap:2px;font-size:11px;line-height:1.3}
  .daily .bar{height:5px}
  .daily .ch b{font-size:11px}
  .nameplate{right:max(4vw,16px);bottom:max(3vh,8px);gap:4px}
  .nameplate>.splat{width:150px;height:126px;margin:-63px 0 0 -75px}
  .np-name{font-size:30px;-webkit-text-stroke:5px var(--line)}
  /* characters */
  .char-info{gap:5px}
  #char-line,.poke-hint,.char-stats .note{display:none}
  .np{margin-top:2px;padding:2px 10px 0}
  .np>.splat{width:140px;height:104px;left:-24px;top:-20px}
  .quote-tag{font-size:14px;padding:2px 9px 3px;max-width:100%}
  .char-strip{gap:5px;flex-wrap:nowrap}
  .char-pip{width:36px;height:36px;border-width:2.5px;box-shadow:0 3px 0 var(--line)}
  .char-pip svg{width:28px;height:33px}
  .char-pip.sel{transform:rotate(-8deg) scale(1.1)}
  .arrow{width:44px;height:44px;margin-top:-22px;font-size:18px}
  .arrow.prev{left:calc(max(14px,env(safe-area-inset-left,0px)) + min(380px,50vw) + 10px)}
  .arrow.next{right:max(14px,env(safe-area-inset-right,0px))}
  /* setup */
  .map-grid{gap:5px}
  .map-card{font-size:11px;padding:4px 3px 5px;border-width:2.5px}
  .diff-row .blob{font-size:14px;padding:3px 10px 4px}
  .preview-tag{top:max(8px,env(safe-area-inset-top,0px));right:max(12px,env(safe-area-inset-right,0px))}
  /* versus */
  .vs-wrap{padding:0 4vw 34px}
  .vs-you>.splat{width:220px;height:220px;margin:-110px 0 0 -110px}
  .vs-you .face svg{width:84px;height:100px}
  .vs-mark{font-size:56px;-webkit-text-stroke:6px var(--line)}
  .vs-mark>.splat{width:140px;height:140px;margin:-70px 0 0 -70px}
  .vs-foes{gap:4px}
  .vs-foes .face svg{width:44px;height:53px}
  .vs-foes b{font-size:20px;-webkit-text-stroke:4px var(--line)}
  .vs-info{bottom:30px}
  .vs-hint{bottom:8px;font-size:12px}
  /* result: one short row per player, the buttons always in view */
  #scr-result .side-col{width:min(400px,54vw)}
  .res-list{gap:3px}
  .strip{padding:0 8px 0 4px;gap:6px;border-width:2px;box-shadow:0 2px 0 var(--line)}
  .strip .face svg{width:20px;height:24px}
  .strip .rank{font-size:14px;width:16px}
  .strip .nm{font-size:12px}
  .strip .sc{font-size:16px}
  .res-bottom{gap:4px}
  .earn-total{font-size:20px;-webkit-text-stroke:4px var(--line)}
  .earn-total small{font-size:14px}
  .earn-parts{display:none} /* (how the shells add up: the total is enough here) */
  /* how to play: the cards side by side, a finger swipes along them; each card scrolls on its own if it must */
  #scr-howto .howto-col{right:0;width:auto;display:grid;grid-template-rows:auto minmax(0,1fr);grid-auto-columns:min(330px,64vw);grid-auto-flow:column;align-content:stretch;gap:6px 14px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;padding-right:max(14px,env(safe-area-inset-right,0px))}
  #scr-howto .howto-col>.tape{grid-row:1;grid-column:1;align-self:center}
  #scr-howto .howto-col>.actions{grid-row:1;grid-column:2;margin:0;padding-bottom:16px}
  #scr-howto .howto-col>.shard{grid-row:2;width:auto;max-height:100%;overflow-y:auto;scrollbar-width:none;scroll-snap-align:start;box-sizing:border-box;margin-bottom:6px}
  #scr-howto .howto-col .shard{font-size:11.5px;line-height:1.4}
  /* pause */
  .pause-stack{gap:16px;padding:10px}
  .pause-stack .ink-title{font-size:40px;margin-bottom:0}
  /* in-game HUD: the round faces, the timer and the buttons smaller */
  .hud-top{padding:0 94px}
  .scorebar{gap:7px}
  .team{gap:5px}
  .pl .face{width:34px;height:34px;border-width:2.5px}
  .pl .face svg{width:28px;height:33px}
  .pl .pips i{width:7px;height:7px;border-width:1.5px}
  .pl.out .face::before,.pl.out .face::after{width:34px;height:6px;margin:-3px 0 0 -17px}
  .timer{font-size:22px;padding:5px 10px 3px;min-width:48px}
  .banner .bt{font-size:clamp(34px,12vh,58px)}
  .banner .bt.num{font-size:clamp(70px,26vh,110px)}
  .qm-card{padding:12px 16px 14px;gap:6px}
  /* the candy shop: from the top, four to a row, smaller cards */
  #scr-shop .shop-col{top:max(8px,env(safe-area-inset-top,0px));bottom:max(4px,env(safe-area-inset-bottom,0px));max-height:none;gap:5px}
  .shop-tabs{gap:14px 16px}
  .shop-tabs .blob{font-size:14px;padding:3px 11px 4px}
  .shop-grid{grid-template-columns:repeat(4,1fr);gap:6px}
  .shop-card{padding:4px 3px 5px;font-size:11.5px;gap:2px;border-width:2.5px}
  .shop-card .sw{width:34px;height:34px;border-width:2.5px}
  .shop-card .sw svg{width:30px;height:36px}
  #scr-shop .shop-card .sw,#scr-shop .shop-card .icon-art{width:30px;height:30px}
  #scr-shop .shard.small{font-size:11px;padding:3px 9px}
  .shop-card small{font-size:10px;padding:0 5px}
}
