/* One palette preference shared by the pocket playground and online arena. */
:root,:root[data-palette=lcd]{--ui-bg:#bfcd94;--ui-panel:#cbd9a8;--ui-soft:#afc184;--ui-ink:#293f2b;--ui-muted:#50673b;--ui-line:#789454;--ui-accent:#355234;--ui-on-accent:#edf3d0;--ui-shell:#424e48;--ui-shell-ink:#e6edd7;--ui-outer:#242e2c;--ui-sky:linear-gradient(#c6d59e,#b8ca8a)}
:root[data-palette=hacker]{--ui-bg:#102018;--ui-panel:#172d20;--ui-soft:#203e29;--ui-ink:#d3f5b2;--ui-muted:#9bc87b;--ui-line:#466f3d;--ui-accent:#b6ee67;--ui-on-accent:#142014;--ui-shell:#080e0b;--ui-shell-ink:#bbf879;--ui-outer:#030806;--ui-sky:linear-gradient(#0a160e,#193d23)}
:root[data-palette=dream]{--ui-bg:#f2e3fa;--ui-panel:#f9efff;--ui-soft:#dfd5f5;--ui-ink:#47335e;--ui-muted:#715583;--ui-line:#af94c4;--ui-accent:#755493;--ui-on-accent:#fff3fe;--ui-shell:#73608f;--ui-shell-ink:#fff1fc;--ui-outer:#d1bde4;--ui-sky:linear-gradient(130deg,#f9c8dd,#dfc6f5 52%,#b6dcf2)}
:root[data-palette=ember]{--ui-bg:#f2c49e;--ui-panel:#f9d6b3;--ui-soft:#e9af84;--ui-ink:#582e32;--ui-muted:#85463d;--ui-line:#b77352;--ui-accent:#853d3d;--ui-on-accent:#fff0d3;--ui-shell:#6b3039;--ui-shell-ink:#ffe1bb;--ui-outer:#381d29;--ui-sky:linear-gradient(#efa67f,#f7d0a0)}
:root[data-palette=mono]{--ui-bg:#f3f3f0;--ui-panel:#fff;--ui-soft:#dededb;--ui-ink:#171a18;--ui-muted:#505650;--ui-line:#828882;--ui-accent:#202621;--ui-on-accent:#fff;--ui-shell:#252b27;--ui-shell-ink:#fff;--ui-outer:#b7beb9;--ui-sky:linear-gradient(#fff,#e4e7e3)}
:root[data-palette=ocean]{--ui-bg:#172f42;--ui-panel:#203f51;--ui-soft:#294d5d;--ui-ink:#d2f4eb;--ui-muted:#9fc9cc;--ui-line:#497783;--ui-accent:#83d8cd;--ui-on-accent:#123747;--ui-shell:#102333;--ui-shell-ink:#c5f3ee;--ui-outer:#091622;--ui-sky:linear-gradient(#13283e,#20576a)}
html[data-palette] body{background:var(--ui-outer);color:var(--ui-ink)}
html[data-palette] .device{background:var(--ui-shell);border-color:var(--ui-outer)}
html[data-palette] .device-header,html[data-palette] .device-bottom,html[data-palette] .name-button{color:var(--ui-shell-ink)}
html[data-palette] .device-header .eyebrow,html[data-palette] #pet-subtitle,html[data-palette] .edit-icon{color:var(--ui-shell-ink);opacity:.85}
html[data-palette] .device-header .icon-button{background:var(--ui-outer);color:var(--ui-shell-ink);border-color:var(--ui-line)}
html[data-palette] .lcd{background:var(--ui-bg);color:var(--ui-ink);border-color:var(--ui-outer);box-shadow:inset 2px 2px var(--ui-line)}
html[data-palette] .habitat{background:var(--ui-sky);border-color:var(--ui-line);margin:0}
html[data-palette] .ground,html[data-palette] .creature::after{background:var(--ui-line)}
html[data-palette] .activities{color:var(--ui-ink)}
html[data-palette] :is(.screen-heading h2,#panel h2,#stats-screen h2,.eyebrow,.speech,#evolution-label,.habitat-label,.hint,.pager>span,.need label,.stats span,.level-line span,.evolution-progress,.snack-card p,.drill-card p,.collection-card p,.mood-pill,.energy-tag,.collection-hint,.codex-hint){color:var(--ui-muted)}
html[data-palette] :is(.screen-heading h2,#panel h2,#stats-screen h2,.stats b,.level-line,.need label,.snack-card h3,.drill-card h3,.collection-card h3){color:var(--ui-ink)}
html[data-palette] :is(.snack-card,.drill-card,.collection-card,.stats>div,#level-progress,.scrapbook,.monster-card,.partner-card,.bag-grid>div,.training-result,.battle-log,.opponent-picker,.reward-label){background:var(--ui-panel);color:var(--ui-ink);border-color:var(--ui-line)}
html[data-palette] :is(.stats b,.scrapbook b,.monster-card h3,.partner-card b,.partner-card small,.bag-grid b,.bag-grid small){color:var(--ui-ink)}
html[data-palette] :is(.primary,.button){background:var(--ui-accent);color:var(--ui-on-accent);border-color:var(--ui-accent);box-shadow:2px 2px var(--ui-line)}
html[data-palette] :is(.secondary,.icon-button,select,input,.inventory-tabs button,.starter-choice){background:var(--ui-soft);color:var(--ui-ink);border-color:var(--ui-line);box-shadow:none}
html[data-palette] :is(.primary,.secondary,.button,.icon-button):hover:not(:disabled){filter:brightness(1.08)}
html[data-palette] :is(.inventory-tabs button.active,nav button.active){background:var(--ui-accent);color:var(--ui-on-accent)}
html[data-palette] nav[aria-label=Activities]{background:var(--ui-soft);border-color:var(--ui-line)}
html[data-palette] nav[aria-label=Activities] button{color:var(--ui-muted);background:none;border:1px solid transparent}
html[data-palette] nav[aria-label=Activities] button.active{background:var(--ui-accent);color:var(--ui-on-accent);border-color:var(--ui-line)}
nav[aria-label=Activities] .nav-icon{display:grid;place-items:center}nav[aria-label=Activities] .nav-icon svg{width:24px;height:24px;fill:currentColor;shape-rendering:crispEdges}
html[data-palette] :is(.bar,.hp-row .bar){background:var(--ui-soft);border-color:var(--ui-line)}
html[data-palette] .bar i{background:var(--ui-accent)}
html[data-palette] dialog:not(#evolution-dialog):not(#scan-dialog):not(#invite-scan-dialog){background:var(--ui-bg);color:var(--ui-ink);border-color:var(--ui-line)}
html[data-palette] dialog :is(label,.hint,.description,.eyebrow,.icon-button){color:var(--ui-muted)}
#settings-dialog{overflow-y:auto}#palette-dialog{width:min(440px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow-y:auto;padding:20px;border-radius:6px;border:3px solid var(--ui-line);font-family:'Courier New',monospace;box-sizing:border-box}#palette-dialog::backdrop{background:#07150ddd}
.palette-heading{display:flex;justify-content:space-between;align-items:center;gap:10px}.palette-heading p{font-size:8px;margin:0 0 6px;color:var(--ui-muted)}.palette-heading h2{font:700 21px 'Courier New',monospace;margin:0}.palette-heading button{background:none;border:0;color:var(--ui-ink);font-size:30px;min-width:40px;min-height:40px;cursor:pointer}.palette-note{font-size:11px;line-height:1.6;color:var(--ui-muted)}.palette-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.palette-grid button{text-align:left;padding:10px;border:2px solid var(--ui-line);background:var(--ui-panel);color:var(--ui-ink);font-family:inherit;border-radius:4px;cursor:pointer}.palette-grid button[aria-pressed=true]{outline:2px solid var(--ui-accent);outline-offset:1px}.palette-grid b{display:block;font-size:12px;margin:8px 0 5px}.palette-grid small{display:block;font-size:9px;line-height:1.5;color:var(--ui-muted)}.palette-swatch{height:38px;display:flex;gap:3px;background:#bfcd94;border:1px solid #789454;padding:5px}.palette-swatch i{flex:1;background:#355234}.palette-swatch i:nth-child(2){opacity:.6}.palette-swatch i:nth-child(3){opacity:.25}.swatch-hacker{background:#0c1911;border-color:#426b34}.swatch-hacker i{background:#b6ee67}.swatch-dream{background:linear-gradient(110deg,#f9c8dd,#dfc6f5,#b6dcf2);border-color:#af94c4}.swatch-dream i{background:#755493}.swatch-ember{background:#efac81;border-color:#9a4d45}.swatch-ember i{background:#6b3039}.swatch-mono{background:#fff;border-color:#444}.swatch-mono i{background:#202621}.swatch-ocean{background:#173449;border-color:#497783}.swatch-ocean i{background:#83d8cd}
html[data-palette] :is(.battle-report thead th,.report-reason,.report-chips p){background:var(--ui-panel);color:var(--ui-ink);border-color:var(--ui-line)}
html[data-palette] .battle-report :is(th,td){border-color:var(--ui-line)}
@media(max-height:610px){nav[aria-label=Activities] .nav-icon svg{width:20px;height:20px}.palette-grid{gap:7px}.palette-grid button{padding:8px}.palette-swatch{height:28px}}

html[data-palette] .device-header .eyebrow{color:var(--ui-shell-ink)!important}html[data-palette] #stats-screen .mood-pill{background:var(--ui-soft);color:var(--ui-ink)}

/* Palette coverage: status chips, inventory surfaces and both battle boards. */
html[data-palette] :is(.energy-tag,.reward-label,.story-traits,.online-game-link,.bag-trade-link){background:var(--ui-soft);color:var(--ui-ink);border-color:var(--ui-line);box-shadow:none}
html[data-palette] :is(.codex-tile,.codex-tile.unseen,.collection-card.locked){background:var(--ui-panel);color:var(--ui-ink);border-color:var(--ui-line);box-shadow:none}
html[data-palette] :is(.codex-tile.current-form,.partner-card.active-partner){background:var(--ui-soft);color:var(--ui-ink);border-color:var(--ui-accent)}
html[data-palette] .inventory-tabs button.selected{background:var(--ui-accent);color:var(--ui-on-accent);border-color:var(--ui-accent)}
html[data-palette] :is(.snack-card,.drill-card,.collection-card,.stats>div,#level-progress,.scrapbook,.result){box-shadow:inset 1px 1px var(--ui-line)}
html[data-palette] :is(.arena,#online-board){background:var(--ui-line);border-color:var(--ui-accent)}
html[data-palette] :is(.tile,.online-tile){background:var(--ui-panel);border-color:var(--ui-line)}
html[data-palette] :is(.tile.enemy-side,.online-tile.right-side){background:var(--ui-soft);border-color:var(--ui-line)}
html[data-palette] :is(.tile.wall,.online-tile.online-wall){background:var(--ui-accent);color:var(--ui-on-accent);border-color:var(--ui-line)}
html[data-palette] :is(.hp-row,.focus-report,.battle-status,.result h3,.result p,.strategy-label,.monster-card p,.collection-card .eyebrow){color:var(--ui-ink)}
html[data-palette] .result{background:var(--ui-panel);border-color:var(--ui-line)}
html[data-palette] :is(.inventory-tabs button,.pager .icon-button){box-shadow:none}
html[data-palette] .matchup-tag.favorable,html[data-palette] .matchup-tag.close,html[data-palette] .matchup-tag.tough{background:var(--ui-panel);color:var(--ui-ink);border-color:var(--ui-line)}
/* Feed uses two balanced zones; food size follows its contents rather than filling the screen. */
body[data-screen=feed] .lcd{display:grid;grid-template-rows:minmax(0,1fr) minmax(220px,1fr) auto}
body[data-screen=feed] .pet-card{display:block!important;min-height:0;height:100%}
body[data-screen=feed] .habitat{height:100%;box-sizing:border-box}
body[data-screen=feed] .creature{width:clamp(84px,26vh,220px);height:clamp(84px,26vh,220px);max-width:70%;max-height:calc(100% - 50px);bottom:23px;transform:translateX(-50%);transform-origin:center bottom}
body[data-screen=feed] .speech{top:12px;font-size:9px;white-space:normal;max-width:94%}
body[data-screen=feed] .activities{min-height:0;padding:12px 15px;justify-content:center}
body[data-screen=feed] #panel{flex:none;display:grid;grid-template-columns:minmax(0,1fr);align-content:center;gap:8px}
body[data-screen=feed] .screen-heading{margin:0}
body[data-screen=feed] .snack-card{flex:none;min-height:0;gap:14px;padding:10px 12px;justify-content:flex-start;box-sizing:border-box}
body[data-screen=feed] .food-art{width:60px;height:60px;flex:0 0 60px;filter:none}
body[data-screen=feed] .snack-card>div{min-width:0}
body[data-screen=feed] .snack-card h3{font-size:16px;line-height:1.3;margin:4px 0}
body[data-screen=feed] .snack-card p{font-size:10px;line-height:1.6;margin:0}
body[data-screen=feed] .snack-card .eyebrow{font-size:8px;line-height:1.4}
body[data-screen=feed] .pager{margin:0}
body[data-screen=feed] #feed-snack{min-height:40px;line-height:1.4}
@media(max-height:650px){body[data-screen=feed] .lcd{grid-template-rows:minmax(0,1fr) minmax(205px,1fr) auto}body[data-screen=feed] .activities{padding:9px 12px}body[data-screen=feed] #panel{gap:5px}body[data-screen=feed] .food-art{width:46px;height:46px;flex-basis:46px}body[data-screen=feed] .snack-card{padding:7px 9px;gap:10px}body[data-screen=feed] .snack-card h3{font-size:13px;margin:3px 0}body[data-screen=feed] .snack-card p{font-size:9px;line-height:1.5}body[data-screen=feed] .speech{font-size:8px;top:7px}body[data-screen=feed] #feed-snack{min-height:35px;font-size:10px}}
@media(max-height:460px){body[data-screen=feed] .lcd{grid-template-rows:minmax(0,1fr) 182px auto}body[data-screen=feed] .activities{padding:5px 10px}body[data-screen=feed] #panel{gap:4px}body[data-screen=feed] .screen-heading h2{font-size:13px!important}body[data-screen=feed] .snack-card{padding:5px 8px}body[data-screen=feed] .snack-card h3{font-size:12px}body[data-screen=feed] .food-art{width:35px;height:35px;flex-basis:35px}body[data-screen=feed] .creature{min-height:0;max-height:calc(100% - 20px);bottom:5px}body[data-screen=feed] .speech,body[data-screen=feed] #evolution-label{display:none}body[data-screen=feed] #feed-snack{min-height:30px}body[data-screen=feed] .pager .icon-button{height:25px}}

.heal-number{position:absolute;top:0;left:0;right:0;text-align:center;color:var(--ui-on-accent);background:var(--ui-accent);font:bold 9px monospace;z-index:4;padding:2px}.collection-card .chip-art{flex:none}.collection-card p{overflow-wrap:anywhere}
