/* Reference: compact connected portraits, blue information cards, gold choices. */
body.playing #hud-round{width:auto;max-width:calc(100vw - 510px);min-width:430px;top:10px}
body.playing #hud-roundbar{padding:0 12px}body.playing #hud-progress{position:relative;padding:4px 12px 5px;border:2px solid #8b9aab;border-radius:28px;background:linear-gradient(#2a355d,#182240);box-shadow:inset 0 2px #d7e5ff38,0 4px 8px #0006}
body.playing #stage-dots{gap:10px;min-height:45px;padding:0 5px}
body.playing #stage-dots .stage-node{width:38px;height:44px;padding:0;cursor:help;color:#dce6f2}
body.playing #stage-dots .stage-node i{position:relative;width:32px;height:32px;line-height:30px;font-size:20px;border-radius:50%;overflow:visible;background:linear-gradient(#48677b,#203349);border:2px solid #8596b3;display:grid;place-items:center}
body.playing #stage-dots .stage-node i img{width:40px;height:40px;object-fit:contain;image-rendering:pixelated;position:absolute;bottom:0;max-width:none}
body.playing #stage-dots .stage-node i .type-symbol{width:21px;height:21px}
body.playing #stage-dots .stage-node i em{position:absolute;right:-6px;top:-6px;font:900 11px/17px system-ui;width:17px;height:17px;background:#3e8665;border-radius:50%;border:1px solid #bbe7c2;color:#fff;z-index:2}
body.playing #stage-dots .stage-node.event i{background:linear-gradient(#ffe291,#e0a62e);color:#423219;border-color:#fff0b9}
body.playing #stage-dots .stage-node.rocket i{background:linear-gradient(#813f54,#402136)}
body.playing #stage-dots .stage-node.gym i{background:linear-gradient(#a6424d,#652936);border-color:#f6b46b;border-radius:12px}
body.playing #stage-dots .stage-node.active i{border-color:#fff0ad;box-shadow:0 0 0 2px #b48631,0 0 13px #fdd5676b;transform:scale(1.15)}
body.playing #stage-dots .stage-node.cleared i{filter:saturate(.65)}
body.playing #stage-dots .stage-node:not(:last-child)::after{left:32px;top:16px;width:20px;height:3px;z-index:0}
body.playing #stage-dots .stage-node small{font-size:8px;line-height:12px}
#route-readout{display:flex;align-items:center;gap:8px;color:#ccd9e9;margin:3px 0 0;max-width:430px}#route-readout>small{font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:240px}.route-track{height:5px;width:110px;flex:0 0 110px;background:#10182d;border:1px solid #748299;border-radius:5px;overflow:hidden}.route-track i{display:block;height:100%;background:#ebc363}
body.playing #hud-clock{top:132px}body.playing .shop-card{overflow:visible}body.playing .shop-top{overflow:hidden}
.shop-info{position:absolute;top:5px;right:5px;z-index:3;width:23px;height:23px;padding:0!important;border:1px solid #acbdd9;border-radius:50%;background:#223654;color:#e3ecfc;font:bold italic 15px Georgia;cursor:pointer;box-shadow:0 2px 2px #0007}
.shop-info:hover,.shop-info:focus-visible{background:#466394;outline:2px solid #ffdf8a}.merge-hint{position:absolute;top:-19px;left:7px;z-index:3;background:linear-gradient(#ffe58b,#e7b542);color:#513411;border:1px solid #fff1c5;border-radius:5px;padding:2px 7px;font-size:10px;font-weight:900;box-shadow:0 2px 3px #0006}
#detail-popover{position:fixed;z-index:151;width:min(480px,calc(100vw - 24px));max-height:calc(100vh - 130px);overflow:auto;border:2px solid #adc0d4;border-radius:12px;padding:18px;background:linear-gradient(130deg,#303e68,#19243f 70%);color:#eef2ff;box-shadow:inset 0 2px #fff3,0 12px 35px #07101edb;font-size:12px;line-height:1.5}
#detail-popover.hidden{display:none}#detail-popover h2{font-size:20px;margin:0 26px 10px 0;color:#fff5df;display:flex;align-items:center;gap:7px}#detail-popover h3{font-size:12px;color:#ecd79f;margin:10px 0 5px}.detail-close{position:absolute;right:9px;top:9px;background:#101c33;border:1px solid #748bac;border-radius:50%;width:24px;height:24px;color:white;cursor:pointer}.detail-price{margin-left:auto;font-size:17px;color:#ffde71}.info-stars{color:#eabd82;font-size:16px}.detail-types{display:flex;align-items:center;gap:4px;margin:6px 0 10px}.detail-types .type-symbol{width:23px;height:23px}.detail-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:5px}.detail-stats>div{border:1px solid #0a132d;background:linear-gradient(#253254,#1b2542);box-shadow:inset 0 1px #9eacc129;border-radius:6px;text-align:center;padding:6px 2px}.detail-stats small{font-size:10px;color:#c3d0e7;display:block}.detail-stats b{font-size:20px;color:#f2f5ff}.detail-skill{padding:10px;margin:10px 0;background:#17213b8c;border-radius:7px;border-top:1px solid #a9bed435}.detail-skill b{font-size:16px}.detail-skill p{margin:4px 0}.detail-note{display:block;font-size:10px!important;color:#b3c1d8;margin-top:6px}.evolution-line{display:flex;align-items:center;justify-content:space-around;background:#121c3055;border-radius:7px}.evolution-line>span{display:flex;flex-direction:column;align-items:center;padding:5px}.evolution-line img{width:54px;height:54px;object-fit:contain;image-rendering:pixelated}.evolution-line i{color:#b0bfd5}.detail-status{color:#f8dea0}.synergy-thresholds p{margin:4px 0;padding:4px 7px;background:#14203a;color:#93a4c0;border-radius:4px}.synergy-thresholds p.lit{color:#fff2bc;background:#43523e}.synergy-thresholds b{border:1px solid currentColor;border-radius:3px;display:inline-block;min-width:20px;text-align:center;margin-right:8px}.member-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:5px;margin:12px 0}.member-grid>div{position:relative;background:#15213a;border:1px solid #536684;border-radius:6px;display:flex;flex-direction:column;align-items:center;padding:3px;opacity:.55}.member-grid>div.on-board{opacity:1;border-color:#a3d498;background:#23443d}.member-grid img{width:46px;height:43px;object-fit:contain;image-rendering:pixelated}.member-grid small{font-size:9px}.member-grid b{font-size:9px;color:#f7d484}
.item-art{image-rendering:pixelated;object-fit:contain}.item-slot .item-art{width:32px;height:32px;pointer-events:none}.equip-preview{margin:8px 0;padding:8px;background:#112d30;border:1px solid #64a59b;border-radius:5px;font-size:11px}.equip-preview p{display:flex;justify-content:space-between;margin:3px 0}.equip-preview strong{color:#91ecc4}.equip-preview small{font-size:9px;color:#bacbd2}.recipe-matrix{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin:12px auto}.recipe-matrix>span,.recipe-matrix>button{display:flex;align-items:center;justify-content:center;height:54px}.recipe-matrix button{border:1px solid #9cacc5;border-radius:7px;background:linear-gradient(#3d5277,#1a2842);cursor:pointer}.recipe-matrix button:hover{border-color:#ffdf86;background:#536686}.recipe-matrix img{width:40px;height:40px}.recipe-product{display:flex;align-items:center;gap:14px}.recipe-product img{width:64px;height:64px}.recipe-product h3{font-size:16px!important}.recipe-product p{margin:4px 0}.recipe-parts{display:flex;align-items:center;justify-content:center;font-size:11px;margin:12px 0}.recipe-parts img{width:32px;height:32px}.event-gold-button{background:linear-gradient(#ffe991,#e7b837);border:2px solid #fff0bb;border-radius:6px;box-shadow:0 3px #7f5924;color:#31250d;padding:9px 20px;font-weight:900;cursor:pointer}.event-gold-button:disabled{filter:grayscale(.6);opacity:.5;cursor:default}
#encounter-event{z-index:140;background:#061625b0;backdrop-filter:none}#encounter-event.hidden{display:none}.event-scene{max-width:700px;width:90vw;text-align:center;color:#eef4ff}.event-scene header{display:flex;align-items:center;justify-content:center;gap:10px;margin-bottom:20px;text-shadow:0 3px 5px #000}.event-scene h2{font-size:27px;margin:4px 0 8px}.event-scene header small{color:#9bc6e7;font-size:10px;letter-spacing:2px}.event-scene header p{font-size:13px;max-width:450px;line-height:1.6;margin:0 auto}.event-oak{width:68px;height:100px;object-fit:contain;image-rendering:pixelated}.event-choices{display:flex;gap:14px;justify-content:center;margin-bottom:18px}.event-choice{width:175px;min-height:220px;padding:16px 10px;background:linear-gradient(130deg,#3e4e74,#1a2845 70%);border:2px solid #a7bfda;box-shadow:inset 0 0 0 3px #152039,0 10px 25px #0007;border-radius:10px;animation:reward-enter .35s both}.event-choice:nth-child(2){animation-delay:.08s}.event-choice:nth-child(3){animation-delay:.16s}.event-choice>img{width:76px;height:76px;object-fit:contain;image-rendering:pixelated;filter:drop-shadow(0 4px 6px #eef7ff2b)}.event-choice h3{font-size:16px;margin:9px 0}.event-choice p{font-size:11px;min-height:37px;color:#e4e8fc;padding:5px;background:#101d36;border-radius:15px}.event-choice button{background:linear-gradient(#ffe494,#eab234);border:2px solid #fff0b9;color:#3b2910;border-radius:5px;padding:7px 21px;font-weight:900;cursor:pointer;box-shadow:0 3px #704814}.event-choice button:disabled{opacity:.45;cursor:default}.event-scene>button:not(.event-gold-button){border:1px solid #99acc677;border-radius:6px;padding:8px 15px;background:#152641;color:#e6f0ff;cursor:pointer;margin:7px}.event-back{display:block;margin:16px auto!important;font-size:11px;opacity:.8}
#prep-motion{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:119}.bench-slot.in-flight img{opacity:0}#item-notice{position:fixed;z-index:133;top:24%;left:50%;transform:translate(-50%,12px);width:178px;display:none;text-align:center;padding:13px;border-radius:10px;border:2px solid #b6c9df;background:linear-gradient(#344b71,#17283f);box-shadow:inset 0 0 0 3px #101b32,0 8px 30px #0008;color:white}#item-notice.show{display:flex;flex-direction:column;align-items:center;gap:7px;animation:reward-enter .25s}#item-notice>small{color:#ffe173;font-size:17px;font-weight:900}#item-notice img{width:60px;height:60px}#item-notice>span{font-size:11px;background:#142139;padding:6px 9px;border-radius:8px}#item-notice button{background:linear-gradient(#ffe38a,#eab237);color:#37260b;border:1px solid #ffe9b0;border-radius:5px;font-weight:900;padding:5px 20px;cursor:pointer}
@keyframes reward-enter{from{opacity:0;translate:0 15px;scale:.94}to{opacity:1;translate:0 0;scale:1}}
.evolution-card{pointer-events:none!important}.evolution-card #evolution-skip{pointer-events:auto!important}.evolution-card>.eyebrow,.evolution-card #evolution-audio-state{display:none}.evolution-card h2{font-size:15px!important;margin:0!important}.evolution-card #evolution-name{font-size:16px!important;text-shadow:0 2px 3px #000}.evolution-card #evolution-stars{font-size:18px!important}
body.playing .combat-result{border:0!important;background:transparent!important;box-shadow:none!important;backdrop-filter:none!important;width:min(530px,80vw);text-shadow:0 3px 5px #000}
body.playing .combat-result #result-title{font-size:clamp(48px,5vw,76px);color:#ffe369;letter-spacing:-3px;filter:drop-shadow(0 4px #805e26);line-height:1.2;margin:12px 0}
body.playing .combat-result.lose #result-title{color:#ff8b8e;filter:drop-shadow(0 4px #73283a)}body.playing #result-description{font-size:12px;background:#102035bd;padding:10px;border-radius:10px;line-height:1.6}body.playing #result-rewards span{background:#1b2948df;border:1px solid #adb7c596;border-radius:14px;padding:5px 10px;color:#ffe292}
body.playing #result-overline{color:#f9e6b5;letter-spacing:3px;font-size:10px}body.playing #result-continue{width:auto;min-width:210px}
.opponent-trainer{width:70px;height:70px;object-fit:contain;image-rendering:pixelated;float:right;margin-top:-25px;filter:drop-shadow(0 3px 2px #0007)}
@media(max-height:800px){body.playing #hud-round{top:6px}body.playing #stage-dots .stage-node i{width:28px;height:28px}body.playing #stage-dots .stage-node{height:39px;width:34px}body.playing #stage-dots{min-height:39px;gap:8px}body.playing #hud-clock{top:123px}#detail-popover{font-size:11px;padding:13px}.detail-stats b{font-size:17px}.evolution-line img{width:42px;height:42px}}
@media(prefers-reduced-motion:reduce){.event-choice,#item-notice.show{animation:none}}

#evolution-overlay{pointer-events:none}#evolution-skip{pointer-events:auto}

body.playing .shop-card .shop-cost{display:block!important;position:absolute;right:5px;top:auto;bottom:-20px;color:#ffdf75;font-size:13px;background:none;border:0;z-index:2}body.playing .shop-card .shop-cost:before{content:'● ';font-size:11px}body.playing .shop-top{overflow:visible}body.playing .shop-info{right:6px;top:5px}body.playing #stage-dots .stage-node i{overflow:hidden}body.playing #stage-dots .stage-node i em{right:0;top:0;width:13px;height:13px;line-height:12px;font-size:9px}body.playing #stage-dots .stage-node i img{width:33px;height:33px}
#sell-drop{display:none;position:fixed;bottom:145px;left:calc(50% + 280px);z-index:125;width:190px;padding:15px 8px;border:2px dashed #f8a1a8;border-radius:8px;background:#782a35d9;color:#fff3d9;text-align:center;font-size:12px;font-weight:800}body.unit-dragging #sell-drop{display:block}body.item-dragging .bench-slot.occupied{outline:2px solid #91eddd}body.item-dragging #arena-wrap{cursor:copy}

/* Keep all progress inside one capsule, leaving the upper battlefield readable. */
body.playing #hud-round{display:grid;grid-template-columns:105px auto;align-items:center;gap:0;border:2px solid #8696ad;border-radius:34px;background:linear-gradient(#29375b,#17233d);box-shadow:inset 0 2px #c9ddff2b,0 3px 8px #0007;padding:3px 10px;min-width:0}
body.playing #hud-roundbar{padding:0 5px;background:none;border:0;box-shadow:none}body.playing #hud-roundbar .header-middle{display:flex;flex-direction:column;gap:3px;border:0;background:none;box-shadow:none;padding:0;min-width:0}body.playing #hud-roundbar .header-middle>span:first-child{display:none}body.playing #round-label{font-size:13px;line-height:1.25;max-width:100px;white-space:normal;text-align:center}body.playing #phase-pill{font-size:8px;padding:0}body.playing #hud-progress{border:0;background:none;box-shadow:none;padding:2px 5px}body.playing #hud-clock{top:94px}body.playing #route-readout{margin-top:2px}.opponent-trainer{position:absolute;right:4px;top:6px;float:none;margin:0;width:49px;height:58px}body.playing #hud-opponent{position:relative}body.playing #hud-opponent:has(.opponent-trainer) #encounter-name{padding-right:39px;line-height:1.4}body.playing #hud-opponent:has(.opponent-trainer) .hud-kicker{padding-right:35px}
@media(max-height:800px){body.playing #hud-round{grid-template-columns:92px auto;padding:2px 7px}body.playing #hud-clock{top:87px}}
.evolution-card #evolution-name{min-height:0;padding:11px 16px;text-shadow:none}

body.playing #hud-roundbar .round-text{font-size:0;white-space:normal;line-height:1.3}body.playing #hud-roundbar #round-label{display:block;word-break:keep-all}#casino-overlay{z-index:160}
/* Short NPC dialogue and League information keep the existing game HUD. */
#story-dialogue{position:fixed;z-index:146;left:50%;bottom:260px;transform:translateX(-50%);width:min(600px,80vw);display:flex;align-items:center;gap:16px;padding:16px 22px;border:2px solid #bbc9df;border-radius:16px;background:linear-gradient(130deg,#263c64f5,#142039f5);box-shadow:inset 0 0 0 3px #0a142d,0 10px 34px #0009;color:#f3f6ff;animation:reward-enter .2s}
#story-dialogue.hidden{display:none}#story-dialogue>img{width:112px;height:112px;object-fit:contain;image-rendering:pixelated;filter:drop-shadow(0 5px 2px #0007)}#story-dialogue>div{flex:1}#story-dialogue small{font-size:11px;color:#94c6e1;display:block}#story-dialogue strong{color:#ffe38b;font-size:20px}#story-dialogue p{font-size:15px;line-height:1.65;margin:8px 0}#story-dialogue button{border:0;background:none;padding:4px 0;color:#d5e4ef;cursor:pointer;font-size:11px}#story-dialogue button span{opacity:.55;padding-left:10px}
.league-roster{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin:16px 0}.league-roster article{display:flex;flex-direction:column;align-items:center;gap:4px;border:1px solid #73889d;border-radius:10px;background:#172b44;padding:8px 3px}.league-roster article.current{border:2px solid #ffe094;background:#3e3c48}.league-roster img{width:80px;height:80px;object-fit:contain;image-rendering:pixelated}.league-roster strong{color:#ffdf8a}.league-roster span{font-size:9px;color:#aac8cb}.league-enter{padding:10px 24px;background:linear-gradient(#ffe38b,#b98732);color:#252935;font-weight:900;border-radius:8px}.gym-badge-list{display:grid;grid-template-columns:repeat(8,1fr);gap:5px}.gym-badge img{width:36px;height:36px;object-fit:contain;image-rendering:pixelated}.gym-badge{display:flex;flex-direction:column;align-items:center;opacity:.3;padding:6px!important}.gym-badge.earned{opacity:1;box-shadow:inset 0 0 10px #ffdf7820}.gym-badge small{font-size:9px}.result-dialogue{display:flex;gap:9px;align-items:center;text-align:left;margin-bottom:8px;color:#ffdfa6}.result-dialogue img{width:55px;height:55px;object-fit:contain;image-rendering:pixelated}.result-badge{width:42px;height:42px;image-rendering:pixelated;float:right}#item-notice.result-item{left:clamp(100px,calc(50% + 375px),calc(100vw - 110px));top:38%;width:156px}
body.playing #stage-dots{gap:6px}body.playing #stage-dots .stage-node.oak i{background:linear-gradient(#62794e,#263c37)}body.playing #stage-dots .stage-node.league i,body.playing #stage-dots .stage-node.champion i{border-color:#e7c26d;background:#513b5a}body.playing #stage-dots .stage-node.champion i{border-radius:10px}
@media(max-height:800px){#story-dialogue{bottom:220px;padding:10px 18px}#story-dialogue>img{width:90px;height:90px}#story-dialogue p{font-size:13px}.league-roster img{width:64px;height:64px}.journey-panel{max-height:90vh;overflow:auto}}

body.playing #stage-dots .stage-node.rival-defeat i em{background:#945763;border-color:#e7b2b5}.badge-recovery{padding:12px;background:#1e3149;border-radius:9px;margin:10px 0}.badge-recovery p{font-size:11px}.badge-recovery button{margin:4px;font-size:11px;padding:5px 8px}
