/* The stage (2026-10-17, the desktop-feel audit, D4). The game is one fixed 1024 x 576 screen (#frame, scaled to the window by js/ui/stage.js), so there are no
   width or height media queries any more (the phone rules of style.css were removed with this change: git history has them). This file holds the shell, the
   window look (title bars, the solid well the cards sit on) and the layouts that are specific to the stage; style.css keeps the components. */

:root{--well:#22345a;--well-b:#2a4068;--bar:#111a30;--accent:#f8c030}

/* ---- Museum track C (2026-10-19): name plates, sky paints, the logbook, the Trophy wing and the Wanted poster (js/state/museum-c.js) ---- */
.tc-plate{display:flex;align-items:center;gap:4px;font:700 var(--fs-tag) var(--f-ui);letter-spacing:1px;text-transform:uppercase;color:#6a3aa8}
.platepick{display:flex;align-items:center;gap:8px;margin-top:6px}
.platepick label{font:700 var(--fs-tag) var(--f-ui);letter-spacing:1px;text-transform:uppercase;color:var(--mut);flex:none}
.platepick select{flex:1;min-width:0;font:500 var(--fs-text) var(--f-text);color:var(--ink);background:#fff;border:3px solid var(--edge);border-radius:6px;padding:4px 6px}
#s-profile .themes.many{grid-template-columns:repeat(8,minmax(0,1fr))}
#s-profile .panel.profwide{flex:1 1 0;min-height:0;display:flex;flex-direction:column}
#s-profile .profwide .tabs{flex:none;margin-bottom:6px}
#s-profile .profwide #profileStats,#s-profile #profileLog{overflow-y:auto;min-height:0;flex:1 1 auto}
.lbrow{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:3px 0;border-bottom:2px dashed #c4ccdc;font-size:var(--fs-small)}
.lbtext{display:flex;flex-direction:column;min-width:0}
.lbtext small{font-size:var(--fs-fine)}
.lbteam{display:flex;gap:1px;flex:none}
.lbteam img{width:32px;height:32px;image-rendering:auto}
.wing{grid-column:1/-1;display:flex;flex-direction:column;gap:10px}
.wingsec h3{margin-bottom:4px}
.wtiles{display:flex;flex-wrap:wrap;gap:4px}
.wtile{width:50px;height:50px;padding:0;min-width:0;display:flex;align-items:center;justify-content:center}
.wtile img{width:44px;height:44px;image-rendering:auto}
.wtile.mastered{border-color:#e8b400;background:#fff3b8}
.wtile.shiny{border-color:#1ec8ff}
.wtile.classS{border-color:#e8c020}
.wbadges{display:flex;flex-wrap:wrap;gap:8px}
.wbadge{display:flex;flex-direction:column;align-items:center;gap:2px;width:84px;text-align:center}
.wbadge .px{width:32px;height:32px}
.wbadge small{font-size:var(--fs-fine);line-height:1.1}
.posterimg{width:32px;height:32px;vertical-align:middle;image-rendering:auto}
.posterbox{display:flex;flex-direction:column;gap:8px}
.posterbox .row{display:flex;gap:8px;align-items:center}
.posterbox input{flex:1;min-width:0;font:500 var(--fs-text) var(--f-text);color:var(--ink);background:#fff;border:3px solid var(--edge);border-radius:6px;padding:6px 8px}
.posterlist{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;max-height:300px;overflow-y:auto;padding-right:4px;align-content:start}
.posterrow{display:flex;align-items:center;gap:6px;text-align:left;padding:3px 6px}
.posterrow img{width:40px;height:40px;flex:none;image-rendering:auto}
.posterrow span{display:flex;flex-direction:column;min-width:0}
.posterrow b{font:700 var(--fs-small)/1.1 var(--f-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.posterrow small{font-size:var(--fs-fine);line-height:1.1}

/* ---- The frame: a console screen on the sky ---- */
#frame{position:fixed;left:50%;top:50%;width:1024px;height:576px;margin:-288px 0 0 -512px;transform:scale(var(--k,1));transform-origin:50% 50%;overflow:hidden;border-radius:10px;
  background-color:var(--well);background-image:repeating-linear-gradient(135deg,var(--well-b) 0 6px,transparent 6px 12px);
  box-shadow:0 0 0 4px #0c1224,0 0 0 8px #8fa6cf,0 10px 0 8px #0c1224}
#frame[data-screen="s-title"]{background-color:var(--sky-a);background-image:conic-gradient(var(--sky-b) 25%,transparent 0 50%,var(--sky-b) 0 75%,transparent 0);background-size:32px 32px}
.wrap{position:absolute;inset:0;max-width:none;margin:0;padding:0;gap:0;overflow:hidden}
* {scrollbar-width:thin;scrollbar-color:#9db0d4 #151f38}
::-webkit-scrollbar{width:10px;height:10px}::-webkit-scrollbar-track{background:#151f38}::-webkit-scrollbar-thumb{background:#9db0d4;border:2px solid #151f38;border-radius:2px}

/* ---- A screen is a window: a title bar, then the body ---- */
.screen.on{flex:1 1 0;min-height:0;gap:10px;padding:0 14px 12px;overflow:visible}
.screen>.head{flex:none;display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:10px;min-height:48px;margin:0 -14px 2px;padding:6px 12px 6px 16px;background:var(--bar);border-bottom:4px solid var(--accent)}
.screen>.head h2{display:flex;align-items:center;gap:8px;font:700 var(--fs-ui)/1.1 var(--f-ui);color:#fff;text-shadow:2px 2px 0 #000;letter-spacing:1px;min-width:0}
.screen>.head h2 .px{width:24px;height:24px;vertical-align:0}
.screen>.head .row{flex-wrap:nowrap;gap:8px}
.screen>.head button.small{padding:5px 9px}
.screen>.head .deckcount,.screen>.head .note{white-space:nowrap}
#frame[data-screen="s-map"],#frame[data-screen="s-preview"],#frame[data-screen="s-battle"]{--accent:#e04838}
#frame[data-screen="s-town"],#frame[data-screen="s-zoneend"]{--accent:#58b848}
#frame[data-screen="s-event"]{--accent:#f0d040}
#frame[data-screen="s-museum"],#frame[data-screen="s-corner"],#frame[data-screen="s-hatchery"],#frame[data-screen="s-profile"]{--accent:#c070e8}
#s-title.on{position:relative;padding-top:12px}
#btnHelp.helpbtn{position:absolute;top:12px;right:14px;z-index:2}

/* ---- Windows over the screen: the same title bar ---- */
.modal{padding:14px}
.modal-box{padding:0 16px 14px;gap:12px;overflow:hidden auto}
.modal-box>.row.between:first-child{position:sticky;top:0;z-index:3;margin:0 -16px;padding:8px 12px 8px 16px;background:var(--bar);border-bottom:4px solid var(--accent);flex-wrap:nowrap;gap:10px}
.modal-box>h2:first-child{margin:0 -16px;padding:11px 16px;background:var(--bar);border-bottom:4px solid var(--accent);font-size:var(--fs-ui)}
.modal-box>.row.between:first-child h2,.modal-box>h2:first-child{color:#fff;text-shadow:2px 2px 0 #000;letter-spacing:1px}
.modal-box>.row.between:first-child h2 .px{width:24px;height:24px;vertical-align:-6px}
.modal-box>.row.between:first-child .row{flex-wrap:nowrap}
#brTitle.win{color:#8ce89a!important}#brTitle.lose{color:#ff9a88!important}
.pausebox{max-width:340px}.pausebox .menu{padding:6px 0 0}

/* ---- Side panels (they were in the margins of a wide window; the stage has none): the minimap and the charms of the map screen, the fight's live totals ---- */
#minimap{display:none}
#s-map #minimap{display:block;position:absolute;right:14px;top:104px;width:170px;pointer-events:none;opacity:.9}
#minimap svg.mlines{position:absolute;inset:0;width:100%;height:100%}
#minimap svg.mlines line{stroke:#7f93b8;stroke-width:2;stroke-dasharray:4 3;vector-effect:non-scaling-stroke}
#minimap svg.mlines line.past{stroke:#ff6a58;stroke-dasharray:none;stroke-width:3}
#minimap svg.mlines line.open{stroke:#7ab4ff;stroke-dasharray:none;stroke-width:3}
#minimap .mfl{position:absolute;left:-18px;font:400 var(--fs-tag) var(--f-ui);color:#fff;text-shadow:1px 1px 0 #000;transform:translateY(-50%)}
#minimap .mmn{position:absolute;width:32px;height:32px;margin:-16px 0 0 -16px;display:flex;align-items:center;justify-content:center;background:var(--win);border:2px solid var(--edge);border-radius:6px;font-size:0}
#minimap .mmn .px{width:20px;height:20px}
#minimap .mmn.rest{background:#dceaf8}#minimap .mmn.wild{background:#dff0d8}#minimap .mmn.capture{background:#f8dcd0}#minimap .mmn.elite{background:#f6d8d0}#minimap .mmn.event{background:#f8f0b8}#minimap .mmn.boss{background:#f8e090;border-color:#a02818}
#minimap .mmn.gone{opacity:.35}
#minimap .mmn.past{border-color:#c02818;box-shadow:0 0 0 2px #fff}
#minimap .mmn.open{border-color:#2a5ec8;box-shadow:0 0 0 2px #fff,0 0 0 3px #2a5ec8}
#fightTotals{display:none}
#s-battle.on #fightTotals{display:block;position:absolute;right:14px;top:62px;width:166px;background:rgba(0,0,0,.4);color:#fff;border-radius:6px;padding:8px 10px;font-size:var(--fs-small)}
#fightTotals h4{margin:6px 0 2px;font:700 var(--fs-tag) var(--f-ui);letter-spacing:1px;text-transform:uppercase}
#fightTotals h4:first-child{margin-top:0}

/* ---- Fitting the screens to 576 px ---- */
/* the map: the minimap and the charms live in a right rail */
#s-map .sbody{padding-right:196px}
#s-map .charms{position:absolute;right:14px;bottom:14px;width:172px;flex-direction:column;flex-wrap:nowrap;align-items:flex-end}
#s-map .charm{width:100%;justify-content:flex-end;text-align:right;line-height:1.15}
/* the battle: the live totals have a rail too */
#s-battle .sbody{padding-right:184px}
#battleResult .modal-box>h2{align-self:stretch;text-align:center}
/* the team select: the help paragraph is gone (the choices explain themselves), the head, budget, slots and filters take less room */
#s-team.on{gap:8px}
#s-team .budgetbar{padding:6px 12px}
#s-team .teamslots{padding:4px 10px}
.tools{padding:8px 10px}
/* an event or a zone end: the choices sit in a row under the text instead of a tall box that covers the team */
/* the town: the Center and the way on side by side, then the buildings, then the team */
#s-town .sbody{display:grid;grid-template-columns:1fr 1fr;grid-auto-rows:min-content;gap:10px;align-content:start}
#s-town .sbody>*{min-width:0}
#s-town .charms{grid-column:1/-1}
#s-town .services{grid-column:1;grid-row:1}
#s-town .townexits{grid-column:2;grid-row:1;flex-direction:column;flex-wrap:nowrap;justify-content:stretch;gap:8px}
#s-town .townexits .exitbtn{flex:1;min-width:0;padding:8px 14px}
#s-town .sbody>.panel{grid-column:1/-1}
#s-town .sbody>.teambar{grid-column:1/-1}
#s-town .services .panel:not(.has-portrait) p:not(.healed){display:none} /* a Pokémon Center's explanation goes (the room); Mom's own words stay */
/* the paths of a floor (2 or 3 since 2026-10-18, it was 2 to 5) always share one row */
.nodes{flex-wrap:nowrap}
.node{min-width:0;flex:1 1 0;padding:12px 10px 10px 34px;gap:4px}
.node::before{left:12px;top:16px}
.node .ic .px{width:40px;height:40px}
.node .d{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
/* the title screen with the help open: the help scrolls inside the frame */
#s-title.on{overflow:hidden auto}

/* ---- The zone board (the zone intro, the Map window): the whole zone, floor 1 at the left, the boss at the right ---- */
#zonemap .modal-box{max-width:980px}
.zboard{position:relative;height:300px;flex:none;background:#14203b;border:3px solid var(--bar);border-radius:8px;box-shadow:inset 0 0 0 2px #35507f}
.zbplot{position:absolute;left:36px;right:36px;top:22px;bottom:36px}
.zbplot>svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible} /* only the lines layer: this rule also matched the spots' icons (svgs inside .zbn), pinning them to the top-left of their tiles */
.zbplot line{stroke:#6f86b0;stroke-width:2;stroke-dasharray:4 3;vector-effect:non-scaling-stroke}
.zbplot line.past{stroke:#ff6a58;stroke-dasharray:none;stroke-width:3}
.zbplot line.open{stroke:#7ab4ff;stroke-dasharray:none;stroke-width:3}
.zbn{position:absolute;width:40px;height:40px;margin:-20px 0 0 -20px;display:flex;align-items:center;justify-content:center;background:var(--win);border:3px solid var(--edge);border-radius:8px;box-shadow:0 3px 0 #0a1020;font-size:0}
.zbn .px{width:24px;height:24px;vertical-align:0}
.zbn.rest{background:#dceaf8}.zbn.wild{background:#dff0d8}.zbn.capture{background:#f8dcd0}.zbn.elite{background:#f6d8d0}.zbn.event{background:#f8f0b8}.zbn.torch{background:#fdf0cc}
.zbn.boss{width:58px;height:58px;margin:-29px 0 0 -29px;background:#f8e090;border-color:#a02818}.zbn.boss .px{width:36px;height:36px}
.zbn.gone{opacity:.3}
.zbn.past{border-color:#c02818;box-shadow:0 0 0 2px #fff,0 0 0 4px #c02818}
.zbn.open{border-color:#2a5ec8;box-shadow:0 0 0 2px #fff,0 0 0 4px #2a5ec8;animation:blink 1s steps(2) infinite}
.zblabels{position:absolute;left:36px;right:36px;bottom:9px;height:18px}
.zblabels span{position:absolute;transform:translateX(-50%);font:400 var(--fs-tag) var(--f-ui);color:#9db0d4}
.zblabels span.cur{color:#ffd848}
.zboard.anim .zbn{animation:zbpop .2s steps(3) both;animation-delay:var(--d)}
.zboard.anim line{animation:zbfade .2s steps(2) both;animation-delay:var(--d)}
@keyframes zbpop{from{opacity:0;transform:scale(.3)}to{opacity:1;transform:scale(1)}}
@keyframes zbfade{from{opacity:0}to{opacity:1}}
.zboard.fog{display:flex;align-items:center;justify-content:center;background:rgba(0,0,0,.7)}
.zboard.fog p{color:#c8d4ee;max-width:56ch;text-align:center;font-size:var(--fs-text)}
.ziinfo{display:grid;grid-template-columns:1fr 290px;gap:12px;align-items:stretch;min-height:0}
.zinotes,.ziboss{background:rgba(0,0,0,.3);border-radius:8px;padding:10px 14px;color:#fff;font-size:var(--fs-small);line-height:1.3}
.zinotes{display:flex;flex-direction:column;gap:5px}
.zinotes .muted{color:#9db0d4}
.ziboss{display:flex;align-items:center;gap:12px}
.ziboss b{font:700 var(--fs-ui)/1.2 var(--f-ui);letter-spacing:.5px}
.ziboss .bpsil img{filter:brightness(0) invert(1);opacity:.4}
/* the intro's board takes the room the screen has, and its spots are bigger */
#ziBoard{height:auto;flex:1 1 0;min-height:240px}
#ziBoard .zbn{width:50px;height:50px;margin:-25px 0 0 -25px}
#ziBoard .zbn .px{width:30px;height:30px}
#ziBoard .zbn.boss{width:72px;height:72px;margin:-36px 0 0 -36px}
#ziBoard .zbn.boss .px{width:44px;height:44px}
#ziBoard .zblabels span{font-size:var(--fs-fine)}
.ziinfo{flex:none}
#ziMeta{color:#c8d4ee;font-size:var(--fs-small)}

/* ---- The battle as a showpiece (D5, 2026-10-17): two sides facing each other on their own ground, the front Pokémon big, the rest on the bench ---- */
#s-battle .sbody{gap:8px}
#s-battle .arena{flex:1 1 0;min-height:0;display:flex;flex-direction:column;justify-content:space-between;padding:10px 12px;border:3px solid var(--bar);border-radius:8px;position:relative;overflow:hidden;
  background:radial-gradient(ellipse 150px 22px at 80% 42%,rgba(255,255,255,.14) 0 60%,transparent 62%),radial-gradient(ellipse 150px 22px at 20% 94%,rgba(255,255,255,.14) 0 60%,transparent 62%),linear-gradient(#2a4572 0 48%,#235e5a 48%)}
#s-battle .vs{display:none}
#s-battle .side.cgrid{display:flex;gap:5px;align-items:flex-end;grid-template-columns:none}
#enemySide.side{flex-direction:row-reverse}
#playerSide.side{flex-direction:row}
#s-battle .side .ccard{width:94px;flex:0 1 94px;min-width:72px;padding:4px 2px 4px;border-top-width:5px}
#s-battle .side .ccard .cart,#s-battle .side .ccard .cart img{width:64px;height:64px}
#s-battle .side .ccard .cname b{font-size:var(--fs-fine)}
#s-battle .side .ccard .hpbar{height:8px}
#s-battle .side .ccard .chp{font-size:11px}
/* the front one: the sprite at x2 and its numbers beside it */
#s-battle .side .ccard.front{order:-1;width:312px;flex:none;min-width:312px;display:grid;grid-template-columns:160px 1fr;column-gap:12px;align-content:center;align-items:center;text-align:left;padding:8px 10px;border-top-width:6px;box-shadow:0 0 0 3px var(--t1),0 5px 0 var(--shade)}
#s-battle .side .ccard.front .cart{grid-row:1 / span 6;width:160px;height:160px}
#s-battle .side .ccard.front .cart img{width:160px;height:160px}
#s-battle .side .ccard.front .cname{justify-content:flex-start}
#s-battle .side .ccard.front .cname b{font-size:var(--fs-ui)}
#s-battle .side .ccard.front .hpbar{height:14px}
#s-battle .side .ccard.front .chp{font-size:var(--fs-small)}
#s-battle .side .ccard.front .atb{height:8px;margin-top:6px}
#s-battle .side .ccard.front .chold{justify-self:start}
#s-battle .side .ccard.front .pop{left:80px;top:50px;font-size:var(--fs-title)}
#s-battle .log{height:88px;flex:none}
/* motion: stepped, one thing per event */
@keyframes lungeP{50%{transform:translate(18px,-12px)}}
@keyframes lungeE{50%{transform:translate(-18px,12px)}}
#playerSide .ccard.act{animation:lungeP .24s steps(2)}
#enemySide .ccard.act{animation:lungeE .24s steps(2)}
@keyframes flashimg{34%{filter:brightness(3) saturate(0)}67%{filter:none}}
.ccard.hit .cart img{animation:flashimg .3s steps(3)}
@keyframes faintdrop{to{transform:translateY(16px) scale(.88);opacity:.55}}
#s-battle .ccard.ko .cart img{animation:faintdrop .4s steps(4) forwards}

/* The result window's XP rows (the payoff pass) */
.xprows{display:grid;grid-template-columns:1fr 1fr;gap:6px 12px;width:100%;margin:4px 0 2px}
.xprow{display:flex;align-items:center;gap:8px;text-align:left;background:var(--tint);border:2px solid #98a8c0;border-radius:6px;padding:3px 8px 3px 4px}
.xprow.out{opacity:.5}
.xprow img{width:48px;height:48px;flex:none;image-rendering:pixelated;background:#fff;border-radius:4px}
.xpi{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px}
.xph{display:flex;align-items:baseline;gap:8px;flex-wrap:nowrap;white-space:nowrap;overflow:hidden}
.xph b{font:700 var(--fs-small)/1 var(--f-text);overflow:hidden;text-overflow:ellipsis}
.xplv{font:500 var(--fs-fine) var(--f-text);color:var(--mut)}
.xpgain{margin-left:auto;font:700 var(--fs-fine) var(--f-text);color:#2c8a38}
.luflag{visibility:hidden;font:700 var(--fs-tag) var(--f-ui);letter-spacing:1px;color:#fff;background:var(--red);border:2px solid #601808;border-radius:4px;padding:1px 4px;text-transform:uppercase}
.luflag.on{visibility:visible;animation:flagblink .8s steps(2) infinite}
@keyframes flagblink{50%{opacity:.4}}
.xprow .xpbar{height:10px}
.xprow .xpbar i{transition:width .42s steps(8)}

/* ---- The catch comparison (the payoff pass): the newcomer beside the team member under the cursor, the team on the left ---- */
#s-event.cmpmode .sbody{display:grid;grid-template-columns:372px 1fr;grid-template-rows:auto 1fr;gap:10px;align-content:start}
#s-event.cmpmode .sbody>.dialog{grid-column:1 / -1}
#s-event.cmpmode .sbody>.teambar{grid-column:1;grid-row:2}
#s-event.cmpmode #eventStage{grid-column:2;grid-row:2;align-self:start}
#s-event.cmpmode #eventTeam{grid-template-columns:repeat(3,1fr);gap:6px}
#s-event.cmpmode #eventTeam .ccard.cmpon{border-color:var(--yellow);box-shadow:0 0 0 3px var(--yellow),0 3px 0 var(--shade)}
#s-event.cmpmode #eventTeam .ccard{padding:3px 4px}
#s-event.cmpmode #eventTeam .ccard .cart,#s-event.cmpmode #eventTeam .ccard .cart img{width:64px;height:64px}
.cmp3{width:100%;display:grid;grid-template-columns:1fr 150px 1fr;grid-template-rows:auto 1fr;gap:0 10px;background:var(--win);border:3px solid var(--edge);border-radius:8px;box-shadow:inset 0 0 0 3px var(--ring),inset 0 0 0 5px var(--win),0 3px 0 var(--shade);padding:10px 14px 12px}
.cmphead{grid-column:1 / -1;display:grid;grid-template-columns:1fr 1fr;font:700 var(--fs-tag) var(--f-ui);letter-spacing:1px;text-transform:uppercase;color:var(--mut);margin-bottom:6px}
.cmphead span:last-child{text-align:right}
.cmpside{display:flex;flex-direction:column;align-items:center;gap:6px;min-width:0;text-align:center}
.cmpart{position:relative;width:96px;height:96px;background:color-mix(in srgb,var(--t1) 22%,#fff);border:3px solid #98a8c0;border-radius:6px;display:flex;align-items:center;justify-content:center}
.cmpart img{width:80px;height:80px;image-rendering:pixelated}
.cmpart .ivc{position:absolute;left:3px;top:3px}
.cmpwho{display:flex;flex-direction:column;align-items:center;gap:3px;min-width:0}
.cmpwho b{font:700 var(--fs-ui)/1.1 var(--f-ui);letter-spacing:.5px}
.cmpwho .cpills{display:flex;gap:3px;justify-content:center;flex-wrap:wrap}
.cmpmeta{font-size:var(--fs-small);color:var(--mut)}
.cmpab{font-size:var(--fs-fine);line-height:1.25;color:var(--mut);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.cmpab b{font:700 var(--fs-fine) var(--f-text);color:var(--ink);letter-spacing:0}
.cmpmid{display:flex;flex-direction:column;justify-content:center;gap:3px;font-size:var(--fs-small)}
.cmpmid.hint{text-align:center;color:var(--mut);padding:0 6px}
.cmprow{display:grid;grid-template-columns:1fr 34px 1fr;align-items:baseline;gap:4px;border-bottom:2px dotted #c8d0e0;padding:1px 0}
.cmprow .cn{text-align:right;font-weight:700}.cmprow .cn small{margin-left:4px;font-size:var(--fs-fine)}
.cmprow .cn.up{color:#2c8a38}.cmprow .cn.dn{color:#b02820}
.cmprow .cl{text-align:center;font:700 var(--fs-tag) var(--f-ui);color:var(--mut)}
.cmprow .cc{color:var(--mut)}
.cmpside.empty{opacity:.4}

/* The payoff pass: the wild Pokémon reacts to each throw, the money counts */
@keyframes bonk{25%{transform:translateX(-6px);filter:brightness(2.2)}50%{transform:translateX(6px)}75%{transform:translateX(-3px);filter:none}}
@keyframes caughtball{0%{transform:scale(1)}40%{transform:scale(.55);filter:brightness(3)}100%{transform:scale(.12);opacity:0}}
@keyframes fledaway{to{transform:translateX(160px);opacity:0}}
#eventStage .ccard.bonk{animation:bonk .3s steps(4)}
#eventStage .ccard.caught{animation:caughtball calc(.6s / var(--bs,1)) steps(6) forwards}
#eventStage .ccard.fled{animation:fledaway calc(.5s / var(--bs,1)) steps(5) forwards}
.ticking{color:var(--red-d)}
@keyframes dodge{40%{transform:translateY(-14px)}}
#eventStage .ccard.dodge{animation:dodge .3s steps(3)}

/* ---- Team select (D7): the deck on the left, your team on the right ---- */
.teamgrid{flex:1 1 0;min-height:0;display:grid;grid-template-columns:1fr 332px;gap:12px}
.teamdeck{display:flex;flex-direction:column;gap:8px;min-height:0;min-width:0}
.teamdeck .sbody{flex:1 1 0;min-height:0}
#teamList{grid-template-columns:minmax(0,1fr)}
.teamside{display:flex;flex-direction:column;gap:8px;min-height:0}
.teamside .teamslots{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:8px}
.teamside .slot{position:relative;width:auto;height:66px;justify-content:flex-start;gap:8px;padding:4px 8px 4px 4px;text-align:left;border-radius:6px}
.teamside .slot.full img{width:52px;height:52px}
.sno{position:absolute;left:3px;top:1px;font:700 var(--fs-tag) var(--f-ui);color:var(--mut);z-index:1}
.slot:not(.full){justify-content:center}
.sinfo{display:flex;flex-direction:column;gap:3px;min-width:0;align-items:flex-start}
.sinfo b{font:700 var(--fs-fine)/1.1 var(--f-text);max-width:84px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.teamhint{font-size:var(--fs-small);line-height:1.3;color:#c8d4ee;padding:0 4px}
.teamside #btnTeamStart{margin-top:auto;width:100%;padding:16px 14px;font-size:var(--fs-title)}
/* the Museum's Charm pouch / Trainer's satchel pickers (state/museum-a.js startPicksPanel): above the Start run button; if the pane is short the box scrolls inside itself and the help line steps aside */
.teampicks{display:flex;flex-direction:column;gap:4px;padding:6px;flex:0 1 auto;min-height:0;overflow-y:auto;margin-top:auto}
.teampicks+#btnTeamStart{margin-top:0}
.teamside.manypicks .teamhint{display:none}
.pickrow{display:flex;gap:4px;align-items:stretch;flex:none}
.pickrow button{padding:3px 6px}
.pickrow .pkb{flex:none;width:30px;display:flex;align-items:center;justify-content:center}
.pickrow .pkc{flex:1 1 0;min-width:0;display:flex;align-items:center;gap:6px;text-align:left;overflow:hidden;font:700 var(--fs-small)/1.1 var(--f-text);letter-spacing:0}
.pickrow .pkc b{flex:none;font-weight:700;white-space:nowrap}
.pickrow .pkfx{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:400 var(--fs-fine)/1.1 var(--f-text);color:var(--mut)}
.pickrow .pknone{color:var(--mut);font-weight:500}

/* ---- The fight preview (D7): the two teams in rows of six, the battle items in a rail ---- */
#s-preview .sbody{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto;gap:6px 14px;align-content:start}
#s-preview .sbody.hasbag{grid-template-columns:minmax(0,1fr) 236px} /* the rail only when there are battle items to give */
#s-preview .sbody>.teambar{min-width:0;grid-column:1}
#s-preview .sbody>.teambar:nth-child(1){grid-row:1}
#s-preview .sbody>.teambar:nth-child(2){grid-row:2}
#s-preview #fightBagBox{grid-column:2;grid-row:1 / span 2;min-height:0;overflow-y:auto}
#previewEnemies,#previewTeam{grid-template-columns:repeat(6,minmax(0,1fr))}
#fightBagBox .items{max-width:none}
#fightBagBox .item{flex-direction:column;align-items:stretch;gap:6px}
#s-preview .ccard .cart,#s-preview .ccard .cart img{width:64px;height:64px}
#s-preview .ccard{padding:4px 5px}

/* ---- Motion clean-up (D8, 2026-10-17): everything stepped, the ambient motion only where something needs attention ---- */
/* a screen slides in from the side it comes from (deeper = from the right, back = from the left); a window opens with a short rise */
.screen.on.slideR{animation:slideR .26s steps(6)}
.screen.on.slideL{animation:slideL .26s steps(6)}
@keyframes slideR{from{transform:translateX(56px);opacity:0}to{transform:none;opacity:1}}
@keyframes slideL{from{transform:translateX(-56px);opacity:0}to{transform:none;opacity:1}}
.modal-box{animation:winopen .18s steps(3)}
@keyframes winopen{from{transform:translateY(16px);opacity:0}to{transform:none;opacity:1}}
/* lists are for scanning: a Mastered row keeps its gold frame but does not shimmer (the cards still do) */
.drow.mastered{animation:none}

/* ---- The run's result (the makeover): a title bar, the summary as tiles on the left, the team on the right, the way on at the bottom ---- */
#frame[data-screen="s-result"][data-result="win"]{--accent:#58b848}
#frame[data-screen="s-result"][data-result="lose"]{--accent:#e04838}
#s-result.on{gap:8px}
#s-result .reslead{font-size:var(--fs-text);color:#fff;text-shadow:1px 1px 0 #000;padding:0 2px}
.resgrid{flex:1 1 0;min-height:0;display:grid;grid-template-columns:366px minmax(0,1fr);gap:12px}
.ressum{margin:0;display:flex;flex-direction:column;gap:6px;overflow-y:auto;min-height:0;padding:2px 4px 4px 2px;text-align:left}
.rstile{flex:none;background:var(--win);border:3px solid var(--edge);border-radius:8px;box-shadow:0 3px 0 var(--shade);padding:5px 10px 6px}
.rstile dt{font:700 var(--fs-tag)/1.3 var(--f-ui);letter-spacing:1px;text-transform:uppercase;color:var(--mut)}
.rstile dd{margin:0;font-size:var(--fs-small);line-height:1.3}
.rstile.gc{border-color:#7a3fb0}
.rstile.mvp{border-color:#c09418;box-shadow:0 0 0 2px #f8d048,0 3px 0 var(--shade)}
.rstile.assist{border-color:#8890a0;box-shadow:0 0 0 2px #d8dce8,0 3px 0 var(--shade)}
#resTeam{grid-template-columns:repeat(3,minmax(0,1fr));align-content:start;gap:8px;overflow-y:auto;min-height:0;padding:2px 4px 4px 2px}
#resTeam .ccard .cart,#resTeam .ccard .cart img{width:64px;height:64px}
#resTeam .ccard{padding:4px 5px}
#resTeam .abil{font-size:var(--fs-fine);line-height:1.25}
.resbtns{flex:none;justify-content:center;gap:14px;padding-top:2px}
.resbtns button{padding:14px 26px;font-size:var(--fs-ui)}
.resbtns button.pri{font-size:var(--fs-title)}
/* the tiles are one row each: the label on the left, the value beside it (all of them fit without scrolling) */
.rstile{display:grid;grid-template-columns:76px minmax(0,1fr);gap:0 8px;align-items:baseline;padding:5px 10px}
.rstile dt{align-self:center}
#resTeam .ccard .cart,#resTeam .ccard .cart img{width:56px;height:56px}
.resbtns button{padding:10px 24px}
.resbtns button.pri{font-size:var(--fs-ui)}

/* ---- Reveals (a badge, an egg, a hatching) ---- */
#reveal{z-index:30;background:rgba(6,10,24,.9)}
.revbox{position:relative;display:flex;flex-direction:column;align-items:center;gap:12px;text-align:center;max-width:620px;padding:10px 20px}
.revrays{position:absolute;left:50%;top:106px;width:460px;height:460px;margin:-230px 0 0 -230px;border-radius:50%;pointer-events:none;
  background:repeating-conic-gradient(color-mix(in srgb,var(--tone) 34%,transparent) 0 7deg,transparent 7deg 22deg);-webkit-mask:radial-gradient(circle,#000 18%,transparent 68%);mask:radial-gradient(circle,#000 18%,transparent 68%);animation:revturn 9s steps(30) infinite}
@keyframes revturn{to{transform:rotate(360deg)}}
.revflash{position:absolute;inset:-40px;background:#fff;opacity:0;pointer-events:none}
.revflash.go{animation:revflash .45s steps(5)}
@keyframes revflash{0%{opacity:.95}100%{opacity:0}}
.revart{position:relative;min-height:128px;display:flex;align-items:center;justify-content:center}
.revart .px{width:128px;height:128px;vertical-align:0;filter:drop-shadow(0 0 14px var(--tone))}
.revart.pop{animation:revpop .5s steps(5)}
@keyframes revpop{0%{transform:scale(.2);opacity:0}60%{transform:scale(1.25);opacity:1}100%{transform:scale(1)}}
.revart.shake{animation:eggshake .45s steps(4) infinite}
@keyframes eggshake{25%{transform:rotate(-8deg) translateX(-4px)}75%{transform:rotate(8deg) translateX(4px)}}
.revmon{position:relative;filter:drop-shadow(0 0 14px var(--tone))}
.revmon img{width:160px;height:160px;image-rendering:pixelated;display:block}
.revmon .ivc{position:absolute;left:0;top:0;width:28px;height:28px;font-size:var(--fs-ui)}
.revbox h2{font:700 var(--fs-title)/1.15 var(--f-ui);color:#fff;letter-spacing:1px;text-shadow:3px 3px 0 #000,0 0 18px var(--tone);opacity:0}
.revlines{display:flex;flex-direction:column;gap:6px;color:#e6edff;font-size:var(--fs-text);line-height:1.35;opacity:0;min-height:20px}
.revbtns{justify-content:center;gap:12px;opacity:0;margin-top:6px}
.revbox.shown h2,.revbox.shown .revlines,.revbox.shown .revbtns{opacity:1;animation:revrise .35s steps(4)}
@keyframes revrise{from{transform:translateY(12px);opacity:0}to{transform:none;opacity:1}}
.revbtns button{padding:12px 24px}

/* ---- The starter pick: three full cards, each with its Choose button ---- */
#s-starter .starters{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;flex:1 1 0;min-height:0;align-content:start}
.starter-cell{display:flex;flex-direction:column;gap:10px;min-width:0}
.starter-cell .card .art{height:120px} /* the starters are small sprites on their canvas: the empty margin is cropped to fit the screen */
.starter-cell button{padding:12px 14px}
.starter-cell .card{flex:1 1 auto} /* the buttons line up whatever the length of the ability text */


/* ---- Hover and focus on the navy well (the last pass of the desktop-feel work): the red frame inside a card is lost against the dark blue, so whatever is under the cursor, the mouse or the pad
   (hover, or the keys' focus) also gets a bright yellow halo around it; the pulsing red / amber ring inside stays ---- */
.ccard:hover:not(.dim),body.navmode .ccard:focus,.ccard:focus-visible{box-shadow:0 0 0 3px #ffd848,0 6px 0 var(--shade)}
.ccard:active:not(.dim){box-shadow:0 0 0 3px #ffd848}
.node:hover,body.navmode .node:focus{box-shadow:inset 0 0 0 3px #f0a8a0,inset 0 0 0 5px var(--win),0 0 0 3px #ffd848,0 7px 0 var(--shade)}
.node:active{box-shadow:inset 0 0 0 3px #f0a8a0,inset 0 0 0 5px var(--win),0 0 0 3px #ffd848}
.drow:hover,body.navmode .drow:focus,.drow:focus-visible{box-shadow:inset 0 0 0 2px var(--tint),0 0 0 3px #ffd848,0 3px 0 var(--shade)}
.drow:active{box-shadow:inset 0 0 0 2px var(--tint),0 0 0 3px #ffd848}
.slot.full:hover,.bld:hover:not(:disabled),.exitbtn:hover:not(:disabled),.bld:focus-visible,.exitbtn:focus-visible,body.navmode .bld:focus,body.navmode .exitbtn:focus{box-shadow:inset 0 0 0 2px var(--tint),0 0 0 3px #ffd848,0 3px 0 var(--shade)}
.exitbtn.pri:hover:not(:disabled),.exitbtn.pri:focus-visible,body.navmode .exitbtn.pri:focus{box-shadow:inset 0 0 0 2px #f08070,0 0 0 3px #ffd848,0 3px 0 #401004}
.slot.full:active,.bld:active:not(:disabled),.exitbtn:active:not(:disabled){box-shadow:inset 0 0 0 2px var(--tint),0 0 0 3px #ffd848}
/* a drow on the navy: its frame goes red like the cards' (the old blue was invisible there) */
.drow:hover{border-color:var(--red)}

/* ---- The details window (2026-10-17, streamlined at the user's request: "bloated", "garbled"): the card on the left, the facts beside it (the ability, the evolution, a few chips), the
   candy options as a row of calm buttons under them. Gone: the class sentence, the ability's tier, "how a re-roll works", the bond's explanation, "Now X" under the options ---- */
#mon .modal-box{max-width:640px}
#mon .modal-box.has-side{max-width:870px}
.mon-detail{display:grid;grid-template-columns:230px minmax(0,1fr);gap:12px 16px;align-items:start}
.mon-detail.has-side{grid-template-columns:190px 230px minmax(0,1fr)}
.mon-card{width:230px;margin:0}
.mon-card .abil{display:none} /* the ability is in the facts beside the card */
.mon-side{min-width:0}
.mon-info{display:flex;flex-direction:column;gap:10px;min-width:0;font-size:var(--fs-text)}
.mi-h{display:block;font:700 var(--fs-tag)/1 var(--f-ui);letter-spacing:1px;text-transform:uppercase;color:var(--mut)}
.mi-ab{background:#fff;border:2px solid #98a8c0;border-radius:8px;padding:8px 10px;display:flex;flex-direction:column;gap:4px}
.mi-ab b{font:700 var(--fs-ui)/1.2 var(--f-ui);letter-spacing:.5px}
.mi-ab p{font-size:var(--fs-small);line-height:1.3}
.mi-evo{display:flex;flex-direction:column;gap:4px}
.mi-evo p{font-size:var(--fs-small);line-height:1.3;color:var(--mut)}
.mi-chips{display:flex;flex-wrap:wrap;gap:6px}
.mi-chip{display:inline-flex;align-items:center;gap:5px;background:var(--tint);border:2px solid #98a8c0;border-radius:6px;padding:3px 8px;font-size:var(--fs-small);line-height:1.1}
.mi-chip .px{width:16px;height:16px;vertical-align:-3px}
.mon-note{background:#fff3b8;border:2px solid #c09418;border-radius:6px;padding:6px 8px;font-size:var(--fs-small);line-height:1.3}
.mon-optswrap{grid-column:1 / -1;display:flex;flex-direction:column;gap:6px}
.mon-opts{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:8px}
.opt{display:flex;flex-direction:column;align-items:flex-start;justify-content:space-between;gap:6px;min-height:62px;padding:7px 10px;text-align:left;background:#fff;border:3px solid #7f8fb0;border-radius:8px;box-shadow:0 3px 0 #5b6a8c}
.opt:hover:not(:disabled){background:#fff3b8}
.opt .ot{display:flex;flex-direction:column;gap:2px;min-width:0}
.opt .ot b{font:700 var(--fs-text)/1.15 var(--f-text);letter-spacing:0;text-transform:none}
.opt .ot small{font:400 var(--fs-fine)/1.2 var(--f-text);color:var(--mut);letter-spacing:0;text-transform:none;white-space:normal}
.opt .ob{display:inline-flex;align-items:center;gap:4px;font:700 var(--fs-small)/1 var(--f-text);letter-spacing:0;background:var(--tint);border-radius:10px;padding:3px 8px}
.opt .ob .px{width:16px;height:16px;vertical-align:0}
.opt.on{background:#e4f6dc;border-color:#2c7c34}
.opt.on .ob{background:#cdeec2;color:#2c8a38}
.opt:disabled{background:#eef1f7;border-color:#b4bdd0;box-shadow:none;color:#7d86a0}
.opt:disabled .ot b{color:#6e7892}
.opt:disabled .ot small{color:#8b94ac}
.opt:disabled .ob{background:#e2e7f0;color:#7d86a0}
#monActions:empty{display:none}

/* ---- The Deck: the card's window docks at the right of the list (click another row and it follows) ---- */
#frame[data-screen="s-deck"] #mon{background:none;pointer-events:none;justify-content:flex-end;align-items:stretch;padding:54px 8px 8px 0}
#frame[data-screen="s-deck"] #mon .modal-box{pointer-events:auto;width:620px;max-width:none;max-height:100%;padding-bottom:6px;box-shadow:inset 0 0 0 3px var(--ring),inset 0 0 0 5px var(--win),0 0 0 4px #0c1224,0 0 0 6px #8fa6cf}
#frame[data-screen="s-deck"]:has(#mon:not([style*="none"])) #s-deck .tools,
#frame[data-screen="s-deck"]:has(#mon:not([style*="none"])) #s-deck .dlist{margin-right:634px}
#frame[data-screen="s-deck"] #mon .mon-card .art{height:150px} /* 5 px of the sprite's empty margin at the top and bottom: the docked window fits without scrolling */
#frame[data-screen="s-deck"] #mon .mon-card .st{display:none}
/* docked: the options sit in the free space under the facts, two by two, so the window needs no more height than the card */
#frame[data-screen="s-deck"] #mon .mon-card{grid-row:1 / span 2}
#frame[data-screen="s-deck"] #mon .mon-info{grid-column:2;grid-row:1}
#frame[data-screen="s-deck"] #mon .mon-optswrap{grid-column:2;grid-row:2;align-self:end}
#frame[data-screen="s-deck"] #mon .mon-opts{grid-auto-flow:row;grid-template-columns:repeat(2,minmax(0,1fr))}

/* the nature picker: two columns of small buttons beside the card (24 of them) */
.naturegrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
.naturegrid button{padding:3px 6px;font-size:var(--fs-fine);line-height:1.2}
.naturegrid{gap:3px}
.naturegrid button{padding:1px 6px;line-height:1.15;border-width:2px}
#s-town .townexits{align-content:start}
#s-town .townexits .exitbtn{flex:1 1 0;max-height:92px} /* a lone exit (Glenford's) no longer fills the whole cell */

/* the newcomer alone: the same card and facts as the details window */
.cmp3.solo{display:grid;grid-template-columns:230px minmax(0,1fr);gap:0 16px;align-items:start;padding:12px 16px}
.cmp3.solo .mon-info{font-size:var(--fs-text)}
.cmp3.solo{padding:8px 14px}
.cmp3.solo .mon-card .art{height:146px} /* a few px of the sprite's empty margin: the card fits the screen without scrolling */

/* ---- A boss's intro: the dialog (with the speaker's portrait) on top, the team and the boss's silhouettes in one row under it, so nothing is cut ---- */
#s-event.bossmode .sbody{display:grid;grid-template-columns:minmax(0,1fr) 250px;grid-template-rows:auto auto;gap:10px 14px;align-content:start}
#s-event.bossmode .sbody>.dialog{grid-column:1 / -1}
#s-event.bossmode .sbody>.teambar{grid-column:1;grid-row:2;min-width:0}
#s-event.bossmode #eventStage{grid-column:2;grid-row:2;align-self:start}
#s-event.bossmode .bpteam{gap:4px}
#s-event.bossmode .bpsil img{width:44px;height:44px}
#s-event.bossmode .sbody{grid-template-columns:minmax(0,1fr) 190px}
#s-event.bossmode #eventTeam{grid-template-columns:repeat(6,minmax(0,1fr));gap:6px}
#s-event.bossmode .bpsil img{width:40px;height:40px}

/* ---- Fixed windows (2026-10-17, "wherever we can"): the town's buildings are one slim row of horizontal tiles, so a town never scrolls ---- */
#s-town .townmap{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);gap:8px}
#s-town .bld{display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-rows:auto auto;column-gap:10px;row-gap:2px;align-items:center;justify-items:start;align-content:center;text-align:left;padding:8px 10px;min-height:84px}
#s-town .bld .bic{grid-row:1 / span 2;display:flex}
#s-town .bld .bic .px{width:40px;height:40px}
#s-town .bld b{font-size:var(--fs-ui);line-height:1.15}
#s-town .bld small{line-height:1.2}
#s-town .sbody>.panel{padding:8px 12px 10px}
#s-town .sbody>.panel h3{margin-bottom:6px}
#eventStage .ccard .cart,#eventStage .ccard .cart img{width:64px;height:64px}

/* ---- Fixed windows, the rest of them (2026-10-17: "wherever we can"): tabs instead of long pages ---- */
.tabrow{display:flex;align-items:center;gap:10px;flex-wrap:nowrap;margin-bottom:8px}
.tabrow .note{margin-left:auto;font-size:var(--fs-small);color:var(--mut);white-space:nowrap}
.tabs{display:flex;gap:4px;flex-wrap:wrap;flex:1;min-width:0}
button.tab{padding:6px 10px;font:700 var(--fs-text)/1.1 var(--f-text);letter-spacing:0;background:var(--tint);border:3px solid #98a8c0;border-radius:6px;box-shadow:none}
button.tab:hover:not(:disabled){background:#fff3b8}
button.tab.on{background:var(--yellow);border-color:#8c6410}
.items.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-content:start}
.items.grid2 .item{height:100%}
#s-museum .dialog,#s-corner .dialog{min-height:0;padding:6px 14px;font-size:var(--fs-small)}
/* the Museum and the Game Corner: the panel fills the screen, its page is the tab's items */
#s-museum .sbody,#s-corner .sbody{overflow:hidden}
.tabpanel{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}
.tabpanel .items{overflow-y:auto;min-height:0}
/* the profile: a dashboard of two columns */
#s-profile .sbody{flex-direction:row;gap:12px;overflow:hidden;align-items:stretch}
.pcol{display:flex;flex-direction:column;gap:10px;min-width:0;min-height:0}
.pleft{flex:0 0 380px}.pright{flex:1 1 0}
.pright .pstats{grid-template-columns:repeat(2,minmax(0,1fr));column-gap:20px}
.pstat{padding:2px 0}
#s-profile .panel{padding:8px 12px}
#s-profile .cgrid.favs{grid-template-columns:repeat(3,minmax(0,1fr))}
#s-profile .favs .ccard .cart,#s-profile .favs .ccard .cart img{width:64px;height:64px}
.perkpanel{flex:1 1 0;min-height:0;display:flex;flex-direction:column}
.perkpanel .perks{overflow-y:auto;min-height:0}
/* How to play: a window with tabs */
#helpModal{z-index:22}
.helpwin{max-width:860px}
.helpbody{max-height:360px;overflow-y:auto}
.helpbody p{margin:0 0 8px;font-size:var(--fs-text);line-height:1.4}
.helpbody b{color:var(--red-d)}
/* Options: two columns */
#options .modal-box{max-width:880px;display:grid;grid-template-columns:1fr 1fr;column-gap:22px;align-content:start}
#options .modal-box>.row.between:first-child{grid-column:1 / -1}
#options .option{min-width:0}
/* the shop: the two lists scroll on their own, the window stays put */
#bBody .shopcols>div{max-height:350px;overflow-y:auto;padding-right:4px}
#bBody .shoplist{max-height:290px;overflow-y:auto;padding-right:4px;align-content:start}
/* profile: the backgrounds in one row, the rewards in two columns, so the rewards get the room that is left */
#s-profile .themes{grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}
#s-profile .theme{padding:4px 2px;gap:2px;font-size:var(--fs-fine);line-height:1.1;text-align:center}
#s-profile .theme i{height:18px;border-width:2px}
#s-profile .perks{gap:4px;font-size:var(--fs-small)}
#s-profile .pstat{padding:1px 0;font-size:var(--fs-small)}
#s-profile .pstats{gap:2px 20px}
/* the favourites are a shelf: art, name, types and the run count (no hp bar) */
#s-profile .favs .ccard .hpbar,#s-profile .favs .ccard .chp,#s-profile .favs .ccard .cab{display:none}
/* the two-column grids: a row is text over its button, the tabs stay on one line */
.items.grid2 .item{flex-direction:column;align-items:stretch;justify-content:flex-start;gap:6px}
.items.grid2 .item>button,.items.grid2 .item>.achstate{align-self:flex-end}
.items.grid2 .item b{font-size:var(--fs-text)}
.tabrow .tabs{flex-wrap:nowrap}
button.tab{padding:6px 8px;font-size:var(--fs-small);white-space:nowrap}
.tabrow>button.small{padding:5px 8px;font-size:var(--fs-small);flex:none}
.tabrow .tabs{flex-wrap:wrap;row-gap:4px}
.tabrow{align-items:flex-start}
.items.grid2 .item.ach{flex-direction:row;align-items:center;gap:8px}
.items.grid2 .item.ach>.achstate{align-self:center;max-width:42%;text-align:center}
#options .modal-box{max-width:940px;width:calc(100% - 40px);row-gap:3px;padding-top:10px;padding-bottom:10px}
#options .option{padding-top:4px;gap:10px}
#options .option p{font-size:var(--fs-fine);line-height:1.25;margin-top:1px}
#options .seg button{padding:4px 8px;font-size:var(--fs-small)}
#options .option>button{padding:4px 8px;font-size:var(--fs-small)}
#options .option.col{flex-direction:row;align-items:center}
#options .option.col>div:first-child{flex:1 1 0;min-width:0}
#options .option.col .seg{flex:none;flex-wrap:nowrap;gap:4px}
#options .option.col .seg button{padding:4px 6px}
/* the couple's gift: the little one's card beside its note, the team choices under them */
.couple-little{display:flex;gap:14px;align-items:center}
.couple-little .cgrid{flex:none;width:150px}
.couple-little .cgrid .ccard .cart,.couple-little .cgrid .ccard .cart img{width:56px;height:56px}
.couple-little>p{flex:1;margin:0}
.couple-little .ccard .hpbar,.couple-little .ccard .chp,.couple-little .ccard .cab{display:none}
/* the title is a fixed window too: a tighter credit line, so nothing scrolls */
#s-title footer{padding-top:8px;line-height:1.35;font-size:var(--fs-fine)}
#s-title .logo{padding:2px 0 0}
/* the bag: items in two columns, the list scrolls inside the window if it is ever longer */
#bag .modal-box{max-width:880px;overflow:hidden}
#bagList{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;align-content:start;overflow-y:auto;min-height:0;flex:1 1 auto}
#bagTarget{flex:none}
/* no Center panel (2026-10-17, a toast says the team is healed): the way on runs across the top, side by side */
#s-town.nocenter .townexits{grid-column:1 / -1;flex-direction:row}
#s-town.nocenter .townexits .exitbtn{min-height:72px}

/* ---- The stats (2026-10-17): bars, pips and chips, one look for the card's column, the live rail and the result report ---- */
.sbar{display:block;height:10px;background:#e6ebf4;border:2px solid #98a8c0;border-radius:3px;overflow:hidden}
.sbar i{display:block;height:100%;transition:width .3s steps(6)}
.sbar.dealt i{background:#e0503c}.sbar.taken i{background:#4878c8}.sbar.healed i{background:#48a850}
.kopips{display:inline-flex;align-items:center;gap:3px;color:var(--mut);font:700 var(--fs-fine) var(--f-text)}
.kopips i{width:9px;height:9px;background:#3a3a4a;border:2px solid #101018;display:block}
.kopips.none{opacity:.5}.kopips b{margin-left:2px;color:var(--ink)}
.schips{display:flex;flex-wrap:wrap;gap:4px}
.schip{padding:2px 6px;border-radius:4px;border:2px solid #98a8c0;background:#fff;font:700 var(--fs-fine)/1.2 var(--f-text);white-space:nowrap;color:var(--ink)}
.schip.good{background:#d4f0d4;border-color:#58a858;color:#1c6a28}.schip.bad{background:#f8dcd4;border-color:#c8604c;color:var(--red-d)}.schip.heal{background:#e0f4e0;border-color:#68b068}
/* the details card's column */
.mon-side h3{margin-bottom:6px}
.sbrow{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 8px;align-items:baseline;margin-bottom:8px;font-size:var(--fs-small)}
.sbrow b{font-family:var(--f-ui);font-size:var(--fs-ui)}
.sbrow .sbar{grid-column:1 / -1}
.sbrow.ko{grid-template-columns:auto auto 1fr;align-items:center}
.sbrow.ko b{font-size:var(--fs-ui)}
.mon-side .schips{margin-top:2px}
/* the live rail */
#fightTotals .ftbar{display:flex;height:12px;background:rgba(255,255,255,.16);border:2px solid rgba(255,255,255,.35);margin-top:3px}
#fightTotals .ftbar i{flex-basis:0;min-width:2px;transition:flex-grow .25s steps(5)}
#fightTotals .ftlegend{display:flex;gap:2px;margin:4px 0 2px}
#fightTotals .ftlegend img{flex:1 1 0;min-width:0;max-width:24px;aspect-ratio:1;image-rendering:pixelated;border-bottom:3px solid;background:rgba(255,255,255,.12)}
#fightTotals .ftlegend img.ko{opacity:.3;filter:grayscale(1)}
#fightTotals .ftbig{display:flex;justify-content:space-between;gap:4px;margin:4px 0}
#fightTotals .ftbig div{min-width:0;text-align:center;flex:1}
#fightTotals .ftbig b{display:block;font:700 var(--fs-text)/1.1 var(--f-ui);letter-spacing:0}
#fightTotals .ftbig small{display:block;font:700 var(--fs-fine)/1 var(--f-text);color:#c8d8f0}
#fightTotals .schip{background:rgba(255,255,255,.16);border-color:rgba(255,255,255,.35);color:#fff}
/* the result window: tabs and the report */
#brTabs{justify-content:center}
#brStats{align-self:stretch}
.rprow{display:grid;grid-template-columns:170px minmax(0,1fr) minmax(0,1fr) 72px minmax(0,1.1fr);gap:10px;align-items:center;padding:5px 8px;text-align:left}
.rprow:nth-child(even):not(.rphead):not(.rptotal){background:rgba(0,0,0,.04)}
.rphead{font:700 var(--fs-fine)/1 var(--f-text);color:var(--mut);padding-bottom:2px;border-bottom:3px solid var(--edge);margin-bottom:2px}
.rpname{display:flex;align-items:center;gap:8px;min-width:0}
.rpname img{width:36px;height:36px;image-rendering:pixelated;flex:none}
.rpname b{font:700 var(--fs-text)/1.1 var(--f-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rpstar{display:inline-flex;flex:none}
.rpbar{display:flex;align-items:center;gap:8px;min-width:0}
.rpbar .sbar{flex:1}
.rpbar em{font-style:normal;font:700 var(--fs-small) var(--f-text);min-width:40px;text-align:left} /* the number first, under its column title, then the bar */
.rpchips{display:flex;flex-wrap:wrap;gap:4px;min-width:0}
.rprow.ko .rpname{opacity:.55}.rprow.ko .rpname b{text-decoration:line-through}
.rptotal{border-top:3px solid var(--edge);margin-top:4px;font-weight:700}.rptotal.foe{border-top:2px dashed #c4ccdc;margin-top:0;color:var(--mut)}
.sbar.ghost{visibility:hidden} /* the totals keep the bars' room, so their numbers line up with the rows above */

/* The choices of an event and of a zone end are boxed buttons in a row (2026-10-17, the user: the cursor rows on a cream bar looked outdated); the menus keep the list look */
.choices{display:flex;flex-wrap:wrap;justify-content:flex-end;align-self:stretch;align-items:center;gap:10px;min-width:0;padding:4px 2px 6px}
.choices:empty{display:none}
.choices button{min-width:150px;padding:12px 20px}
#s-event .sbody{gap:8px}
.choices{padding:0 2px 4px}
.choices button{padding:11px 20px}

/* ---- The shop and the bag (2026-10-17): one-line tiles, the sentence in a description bar under the list, like the Pokémon games ---- */
.titem{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#fff;border:3px solid #98a8c0;border-radius:6px;padding:6px 10px;min-height:46px}
.titem .tname{display:flex;align-items:center;gap:8px;min-width:0;font:700 var(--fs-text)/1.2 var(--f-text)}
.titem .tname b{font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.titem .tcount{color:var(--mut);font-weight:500}
.titem button{flex:none;white-space:nowrap}
.titem .schip{flex:none;font-weight:500}
.titem:hover,.titem:focus-within{border-color:#f0c020;background:#fffbe8}
.descbar{flex:none;min-height:56px;margin:0;padding:8px 12px;display:flex;align-items:center;font-size:var(--fs-small);line-height:1.35}
#bagList .titem{height:auto}
#bBody .shopcols>div{max-height:300px}

/* ---- No clipped sentences (2026-10-17): the map's paths and the preview's battle items say what they are in a bar, like the shop and the bag ---- */
#nodeDesc{margin-top:4px}
.node .d{display:none}
#s-preview #fightBagBox{display:flex;flex-direction:column;gap:6px}
#fightBagBox .items{flex:1 1 auto;min-height:0;overflow-y:auto;gap:5px}
#fightBagBox .titem{padding:3px 8px;min-height:38px;gap:6px}
#fightBagBox .titem .tname{font-size:var(--fs-small)}
#fightBagBox .titem button{padding:4px 8px}
#fightBagDesc{min-height:96px;font-size:var(--fs-small)}
/* the path cards: the icon beside the title and the chip, the reward and the tide under them (no sentence on the card any more) */
.node{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:8px;row-gap:4px;align-content:start;padding:10px 10px 10px 34px}
.node .nkey{grid-column:2}
.node .ic{grid-column:1;grid-row:1 / span 2;align-self:center}
.node .t{grid-column:2;grid-row:1;align-self:end;min-width:0}
.node .vnote{grid-column:2;grid-row:2;min-width:0}
.node .reward,.node .tidecost{grid-column:1 / -1;justify-self:start}

#fightBagBox .ticon{position:relative;display:inline-flex;flex:none}
#fightBagBox .ticon i{position:absolute;right:-6px;bottom:-5px;min-width:14px;padding:0 3px;border-radius:4px;background:var(--ink);color:#fff;font:700 var(--fs-fine)/14px var(--f-text);text-align:center;font-style:normal}
#fightBagBox .titem{min-height:34px;padding:2px 8px}
#fightBagDesc{min-height:84px;font-size:var(--fs-fine);padding:6px 10px}
#fightBagBox .titem{padding:2px 6px}
#fightBagBox .titem .tname{font-size:var(--fs-fine);gap:6px}
#fightBagBox .items{gap:3px}
#s-map .cgrid .ccard .cart,#s-map .cgrid .ccard .cart img,#s-preview .ccard .cart,#s-preview .ccard .cart img{width:56px;height:56px}
#nodeDesc{min-height:50px}
/* the preview's held battle item is a badge on the card (its name is the tooltip), not a row that makes the cards taller */
#s-preview .ccard .chold{position:absolute;top:30px;right:8px;font-size:0;line-height:0;padding:2px;background:var(--win);border:2px solid var(--edge);border-radius:4px;gap:0}
#s-preview .ccard .chold .px{width:16px;height:16px}
#s-preview .sbody{gap:8px}
#fightBagDesc{min-height:74px}
.zonenote span{padding:3px 10px}
#s-preview .teambar h3{margin-bottom:3px}
#s-preview .ccard{padding:3px 5px}
#fightBagBox .titem{min-height:32px;padding:1px 6px}
#fightBagDesc{min-height:68px;padding:5px 10px}
.zonenote{gap:1px}.zonenote span{padding:2px 10px}

/* ---- A boss's outro as a scene (2026-10-17): letterbox bars, the speaker, speech bubbles ---- */
#frame[data-screen="s-scene"]{--accent:#e8c030}
#s-scene.on{position:relative;padding:0;gap:0;overflow:hidden;background:radial-gradient(ellipse at 30% 50%,#26305a 0,#0a0e22 70%)}
#s-scene .scenebar{position:absolute;left:0;right:0;height:62px;background:#000;z-index:3}
#s-scene .scenebar.top{top:0;border-bottom:3px solid #1a1a28}#s-scene .scenebar.bot{bottom:0;border-top:3px solid #1a1a28}
#btnSceneSkip{position:absolute;top:12px;right:14px;z-index:4}
#s-scene .scenestage{flex:1;display:flex;align-items:center;gap:26px;padding:84px 44px 110px}
#s-scene .sceneportrait .portrait{margin:0;--portrait:236px;animation:sceneIn .5s steps(6) both}
#s-scene .portrait img.echo{opacity:.22}
#s-scene .bubble{position:relative;flex:1;max-width:540px;min-height:128px;display:flex;align-items:center;background:#fff;border:4px solid var(--edge);border-radius:18px;box-shadow:inset 0 0 0 3px var(--ring),0 5px 0 rgba(0,0,0,.45);padding:18px 24px;animation:bubbleIn .22s steps(3) both}
#s-scene .bubble::before{content:'';position:absolute;left:-26px;top:50%;margin-top:-14px;border:14px solid transparent;border-right:22px solid var(--edge);border-left:0}
#s-scene .bubble::after{content:'';position:absolute;left:-17px;top:50%;margin-top:-10px;border:10px solid transparent;border-right:16px solid #fff;border-left:0}
#s-scene .bubble p{margin:0;font:500 var(--fs-text)/1.45 var(--f-text);color:var(--ink)}
#s-scene .bubble p.done::after{content:'';display:inline-block;width:16px;height:16px;margin-left:8px;vertical-align:-3px;background:#c04030;-webkit-mask:var(--ic-more) center/contain no-repeat;mask:var(--ic-more) center/contain no-repeat;animation:more .8s steps(2) infinite}
#s-scene .scenenote{position:absolute;left:0;right:0;bottom:72px;z-index:4;margin:0;text-align:center;font:500 var(--fs-small) var(--f-text);color:#d8e0f8;text-shadow:1px 1px 0 #000;min-height:20px}
@keyframes sceneIn{from{transform:translateX(-40px);opacity:0}to{transform:none;opacity:1}}
@keyframes bubbleIn{from{transform:scale(.9);opacity:0}to{transform:none;opacity:1}}

/* ---- The minimap scrolls and shows the whole zone; the spot you are on is green and pulses (2026-10-17) ---- */
#s-map #minimap{right:8px;top:104px;width:188px;height:320px;overflow-x:hidden;overflow-y:auto;pointer-events:auto;overscroll-behavior:contain}
#minimap .mmin{position:relative;margin-left:20px}
#minimap .mmn.here::after,.zbn.here::after{content:'';position:absolute;top:-8px;right:-8px;width:10px;height:10px;background:#38c050;border:2px solid #fff;border-radius:50%}
/* the blue choices pulse too (2026-10-17): the open spots and the lines that lead to them, on the minimap and in the Map window, in two steps like the green "here" */
#minimap .mmn.hl{animation:openpulse .9s steps(2) infinite} /* the path card under the mouse or the focus: its spot pulses blue (2026-10-18) */
@keyframes openpulse{50%{box-shadow:0 0 0 2px #fff,0 0 0 7px #9cc8ff}}
/* the spot you are on: a steady green ring (no pulse, 2026-10-18) beside its green dot */
#minimap .mmn.here,.zbn.here{border-color:#1f9a3a;box-shadow:0 0 0 2px #fff,0 0 0 4px #38c050}
/* the highlighted path's spot also zooms a little (2026-10-18), in two steps like the rest of the game's motion */
#minimap .mmn{transition:transform .1s steps(2)}
#minimap .mmn.hl{transform:scale(1.22);z-index:3}

/* ---- Museum, track B (2026-10-19): the peddler's stall node, the Trail flags on the boards, the Strategist's clipboard arrows ---- */
.node.shop{--rg:#e8b878}
.zbn.shop,#minimap .mmn.shop,.zm .mn.shop{background:#fbe3c4}
.zbn[data-f]{cursor:pointer}
body.navmode .zbn[data-f]:focus,.zbn[data-f]:focus-visible{outline:3px solid #ffd848;outline-offset:3px}
.ccard .cmatch{position:absolute;left:-4px;top:-7px;z-index:3;width:16px;height:16px;box-sizing:border-box;border:2px solid #fff;border-radius:4px;box-shadow:0 2px 0 rgba(0,0,0,.3)}
.ccard .cmatch::after{content:'';position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);border-left:4px solid transparent;border-right:4px solid transparent}
.ccard .cmatch.up{background:#2fa040}.ccard .cmatch.up::after{border-bottom:6px solid #fff}
.ccard .cmatch.down{background:#d03020}.ccard .cmatch.down::after{border-top:6px solid #fff}

/* the run timer (2026-10-19): top left of the window, over the sky around the stage; white with a dark outline like the town's subtitle */
#runTimer{position:fixed;left:10px;top:2px;z-index:3000;pointer-events:none;font-family:var(--f-ui);font-size:16px;line-height:16px;letter-spacing:1px;color:#fff;text-shadow:1px 0 #101830,-1px 0 #101830,0 1px #101830,0 -1px #101830,1px 1px #101830,-1px -1px #101830,1px -1px #101830,-1px 1px #101830}
/* two one-line options share one cell of the Options grid (Skip speed and the Run timer, 2026-10-19), so the window keeps its six rows */
#options .optstack{display:flex;flex-direction:column;gap:3px;min-width:0}

/* A Poké Ball thrown after a won wild fight (2026-10-19): the ball under the beaten Pokémon's card, stepped like the rest of the game's motion */
.ballbox{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;height:70px;margin-top:6px}
.theball{display:block;width:48px;height:48px;transform-origin:50% 100%}
.theball svg{width:48px;height:48px}
.shakelights{display:flex;gap:6px}
.shakelights i{display:block;width:10px;height:10px;border:2px solid #fff;background:transparent}
.shakelights i.on{background:#ffd848;border-color:#ffd848}
@keyframes ballfly{0%{transform:translate(-150px,22px) scale(.6)}40%{transform:translate(-70px,-70px) scale(.8)}75%{transform:translate(-8px,-120px) scale(1)}100%{transform:translate(0,-112px) scale(1)}}
@keyframes balldrop{0%{transform:translate(0,-112px)}60%{transform:translate(0,2px)}80%{transform:translate(0,-8px)}100%{transform:translate(0,0)}}
@keyframes ballshake{0%{transform:rotate(0)}25%{transform:rotate(-24deg)}50%{transform:rotate(0)}75%{transform:rotate(24deg)}100%{transform:rotate(0)}}
@keyframes ballclick{0%,40%{filter:brightness(2.6)}100%{filter:none}}
@keyframes ballopen{0%{transform:scale(1)}40%{transform:scale(1.5)}100%{transform:scale(1.5);opacity:0}}
.theball.fly{animation:ballfly calc(.55s / var(--bs,1)) steps(8) forwards}
.theball.drop{animation:balldrop calc(.35s / var(--bs,1)) steps(5) forwards}
.theball.shake{animation:ballshake calc(.6s / var(--bs,1)) steps(6)}
.theball.click{animation:ballclick calc(.5s / var(--bs,1)) steps(4)}
.theball.open{animation:ballopen calc(.4s / var(--bs,1)) steps(4) forwards}
@media (prefers-reduced-motion:reduce){.theball.fly,.theball.drop,.theball.shake,.theball.click,.theball.open{animation:none}}
/* the details window's header buttons (Mastery, Favorite, Close) stay on one line each */
#mon .modal-box>.row.between button{white-space:nowrap}

/* the Poké Ball prompt (2026-10-19): the Pokémon to catch is picked by its card, the picked one lit */

/* ---- The Hall of Fame (after the Champion) ---- */
#s-hof.on{position:relative;padding:18px 20px 16px;gap:8px;overflow:hidden;align-items:center;background:radial-gradient(ellipse at 50% 38%,#3a3270 0,#0c0f26 72%)}
#s-hof .hofrays{position:absolute;left:50%;top:150px;width:900px;height:900px;margin:-450px 0 0 -450px;border-radius:50%;pointer-events:none;background:repeating-conic-gradient(rgba(248,208,72,.2) 0 7deg,transparent 7deg 24deg);-webkit-mask:radial-gradient(circle,#000 10%,transparent 62%);mask:radial-gradient(circle,#000 10%,transparent 62%);animation:revturn 24s steps(48) infinite}
#s-hof .hofstars{position:absolute;inset:0;pointer-events:none}
#s-hof .hofstars i{position:absolute;width:4px;height:4px;background:#fff6c8;box-shadow:0 0 0 1px rgba(248,208,72,.5);animation:flagblink 1.6s steps(2) infinite}
#s-hof>*:not(.hofrays):not(.hofstars){position:relative}
#s-hof #btnHofSkip{position:absolute;right:16px;top:14px;z-index:3}
#s-hof .hoftitle{margin:6px 0 0;font-family:var(--f-ui);font-size:var(--fs-hero);letter-spacing:4px;color:#f8d048;text-shadow:0 3px 0 #7a4a08,0 0 0 2px #2a1a04;text-transform:uppercase;opacity:0;transform:scale(.3)}
#s-hof .hoftitle.in{opacity:1;transform:none;animation:hofpop .7s steps(7)}
@keyframes hofpop{0%{transform:scale(.3);opacity:0}60%{transform:scale(1.25);opacity:1}100%{transform:scale(1);opacity:1}}
#s-hof .hofsub{margin:0;color:#fff6c8;font-size:var(--fs-text)}
#s-hof .hofrow{display:flex;justify-content:center;align-items:flex-end;gap:0;margin:8px 0 4px;min-height:236px}
#s-hof .hofmon{width:160px;display:flex;flex-direction:column;align-items:center;opacity:0;transform:translateY(24px)}
#s-hof .hofmon.in{opacity:1;transform:none;animation:hofin .5s steps(5)}
@keyframes hofin{0%{opacity:0;transform:translateY(24px);filter:brightness(3)}60%{opacity:1;transform:translateY(-6px);filter:brightness(1.8)}100%{opacity:1;transform:none;filter:none}}
#s-hof .hofplinth{position:relative;width:160px;height:160px;display:flex;align-items:flex-end;justify-content:center;border-bottom:6px solid #f8d048;box-shadow:0 8px 0 #7a4a08}
#s-hof .hofplinth img{width:160px;height:160px;image-rendering:pixelated}
#s-hof .hofplinth .icon,#s-hof .hofplinth svg{position:absolute;right:14px;top:10px}
#s-hof .hofplate{margin-top:12px;padding:4px 8px;min-width:128px;text-align:center;background:#16193a;border:2px solid #f8d048;display:flex;flex-direction:column;gap:2px}
#s-hof .hofplate b{font-family:var(--f-text);font-size:var(--fs-small);color:#fff6c8;white-space:nowrap}
#s-hof .hofplate span{font-size:var(--fs-fine);color:#c8d0ff;display:flex;justify-content:center;align-items:center;gap:6px}
#s-hof .hofplate .ivc{position:static;flex:none}
#s-hof .hofdialog{width:760px;max-width:100%;margin-top:6px;min-height:70px}
#s-hof .hofbtns{margin-top:4px;min-height:44px}
#s-hof .hofbtns button{padding:10px 28px;font-size:var(--fs-ui)}
#s-profile .hofprow{align-items:center;padding:5px 0}
#s-profile .hofpteam{display:flex;gap:2px;flex:none}
#s-profile .hofpmon{display:flex;flex-direction:column;align-items:center;width:62px}
#s-profile .hofpmon img{width:56px;height:56px;image-rendering:pixelated}
#s-profile .hofpmon span{display:flex;align-items:center;gap:3px;font-size:var(--fs-fine);color:var(--ink-soft,#5a6486);line-height:1}
#s-profile .hofpmon .ivc{position:static;width:auto;height:auto;padding:0 3px;font-size:var(--fs-tag);font-style:normal}
#s-profile #profileHof{overflow-y:auto;min-height:0;flex:1 1 auto}

/* The browser blocks the site's storage (2026-10-21, main.js): a window over the empty stage says so */
.nostorage { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 560px; padding: 16px 20px; z-index: 50; }
.nostorage h3 { margin: 0 0 8px; }

/* ---- Options → Sound: the music and effects levels ---- */
#options .option:has([data-pref="preview"]){grid-column:1 / -1}
#options .optTabrow{grid-column:1 / -1;margin:2px 0 6px}
#options .option.audio{grid-column:1 / -1;display:flex;flex-direction:column;align-items:stretch;gap:4px}
#options .audiorow{display:flex;flex-direction:column;gap:8px;padding:8px 0}
#options .audiotop{display:flex;align-items:center;gap:14px}
#options .audiotop .audiolabel{width:90px}
#options .audiolabel{font-family:var(--f-ui);font-size:var(--fs-small)}
#options .audiorow input[type=range]{width:100%;height:18px;accent-color:var(--red,#d8483c);cursor:pointer}
#options .audioval{font-size:var(--fs-small);text-align:right}
#options .audiohead{display:flex;justify-content:space-between;align-items:baseline;gap:10px}
#options .audiocredit{margin:0;font-size:var(--fs-fine)}
#options .audiocredit a{color:inherit;text-decoration:underline}

/* ---- The catch panel (2026-10-21) ---- */
#s-catch.on{padding:0;gap:0;background:linear-gradient(#233a66 0 62%,#3c7a46 62% 100%)}
#s-catch .head{position:relative;z-index:2}
#s-catch .catchchips{display:flex;justify-content:center;gap:10px;padding:10px 16px 0}
#s-catch .cchip{display:flex;align-items:center;gap:8px;padding:4px 12px 4px 6px;background:#f4f0e0;border:3px solid #1a1a28;box-shadow:0 3px 0 #1a1a28;opacity:.72;cursor:pointer}
#s-catch .cchip img{width:48px;height:48px;image-rendering:pixelated}
#s-catch .cchip span{display:flex;flex-direction:column;text-align:left;line-height:1.1}
#s-catch .cchip small{font-size:var(--fs-fine)}
#s-catch .cchip.on{opacity:1;box-shadow:0 0 0 3px #ffd848,0 0 0 6px #c8302c;transform:translateY(-3px)}
#s-catch .catchbody{flex:1;display:grid;grid-template-columns:1fr 330px;gap:18px;align-items:center;padding:6px 26px}
#s-catch .catchleft{display:flex;flex-direction:column;align-items:center;gap:6px}
#s-catch .catchstagebox{min-height:236px;display:flex;align-items:flex-end;justify-content:center}
#s-catch .catchpad{position:relative;display:flex;flex-direction:column;align-items:center;min-width:240px;padding-bottom:6px;border-bottom:8px solid #2a5a32}
#s-catch .wsprite img{display:block;width:160px;height:160px;image-rendering:pixelated;animation:catchidle 1.1s steps(2) infinite}
#s-catch .wsprite.caught img,#s-catch .wsprite.fled img{animation:none}
#s-catch .wsprite.caught{animation:caughtball calc(.6s / var(--bs,1)) steps(6) forwards}
#s-catch .wsprite.fled{animation:fledaway calc(.5s / var(--bs,1)) steps(5) forwards}
@keyframes catchidle{50%{transform:translateY(-5px)}}
#s-catch .catchinfo{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:center;min-height:30px;padding:4px 12px;background:rgba(14,18,40,.78);border:3px solid #1a1a28}
#s-catch .cname{font-family:var(--f-ui);font-size:var(--fs-ui);color:#fff6c8;display:inline-flex;align-items:center;gap:6px}
#s-catch .clv{color:#c8d0ff;font-size:var(--fs-small)}
#s-catch .cowned{display:inline-flex}
#s-catch .cchip .cowned{margin-left:2px}
#s-catch .catchtray{display:flex;flex-direction:column;gap:10px}
#s-catch .cball{display:grid;grid-template-columns:44px 1fr auto;align-items:center;gap:10px;padding:8px 14px;font-size:var(--fs-ui);text-align:left}
#s-catch .cball .cbi svg{width:36px;height:36px}
#s-catch .cball .cbn{font-family:var(--f-ui);color:#6a2020}
#s-catch .cball:hover,#s-catch .cball:focus-visible{transform:translateY(-2px)}
#s-catch .catchcap{margin:0;padding:8px 26px 12px;min-height:44px;text-align:center;color:#fff6c8;text-shadow:0 2px 0 #14301a;background:rgba(14,40,22,.55);font-size:var(--fs-text)}

/* ---- Town of the day and the TV station (2026-10-21) ---- */
.townmood{display:flex;align-items:center;gap:6px;margin:2px 0 0;padding:1px 8px;width:max-content;max-width:100%;background:rgba(255,216,72,.92);color:#2a1a04;border:2px solid #7a4a08;font:400 var(--fs-small)/1.3 var(--f-text)}
.quizpad{display:flex;justify-content:center;padding:8px;margin:6px 0;background:linear-gradient(#e8f0ff,#c8d8f4);border:3px solid #1a1a28}
.quizpic{width:160px;height:160px;image-rendering:pixelated}
.quizpic.dark{filter:brightness(0)}
.quizopts{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}
.quizopts button{padding:8px 18px}
#s-town .townmap.dense .bld{padding:8px 7px;column-gap:7px}
#s-town .townmap.dense .bld .bic .px{width:32px;height:32px}
#s-town .townmap.dense .bld b{font-size:var(--fs-small);overflow-wrap:anywhere}

/* ---- The spin of a roll the player paid for (2026-10-21) ---- */
.revart.spinning{animation:none}
.revart .ivc.bigbadge{position:static;width:104px;height:104px;font-size:64px;display:flex;align-items:center;justify-content:center;border-width:4px;box-shadow:0 0 18px var(--tone)}

/* ---- Menu polish, tiers 1 and 2 (2026-10-21) ---- */
button:not(:disabled):hover:not(.tab){translate:0 -1px;transition:translate .08s steps(2)}
.menu button:hover,.list button:hover{translate:none}
.drow:hover,.bld:hover,.exitbtn:hover:not(:disabled){translate:0 -2px;transition:translate .08s steps(2)}
.casc{animation:casc .22s steps(4) both;animation-delay:calc(var(--i, 0) * 32ms)}
@keyframes casc{from{opacity:0;transform:translateX(-16px)}to{opacity:1;transform:none}}
.fxghost{pointer-events:none;animation:ghostout .17s steps(3) forwards}
.fxghost .modal-box{animation:boxout .17s steps(3) forwards}
@keyframes ghostout{to{opacity:0}}
@keyframes boxout{to{transform:translateY(14px)}}
body.nofx .fx,body.nofx .fxghost{display:none}
.toast.ach{position:relative;animation:toastpop .36s steps(5)}
@keyframes toastpop{0%{transform:translateY(-12px) scale(.9);opacity:0}60%{transform:translateY(2px) scale(1.04);opacity:1}100%{transform:none}}
.toast.ach::before,.toast.ach::after{content:'';position:absolute;width:6px;height:6px;background:#ffd848;box-shadow:0 0 0 2px #fff6c8;animation:twinkle .7s steps(2) infinite}
.toast.ach::before{left:-8px;top:-8px}.toast.ach::after{right:-8px;bottom:-8px;animation-delay:.35s}
@keyframes twinkle{50%{opacity:.15;transform:scale(.5)}}
/* the title: pixel clouds in the sky, a Pokémon beside the logo, a blinking cursor */
#s-title.on{position:relative}
#s-title>*:not(.fxclouds):not(.helpbtn){position:relative;z-index:1}
#s-title>.helpbtn{z-index:2}
.fxclouds{position:absolute !important;inset:0;overflow:hidden;pointer-events:none;z-index:0 !important}
.fxclouds .cloud{position:absolute;left:0;width:8px;height:8px;background:#fff;opacity:.8;box-shadow:8px 0 #fff,16px 0 #fff,24px 0 #fff,32px 0 #fff,-8px 8px #fff,0 8px #fff,8px 8px #fff,16px 8px #fff,24px 8px #fff,32px 8px #fff,40px 8px #fff,0 -8px #fff,8px -8px #fff,16px -8px #fff;animation:clouddrift 100s steps(160) infinite}
@keyframes clouddrift{from{transform:translateX(-80px)}to{transform:translateX(1080px)}}
.logo{position:relative}
.titlemon{position:absolute;left:calc(50% + 176px);bottom:16px;width:80px;height:80px;image-rendering:pixelated;animation:bob 1.2s steps(2) infinite}
.menu button:focus::before,.menu button:hover::before{animation:cursorblink .9s steps(2) infinite}
@keyframes cursorblink{50%{opacity:.25}}
/* the Game Corner: arcade bulbs chasing along the header */
#s-corner .head{position:relative}
#s-corner .head::after{content:'';position:absolute;left:12px;right:12px;bottom:3px;height:4px;background:repeating-linear-gradient(90deg,#ffd848 0 6px,transparent 6px 20px);animation:bulbs .8s steps(2) infinite;pointer-events:none}
@keyframes bulbs{to{background-position:10px 0}}
body.nofx #s-corner .head::after{display:none}
/* confetti on a cleared zone */
#s-zoneend{position:relative}
.confetti{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:5}
.confetti i{position:absolute;top:-12px;width:8px;height:8px;animation:confall linear forwards}
@keyframes confall{from{transform:translateY(0) rotate(0)}to{transform:translateY(640px) rotate(540deg)}}
@media (prefers-reduced-motion:reduce){.casc,.fxghost,.toast.ach{animation:none}}

/* ---- The house windows (2026-10-21): the sub line, the speech bubble, the offer card, the choices row ---- */
#building .modal-box.talk{max-width:640px}
#building .bsub{margin:-8px 0 -2px;padding:0 4px;font:400 var(--fs-small)/1.3 var(--f-text);color:#5a6486}
#building .bsub:empty{display:none}
#bBody>.dialog.bubble{position:relative;margin-top:14px;border-radius:10px;padding:14px 18px 12px}
#bBody .btail{position:absolute;left:26px;top:-17px;width:0;height:0;border-left:9px solid transparent;border-right:9px solid transparent;border-bottom:17px solid var(--edge)}
#bBody .btail::after{content:'';position:absolute;left:-6px;top:6px;width:0;height:0;border-left:6px solid transparent;border-right:6px solid transparent;border-bottom:12px solid var(--win)}
#bBody>.dialog.bubble p+p{margin-top:6px}
#bBody .brow{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}
#bBody .offer{display:grid;grid-template-columns:48px 1fr auto;gap:12px;align-items:center;margin-top:12px;padding:10px 14px;background:#fffbe8;border:3px solid var(--edge);box-shadow:inset 0 0 0 2px #fff,0 3px 0 var(--shade)}
#bBody .offer .oicon{display:flex;justify-content:center}
#bBody .offer .oicon .px{width:40px;height:40px}
#bBody .offer .otext b{font-family:var(--f-ui);font-size:var(--fs-ui);letter-spacing:.5px}
#bBody .offer .otext p{margin:3px 0 0;font-size:var(--fs-small);line-height:1.3}
#bBody .offer button{white-space:nowrap}
#bBody .offer.taken{grid-template-columns:48px 1fr;background:#eef0f4;opacity:.8}
#bBody .offer.taken .otext p{margin:0}

/* ---- a Gym exit wears its leader's face; the zone end's look ahead has the next boss's silhouette (2026-10-21) ---- */
.exitbtn .exitface{display:block;width:44px;height:44px;image-rendering:pixelated}
.exitbtn:disabled .exitface{filter:grayscale(1);opacity:.6}
#zeAhead.hassil{position:relative;padding-right:118px}
#zeAhead .aheadsil{position:absolute;right:12px;top:50%;transform:translateY(-50%);pointer-events:none}
#zeAhead .aheadsil img{display:block;width:96px;height:96px;image-rendering:pixelated;filter:brightness(0);opacity:.3}

/* ---- the event's watermark and the boss intro's flash (2026-10-21) ---- */
#s-event .sbody>.dialog{isolation:isolate}
.evmark{position:absolute;right:10px;top:6px;bottom:6px;aspect-ratio:1;z-index:-1;opacity:.1;pointer-events:none;display:flex;align-items:center}
.evmark .px{width:auto;height:100%;max-height:120px}
#frame.bossgo{animation:bossshake .46s steps(8)}
#frame.bossgo::after{content:'';position:absolute;inset:0;background:#fff;z-index:60;pointer-events:none;animation:bossflash .46s steps(5) forwards}
@keyframes bossshake{20%{translate:-6px 2px}40%{translate:5px -3px}60%{translate:-4px -2px}80%{translate:3px 2px}} /* the translate property: #frame keeps its transform scale */
@keyframes bossflash{0%{opacity:.95}30%{opacity:.6}100%{opacity:0}}
@media (prefers-reduced-motion:reduce){#frame.bossgo,#frame.bossgo::after{animation:none}}

/* ---- the Pokéfans' wanted poster (2026-10-21) ---- */
.wanted{display:grid;grid-template-columns:224px 1fr;gap:18px;align-items:start;margin-top:12px}
.poster{position:relative;display:flex;flex-direction:column;align-items:center;gap:5px;padding:10px 10px 12px;background:#f6e6b8;border:4px solid #7a5a2a;box-shadow:inset 0 0 0 3px #fff2cc,0 3px 0 var(--shade)}
.poster .wtitle{font:700 var(--fs-title)/1 var(--f-ui);letter-spacing:4px;color:#7a3a1a}
.poster img{width:128px;height:128px;image-rendering:pixelated;background:#fff8e4;border:3px solid #7a5a2a}
.poster b{font-family:var(--f-ui);font-size:var(--fs-ui);letter-spacing:.5px}
.poster .wstamp{position:absolute;left:50%;top:68%;transform:translate(-50%,-50%) rotate(-10deg);padding:3px 10px;border:3px solid #c8302c;color:#c8302c;font:700 var(--fs-ui)/1 var(--f-ui);letter-spacing:1px;background:rgba(255,248,228,.88);white-space:nowrap}
.poster.done img{filter:grayscale(1);opacity:.6}
.poster.done .wstamp{border-color:#2e9e6b;color:#2e9e6b}
.wtext{display:flex;flex-direction:column;gap:8px;min-width:0}
.wtext p{margin:0}
.wtext button{align-self:flex-start;margin-top:4px}
#bBody>.poster{width:224px;margin:12px auto 0}

/* ---- The arena's looks (2026-10-21): a backdrop per zone family; the two mats stay ---- */
#s-battle .arena{--mat:radial-gradient(ellipse 150px 22px at 80% 42%,rgba(255,255,255,.14) 0 60%,transparent 62%),radial-gradient(ellipse 150px 22px at 20% 94%,rgba(255,255,255,.14) 0 60%,transparent 62%)}
#s-battle[data-look=grass] .arena{background:var(--mat),repeating-linear-gradient(90deg,transparent 0 22px,rgba(0,0,0,.06) 22px 24px),linear-gradient(#2a4572 0 48%,#3a7a4a 48%)}
#s-battle[data-look=forest] .arena{background:var(--mat),radial-gradient(ellipse 60% 40% at 50% 0,rgba(0,0,0,.25),transparent 70%),linear-gradient(#1f3d2e 0 48%,#2e5a34 48%)}
#s-battle[data-look=lake] .arena{background:var(--mat),repeating-linear-gradient(0deg,transparent 0 10px,rgba(255,255,255,.05) 10px 12px),linear-gradient(#2a4572 0 48%,#2d6d8a 48%)}
#s-battle[data-look=cave] .arena{background:var(--mat),radial-gradient(ellipse 70% 50% at 50% 100%,rgba(90,80,120,.35),transparent 70%),linear-gradient(#141628 0 48%,#2c2a3a 48%)}
#s-battle[data-look=ember] .arena{background:var(--mat),radial-gradient(ellipse 80% 40% at 50% 100%,rgba(255,120,40,.35),transparent 70%),linear-gradient(#2a1018 0 48%,#6a2a18 48%)}
#s-battle[data-look=rock] .arena{background:var(--mat),repeating-linear-gradient(45deg,transparent 0 14px,rgba(0,0,0,.08) 14px 16px),linear-gradient(#2e2e3a 0 48%,#5a5450 48%)}
#s-battle[data-look=sea] .arena{background:var(--mat),repeating-linear-gradient(0deg,transparent 0 12px,rgba(255,255,255,.07) 12px 14px),linear-gradient(#1f3b66 0 48%,#2b6c8c 48%)}
#s-battle[data-look=coast] .arena{background:var(--mat),linear-gradient(#2a4572 0 48%,#2b6c8c 48% 70%,#d8c890 70%)}
#s-battle[data-look=volt] .arena{background:var(--mat),repeating-linear-gradient(90deg,transparent 0 30px,rgba(248,208,72,.12) 30px 32px),linear-gradient(#202a40 0 48%,#3c3a2c 48%)}
#s-battle[data-look=meadow] .arena{background:var(--mat),radial-gradient(circle 3px at 20% 70%,#f080c0 98%,transparent),radial-gradient(circle 3px at 70% 80%,#ffd848 98%,transparent),radial-gradient(circle 3px at 45% 92%,#f080c0 98%,transparent),linear-gradient(#2e5a52 0 48%,#6a8a3a 48%)}
#s-battle[data-look=temple] .arena{background:var(--mat),repeating-linear-gradient(90deg,transparent 0 60px,rgba(255,255,255,.06) 60px 64px),linear-gradient(#2a2a44 0 48%,#4a4458 48%)}
#s-battle[data-look=salt] .arena{background:var(--mat),linear-gradient(#3a4660 0 48%,#8a8a7a 48%)}
#s-battle[data-look=ruins] .arena{background:var(--mat),repeating-linear-gradient(0deg,transparent 0 18px,rgba(255,255,255,.05) 18px 20px),linear-gradient(#1e2236 0 48%,#3a3450 48%)}
#s-battle[data-look=marsh] .arena{background:var(--mat),radial-gradient(ellipse 40% 20% at 30% 85%,rgba(80,140,100,.4),transparent 70%),linear-gradient(#22342a 0 48%,#3a4a2a 48%)}
#s-battle[data-look=snow] .arena{background:var(--mat),linear-gradient(#3c4c70 0 48%,#c8d4e8 48%)}
#s-battle[data-look=ice] .arena{background:var(--mat),repeating-linear-gradient(135deg,transparent 0 26px,rgba(255,255,255,.12) 26px 28px),linear-gradient(#2a4a7a 0 48%,#8ac0e8 48%)}
#s-battle[data-look=league] .arena{background:var(--mat),linear-gradient(90deg,transparent 0 49.5%,#f8d048 49.5% 50.5%,transparent 50.5%) 0 48%/100% 4px no-repeat,linear-gradient(#2a2a52 0 48%,#d8d0c0 48%)}
/* the particles */
.arenafx{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:0}
.arenafx i{position:absolute;top:-10px;width:6px;height:6px;animation:arenafall linear infinite}
.arenafx.snow i{background:#fff;box-shadow:0 0 0 1px rgba(255,255,255,.4)}
.arenafx.pollen i{background:#ffd848;width:5px;height:5px}
.arenafx.leaf i{background:#78d060;width:7px;height:5px}
.arenafx.ember i{background:#ff9a30;top:auto;bottom:-10px;animation-name:arenarise}
.arenafx.bubble i{background:transparent;border:2px solid rgba(255,255,255,.5);width:7px;height:7px;top:auto;bottom:-10px;animation-name:arenarise}
@keyframes arenafall{from{transform:translateY(0)}to{transform:translateY(420px)}}
@keyframes arenarise{from{transform:translateY(0);opacity:1}to{transform:translateY(-420px);opacity:0}}
#s-battle .arena>.side,#s-battle .arena>.vs{position:relative;z-index:1}
body.nofx .arenafx{display:none}
/* the punch: a shake on a KO or a boss move, a white-out on the card that falls, a tag over the target */
#s-battle .arena.shake-s{animation:arenashake .4s steps(6)}
#s-battle .arena.shake-l{animation:arenashakel .45s steps(7)}
@keyframes arenashake{25%{translate:-3px 1px}50%{translate:3px -1px}75%{translate:-2px 0}}
@keyframes arenashakel{20%{translate:-7px 3px}40%{translate:6px -3px}60%{translate:-5px 2px}80%{translate:3px -1px}}
#s-battle .ccard.kowhite .cart{animation:kowhite .32s steps(3)}
@keyframes kowhite{0%{filter:brightness(4)}60%{filter:brightness(2)}100%{filter:none}}
.ccard .pop.tag{top:22%;font-size:var(--fs-small);letter-spacing:1px;white-space:nowrap}
#s-battle .side .ccard.front .pop.tag{top:16px;left:80px;font-size:var(--fs-ui)}
.ccard .pop.crit{color:#ff8c40}
@media (prefers-reduced-motion:reduce){#s-battle .arena.shake-s,#s-battle .arena.shake-l,.arenafx i{animation:none}}
