
/* Rally v1: PokéRally shared visual language, full-viewport no-scroll layout. */
@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:#173449;--rally-paper:#fffbea;--rally-border:#1b384c;--rally-bright:#248dca}
html,body{width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
body{background:#183545;font-family:Rally,Arial,sans-serif;color:#fff}
button,input,select{font-family:Rally,Arial,sans-serif}
.site{width:min(100%,1450px);height:100dvh;min-height:0;max-width:1450px;margin:0 auto;padding:clamp(6px,1.1vh,12px);display:grid;grid-template-rows:clamp(50px,9vh,76px) minmax(0,1fr);gap:clamp(5px,1vh,12px);overflow:hidden}
header{min-width:0;margin:0;display:flex;align-items:center;justify-content:space-between;flex-wrap:nowrap;gap:8px}
header>div:first-child{display:grid;grid-template-columns:auto auto;align-items:center;gap:0 14px;min-width:0}
.logo{font-size:0;width:clamp(130px,17vw,216px);height:clamp(42px,7vh,66px);background:url("../../assets/branding/pokerally-logo.png?v=0.80") center / contain no-repeat;text-shadow:none;-webkit-text-stroke:0;grid-row:span 2}
.tag{font:900 clamp(9px,1.1vw,12px)/1.2 Rally,Arial,sans-serif;letter-spacing:.09em;color:#dcebdd;padding:0;white-space:nowrap}
.back-modes{background:#fff8e6;color:#1b3852;border:2px solid #17384c;box-shadow:inset 0 0 0 2px #bccbbb,0 3px #071e2b;font:900 11px Rally,Arial,sans-serif;border-radius:4px;min-height:31px;padding:5px 9px;margin:0;grid-column:2}
.back-modes:hover,.back-modes:focus-visible{background:#ffe7a7;color:#18374c}
.headingmeta{flex-wrap:nowrap;gap:6px;min-width:0}.pill{white-space:nowrap;box-shadow:inset 0 0 0 2px #c2cebf,0 2px #071e2b;border-radius:4px;border:2px solid #143349;background:#fdf9e9;color:#233d52;padding:7px 12px;font:800 12px Rally,Arial,sans-serif}.pill strong{font:900 16px Rally,Arial,sans-serif;color:#146a9b}
.game{height:100%;min-height:0;min-width:0;grid-template-columns:minmax(0,1.45fr) minmax(315px,.85fr);gap:10px;align-items:stretch}
.world{min-height:0;max-height:none;height:100%;aspect-ratio:auto;border:3px solid #16384d;border-radius:4px;box-shadow:inset 0 0 0 3px #d6e2c6,0 3px #0b2435;background:#6bad77}
.world canvas{height:100%;width:100%;image-rendering:pixelated}
.worldhud{top:8px;left:8px;right:8px;gap:6px;flex-wrap:nowrap}
.hudbox{border:2px solid #213e52;outline:1px solid #d5ded1;border-radius:3px;background:#fff9e6e8;color:#173449;font:900 12px Rally,Arial,sans-serif;padding:5px 8px}
.hudbox .gold{color:#214b65}.hudbox .cyan{color:#26769f}
.players{top:51px;right:9px;width:min(210px,46%);gap:4px}.playerbar{border-radius:3px;border:2px solid #18374f;background:#fff8e9e8;color:#1c344a;padding:4px;font:900 11px Rally,Arial,sans-serif}.playerbar strong{color:#14416a}.playerbar small{font:900 10px Rally,Arial,sans-serif}
.track{background:#c6d1c4;border-color:#54718a}.track i{background:linear-gradient(#87d9ff,#127cb4)}.track i.opp{background:linear-gradient(#f8b19b,#d96d62)}
.corner{background:#fff9e6e7;border:2px solid #1b3a51;box-shadow:inset 0 0 0 1px #dbe8d7;border-radius:3px;width:clamp(125px,17vw,188px);left:9px;bottom:9px;padding:5px}
.corner .label,.legend{color:#21425a;font:900 10px Rally,Arial,sans-serif}.minimap{border-color:#21425a}
.panel{min-height:0;background:#fff9e6;color:#1a364a;border:3px solid #18394e;outline:1px solid #b5c6b7;border-radius:4px;box-shadow:inset 0 0 0 2px #eef0d9,0 4px #08263b}
.panelhead{padding:10px 12px;border-bottom:3px solid #acc5b7;background:#264760;color:#f8f9e8;font:900 14px Rally,Arial,sans-serif}
.inner{height:calc(100% - 49px);padding:clamp(10px,2vh,18px);gap:clamp(6px,1.5vh,13px);min-height:0;justify-content:center}
.eyebrow{font:900 11px Rally,Arial,sans-serif;color:#6c8792}
.question{font:900 clamp(17px,2.1vw,23px)/1.25 Rally,Arial,sans-serif;min-height:0}
.typebadge{font:900 11px Rally,Arial,sans-serif;border-radius:4px;padding:5px 9px}
.input{border:2px solid #4c718a;border-radius:3px;padding:10px;font:800 16px Rally,Arial,sans-serif;min-height:47px}
.input:focus{border-color:#1485c2;outline:2px solid #8ce0ed}
.btn{font:900 13px Rally,Arial,sans-serif;letter-spacing:0;border:2px solid #145737;border-radius:4px;box-shadow:inset 0 2px #98dba5,0 3px #0a482f;min-height:44px;padding:8px 10px;text-shadow:none}
.btn.goldbtn{background:linear-gradient(#fbeaaf,#e7c05e);box-shadow:inset 0 2px #fff2ce,0 3px #95742c;color:#344256}.btn.blue{background:linear-gradient(#86d6ee,#289bcd);box-shadow:inset 0 2px #c5f3fa,0 3px #18547d}.btn.dim{box-shadow:inset 0 2px #c4d7e3,0 3px #344f69}
.btn.small{min-height:35px}
.inputrow .btn{width:100px}.notice{font:800 12px/1.3 Rally,Arial,sans-serif;min-height:30px}
.side{min-height:0;display:grid;grid-template-rows:minmax(0,1fr) auto;gap:9px;overflow:hidden}
.side>.panel{min-height:0}
.side>.subpanel:not(.shortcut){background:#fdf8e5;border:3px solid #18384c;border-radius:4px;box-shadow:inset 0 0 0 2px #d3dec8;padding:10px;color:#17384e}
.side>.subpanel h3{color:#315770;font:900 12px Rally,Arial,sans-serif;margin:0 0 7px}
.side>.subpanel p{color:#445c68;font:700 11px/1.3 Rally,Arial,sans-serif;margin:5px 0}
.stat{background:#e5eee0;border:1px solid #9fb5ae;padding:6px;border-radius:3px}
.stat span{font:900 21px Rally,Arial,sans-serif;color:#1a445d}
.stat small{color:#587285;font:900 9px Rally,Arial,sans-serif}
.side>.minihelp,.footnote{display:none}
.overlay{position:fixed;inset:0;z-index:30;background:#0c2335c9;backdrop-filter:blur(3px)}
.overlay-card{width:min(93vw,445px);max-width:445px;max-height:calc(100dvh - 20px);overflow:hidden;border:3px solid #173a50;outline:3px solid #b9cbbb;border-radius:5px;background:#fff9e6;box-shadow:0 14px 40px #061725bb;padding:clamp(12px,2.5vh,22px);color:#1b3549}
.overlay-card h1{font:900 clamp(22px,4.2vh,32px)/1.15 Rally,Arial,sans-serif;color:#17547a;text-shadow:none;margin:5px 0}
.overlay-card p{font:700 clamp(11px,2vh,14px)/1.35 Rally,Arial,sans-serif;color:#3a5368;margin:7px 0}
.overlay-card .minihelp{font-size:11px;color:#567084}
.demo-label{color:#427a63;font:900 10px Rally,Arial,sans-serif;margin:0}
.overlay-card .start{margin-top:9px;min-height:40px}
.difficulty-field{display:flex;justify-content:center;gap:8px;align-items:center;margin:8px 0;font:900 12px Rally,Arial,sans-serif}
.difficulty-field select{background:#fff;border:2px solid #567c87;border-radius:3px;padding:7px 10px;min-height:35px;color:#12364e;max-width:180px}
.overlay-actions{display:flex;gap:9px;justify-content:center;margin:8px 0 0}
.overlay-actions .btn{flex:1;min-width:0}
.shortcut.show{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:31;width:min(93vw,430px);background:#fff9e6;color:#163950;border:4px solid #1a4052;padding:17px;box-shadow:0 0 0 100vmax #0a2335b8,0 12px 35px #031b29bb}
.shortcut h3{color:#2c5470;font:900 17px Rally,Arial,sans-serif}
.shortcut p,.shortcut small{color:#3e6474;font:800 13px Rally,Arial,sans-serif}
.shortcut .row{flex-wrap:nowrap}
.shortcut .row .btn{font-size:12px}
@media(max-width:850px){
 .site{grid-template-rows:clamp(44px,8vh,60px) minmax(0,1fr);gap:5px;padding:5px 7px 7px}
 header>div:first-child{grid-template-columns:auto;grid-template-rows:1fr;gap:0}
 .logo{grid-row:auto;width:clamp(120px,29vw,165px);height:43px}
 .tag{display:none}
 .back-modes{grid-column:auto;position:fixed;bottom:6px;right:9px;z-index:7;min-height:27px;font-size:10px;padding:3px 8px}
 .headingmeta .pill:first-child{display:none}
 .pill{font-size:11px;padding:4px 5px}.pill strong{font-size:13px}
 .game{grid-template-columns:1fr;grid-template-rows:minmax(110px,1fr) auto;gap:6px;min-height:0}
 .world{min-height:110px;max-height:none;aspect-ratio:auto}
 .worldhud{top:7px;left:7px;right:7px}
 .hudbox{font-size:10px;padding:4px 6px}
 .players{top:42px;right:7px;width:min(168px,49%)}
 .corner{width:136px;left:7px;bottom:7px}.minimap{height:35px}.minimap .line{top:11px}.runner{top:5px}.runner.ai{top:18px}.corner .label{margin-bottom:2px}
 .side{display:grid;grid-template-rows:auto auto;gap:5px;min-height:0;overflow:visible}
 .side>.panel{height:auto;min-height:0}
 .panelhead{padding:5px 9px;border-bottom:2px solid #b1c6ba;font-size:12px}
 .inner{height:auto;padding:7px 9px;display:flex;gap:3px;justify-content:initial}
 .eyebrow{display:none}
 .question{font-size:clamp(13px,3.6vw,17px);line-height:1.2;min-height:0;white-space:normal}
 .typebadge{font-size:9px;padding:2px 7px}
 .inputrow{flex-direction:row;gap:6px}
 .input{min-height:38px;font-size:16px;padding:5px 7px}
 .inputrow .btn{min-height:38px;width:88px;padding:3px;font-size:12px}
 .notice{font-size:10px;min-height:1.2em;max-height:2.5em;overflow:hidden}
 .side>.subpanel:not(.shortcut){padding:4px 7px;display:flex;align-items:center;justify-content:space-between;gap:5px}
 .side>.subpanel:not(.shortcut) h3,.side>.subpanel:not(.shortcut) p{display:none}
 .stats{display:flex;gap:5px;flex:1;min-width:0}
 .stat{flex:1;padding:2px 1px;min-width:0}
 .stat span{font-size:13px;line-height:1.05}
 .stat small{font-size:8px}
 .buttons{display:flex;gap:4px;margin:0}
 .btn.small{min-height:34px;padding:4px 6px;font-size:10px}
 .overlay-card .start{width:auto;min-width:0!important}
}
@media(max-width:360px){
 .site{padding:3px 4px 5px;gap:3px}
 .logo{width:118px}
 .pill{font-size:10px;padding:3px 4px}
 .game{gap:4px}
 .panelhead{font-size:10px;padding:4px 8px}
 .inner{padding:5px 6px;gap:2px}
 .question{font-size:13px}
 .typebadge{font-size:8px}
 .inputrow .btn{width:74px;font-size:10px}
 .notice{font-size:9px}
 .corner{width:112px}.players{width:146px}
 .stat small{font-size:7px}
 .btn.small{font-size:9px;padding:3px 4px}
}
@media(max-height:540px) and (max-width:850px){
 .site{grid-template-rows:36px minmax(0,1fr)}
 .logo{height:32px;width:115px}
 .corner{display:none}
 .side>.subpanel:not(.shortcut){padding:2px 5px}
 .stat small{display:none}
 .worldhud{display:none}
 .players{top:7px}
 .input{min-height:33px}
 .inputrow .btn{min-height:33px}
 .panelhead{padding:3px 7px}
 .inner{padding:4px 6px;gap:2px}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;transition-duration:.01ms!important}}

/* The solo clock race has no artificial opponent. */
body.rally-time-trial .players .playerbar:nth-child(2),
body.rally-time-trial #miniai{display:none}
@media(max-height:440px){
 .overlay-card{padding:8px 12px}
 .overlay-card h1{font-size:19px}
 .overlay-card p{font-size:10px;line-height:1.15;margin:4px 0}
 .overlay-card .minihelp{display:none}
 .difficulty-field{margin:4px 0}
 .overlay-card .start{min-height:34px;padding:4px}
}
