/* v0.70 visual preview: one shared cream-and-blue game theme. */
@font-face{font-family:Rally;src:url('../assets/fonts/nunito-700.ttf') format('truetype');font-weight:400 800;font-display:swap}
@font-face{font-family:Rally;src:url('../assets/fonts/nunito-900.ttf') format('truetype');font-weight:900;font-display:swap}
:root{--rally-ink:var(--accent-082349);--rally-cream:#fffbee;--rally-blue:var(--accent-0877fb);--rally-teal:var(--accent-00c9b5);--rally-border:var(--accent-142e48);--rally-line:#bcc6c5;--rally-shadow:inset 0 0 0 2px #fffdf0,0 2px 0 var(--accent-102b42)}
body,button,input,select,summary,dialog{font-family:Rally,Arial,sans-serif!important;color:var(--rally-ink);font-size:14px;font-weight:700;line-height:1.35}
body *:not(canvas):not(svg):not(path):not(.logo){font-family:Rally,Arial,sans-serif!important}
h1,h2,h3,b,strong,.btn,.requirement,.combat-name{font-weight:900!important;letter-spacing:0}
h2{font-size:21px!important;line-height:1.15!important}h3{font-size:15px!important}
.btn,.mode-choice,.header-menu-panel button{border:2px solid var(--rally-border);border-radius:7px;background:linear-gradient(var(--accent-158dff),var(--accent-0066e6));color:white;box-shadow:inset 0 0 0 1px var(--accent-80caff),0 2px 0 var(--accent-173749);text-shadow:0 1px 0 var(--accent-003d85);font-size:14px;min-height:38px;padding:7px 10px;line-height:1.25}
.btn:hover,.mode-choice:hover{background:linear-gradient(var(--accent-37a0ff),var(--accent-0b75ec))}
.btn.secondary,.small-actions #skipBtn,.mode-choice.battle{background:linear-gradient(var(--accent-17d9c7),var(--accent-00aa9c));box-shadow:inset 0 0 0 1px var(--accent-87f3e5),0 2px 0 var(--accent-173749);text-shadow:0 1px 0 var(--accent-00675c);color:var(--accent-082349)}
.btn.secondary:hover{background:var(--accent-27e1cc)}.btn:disabled{opacity:.55}.btn[aria-pressed=true]{outline:2px solid #ffc64b;outline-offset:1px}
input,select{min-width:0;border:1.5px solid var(--accent-41678a);border-radius:6px;background:#fff;color:var(--accent-12335b);box-shadow:inset 0 1px 3px var(--accent-153c5320);font-size:16px!important;padding:8px;line-height:1.2}
input::placeholder{color:var(--accent-6488ab);font-weight:700}select{min-height:35px}
.app{border-color:var(--accent-123651);border-radius:8px}
.brand{height:58px;flex:none;border:3px solid var(--accent-06274c);border-radius:8px;background:linear-gradient(var(--accent-0769d8),var(--accent-0051b6));box-shadow:inset 0 0 0 2px var(--accent-9fddff);padding:7px 10px;gap:8px}
.brand .logo{max-width:47%;flex:0 1 auto}.brand .logo img{height:auto;max-height:42px;width:100%;object-fit:contain}
.header-score{font-size:13px}.single-best-card{border-radius:5px;background:var(--rally-cream);color:var(--rally-ink)}
.header-exit,.header-login{font-size:12px!important;min-height:34px!important;height:34px!important;line-height:1.2}
.brand .account-actions{gap:6px}.header-menu,.menu-toggle{color:white;font:28px/1 Arial,sans-serif!important;border-radius:6px;background:transparent!important;box-shadow:none;border-color:var(--accent-b7dbef);min-height:34px!important;height:34px!important;width:36px!important}
.header-menu-panel{background:var(--rally-cream);border-radius:8px;border:2px solid var(--rally-border);padding:8px;box-shadow:0 4px 12px var(--accent-10283f55)}.header-menu-panel button{margin:4px 0;font-size:14px}
dialog,.battle-panel,.dialogue-panel,.battle-entry,.combat-card,.battle-roll-box,.route-history,.type-bonus-box,.trainer-label,.last-box,.route-message,.rules-modal-card,.asset-loading-card,.card:not(.mode-screen),.login-about{
 border:3px solid var(--rally-border);border-radius:10px;background:#fffbeeef;box-shadow:var(--rally-shadow);color:var(--rally-ink)
}
dialog{width:min(460px,calc(100vw - 20px));max-height:calc(100dvh - 22px);padding:14px;overflow:auto;scrollbar-width:thin}
dialog::backdrop{background:var(--accent-0b294540);backdrop-filter:blur(1px)}
.collection-head{margin-bottom:12px;padding:0 0 9px;border-bottom:1px solid #b2bdbf;align-items:center;gap:8px}
.collection-head h2{margin:0;white-space:normal}
.collection-head .btn{font:25px/1 Arial,sans-serif!important;min-height:30px;width:30px;padding:1px;background:transparent!important;box-shadow:none;color:var(--rally-ink);border:0;text-shadow:none}
.collection-panel-body{padding:0;scrollbar-gutter:auto}
#loginScreen{padding:30px 20px 40px;align-items:center}
.login-content{width:min(380px,100%);gap:15px;margin:auto;transform:translateY(-25px)}
.login-logo{width:100%;max-height:none;margin:0 0 10px;filter:none}
.login-panel{width:100%;height:auto;display:block;padding:20px;border-radius:10px}
.login-panel #accountForm{gap:12px;grid-template-columns:repeat(2,minmax(0,1fr))}
.login-panel #accountForm label{font-size:16px;line-height:1.4;font-weight:900}
.login-panel #accountForm input{height:38px;margin-top:5px}
.login-panel #accountForm .btn{font-size:15px!important;min-height:36px}
.login-panel #accountForgot{font-size:11px!important;margin:0;background:transparent;border:none;box-shadow:none;color:var(--accent-065dde);line-height:1.2;text-decoration:underline}
.login-panel #accountSocialSignIn{gap:8px;border-top:1px solid #bac3c6;padding-top:11px;margin-top:13px}
.login-panel #accountSocialSignIn .btn{font-size:13px!important;gap:5px;min-height:36px}

.social-logo{width:20px;height:20px}
.login-about{width:100%;padding:8px 14px;font-size:13px;border-radius:8px}
.login-about summary{font-size:14px;font-weight:900;cursor:pointer;list-style-position:inside}
.login-about p{margin:9px 0 0;line-height:1.4;font-size:13px;font-weight:700}
.site-footer{font-size:10px}.site-footer .build-marker,.site-footer nav{border-radius:4px}
.mode-choice-title{font-size:23px!important}.mode-choice{min-height:65px!important;border-radius:9px!important}
.battle-panel h2{margin:7px 0 12px}.battle-copy,.battle-panel p{font-size:14px!important;line-height:1.4}
.battle-choice{font-size:16px!important;min-height:45px}
.battle-teams fieldset,.lobby-card,.battle-person,.multi-player,.lobby-code-box{border:1.5px solid var(--accent-9bafbf);border-radius:7px;background:#fffdf4}
.battle-person b,.multi-player b{font-size:15px!important}.battle-person small,.multi-player small{font-size:12px!important}
.lobby-achievement{font-size:12px!important}.lobby-title-text{font-size:12px}.lobby-settings label{font-size:13px}
/* Profile: equal selected/choice sprite boxes, compact stats and clear identity. */
#profileDialog .profile-identity{padding:4px 0 10px;border:0;border-bottom:1px solid #b7c1c5;background:transparent;gap:12px;align-items:center}
#profileDialog .profile-identity b{font-size:21px!important;line-height:1.2;display:inline}
#profileDialog p{font-size:12px!important;line-height:1.35!important;margin:5px 0}
#profileDialog #profileEmail{font-size:11px!important;overflow-wrap:anywhere;color:var(--accent-587082)}
#profileChangeName{background:transparent!important;color:var(--accent-123b70);border:0;box-shadow:none;font-size:22px!important;text-shadow:none}
#profilePicture{width:var(--profile-choice-size,68px);height:var(--profile-choice-size,68px);background:#cef4df;border:2px solid var(--accent-00a59d);border-radius:7px;padding:4px;flex-shrink:0;box-sizing:content-box}
#profilePicture canvas{width:100%;height:100%}
#profileDialog .profile-level{background:transparent;border:0;padding:10px 0;margin:0;border-bottom:1px solid #b7c1c5}
#profileDialog .profile-level-heading b{font-size:16px!important}.profile-level-heading span{font-size:13px!important}
.profile-xp-track,.unlock-progress,.hp-track{border:1px solid var(--accent-32618b);border-radius:8px;height:13px;background:var(--accent-dce3ed);box-shadow:inset 0 1px 2px var(--accent-63829b44);overflow:hidden}
#profileXPFill,#profileRankFill{border:0;border-radius:7px;background:linear-gradient(var(--accent-27b7ff),var(--accent-0085f8));height:100%}
#profileDialog .profile-rank{background:transparent;border:0;padding:10px 0;margin:0;gap:14px;border-bottom:1px solid #b7c1c5}
#profileDialog .profile-rank>img{width:65px;height:65px;image-rendering:pixelated}
#profileRankName{font-size:18px!important}#profileRankPoints{font-size:12px!important}
.profile-match-record{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:9px 0!important}
.profile-match-record>span{padding:7px;border:1px solid var(--accent-9bafbf);border-radius:7px;min-width:0;background:#fffdf5;font-size:12px!important}
.profile-match-record strong{display:block;font-size:13px}.profile-match-record small{display:block;font-size:10px;color:var(--accent-536c84)}
.profile-title-label{font-size:13px!important;display:block;margin:6px 0}.profile-title-label select{width:100%;margin-top:4px}
#profileTitleHint{display:none}#profileDialog h3{margin:9px 0 6px;font-size:15px!important}
.profile-filters{gap:8px;margin:7px 0;display:grid;grid-template-columns:minmax(0,1fr) 100px}
#profileAvatarGrid{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;max-height:245px}
.profile-avatar{aspect-ratio:1;border:1px solid var(--accent-899eae);border-radius:7px;background:#fffdf4;padding:5px;grid-template-rows:minmax(0,1fr);box-shadow:none}
.profile-avatar[aria-pressed=true]{background:#cbf6df;border:2px solid var(--accent-00a98c);outline:0}.profile-avatar canvas{width:100%;height:100%;min-width:0;min-height:0;image-rendering:pixelated}
/* Pokédex: names, sprites and counters occupy separate rows. */
#collectionDialog{width:min(460px,calc(100vw - 20px))}
#collectionDialog .collection-tools{gap:7px;margin:8px 0;font-size:13px}
#collectionDialog .collection-tools .btn{font-size:14px;flex:1}

#collectionStats{font-size:12px!important;line-height:1.4;font-weight:900}
#collectionGrid{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
#collectionGrid .collection-card{aspect-ratio:auto;width:100%;min-width:0;border:1px solid var(--accent-899eae);border-radius:7px;background:#fffdf4;padding:6px;display:grid;grid-template-rows:12px 17px minmax(0,1fr) 12px;gap:3px;min-height:120px;opacity:1!important}
.dex-number{font-size:10px!important;font-weight:900;text-align:center;color:var(--accent-193854)}
.dex-name{font-size:11px;font-weight:900;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#collectionGrid .collection-card .dex-sprite{width:100%;height:60px;max-height:60px;aspect-ratio:auto;object-fit:contain;align-self:center;justify-self:center;min-height:0;image-rendering:pixelated}
.unlock-progress{position:relative;height:12px}.unlock-progress>span{border:0;height:100%;border-radius:6px;display:block}
.dex-progress-count{position:absolute;inset:0;text-align:center;font-size:9px;font-weight:900;line-height:10px;color:var(--accent-0c315a);pointer-events:none}
/* Achievements retain the requested red/orange/red/complete-blue ranges. */
#achievementsCount{font-size:14px;text-align:right;margin:0 0 10px}
.achievement-card{display:grid;grid-template-columns:50px minmax(0,1fr);gap:12px;align-items:center;padding:11px 10px;border:1px solid #a2adb5;border-radius:9px;margin-bottom:10px;background:#fffdf3}
.achievement-icon{width:50px;height:50px;border:3px double var(--accent-172e47);border-radius:50%;background:radial-gradient(circle at 35% 30%,#fdfcf2,var(--accent-b5c9d2));padding:5px;display:grid;place-items:center;box-shadow:inset 0 0 0 2px #eef4ee,0 1px 0 var(--accent-152d41)}
.achievement-icon canvas,.achievement-icon svg{width:100%;height:100%;image-rendering:pixelated}
.achievement-heading{display:flex;justify-content:space-between;gap:7px;align-items:center;font-size:14px!important;line-height:1.3;margin-bottom:8px}
.achievement-heading b{font-size:15px!important}.achievement-heading span{font-size:12px;white-space:nowrap}
.achievement-progress{height:13px;margin:0}
/* Leaderboards: rounded rows, medal positions and a single dropdown. */
.leaderboard-options{font-size:13px;display:block}.leaderboard-options select{width:100%;margin:4px 0 6px}
#leaderboardStatus,#leaderboardClock{font-size:11px!important;color:var(--accent-526b83);margin:4px 0}
#leaderboardResults table{border-collapse:separate;border-spacing:0 5px;width:100%;font-size:14px;table-layout:fixed}
#leaderboardResults caption{font-size:12px;text-align:left;margin:5px 0;font-weight:900}
#leaderboardResults th,#leaderboardResults td{padding:7px 5px;background:none;border:0;text-align:left;vertical-align:middle;overflow-wrap:anywhere}
#leaderboardResults th{font-weight:900}#leaderboardResults th:first-child{width:42px}#leaderboardResults th:last-child{width:100px}
#leaderboardResults tbody td{background:#fffdf4;border-top:1px solid #aab5ba;border-bottom:1px solid #aab5ba}
#leaderboardResults tbody td:first-child{border-left:1px solid #aab5ba;border-radius:7px 0 0 7px;font-weight:900;text-align:center}
#leaderboardResults tbody td:last-child{border-right:1px solid #aab5ba;border-radius:0 7px 7px 0;font-weight:900;text-align:right}
#leaderboardResults .leaderboard-you td{background:#e5f9ec;border-color:var(--accent-00a79b)}
#leaderboardResults td small{font-size:10px;display:block;color:var(--accent-536c84)}
.leaderboard-medal{display:grid;place-items:center;width:27px;height:27px;border:2px solid #a87d19;border-radius:50%;background:#ffdf52;color:#624200;box-shadow:inset 0 0 0 2px #fff5a5;font-size:14px}
.leaderboard-medal[data-place="2"]{background:var(--accent-d1dce7);border-color:var(--accent-718298);color:var(--accent-294057);box-shadow:inset 0 0 0 2px #f9ffff}
.leaderboard-medal[data-place="3"]{background:#e7ae76;border-color:#8a5832;color:#563015;box-shadow:inset 0 0 0 2px #ffdfb7}
.leaderboard-placeholder td{color:var(--accent-58718b);font-size:12px!important}
/* Standard gameplay keeps the road and sprite area clear. */
.route-stage{border:0;overflow:hidden}.trainer-label,.type-bonus-box{font-size:12px;padding:7px;border-width:2px;border-radius:8px}
.turn-name{font-size:14px!important;margin:1px 0}.trainer-prefix{font-size:9px!important}
.type-bonus-label,.type-bonus-multiplier{font-size:12px!important;font-weight:900}
.type-bonus-box .pokemon-type-icon{transform:scale(.8)}
.last-box{border-width:2px!important;border-radius:8px;max-width:43%!important;padding:7px!important}
.pokemon-reveal{display:flex;flex-direction:column;gap:3px}.sprite-window{width:80px;height:80px}.pokemon-sprite{width:100%;height:100%;object-fit:contain}
.reveal-name{font-size:14px!important;text-align:center}.reveal-kicker{font-size:10px!important;text-align:center}.reveal-meta{font-size:10px!important}.reveal-types{justify-content:center}
.last-empty{font-size:12px!important}.last-empty span{font-size:10px}
.route-history{padding:8px;border-width:2px;border-radius:8px}.route-history h2{font-size:15px!important;margin:0 0 4px}.route-history .history{font-size:12px!important;line-height:1.3}
.history-item{font-size:12px!important;line-height:1.3;padding:3px 0}.route-message{font-size:13px!important;padding:6px 8px}.status{font-size:13px!important;line-height:1.35}
.dialogue-panel{padding:11px;margin:0 5px 5px;border-radius:9px}
#requirement{font-size:17px!important;line-height:1.25;margin:0 0 8px;font-weight:900}
#gameScreen .word-entry{display:grid;grid-template-columns:minmax(0,1fr) 96px;gap:7px}
#gameScreen .word-entry input{height:39px;font-size:16px!important;grid-column:1}
#gameScreen .entry-actions{display:contents}#playBtn{grid-column:2;grid-row:1;min-height:39px!important;height:39px!important;font-size:14px!important}
#gameScreen .small-actions{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:8px}
#gameScreen .small-actions .btn{font-size:14px!important;height:34px!important;min-height:34px!important}

/* Responsive battle composition uses the same layout on desktop and mobile. */
#battleGameScreen:not(.hidden){display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden}
.battle-game-top{background:var(--rally-cream);border:2px solid var(--rally-border);border-radius:7px;margin:4px 5px;padding:5px 9px;font-size:15px;display:flex;gap:8px;align-items:center}
.battle-game-top b{font-size:17px}.battle-game-top span{margin-left:auto;font-size:13px}
#battleGameScreen .battle-arena{position:relative;flex:1;width:100%;height:auto;min-height:0;overflow:hidden;background:var(--accent-183545)}
#battleGameScreen .battle-route-image{background-size:cover;background-position:center}
#battleGameScreen .battle-layout{position:absolute;inset:0;width:auto;height:auto;transform:none;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:minmax(140px,1fr) 92px minmax(140px,1fr) 65px;gap:9px;padding:8px;align-items:start}
#battleGameScreen .combat-card{position:relative;inset:auto;width:100%!important;max-width:none;min-width:0;padding:9px;border:2px solid var(--rally-border);border-radius:9px}
#battleGameScreen .opponent-card{grid-column:2;grid-row:1}.player-card{grid-column:1;grid-row:3}
#battleGameScreen .combat-name{font-size:15px!important;line-height:1.2;margin-bottom:3px;overflow-wrap:anywhere}
#battleGameScreen .combat-type{font-size:11px!important;margin:3px 0;line-height:1.1}
#battleGameScreen .combat-body{display:flex;flex-direction:column;gap:5px;align-items:center}
#battleGameScreen .combat-body>div{width:100%;text-align:center}
#battleGameScreen .combat-body>canvas{width:72px;height:72px;image-rendering:pixelated;background:transparent;border:0}
#battleGameScreen .combat-body b{font-size:12px!important;margin:0 0 3px;display:block}
#battleGameScreen .hp-wrap{display:flex;align-items:center;gap:4px}.hp-wrap>span{font-size:9px}.hp-track{flex:1;min-width:0;height:12px}.hp-fill{border-radius:7px;height:100%;border:0}
#battleGameScreen .hp-number{font-size:11px!important;margin-top:3px}.combat-name .ai-profile{display:none}
#battleGameScreen .battle-route-tag{position:relative;inset:auto;grid-column:1;grid-row:1;font-size:12px;padding:5px;border-radius:7px;line-height:1.3;max-width:130px;height:max-content;background:#fffbeeea;border:2px solid var(--accent-142e48)}
#battleGameScreen .battle-roll-box{position:relative;inset:auto;transform:none;grid-column:1/-1;grid-row:2;align-self:center;width:100%;min-width:0;height:auto;gap:0;padding:6px;border:2px solid var(--accent-142e48);border-radius:8px}
#battleGameScreen .type-roulette{width:100%;height:62px;object-fit:contain;image-rendering:pixelated}
#battleRouletteLabel{font-size:11px!important}#battleClock{font-size:11px!important}.battle-roll-box:not(:has(#battleRouletteLabel:empty)){padding-bottom:4px}
#battleGameScreen .battle-route-history{position:relative;inset:auto;width:100%;max-width:none;grid-column:1/-1;grid-row:4;margin:0;align-self:end;max-height:65px;padding:5px 8px}
#battleGameScreen .battle-route-history h2{font-size:13px!important;margin:0 0 2px}
#battleGameScreen #battleHistory{max-height:36px;font-size:11px!important}.battle-route-history .history-item{font-size:11px!important;line-height:1.2}
#battleGameScreen .battle-entry{position:relative;inset:auto;flex:none;margin:4px 5px 5px;padding:9px;border-radius:9px;max-height:45%;overflow:auto}
#battleInputLabel{font-size:17px;font-weight:900;display:block}
#battleMessage{font-size:12px!important;margin:2px 0 5px;min-height:0}
.battle-turn-roster{font-size:10px!important;padding:0 0 3px}.battle-input-row{grid-template-columns:minmax(0,1fr) 88px;gap:7px;margin:6px 0}
.battle-input-row input{height:38px;padding:7px}.battle-input-row button{font-size:15px!important;min-height:38px}
.battle-entry details{font-size:11px}.battle-entry details p{font-size:12px;line-height:1.4}
@media(max-width:600px){
 .brand{height:53px;padding:6px;gap:6px}.brand .logo{max-width:45%}.brand .logo img{max-height:35px}
 .brand:has(.header-exit:not([hidden])) .logo{max-width:36%}.header-stats{font-size:11px}
 .header-exit,.header-login{font-size:11px!important;padding:4px 6px!important;min-height:30px!important;height:30px!important}
 .brand .account-actions>.header-menu{height:30px!important;width:30px!important}.pokedex-button{width:29px;height:32px}
 #loginScreen{padding:20px 18px 38px}.login-content{gap:11px;transform:translateY(-20px)}.login-logo{margin-bottom:12px}
 .login-panel{padding:15px}.login-panel #accountForm{gap:9px}
 dialog{padding:12px;width:calc(100vw - 18px);max-height:calc(100dvh - 18px)}
 #profileAvatarGrid{max-height:220px}.achievement-card{grid-template-columns:44px minmax(0,1fr);gap:9px;padding:10px 8px}.achievement-icon{width:44px;height:44px}.achievement-heading b{font-size:14px!important}
 #profileDialog .profile-level-heading b{font-size:15px!important}
 #gameScreen .dialogue-panel{padding:9px}.route-hud{left:7px;right:7px;top:7px}
 #gameScreen .last-box{top:65px!important;right:7px}.route-history{left:7px;right:7px;width:auto!important;max-width:none!important}
 #gameScreen .route-history{bottom:8px!important}.route-message{bottom:84px!important;max-height:60px;overflow:auto}
 #gameScreen .route-history .history{max-height:42px}.pokemon-reveal .sprite-window{width:64px;height:64px}
 #battleGameScreen .battle-layout{gap:7px;padding:7px;grid-template-rows:minmax(140px,1fr) 82px minmax(140px,1fr) 60px}
 #battleGameScreen .battle-route-history{max-height:60px}.battle-roll-box .type-roulette{height:55px}
}
@media(max-height:700px){
 #profileDialog .profile-identity{padding:0 0 5px}.profile-identity #profileEmail,.profile-identity #profileAchievementCount{font-size:10px!important;margin:2px 0!important}
 #profileDialog .profile-level,#profileDialog .profile-rank{padding:6px 0}#profileDialog .profile-rank>img{width:43px;height:43px}
 #profileDialog #profileXPDetail{display:none}#profileAvatarGrid{max-height:132px}
 #profileDialog .profile-match-record{margin:5px 0!important}.profile-match-record>span{padding:4px;font-size:11px!important}
 #profileDialog .profile-title-label{margin:4px 0}#profileDialog .profile-title-label select{min-height:30px;padding:4px}
 #profileDialog h3{margin:5px 0 3px}#profileDialog .profile-filters{margin:4px 0}
 #battleGameScreen .battle-layout{grid-template-rows:minmax(98px,1fr) 58px minmax(98px,1fr) 45px;gap:4px;padding:4px}
 #battleGameScreen .combat-card{padding:5px}.combat-card .combat-type{display:none!important}
 #battleGameScreen .combat-body>canvas{width:40px;height:40px}#battleGameScreen .combat-name{font-size:12px!important}
 #battleGameScreen .combat-body b{font-size:10px!important}#battleGameScreen .combat-body{gap:2px}
 #battleGameScreen .type-roulette{height:37px}#battleGameScreen .battle-roll-box{padding:4px}
 #battleGameScreen .battle-route-history{max-height:45px}#battleGameScreen #battleHistory{max-height:20px}
 #battleGameScreen .battle-entry{padding:6px}#battleMessage{font-size:11px!important}.battle-turn-roster{display:none}
 .login-content{transform:none;gap:8px}.login-logo{max-height:120px;object-fit:contain;margin-bottom:5px}.login-panel{padding:12px}
 .login-panel #accountForm{gap:6px}.login-panel #accountForm input{height:33px}.login-panel #accountForm .btn{min-height:32px!important;height:32px;font-size:13px!important}.login-panel #accountSocialSignIn{margin-top:8px;padding-top:8px}
}
@media(max-width:360px){
 body{font-size:12px}dialog{padding:10px}h2{font-size:19px!important}.collection-head{margin-bottom:8px;padding-bottom:6px}
 #profileDialog .profile-identity b{font-size:18px!important}#profileAvatarGrid{gap:4px}
 #collectionGrid .collection-card{padding:4px;min-height:105px;grid-template-rows:11px 15px minmax(0,1fr) 12px}.dex-name{font-size:10px}
 .achievement-heading{gap:5px}.achievement-heading b{font-size:12px!important}.achievement-heading span{font-size:10px}.achievement-card{gap:7px;grid-template-columns:36px minmax(0,1fr)}.achievement-icon{width:36px;height:36px;padding:3px}
 #requirement,#battleInputLabel{font-size:15px!important}.header-score{font-size:10px}
 #leaderboardResults table{font-size:12px}#leaderboardResults th:last-child{width:85px}
}

/* Keep native type icons small and each arena row clear. */
#battleGameScreen .combat-body .pokemon-type-icon{width:16px;height:16px;border:0;background:none}
#battleGameScreen .combat-body .pokemon-type-icons{justify-content:center;display:inline-flex;margin:0 0 0 4px}
#battleGameScreen .battle-game-top,#battleGameScreen .battle-game-top>b,#battleTurnLabel{color:var(--rally-ink)}
#battleGameScreen .battle-roll-box{max-width:none}
#gameScreen .last-box{left:auto!important;right:8px!important;min-width:110px!important;width:124px!important}
#leaderboardResults th:first-child{width:45px;white-space:nowrap;font-size:12px}
#collectionGrid .collection-card.collected canvas{filter:none;opacity:1}

@media(min-height:701px){
 #battleGameScreen .battle-layout{grid-template-rows:minmax(140px,1fr) 135px minmax(140px,1fr) 60px}
 #battleGameScreen .combat-card{padding:7px}
 #battleGameScreen .combat-body{gap:3px}
 #battleGameScreen .combat-body>canvas{width:60px;height:60px}
 #battleGameScreen .type-roulette{height:90px}
}
@media(max-height:700px) and (max-width:600px){
 #battleGameScreen .combat-card{padding:5px}
 #battleGameScreen .combat-name{padding-right:34px;margin-bottom:1px}
 #battleGameScreen .combat-type{position:absolute;right:5px;top:6px;margin:0;font-size:8px!important;gap:0}
 #battleGameScreen .combat-type .small-icon{display:none}
 #battleGameScreen .combat-body{gap:1px}
 #battleGameScreen .combat-body>canvas{width:28px;height:28px}
 #battleGameScreen .combat-body b{font-size:10px!important;margin:0}
 #battleGameScreen .combat-body .pokemon-type-icon{width:10px;height:10px}
 #battleGameScreen .hp-number{font-size:9px!important;margin-top:1px}
 #battleGameScreen .hp-track{height:9px}
 #battleGameScreen .battle-roll-box{height:58px;padding:3px}
 #battleGameScreen .type-roulette{height:45px}
 #battleRouletteLabel,#battleClock{display:none}
 #battleGameScreen .battle-route-history{overflow:hidden;height:45px;padding:3px 5px}
 #battleGameScreen .battle-route-history h2{font-size:11px!important}
}
#battleInputError:empty{display:none}
@media(min-width:601px) and (min-height:701px){
 #battleGameScreen .combat-body>canvas{width:52px;height:52px}
 #battleGameScreen .combat-body{gap:1px}
 #battleGameScreen .combat-type{margin:1px 0}
 #battleGameScreen .combat-name{margin-bottom:1px}
}
@media(min-width:601px) and (min-height:701px){
 #battleGameScreen .combat-type{position:absolute;right:7px;top:8px;margin:0}
 #battleGameScreen .combat-name{padding-right:75px}
}

/* v0.72: Dex beside logo, available only between games. */
.brand #headerDex{flex:none;margin-left:0;margin-right:0}.brand .header-stats{margin-left:auto}
body:is(.game-active,.battle-playing) #headerDex{display:none!important}
/* v0.73: compact profile choices, structured rankings and Classic controls. */
.brand .logo{width:140px;max-width:43%;flex:0 1 auto;margin-right:0}.brand .logo img{max-height:none;width:100%;height:auto}
.brand{gap:4px}.brand #headerDex{margin-left:0;margin-right:0}.brand .account-actions{margin-left:auto}
#profileDialog #profileAvatarGrid{grid-template-columns:repeat(8,minmax(0,1fr));gap:4px;max-height:180px}
#profileAvatarGrid .profile-avatar{min-height:0;min-width:0;padding:3px;border-radius:5px}
#profileAvatarGrid .profile-shiny-badge{width:12px;height:12px;right:0;top:0}
#profilePicture{width:64px;height:64px}.profile-more,.profile-empty{grid-column:1/-1}
.leaderboard-categories{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin-bottom:12px}
.leaderboard-categories .btn{font-size:12px;min-height:40px;padding:6px 4px}
.leaderboard-categories .btn[aria-pressed=true]{background:linear-gradient(var(--accent-158dff),var(--accent-0066e6));color:white;outline:0;box-shadow:inset 0 0 0 1px var(--accent-80caff),0 2px 0 var(--accent-173749)}
.leaderboard-search{display:block;font-size:12px}.leaderboard-search input{display:block;width:100%;margin-top:4px}
.leaderboard-identity{display:flex;align-items:center;gap:7px;min-width:0}.leaderboard-identity>span:last-child{overflow-wrap:anywhere}
.leaderboard-avatar{width:34px;height:34px;flex:none;display:block}.leaderboard-avatar canvas{width:100%;height:100%;image-rendering:pixelated}
#leaderboardResults th:last-child{width:92px}#leaderboardResults th:first-child{width:36px}#leaderboardResults td{font-size:13px}
#leaderboardResults .leaderboard-empty{text-align:center;padding:18px}
#leaderboardStatus:empty{display:none}
.achievement-details-button{width:100%;color:var(--rally-ink);text-align:left;cursor:pointer;font:inherit;box-shadow:none}
.achievement-details-button:hover{border-color:var(--accent-0877fb);background:var(--accent-f0f8ff)}.achievement-details-button:focus-visible{outline:3px solid var(--accent-0877fb);outline-offset:2px}
#achievementMissingList{display:grid;gap:5px}.achievement-missing-pokemon{display:flex;align-items:center;gap:12px;border-bottom:1px solid #bcc6c5;padding:5px 0}
.achievement-missing-pokemon>span{width:44px;height:44px;flex:none}.achievement-missing-pokemon canvas{width:100%;height:100%;image-rendering:pixelated}
.classic-score .header-stats{margin:4px 0 0;color:var(--rally-ink);padding-top:4px;border-top:1px solid #bcc6c5}
.classic-score .header-score{flex-direction:row;align-items:center;gap:12px;font-size:13px}
.classic-score .header-score .single-best-card{background:none;color:var(--rally-ink);font:inherit;gap:4px;margin:0}
#homeModes .mode-choice.single,#homeModes .mode-choice.battle{background:linear-gradient(var(--accent-17d9c7),var(--accent-00aa9c));color:var(--accent-082349);box-shadow:inset 0 0 0 1px var(--accent-87f3e5),0 2px 0 var(--accent-173749);text-shadow:0 1px 0 var(--accent-00675c)}
#homeModes .coming-soon{background:#e7e5dc;color:#72818b;border-color:#9da9ab;box-shadow:inset 0 0 0 1px white;text-shadow:none;opacity:1;cursor:default}
#homeModes .coming-soon .mode-choice-title{font-size:18px!important}#homeModes .mode-buttons{gap:10px}
@media(max-width:600px){.brand .logo{width:122px;max-width:42%}.brand{gap:3px}.brand #headerDex{width:27px}.classic-score .header-score{font-size:12px;gap:10px}#profileDialog #profileAvatarGrid{max-height:150px}#profileAvatarGrid .profile-avatar{padding:2px}}
/* Appearance options change interface accents, leaving route art and type colours intact. */
.options-colours{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}
.options-colours button{display:flex;align-items:center;justify-content:center;gap:6px;padding:8px 4px;background:#fffdf4;color:var(--rally-ink);text-shadow:none;border:1px solid var(--accent-899eae);border-radius:7px;box-shadow:none;min-height:42px;font-size:12px}
.options-colours button[aria-pressed=true]{outline:2px solid var(--rally-blue);outline-offset:1px}
.options-colour-dot{width:16px;height:16px;border:1px solid var(--accent-263b50);border-radius:50%;flex:none}

:root{--accent-142e48:#142e48;--accent-082349:#082349;--accent-001e4c60:#001e4c60;--accent-082349b0:#082349b0;--accent-0877fb:#0877fb;--accent-336b8b:#336b8b;--accent-9cb2b8:#9cb2b8;--accent-4e7085:#4e7085;--accent-26414e:#26414e;--accent-426a8b:#426a8b;--accent-0064c7:#0064c7;--accent-52758c:#52758c;--accent-e3f5ff:#e3f5ff;--accent-182b31:#182b31;--accent-25394b:#25394b;--accent-172731:#172731;--accent-24527e:#24527e;--accent-172b40:#172b40;--accent-94b7c7:#94b7c7;--accent-233b51:#233b51;--accent-245d91:#245d91;--accent-89aec4:#89aec4;--accent-163959:#163959;--accent-88abc9:#88abc9;--accent-263a51:#263a51;--accent-152a3f:#152a3f;--accent-dce9f1:#dce9f1;--accent-b8cfdb:#b8cfdb;--accent-1f3648:#1f3648;--accent-243b4c:#243b4c;--accent-314252:#314252;--accent-263b50:#263b50;--accent-223c4ca0:#223c4ca0;--accent-314452:#314452;--accent-223b51:#223b51;--accent-245f9d:#245f9d;--accent-51677a:#51677a;--accent-233c50:#233c50;--accent-788798:#788798;--accent-2364a0:#2364a0;--accent-284159:#284159;--accent-79acc3:#79acc3;--accent-29465b:#29465b;--accent-dceaf4:#dceaf4;--accent-a4bdcb:#a4bdcb;--accent-34475a:#34475a;--accent-23598c:#23598c;--accent-20374e:#20374e;--accent-6b97b2:#6b97b2;--accent-88abc5:#88abc5;--accent-3e79a6:#3e79a6;--accent-243748:#243748;--accent-223b4f:#223b4f;--accent-364853:#364853;--accent-7695b3:#7695b3;--accent-213a50:#213a50;--accent-dcebf2:#dcebf2;--accent-253c50:#253c50;--accent-497597:#497597;--accent-243c50:#243c50;--accent-56717e:#56717e;--accent-233e50:#233e50;--accent-223a50:#223a50;--accent-101f2ed9:#101f2ed9;--accent-102030d9:#102030d9;--accent-3f8ee8:#3f8ee8;--accent-8fa9de:#8fa9de;--accent-5269ad:#5269ad;--accent-0b6dc3:#0b6dc3;--accent-5a8ea2:#5a8ea2;--accent-3675a5:#3675a5;--accent-8db3c9:#8db3c9;--accent-1e4d78:#1e4d78;--accent-455e65:#455e65;--accent-243b50:#243b50;--accent-576b72:#576b72;--accent-152a3f85:#152a3f85;--accent-34464d:#34464d;--accent-172b31:#172b31;--accent-14262a:#14262a;--accent-275581:#275581;--accent-547e9e:#547e9e;--accent-244568:#244568;--accent-7da8b9:#7da8b9;--accent-254563:#254563;--accent-18334d:#18334d;--accent-adc4d1:#adc4d1;--accent-314353:#314353;--accent-d6e9ff:#d6e9ff;--accent-152a3f80:#152a3f80;--accent-2c4554:#2c4554;--accent-226ca0:#226ca0;--accent-233c4c:#233c4c;--accent-203747:#203747;--accent-142a38:#142a38;--accent-4caddb:#4caddb;--accent-a6e4ff:#a6e4ff;--accent-335875:#335875;--accent-20374c:#20374c;--accent-7566bc:#7566bc;--accent-183545:#183545;--accent-102238aa:#102238aa;--accent-e8f2ff:#e8f2ff;--accent-26394b:#26394b;--accent-4285f4:#4285f4;--accent-1877f2:#1877f2;--accent-284957:#284957;--accent-183545e8:#183545e8;--accent-102b34f5:#102b34f5;--accent-365e80:#365e80;--accent-102b36:#102b36;--accent-183545d9:#183545d9;--accent-102b42:#102b42;--accent-158dff:#158dff;--accent-0066e6:#0066e6;--accent-80caff:#80caff;--accent-173749:#173749;--accent-003d85:#003d85;--accent-37a0ff:#37a0ff;--accent-0b75ec:#0b75ec;--accent-41678a:#41678a;--accent-12335b:#12335b;--accent-153c5320:#153c5320;--accent-6488ab:#6488ab;--accent-123651:#123651;--accent-06274c:#06274c;--accent-0769d8:#0769d8;--accent-0051b6:#0051b6;--accent-9fddff:#9fddff;--accent-b7dbef:#b7dbef;--accent-10283f55:#10283f55;--accent-0b294540:#0b294540;--accent-065dde:#065dde;--accent-102947:#102947;--accent-bfd8ee:#bfd8ee;--accent-126be0:#126be0;--accent-9bafbf:#9bafbf;--accent-587082:#587082;--accent-123b70:#123b70;--accent-32618b:#32618b;--accent-dce3ed:#dce3ed;--accent-63829b44:#63829b44;--accent-27b7ff:#27b7ff;--accent-0085f8:#0085f8;--accent-536c84:#536c84;--accent-899eae:#899eae;--accent-132e4c:#132e4c;--accent-193854:#193854;--accent-0c315a:#0c315a;--accent-172e47:#172e47;--accent-b5c9d2:#b5c9d2;--accent-152d41:#152d41;--accent-526b83:#526b83;--accent-d1dce7:#d1dce7;--accent-718298:#718298;--accent-294057:#294057;--accent-58718b:#58718b;--accent-9ddfff:#9ddfff;--accent-09324f:#09324f;--accent-f0f8ff:#f0f8ff;}
.brand .logo{width:auto;flex:0 0 auto;max-width:43%}.brand .logo img{height:36px;width:auto;max-width:100%;max-height:36px;object-fit:contain}
@media(max-width:600px){.brand .logo{width:auto;max-width:42%}.brand .logo img{height:32px;max-height:32px}}

/* v0.74: secondary controls use the lighter selected theme accent. */
:root{--accent-0f615b:hsl(212,70%,24%);--accent-00c9b5:hsl(212,85%,62%);--accent-17d9c7:hsl(212,85%,70%);--accent-00aa9c:hsl(212,85%,58%);--accent-27e1cc:hsl(212,85%,75%);--accent-87f3e5:hsl(212,85%,89%);--accent-00675c:hsl(212,70%,24%);--accent-00a59d:hsl(212,85%,53%);--accent-00a79b:hsl(212,85%,53%);--accent-00a98c:hsl(212,85%,53%);}

/* v0.75: one primary and one pastel secondary button style across screens. */
:root{--accent-00c9b5:hsl(212,60%,73%);--accent-17d9c7:hsl(212,60%,78%);--accent-00aa9c:hsl(212,60%,68%);--accent-27e1cc:hsl(212,60%,83%);--accent-87f3e5:hsl(212,55%,90%);}
body .btn:not(.secondary):not(.menu-toggle):not(.header-menu){background:linear-gradient(var(--accent-158dff),var(--accent-0066e6));color:white;box-shadow:inset 0 0 0 1px var(--accent-80caff),0 2px 0 var(--accent-173749);text-shadow:0 1px 0 var(--accent-003d85)}
body .btn.secondary,body #skipBtn,body #helpBtn{background:linear-gradient(var(--accent-17d9c7),var(--accent-00aa9c));color:var(--rally-ink);box-shadow:inset 0 0 0 1px var(--accent-87f3e5),0 2px 0 var(--accent-173749);text-shadow:none}
body .btn:not(.secondary):not(.menu-toggle):not(.header-menu):hover{background:linear-gradient(var(--accent-37a0ff),var(--accent-0b75ec))}
body .btn.secondary:hover,body #skipBtn:hover,body #helpBtn:hover{background:var(--accent-27e1cc)}
body #homeModes .mode-choice:not(:disabled){text-shadow:none}
body #leaderboardDialog .leaderboard-categories button[aria-pressed=true]{background:linear-gradient(var(--accent-158dff),var(--accent-0066e6));color:white;box-shadow:inset 0 0 0 1px var(--accent-80caff),0 2px 0 var(--accent-173749);text-shadow:0 1px 0 var(--accent-003d85)}
body .suggestion-chip{background:linear-gradient(var(--accent-17d9c7),var(--accent-00aa9c));color:var(--rally-ink);border:1px solid var(--rally-border);border-radius:6px;text-shadow:none}
body .collection-head .btn,body #profileChangeName{background:transparent!important;color:var(--rally-ink);box-shadow:none;text-shadow:none}
body .header-menu-panel button:hover{background:linear-gradient(var(--accent-37a0ff),var(--accent-0b75ec));color:white}
body .btn[aria-pressed=true]{outline-color:var(--rally-blue)}
body :is(#gameScreen .entry-actions>#playBtn,.battle-input-row .btn,.difficulty-options .btn){background:linear-gradient(var(--accent-158dff),var(--accent-0066e6));color:white;box-shadow:inset 0 0 0 1px var(--accent-80caff),0 2px 0 var(--accent-173749);text-shadow:0 1px 0 var(--accent-003d85)}
body :is(#gameScreen .entry-actions>#playBtn,.battle-input-row .btn,.difficulty-options .btn):hover{background:linear-gradient(var(--accent-37a0ff),var(--accent-0b75ec))}
