/* Crystal Adventure: handheld-inspired surfaces, scalable type, touch-first controls. */
.deck-companion-change{width:100%;margin-top:12px}
.adv-companion-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:18px 0}
#advModal .adv-companion-option{display:flex;align-items:center;gap:12px;min-height:106px;padding:12px;text-align:left;background:#fffdf3;color:#254b62;border:2px solid #668a99;border-radius:5px;box-shadow:0 3px 0 #35556933;font:14px/1.5 'Courier New',monospace;cursor:pointer}
.adv-companion-option canvas{width:72px;height:72px;flex:none;image-rendering:pixelated}
.adv-companion-option span{min-width:0}.adv-companion-option strong,.adv-companion-option small,.adv-companion-option b{display:block;overflow-wrap:anywhere}.adv-companion-option small{font-size:12px;margin:3px 0}.adv-companion-option b{font-size:12px;color:#376132}
#advModal .adv-companion-option[aria-pressed=true]{background:#e4f1cd;border-color:#557e42}
#advModal .adv-companion-option:disabled{opacity:1;cursor:default;background:#e2e9e7;color:#52656a}
#advModal .adv-companion-option[aria-pressed=true]:disabled{background:#e4f1cd;color:#254b62}
#advModal .adv-companion-option:not(:disabled):hover{background:#ffedb7;border-color:#a07933}
#advModal .adv-companion-option:focus-visible{outline:3px solid #be762e;outline-offset:3px}
@media(max-width:540px){.adv-companion-grid{grid-template-columns:1fr;gap:9px}#advModal .adv-companion-option{min-height:86px;padding:8px}.adv-companion-option canvas{width:60px;height:60px}}
:root{--adv-ink:#17344c;--adv-blue:#176ca8;--adv-sky:#d8efff;--adv-line:#578cba;--adv-paper:#fffdf5;--adv-accent:#ffca38}
.shiny-mark{display:inline-block;color:#785000;background:#fff0a7;border:1px solid #c08b25;border-radius:3px;padding:1px 3px;font-size:.7em;letter-spacing:.03em;vertical-align:middle}
.crystal-item-art{display:inline-flex;position:relative;flex:0 0 48px;width:48px;height:48px;align-items:center;justify-content:center;vertical-align:middle;font-size:30px;color:#35697e}
.crystal-item-art canvas{position:absolute;inset:0;width:100%;height:100%;image-rendering:pixelated}
.crystal-item-art.ready>span{visibility:hidden}
.adv-inventory{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px;margin:0 0 22px}
.adv-inventory-card{display:flex;gap:8px;align-items:center;padding:10px;background:#e7f3f2;border:2px solid #90b9b6;border-radius:6px;min-width:0}
.adv-inventory-card strong{display:block;font-size:23px;line-height:1.2;color:#234a5c}.adv-inventory-card small{display:block;font-size:12px;line-height:1.4;color:#486878}
@media(max-width:600px){.adv-inventory{gap:5px}.adv-inventory-card{flex-direction:column;text-align:center;padding:8px 3px;gap:4px}.adv-inventory-card strong{font-size:20px}}
body{background:#10263e;font-family:'Courier New',ui-monospace,monospace}
#layout{padding:18px;gap:0;max-width:1640px;margin:auto;height:100dvh;min-height:440px}
#gameWrap{border:6px solid #173a58;border-radius:16px 0 0 16px;box-shadow:inset 0 0 0 2px #78b6dc,0 16px 45px #061b2960;background:#183e45}
#hud{height:62px;padding:8px 12px;background:#194668;color:#ffffff;border-bottom:3px solid #102f4c;gap:7px;box-shadow:0 3px 0 #17343d22}
.hbtn{font-family:inherit;font-weight:bold;font-size:14px;border:2px solid #315f82;border-radius:5px;padding:8px 10px;color:var(--adv-ink);background:#fffdf5;box-shadow:0 2px 0 #234864;min-height:36px}
.hbtn:hover{background:#d7edff}.hbtn:focus-visible{outline-color:#e5a838;outline-offset:3px}
#btnMe{width:40px;height:40px;background:#d0e9fc;border-color:#407aa4}
#hudInfo b{font-size:12px;color:#ffffff;letter-spacing:0}#hudInfo b span{color:#8fe9ff}
#xpBar{width:112px;height:7px;border:1px solid #649bbe;background:#14374f}#xpBar i{background:#3edc93}
#quick .q{font-size:13px;padding:7px 8px}#quick a.q{background:transparent;color:#e4f3ff;border-color:transparent;box-shadow:none}#quick a.q:hover{border-color:#9cbdc0}
#btnDex{background:#c8323d;color:#ffffff;border-color:#802233}#btnBadge{background:#ffce3d;color:#443315;border-color:#aa741e}
#mini{top:78px;right:14px;border:3px solid #f1f6de;box-shadow:0 0 0 2px #21496b,0 4px 0 #203d4933;opacity:.93;border-radius:4px}
#tracker{top:78px;left:14px;max-width:calc(100% - 190px);font-family:inherit;font-size:14px;font-weight:bold;line-height:1.5;color:#173b55;background:#fffdf5f5;border:2px solid #3f7492;border-radius:5px;padding:9px 12px;box-shadow:0 3px 0 #233d4433;cursor:pointer}
#wxChip{font:12px/1.4 'Courier New',monospace;border:1px solid #c0d8c6;padding:5px 8px;background:#203d49da;color:#f1f8ef}
#keysHint{font-family:inherit;font-size:12px;line-height:1.65;padding:9px 12px;border:1px solid #90b8ad66;background:#16343dcc;right:12px;bottom:12px}
.back-pill{display:none}.crt{opacity:.13;pointer-events:none}
#fieldDeck{width:294px;flex:none;display:flex;flex-direction:column;background:#28648c;border:6px solid #173a58;border-left:0;border-radius:0 16px 16px 0;padding:13px;box-shadow:inset 0 0 0 2px #78b6dc,0 16px 45px #061b2933;overflow:auto;color:#ffffff}
.deck-top{display:flex;align-items:center;justify-content:space-between;margin:3px 3px 12px;font-size:12px;font-weight:bold;letter-spacing:2px}.deck-top span:last-child{font-size:11px;letter-spacing:0;color:#d5efff}
.deck-screen{background:#fffdf5;color:var(--adv-ink);border:2px solid #153957;border-radius:7px;box-shadow:inset 0 0 0 3px #c7e1f2;padding:15px;margin-bottom:12px}
.deck-screen small,.adv-eyebrow{font-size:12px;font-weight:bold;letter-spacing:1.7px;color:#326287;text-transform:uppercase}
.deck-screen h2{font-size:23px;line-height:1.15;margin:10px 0 6px;letter-spacing:-1px}.deck-screen p{font-size:14px;line-height:1.5;margin:0;color:#415e73}
.deck-progress{display:flex;gap:7px;margin:16px 0 0}.deck-progress i{display:block;height:9px;flex:1;background:#d1deea;border:1px solid #7899b4;border-radius:2px}.deck-progress i.lit{background:#ffc83c;border-color:#aa761a}
.deck-partner{display:flex;align-items:center;gap:8px;min-width:0}.deck-partner canvas{width:64px;height:64px;flex:none;image-rendering:pixelated}.deck-partner b{font-size:14px;overflow-wrap:anywhere}.deck-partner p{font-size:12px}.deck-hp{height:6px;background:#c3d6e4;border-radius:3px;margin-top:7px;overflow:hidden}.deck-hp i{display:block;height:100%;background:#21b571}
.deck-quest{font-size:15px;line-height:1.55;margin:9px 0 0}.deck-quest strong{font-size:14px;display:block;margin-bottom:5px}.deck-quest span{font-size:13px;display:block;color:#466374}.deck-quest button{width:100%;margin-top:10px}
.deck-nav{display:grid;grid-template-columns:1fr 1fr;gap:8px}.deck-nav button{min-height:56px;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:3px;background:#e2f1ff;border:2px solid #204f75;border-radius:6px;box-shadow:0 3px 0 #174767;color:#153c5c;font-size:14px;font-weight:bold;padding:9px}.deck-nav button:hover{background:#ffe9a0;border-color:#ba861e}.deck-nav button span{font-size:11px;font-weight:normal;color:#3e617c}.deck-footer{margin-top:auto;padding-top:15px;font-size:12px;color:#ddf1ff;line-height:1.6}.deck-footer a{color:#ffffff;text-decoration:underline}.deck-balance{display:flex;justify-content:space-between;margin:10px 0;font-size:13px}
#advMobile{display:none}#advLocation{position:absolute;bottom:20px;left:18px;z-index:16;pointer-events:none;background:#f6f9e9f0;border:2px solid #668b8d;border-left:6px solid #46a08e;color:#254b52;border-radius:5px;box-shadow:0 3px 0 #24474a33;padding:10px 18px;max-width:calc(100% - 36px);transition:opacity .2s;opacity:0;transform:translateY(5px)}#advLocation.show{opacity:1;transform:none}#advLocation strong{display:block;font-size:18px}#advLocation span{font-size:12px;color:#58726d}
#advPrompt{position:absolute;left:50%;bottom:24px;transform:translateX(-50%);z-index:17;padding:9px 15px;border-radius:5px;border:2px solid #def0df;background:#23494ae8;color:#fffde7;font-size:14px;font-weight:bold;pointer-events:none;white-space:nowrap}#advPrompt[hidden]{display:none}
#advModal{position:fixed;inset:0;z-index:70;background:#132c39b8;display:flex;align-items:center;justify-content:center;padding:24px;backdrop-filter:blur(3px);color:var(--adv-ink)}#advModal[hidden]{display:none}
.adv-card{width:min(780px,100%);max-height:calc(100dvh - 48px);display:flex;flex-direction:column;background:#f8fbff;border:3px solid #214f75;border-radius:12px;box-shadow:0 7px 0 #153746,0 24px 90px #06223866;overflow:hidden}
.adv-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 22px;border-bottom:2px solid #77a7c9;background:#c4e4fc}.adv-head h2{font-size:24px;margin:0;letter-spacing:-1px}.adv-head button,.adv-button{font:700 14px/1.4 'Courier New',monospace;padding:9px 12px;min-height:40px;background:#fffdf4;border:2px solid #3c78a2;border-radius:5px;color:#173b59;box-shadow:0 2px 0 #8bb5d3}.adv-button:hover{background:#d4edff}.adv-button:disabled{opacity:.5;cursor:not-allowed}.adv-button.primary{background:#146aa6;color:#fffbe9;border-color:#164574;box-shadow:0 2px 0 #103552}
#advBody{overflow:auto;padding:22px;overscroll-behavior:contain;min-height:0}.adv-intro{font-size:16px;line-height:1.65;margin:0 0 20px;color:#3c596c}.adv-section{font-size:13px;letter-spacing:1.5px;text-transform:uppercase;color:#3e6682;margin:24px 0 10px}.adv-section:first-child{margin-top:0}.adv-row{display:flex;align-items:center;gap:14px;padding:15px;background:#fffdf5;border:1px solid #92b8d2;border-radius:6px;margin:9px 0}.adv-row>div{flex:1;min-width:0}.adv-row b{font-size:16px}.adv-row p{font-size:14px;line-height:1.5;color:#405a6c;margin:5px 0}.adv-row small{font-size:12px;color:#496c7c}.adv-row canvas{width:64px;height:64px;image-rendering:pixelated;flex:none}.adv-row.complete{border-left:4px solid #219653}.adv-row.ready{border:2px solid #c09a3f;background:#fff9de}.adv-meter{height:6px;background:#dce9d9;border-radius:3px;overflow:hidden;margin-top:9px}.adv-meter i{display:block;height:100%;background:#23ae6e}.adv-check{font-size:25px;color:#218350;flex:none}.adv-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}.adv-message{font-size:14px;line-height:1.5;min-height:22px;color:#2c7770}.adv-tag{display:inline-block;font-size:12px;font-weight:bold;background:#d9edff;color:#295b7e;border-radius:3px;padding:3px 5px;margin:3px 3px 0 0}
.adv-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.adv-place{padding:16px;border:2px solid #afc6b9;background:#fcfdf3;border-radius:7px;text-align:left;color:#2d545b;font:inherit}.adv-place b{display:block;font-size:17px}.adv-place p{font-size:14px;line-height:1.4;color:#658176}.adv-place[disabled]{opacity:.55}.adv-place .adv-tag{background:#edf0cd}.adv-keyguide{display:grid;grid-template-columns:100px 1fr;font-size:15px;line-height:2;gap:6px}.adv-keyguide kbd{font-size:13px;font-weight:bold;background:#d8e7dc;border:1px solid #a2c2b5;border-radius:4px;padding:3px 6px;text-align:center;align-self:start}.adv-table{width:100%;border-collapse:collapse;font-size:14px;line-height:1.5}.adv-table th,.adv-table td{text-align:left;border-bottom:1px solid #b9cebf;padding:11px 7px}.adv-table th{color:#457c77}.adv-table .good{color:#197346;font-weight:bold}.adv-table .bad{color:#a24736;font-weight:bold}
/* Recovery counter: keep the nurse and machine visible during the conversation. */
#recoveryChoices[hidden],#recoveryControls[hidden]{display:none}
body.in-recovery #dlgPort,body.in-recovery #dlgHint{display:none}
body.in-recovery #dlg{border-radius:9px 3px 9px 3px}
#recoveryChoices{position:absolute;right:14px;bottom:calc(100% + 10px);width:126px;padding:7px;background:#fffdf3;border:3px solid #2c628a;border-radius:7px 2px 7px 2px;box-shadow:0 4px 0 #17384a66,inset 0 0 0 2px #d0e4f0}
#recoveryChoices button{display:block;width:100%;min-height:42px;text-align:left;padding:7px 8px;border:0;border-radius:2px;box-shadow:none;background:transparent;color:#173b59;font-size:17px}
#recoveryChoices button::before{content:' ';display:inline-block;width:21px}
#recoveryChoices button.sel{background:#f9dfa1;color:#382e20}
#recoveryChoices button.sel::before{content:'▸'}
#recoveryChoices button:focus-visible,#recoveryControls button:focus-visible{outline:2px solid #245d83;outline-offset:1px}
#recoveryControls{text-align:right;margin-top:7px}
#recoveryControls button{min-height:36px;padding:5px 10px;box-shadow:none;font-size:13px}
#recoveryControls button:disabled{opacity:1;color:#40677b;background:#e1edec;border-color:#839fa8;cursor:default}
/* Title: the game itself, with a compact save card over original town art. */
#title{background:linear-gradient(180deg,#092f4544 0%,#12384633 35%,#0e2d46bb 100%),url('crystal-title.png') center/cover no-repeat,#3b8a90;padding:26px;overflow:auto;align-items:center}
#title .tcard{width:min(560px,100%);padding:24px 32px 20px;border-radius:13px;border:2px solid #d9fff0a3;background:linear-gradient(#143e4ee8,#113542ed);box-shadow:0 8px 0 #092b3f66,0 24px 80px #092b3f55;color:#f7fae7}
#title .ball{display:none}.tcard h1{font-family:'Press Start 2P','Courier New',monospace;font-size:clamp(25px,4.2vw,43px);letter-spacing:-1.5px;color:#ffe092;text-shadow:0 3px 0 #806943,3px 0 0 #163b51,-3px 0 0 #163b51,0 -3px 0 #163b51,0 6px 0 #10364b;animation:none;line-height:1.3;margin:8px 0 12px}.tcard .sub2{font-size:14px;letter-spacing:3px;color:#b5e9e4;margin-bottom:15px;text-shadow:none}.sub2 .dxspan.cryst{background:#b5e9e4;color:#245565;border:0;border-radius:3px;padding:5px 10px;box-shadow:none;animation:none}.tcard .sub{font-size:14px;line-height:1.65;color:#d4e9de;margin:0 0 18px}.tcard .sub3{font-size:12px;letter-spacing:0;line-height:1.6;color:#a6ceca;margin:16px 0 0}
#titleStart{display:block;width:100%;background:#f5dda0;color:#24495c;border:2px solid #fff1c9;border-radius:6px;box-shadow:0 4px 0 #aa8745;padding:15px;font-family:inherit;font-size:17px;line-height:1.35;font-weight:bold;animation:none;margin:18px 0 12px;cursor:pointer}#titleStart:hover{background:#ffeaba}#titleStart:focus-visible{outline:3px solid white;outline-offset:5px}
#titleSaveSummary{font-size:13px;line-height:1.65;margin:6px 0 14px;color:#b9d9cf}.title-links{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}.title-links button,.title-links a{background:#255465;color:#d4efe4;border:1px solid #659896;border-radius:4px;min-height:36px;font:700 13px/1.5 'Courier New',monospace;padding:7px 13px}.title-links a:hover,.title-links button:hover{background:#376c78}
#soundHint{font-size:11px;letter-spacing:1px;border:0;background:transparent;box-shadow:none;color:#bce2d8;padding:4px;animation:none;line-height:1.4;margin:13px auto 0}.tcard .kgrid{gap:7px;margin:17px auto 0}.kchip{font-family:inherit;font-size:12px;background:transparent;border:0;box-shadow:none;padding:1px;gap:5px;color:#bedbd6}.kchip b{font-size:11px;background:#d0e4d6;color:#315966;border:0;box-shadow:none;border-radius:3px;padding:3px 5px}.ktouch,.tcard .sub3{display:none}#titleNewBtn{font-family:inherit;font-size:13px;background:transparent;color:#aecbc7;border:1px solid #688b8d;padding:7px 12px;min-height:34px}.tnew{margin:10px 0;font-size:12px}#titleNewHint{font-size:12px}
/* Battle bottom screen and readable text panels. */
.deck-progress{margin-top:10px;gap:6px}.deck-progress>span{display:flex;flex:1;justify-content:center;align-items:center;min-width:0;background:#dbe5e5;border:1px solid #9ab1b5;border-radius:4px;height:38px}.deck-progress>span.lit{background:#fff1bd;border-color:#c2a35c}.deck-progress canvas{width:34px;height:34px;image-rendering:pixelated}.gslot canvas{width:48px;height:48px}.gslot{min-height:74px}
.deck-hunt-heading{display:flex;align-items:center;gap:8px;min-width:0}.deck-hunt-heading canvas{width:52px;height:52px;flex:none;image-rendering:pixelated}.deck-hunt-heading strong{font-size:13px;overflow-wrap:anywhere}.deck-hunt-actions{display:flex;gap:6px}.deck-hunt-actions button{flex:1;padding:7px;min-height:36px}
.adv-hunt{padding:14px;border:2px solid #a4bc76;border-radius:6px;background:#f1f4db;margin:16px 0}.adv-hunt small{font:700 11px/1.5 'Courier New',monospace;letter-spacing:1px;color:#617641}.adv-hunt b{display:block;font:700 16px/1.5 'Courier New',monospace;color:#395d41;margin:5px 0;overflow-wrap:anywhere}.adv-hunt p{font:14px/1.6 'Courier New',monospace;color:#4b6851;margin:5px 0}.adv-hunt .adv-hunt-note{font-size:12px}.adv-hunt .adv-actions{margin-top:10px}
#battle{background:#c7dff1;--bfont:clamp(14px,1.65vmin,18px)}#bUI{background:#c9e5f8;border-top:5px solid #265f89;padding:14px;gap:10px;flex:0 0 auto;min-height:210px}#bText{font-size:clamp(15px,1.9vmin,19px);line-height:1.6;background:#fffdf4;border:2px solid #3f759d;border-radius:7px;box-shadow:inset 0 0 0 3px #d5e6ef;color:#15374f;padding:12px 17px;min-height:64px}#bHint{font-size:12px;color:#3d607a;line-height:1.5}
#bMenu button,#bMoves button,#bParty button{font-family:inherit;font-size:clamp(14px,1.65vmin,18px);line-height:1.35;min-height:44px;border:2px solid #41799f;border-radius:6px;box-shadow:0 3px 0 #86aec8;color:#193e5a;background:#fffdf4;padding:10px}#bMenu button.sel,#bMoves button.sel,#bParty button.sel{background:#ffd44f;border-color:#ac7c1e;color:#3d3017;box-shadow:0 3px 0 #a7925e}#bMenu button[data-m="0"]{background:#ffb078}#bMenu button[data-m="4"]{background:#9adc66}#bMenu button[data-m="3"]{background:#ffcc49}.hpbox{font-family:inherit;border-color:#416871;box-shadow:0 3px 0 #22485255;background:#f7f9e6;color:#284c55}.hprow b{font-size:clamp(13px,1.9vmin,19px)}.hpnum{font-size:14px}.barlab{font-size:12px}.hpbar{border-color:#709084}#battle .lv{font-size:14px}
#advTactics{font:700 13px/1.5 'Courier New',monospace;color:#49716f;margin:0 2px;min-height:20px}#advTactics .good{color:#247248}#advTactics .bad{color:#a24b36}
/* Each technique keeps its original script name beneath a readable battle name. */
#bMoves button[data-type]{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 8px;text-align:left;min-height:84px;padding:9px 12px;border-left:5px solid var(--move-color,#6c7f96)}
#bMoves button[data-type="SCRIPT"]{--move-color:#338842}#bMoves button[data-type="CLOUD"]{--move-color:#1682bb}#bMoves button[data-type="BROWSER"]{--move-color:#986131}#bMoves button[data-type="CHORE"]{--move-color:#9d783b}#bMoves button[data-type="GLITCH"]{--move-color:#7e56ae}#bMoves button[data-type="CHAOS"]{--move-color:#c35469}#bMoves button[data-type="SECURITY"]{--move-color:#397b87}#bMoves button[data-type="LEGACY"]{--move-color:#806847}#bMoves button[data-type="CORPORATE"]{--move-color:#897235}
.move-name{grid-column:1/-1;grid-row:1;font-size:15px;line-height:1.3;align-self:center;overflow-wrap:anywhere}.move-code{grid-column:1/-1;grid-row:3;font-size:11px;line-height:1.3;color:#3e647a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.move-type{grid-column:1;grid-row:2;font:700 11px/1.3 'Courier New',monospace;background:var(--move-color,#597089);color:#fff;padding:3px 5px;border-radius:3px;align-self:center}.move-detail{grid-column:2;grid-row:2;font-size:11px;line-height:1.4;text-align:right;color:#35566c;align-self:center}
@media(max-width:700px){#bMoves button[data-type]{padding:7px 8px;min-height:80px;gap:3px 5px}.move-name{font-size:14px}.move-code,.move-detail,.move-type{font-size:11px}.move-type{padding:2px 4px}}
#dlg{background:#fffdf3;border:3px solid #2c628a;box-shadow:0 5px 0 #143b4d66,inset 0 0 0 3px #d0e4f0;color:#153b57;padding:15px;bottom:20px}#dlgName{font:700 14px/1.4 'Courier New',monospace;color:#126ea4;margin-bottom:7px}#dlgText{font:700 16px/1.6 'Courier New',monospace;min-height:54px}#dlgHint{font-size:12px;line-height:1.4;color:#3b6380}#dlgPort{border:2px solid #91b0ac;background:#e1eedb}
.scard,.pcard,.bcard,.pauseCard,.wcard{color:#244853;background:#fffdf5;border-color:#356c91;box-shadow:0 6px 0 #25475455}.srow p,.srow ul,.scontact{font-size:15px}.srow b{font-size:15px}.srow .when,.sfoot,.shead .ssub{font-size:13px}.sbody h3{font-size:15px}.srow{font-size:14px}.shead h2{font-size:23px}.prow .pinfo b{font-size:16px}.prole,.php,.pmv{font-size:13px;line-height:1.6}.pact{font-size:13px;min-height:36px}.prow.empty{font-size:14px}.dexScreen{font-size:14px}.dname{font-size:16px}.dmeta,.dcat,.drow p{font-size:14px}.phint,.whint{font-size:13px}.popt{font-size:15px}
#toast{font:700 15px/1.5 'Courier New',monospace;max-width:min(600px,calc(100% - 28px));border-color:#668a87;background:#f5f6da;color:#2c5158;z-index:80}#fanfare{font-family:inherit}#fanTitle{font-size:18px}#fanSub{font-size:14px}
@media(min-width:1150px){#quick .ql{display:none}#keysHint{font-size:11px}#mini{width:132px;max-height:116px}#tracker{max-width:calc(100% - 190px)}}
@media(max-width:1149px){#layout{padding:10px}#fieldDeck{width:246px;padding:10px}.deck-screen{padding:12px}.deck-top{letter-spacing:1px}.deck-nav button{font-size:13px}.deck-screen h2{font-size:21px}#quick .ql{display:none}#quick .q{padding:6px}#hudInfo{max-width:135px}#btnDex,#btnBadge{font-size:12px;padding:6px}#tracker{max-width:calc(100% - 185px);font-size:13px}}
@media(max-width:899px){#layout{padding:0}#gameWrap{border:0;border-radius:0}#fieldDeck{display:none}#advMobile{position:absolute;z-index:21;left:12px;bottom:14px;display:flex;gap:6px}#advMobile button{min-height:40px;background:#f5f8e9ec;border:2px solid #547f83;border-radius:6px;font:700 13px 'Courier New',monospace;padding:8px 12px;box-shadow:0 3px 0 #284b5366;color:#2d5660}#keysHint{bottom:70px;font-size:11px}#advLocation{bottom:72px}#advPrompt{bottom:70px}#title{padding:20px}}
@media(max-width:700px){#hud{height:58px;gap:5px;padding:7px 8px}#hudInfo{max-width:120px}#hudInfo b{font-size:11px}#quick{position:static;margin:0;gap:4px}#quick a.q{display:none}#quick .q{min-width:32px;padding:6px;font-size:14px}#btnMe{width:34px;height:34px;padding:2px}#btnMe img{width:25px;height:25px}#btnDex,#btnBadge{min-height:34px;font-size:11px;padding:6px}#xpBar{width:95px}#mini{width:88px;top:70px;right:10px;border-width:2px}#tracker{top:70px;left:10px;max-width:calc(100% - 125px);font-size:12px;line-height:1.4;padding:7px 9px}#wxChip{font-size:11px;left:10px}#keysHint{display:none}#advMobile{bottom:calc(158px + env(safe-area-inset-bottom));left:10px}#advMobile button{padding:7px 9px;font-size:12px;min-height:36px}#advLocation{bottom:204px;left:10px;padding:8px 13px}#advLocation strong{font-size:16px}#advPrompt{bottom:calc(144px + env(safe-area-inset-bottom));max-width:95%;font-size:12px;padding:7px 11px}#touch{display:block;bottom:env(safe-area-inset-bottom)}#dpad{left:12px;bottom:16px;opacity:.92}.db{background:#edf5e3e8;color:#30565d;border:2px solid #547b80;box-shadow:0 3px 0 #244b58aa}#ab{right:15px;bottom:26px}#btnA,#btnB{font-size:20px;border-width:3px;box-shadow:0 4px 0 #25414f}#btnRun{right:16px;bottom:104px;font-size:12px;min-height:32px}#dlg{bottom:calc(150px + env(safe-area-inset-bottom));width:calc(100% - 18px);padding:11px;gap:9px}#dlgPort{width:42px;height:46px;font-size:28px;line-height:40px}#dlgName{font-size:12px}#dlgText{font-size:14px;line-height:1.5;min-height:44px}#dlgHint{font-size:11px}#bUI{padding:9px;min-height:235px}#bText{font-size:15px;padding:10px 12px;min-height:72px}#bMenu button,#bMoves button,#bParty button{font-size:13px;padding:9px 6px;min-height:44px}#bHint{font-size:11px}.hprow b{font-size:13px}.hpnum{font-size:12px}#battle .lv{font-size:12px}#advTactics{font-size:12px}#advModal{padding:12px}.adv-card{max-height:calc(100dvh - 24px)}.adv-head{padding:14px}.adv-head h2{font-size:21px}#advBody{padding:15px}.adv-row{gap:10px;padding:12px}.adv-row b{font-size:15px}.adv-row .adv-button{font-size:12px;padding:8px}.adv-grid{grid-template-columns:1fr}.adv-intro{font-size:15px}.adv-row canvas{width:48px;height:48px}.adv-table{font-size:12px}.adv-table td,.adv-table th{padding:8px 4px}.tcard .kgrid{gap:5px}#title .tcard{padding:22px 20px 16px}#title .sub{font-size:13px}.tcard h1{font-size:clamp(24px,7vw,38px)}.tcard .sub2{font-size:12px;letter-spacing:1px}#titleStart{font-size:15px;padding:13px}.kchip{font-size:11px}#titleSaveSummary{font-size:12px}#soundHint{font-size:10px;letter-spacing:0}.srow p,.srow ul,.scontact{font-size:14px}.srow b{font-size:14px}.shead h2{font-size:20px}}
@media(max-height:640px) and (min-width:701px){#layout{padding:8px}#title .tcard{padding:14px 28px;width:570px}.tcard h1{font-size:30px;margin-top:0}.tcard .sub{margin-bottom:8px}.tcard .kgrid{display:none}.deck-footer{display:none}.deck-screen{margin-bottom:9px;padding:10px}.deck-screen h2{font-size:20px}.deck-nav button{min-height:42px}.deck-top{margin-bottom:8px}#bUI{min-height:180px}#bText{min-height:45px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important}#advLocation{transition:none}.tcard h1,.sub2 .dxspan,.kchip,#soundHint,#titleStart{animation:none!important}}
body.adv-dialog-open #hud,body.adv-dialog-open #fieldDeck,body.adv-dialog-open #advMobile{pointer-events:none}
body.in-adventure-room #mini,body.in-adventure-room #tracker,body.in-adventure-room #wxChip{display:none!important}
body.in-adventure-battle #advMobile,body.in-adventure-battle #advPrompt,body.in-adventure-battle #advLocation{display:none!important}
#title .tcard{margin:auto}
.pbtns button{font:700 15px/1.5 'Courier New',monospace;color:#305260;background:#fffdf5;border:2px solid #3a749b;box-shadow:0 2px 0 #a2b8b2}.pbtns button.sel{background:#ffcc45;color:#49442d;border-color:#a98b48}.pcard h2{font-size:22px;color:#35696d}.gslot .gname,.gslot .gst{font-size:12px;line-height:1.5}.bhead{font-size:13px}.whead b{font-size:15px;color:#3c7376}#chText{font-size:16px;color:#305763}#chBtns button{font:700 14px/1.5 'Courier New',monospace}#choice{background:#f3f7e7;border:3px solid #5e8a8b}
@media(max-width:700px){#choice{bottom:156px}#chText{font-size:14px}#chBtns button{font-size:13px}.gslot .gname,.gslot .gst{font-size:12px}.pcard h2{font-size:20px}}
/* A compact four-button cluster leaves the full direction pad unobstructed. */
@media(max-width:700px){#abtns{display:grid;grid-template-columns:44px 54px;grid-template-rows:40px 58px;gap:8px 12px;right:18px;bottom:28px}#btnMenuT{width:40px;height:36px;font-size:16px}#btnRun{position:static;width:50px;height:36px;font-size:11px}#btnA{width:56px;height:56px;font-size:22px}#btnB{width:44px;height:44px;font-size:18px;align-self:end}#dpad{grid-template-columns:repeat(3,44px);grid-template-rows:repeat(3,44px);gap:3px;bottom:18px;left:12px}.hbtn.t{font-size:11px;padding:6px}#simple{top:58px}.deck-screen{box-sizing:border-box}}
@media(max-width:360px){#hudInfo{max-width:84px}#xpBar{width:78px}#hud .spacer{min-width:0}#btnBadge{display:none}.adv-row{flex-wrap:wrap}.tcard .kgrid{display:none}}
@media(max-height:520px) and (pointer:coarse){#advMobile{bottom:140px}#dlg{bottom:12px;width:calc(100% - 300px);left:150px;transform:none}#title .tcard{padding:12px 20px}#title .kgrid,#titleSaveSummary{display:none}#title h1{font-size:26px}#title .sub{margin-bottom:8px}#titleStart{margin:10px 0;padding:10px}#advPrompt{bottom:12px}#advLocation{bottom:60px}#tracker{max-width:240px}}
/* Save recovery remains part of the field notebook. */
.adv-file-label{display:block;margin:18px 0 8px;font-weight:800;color:#193b3b}.adv-file-label span{display:block;font-size:12px;font-weight:400;color:#45645d;margin-top:4px}.adv-file-input{display:block;width:100%;max-width:100%;box-sizing:border-box;padding:10px;border:2px solid #789087;border-radius:8px;background:#fffdf0;color:#193b3b;font:inherit;font-size:13px}.adv-file-input::file-selector-button{padding:9px 12px;margin-right:10px;border:1px solid #567d68;border-radius:5px;background:#d5e5b6;color:#183c35;font:inherit;font-weight:700;cursor:pointer}.adv-file-input:focus-visible{outline:3px solid #1a86a4;outline-offset:3px}.adv-restore-preview{margin-top:20px;padding:18px;background:#e4edca;border:2px solid #80996c;border-radius:10px}.adv-restore-preview>small{font-size:11px;letter-spacing:1px;color:#52664b}.adv-restore-preview h3{font-size:16px;overflow-wrap:anywhere;margin:6px 0 12px}.adv-restore-preview p{font-size:13px;line-height:1.65;color:#385244}.adv-restore-team{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:15px 0}.adv-restore-team>div{display:flex;flex-direction:column;align-items:center;background:#f6f4de;border:1px solid #b6c498;border-radius:7px;padding:6px;min-width:0}.adv-restore-team canvas{width:64px;height:64px;image-rendering:pixelated}.adv-restore-team span{font-size:10px;text-align:center;overflow-wrap:anywhere;width:100%;font-weight:700}

/* The main journey stays visible beside the optional research goals. */
.adv-milestones{background:#edf0d9;border:2px solid #8ba67a;border-radius:7px;padding:16px;margin:0 0 18px;color:#31584b}
.adv-milestones h3{font:700 17px/1.4 'Courier New',monospace;margin:0 0 13px;color:#30574d}.adv-milestones ol{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.adv-milestones li{display:flex;align-items:center;flex-direction:column;text-align:center;gap:5px;padding:10px 5px;background:#f8f4de;border:1px solid #b7c498;border-radius:5px;font:13px/1.4 system-ui,sans-serif}.adv-milestones li.done{background:#dcebbb;border-color:#86a76e}.adv-milestones li b{font-weight:700}
.adv-milestone-mark{font-size:20px;color:#718962}.done .adv-milestone-mark{color:#3c754f}.adv-milestones p{font:14px/1.6 system-ui,sans-serif;margin:12px 0 0}.adv-milestones>.adv-button{margin-top:12px}
@media(max-width:430px){.adv-milestones{padding:12px}.adv-milestones ol{grid-template-columns:1fr}.adv-milestones li{flex-direction:row;justify-content:space-between;padding:8px 10px;text-align:left}.adv-milestones li b{flex:1}}
.work-connection{margin:18px 0;padding:14px 16px;border:2px solid #708998;background:#e3edf0;color:#254453;font-size:13px;line-height:1.75}.work-connection h3,.work-connection h4{margin:0 0 6px;color:#274e62}.work-connection p{margin:6px 0 10px}.work-connection a{color:#164e71;text-decoration:underline;font-weight:bold}.work-connection a:focus-visible{outline:3px solid #e09544;outline-offset:3px}
