/* Royal Arena: scoped to gameplay, leaving account and store screens unchanged. */
body:has(#hud:not([hidden])){--hud-gold:#e6bf62;--hud-navy:#061a2d;--hud-line:#997b3e}
body:has(#hud:not([hidden]))>header{top:24px;left:24px;right:24px;width:auto;transform:none;padding:0;align-items:flex-start;pointer-events:none}
body:has(#hud:not([hidden])) header .game-brand{display:flex;align-items:center;justify-content:center;width:160px;height:80px;padding:10px;background:linear-gradient(145deg,#102d48,#041324);border:1px solid var(--hud-gold);border-radius:12px 0 0 12px;box-sizing:border-box;pointer-events:auto}
body:has(#hud:not([hidden])) header .game-brand img{width:140px;height:auto;max-height:66px;object-fit:contain}
body:has(#hud:not([hidden])) .header-actions{margin:0;gap:8px;pointer-events:auto}
body:has(#hud:not([hidden])) .header-actions #shopButton,body:has(#hud:not([hidden])) .red-gem-wallet{background:linear-gradient(140deg,#102d48,#041324);border:1px solid var(--hud-gold);border-radius:7px;height:42px;color:#f9d77f;min-width:96px}
#hud .score{position:fixed;left:184px;top:24px;transform:none;width:360px;height:80px;display:grid;grid-template-columns:1fr .8fr 1.4fr;gap:0;padding:12px 8px;background:linear-gradient(145deg,#102d48f5,#041324f5);border:1px solid var(--hud-gold);border-left:0;border-radius:0 12px 12px 0;box-shadow:0 4px 16px #0003;overflow:visible}
#hud .hud-metric{display:flex;flex-direction:column;justify-content:center;padding:0 14px;border-left:1px solid #997b3e99;min-width:0}
#hud .hud-metric:first-child{border:0}
#hud .hud-metric>small{font:600 9px/1.4 sans-serif;letter-spacing:1px;color:#d2deeb;white-space:nowrap}
#hud .hud-metric>strong,#hud .hud-metric .wallet{font:700 28px/1.2 'Space Grotesk',sans-serif;color:#f5ce72;font-variant-numeric:tabular-nums;margin:4px 0 0}
#hud .hud-metric .wallet{display:flex;gap:7px;align-items:center;padding:0;flex-wrap:nowrap}
#hud .hud-metric .wallet .currency-icon{width:24px;height:24px}
#hud .score .arena-conversion{position:absolute;top:79px;left:-90px;width:325px;background:#071b2ef5;border:1px solid var(--hud-line);border-top:0;border-radius:0 0 10px 10px;margin:0;padding:6px 12px;color:#ccdcea!important;font:10px/1.4 sans-serif!important;text-align:center}
#hud .score .current-run-wallet{position:absolute;top:111px;left:0;border:0;padding:4px 8px;gap:6px;background:#061a2dd9;border-radius:5px}
#hud .current-run-wallet strong{font-size:12px;color:#f5ce72}
#hud .current-run-wallet span{font-size:7px;max-width:none;color:#cad9e4;letter-spacing:.5px}
#hud #activePowers{position:absolute;top:153px;left:0;color:#edd38e;font-size:10px;max-width:330px}
#hud .score .ranked-hud{position:absolute;top:150px;left:-160px;width:170px;background:#061a2de8;border:1px solid var(--hud-line);border-radius:8px;padding:7px;margin:0}
#hud .score .ranked-ticket-wallet{position:absolute;top:111px;left:160px;color:#ef949d;font-size:11px;white-space:nowrap}
#hud .match-counter,#hud .crate-counter{background:linear-gradient(135deg,#102e4aee,#041526f5);border:1px solid var(--hud-gold);border-radius:9px;color:#f3d794;box-shadow:inset 0 0 0 3px #071929,0 3px 14px #0003;left:50%;max-width:calc(100vw - 32px);white-space:normal;text-align:center}
#hud .match-counter{top:24px;padding:12px 18px;font-size:15px}
#hud .crate-counter{top:83px;padding:8px 16px;font:12px/1.4 sans-serif}
#hud .leaders{right:24px;top:108px;width:220px;background:linear-gradient(145deg,#0c2942f2,#041526f2);border:1px solid var(--hud-gold);border-radius:12px;padding:14px;box-shadow:inset 0 0 0 3px #071929,0 4px 20px #0003;overflow:visible;max-height:none}
#hud .alive-count{color:#f7d67d;font-size:16px;letter-spacing:.5px;margin-bottom:10px}
#hud .leaders>small{color:#c9d8e6;font-size:8px}
#hud #leaderboard li{border-color:#aa8a4640;padding:5px 0;line-height:16px}
#hud #leaderboard .leader-kind{display:none}
#hud #leaderboard li::before,#hud #leaderboard .leader-score{grid-row:1}
#hud #leaderboard .leader-name{color:#edf3fa;font-size:12px}
#hud #leaderboard .leader-score{color:#f5d17e;font-size:12px}
#hud .minimap-dock{right:24px}
#hud .minimap-dock #map,#hud .game-performance{border-color:var(--hud-gold);background:#05192be8;border-radius:8px;box-shadow:inset 0 0 0 2px #071929}
#hud .game-performance{font-size:11px;color:#f7d67d;gap:10px}
#hud #upgrades{left:24px;bottom:max(24px,env(safe-area-inset-bottom));max-width:calc(100vw - 220px)}
#hud .upgrade-heading{display:none}
#hud #upgradeButtons{display:grid;grid-template-columns:repeat(4,136px);gap:8px}
#hud #upgradeButtons .upgrade{width:136px;min-height:76px;padding:9px 8px;background:linear-gradient(145deg,#102f4d,#041426);border:1px solid var(--hud-gold);border-radius:8px;color:#f7cd67;box-shadow:inset 0 0 0 3px #071929;opacity:1;text-align:left}
#hud .upgrade-top{display:flex;gap:6px;align-items:center;min-height:28px}
#hud .upgrade-icon{width:27px;height:27px;flex:0 0 27px;filter:drop-shadow(0 1px 1px #0007)}
#hud #upgradeButtons .upgrade strong{color:#eef4fc;font:600 9px/1.35 sans-serif;text-transform:uppercase;letter-spacing:.2px}
#hud .upgrade-meta{display:flex;justify-content:space-between;align-items:center;border-top:1px solid #997b3e66;margin-top:7px;padding-top:6px;gap:6px}
#hud #upgradeButtons .run-cost{display:flex;align-items:center;gap:3px;font:600 11px/1 monospace;margin:0;color:#f6ce72}
#hud .run-cost .currency-icon{width:16px;height:16px;margin:0}
#hud .run-level{color:#f0d591;font:10px/1 monospace;white-space:nowrap}
#hud .upgrade:disabled{filter:saturate(.6);border-color:#8a784e}
#hud .upgrade:not(:disabled):hover{background:#173d5d;box-shadow:inset 0 0 0 3px #071929,0 0 12px #e6bf6233}
#hud .upgrade:focus-visible{outline:2px solid #fff2ba;outline-offset:3px}
#hud .boost-status{bottom:28px;background:#061a2deb;color:#cbdcea;border-color:var(--hud-line);font-size:9px}
@media(max-width:1200px){
 #hud .score{left:24px;top:102px;width:310px;height:70px;border-left:1px solid var(--hud-gold);border-radius:9px}
 #hud .score .arena-conversion{top:69px;left:0;width:310px}
 #hud .score .current-run-wallet,#hud .score .ranked-ticket-wallet{top:102px}
 #hud .score .ranked-hud{left:0;top:138px}
 #hud .score #activePowers{top:194px}
 body:has(#hud:not([hidden])) header .game-brand{border-radius:9px}
 #hud .leaders{width:190px}
 #hud .hud-metric{padding:0 9px}
 #hud .hud-metric>strong,#hud .hud-metric .wallet{font-size:23px}
 #hud .boost-status{bottom:116px}
}
@media(max-width:650px){
 body:has(#hud:not([hidden]))>header{top:12px;left:12px;right:12px}
 body:has(#hud:not([hidden])) header .game-brand{width:110px;height:48px;padding:6px}
 body:has(#hud:not([hidden])) header .game-brand img{width:96px}
 body:has(#hud:not([hidden])) .header-actions #shopButton,body:has(#hud:not([hidden])) .red-gem-wallet{height:34px;min-width:66px;padding:0 8px;font-size:11px}
 #hud .score{left:12px;top:132px;width:calc(100vw - 175px);min-width:180px;height:63px;padding:8px 3px}
 #hud .hud-metric{padding:0 5px}
 #hud .hud-metric>small{font-size:7px;letter-spacing:0}
 #hud .hud-metric>strong,#hud .hud-metric .wallet{font-size:19px}
 #hud .hud-metric .wallet .currency-icon{width:17px;height:17px}
 #hud .score .arena-conversion{top:62px;width:100%;font-size:8px!important;padding:5px}
 #hud .score .current-run-wallet{top:97px;max-width:100%;padding:3px}
 #hud .current-run-wallet span{font-size:6px}
 #hud .score .ranked-ticket-wallet{left:0;top:123px;font-size:9px}
 #hud .score .ranked-hud{top:148px;width:150px}
 #hud .score #activePowers{top:208px;width:170px}
 #hud .match-counter{top:68px;font-size:11px;padding:6px 10px;width:max-content;max-width:95vw}
 #hud .crate-counter{top:101px;font-size:10px;padding:5px 10px}
 #hud .leaders{right:12px;top:132px;width:145px;padding:9px}
 #hud #leaderboard li{padding:3px 0;line-height:14px}
 #hud #leaderboard .leader-name,#hud #leaderboard .leader-score{font-size:10px}
 #hud .alive-count{font-size:12px;margin-bottom:7px}
 #hud .leaders>small{font-size:7px;letter-spacing:.3px}
 #hud #upgrades{left:12px;max-width:calc(100vw - 165px);bottom:16px}
 #hud #upgradeButtons{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 #hud #upgradeButtons .upgrade{width:100%;min-height:70px;padding:8px 6px}
 #hud .upgrade-icon{width:22px;height:22px;flex-basis:22px}
 #hud #upgradeButtons .upgrade strong{font-size:8px}
 #hud .minimap-dock{right:12px}
 #hud .boost-status{bottom:175px;font-size:7px;padding:6px 8px;max-width:90vw;white-space:normal;text-align:center}
}
@media(max-height:600px) and (min-width:651px){
 body:has(#hud:not([hidden]))>header{top:12px;left:12px;right:12px}
 body:has(#hud:not([hidden])) header .game-brand{width:125px;height:48px;padding:6px}
 body:has(#hud:not([hidden])) header .game-brand img{width:110px}
 body:has(#hud:not([hidden])) .header-actions #shopButton,body:has(#hud:not([hidden])) .red-gem-wallet{height:34px;min-width:72px;font-size:11px}
 #hud .score{left:12px;top:74px;width:270px;height:57px;padding:6px}
 #hud .hud-metric>strong,#hud .hud-metric .wallet{font-size:20px}
 #hud .score .arena-conversion{top:56px;width:270px;font-size:8px!important;padding:4px}
 #hud .score .current-run-wallet{top:83px}
 #hud .score .ranked-ticket-wallet{top:107px;left:0;font-size:9px}
 #hud .score .ranked-hud{top:131px;padding:4px;width:155px}
 #hud .match-counter{top:12px;font-size:11px;padding:8px 12px;max-width:260px}
 #hud .crate-counter{top:49px;font-size:10px;padding:5px 10px}
 #hud .leaders{right:12px;top:65px;width:150px;padding:8px}
 #hud #leaderboard li{padding:1px 0;line-height:12px}
 #hud #leaderboard .leader-name,#hud #leaderboard .leader-score{font-size:10px}
 #hud .alive-count{font-size:11px;margin-bottom:4px}
 #hud #leaderboard{margin-top:4px;margin-bottom:0}
 #hud .leaders>small{font-size:7px}
 #hud #upgrades{left:12px;bottom:16px;max-width:calc(100vw - 180px)}
 #hud #upgradeButtons{grid-template-columns:repeat(4,118px);gap:5px}
 #hud #upgradeButtons .upgrade{width:118px;min-height:67px;padding:6px}
 #hud .upgrade-icon{width:22px;height:22px;flex-basis:22px}
 #hud #upgradeButtons .upgrade strong{font-size:8px}
 #hud .boost-status{bottom:96px}
 #hud .minimap-dock{right:12px}
}
/* Small gold corner studs echo the approved royal frame without heavy artwork. */
#hud .leaders::before,#hud .leaders::after,#hud .upgrade::before,#hud .upgrade::after,#hud .match-counter::before,#hud .match-counter::after{content:'';position:absolute;width:5px;height:5px;background:#f1cc77;border:1px solid #fff0bd;transform:rotate(45deg);pointer-events:none}
#hud .leaders::before,#hud .upgrade::before,#hud .match-counter::before{left:1px;top:1px}
#hud .leaders::after,#hud .upgrade::after,#hud .match-counter::after{right:1px;bottom:1px}
#hud #upgradeButtons .upgrade{position:relative}
@media(min-width:651px) and (max-width:1600px){#hud .boost-status{bottom:114px}}
/* Approved visual fidelity: metallic artwork, readable typography, proportional desktop HUD. */
:root{--royal-scale:1}
#hud{position:fixed;left:0;top:0;width:calc(100vw / var(--royal-scale));height:calc(100dvh / var(--royal-scale));transform:scale(var(--royal-scale));transform-origin:top left;pointer-events:none;font-family:Arial,Helvetica,sans-serif}
body:has(#hud:not([hidden]))>header{top:calc(24px * var(--royal-scale));left:calc(24px * var(--royal-scale));right:auto;width:calc(100vw / var(--royal-scale) - 48px);transform:scale(var(--royal-scale));transform-origin:top left;font-family:Arial,Helvetica,sans-serif}
body:has(#hud:not([hidden])) header .game-brand,#hud .score,#hud .leaders,#hud .match-counter,#hud .crate-counter,#hud #upgradeButtons .upgrade,#hud .game-performance,#hud .minimap-dock #map,body:has(#hud:not([hidden])) .header-actions #shopButton,body:has(#hud:not([hidden])) .red-gem-wallet{border:8px solid transparent;border-image:url('/assets/hud-frame.png') 125 / 28px / 8px stretch;border-radius:0;background:radial-gradient(ellipse at 30% 0,#11365a,#061d34 60%,#031325);box-shadow:inset 0 0 18px #0005;box-sizing:border-box}
#hud .leaders::before,#hud .leaders::after,#hud .upgrade::before,#hud .upgrade::after,#hud .match-counter::after{display:none}
body:has(#hud:not([hidden])) header .game-brand{width:196px;height:88px;padding:5px}
body:has(#hud:not([hidden])) header .game-brand img{width:180px;max-height:78px}
#hud .score{left:220px;top:24px;width:420px;height:88px;padding:8px 6px;border-left-width:3px;grid-template-columns:1fr .9fr 1.4fr}
#hud .hud-metric{padding:0 16px;border-color:#d5ac5899}
#hud .hud-metric>small{font:600 11px/1.3 Arial,sans-serif;letter-spacing:.5px}
#hud .hud-metric>strong,#hud .hud-metric .wallet{font:700 34px/1.2 Georgia,serif;color:#fbd57c;text-shadow:0 2px 3px #000}
#hud .hud-metric .wallet .currency-icon{width:28px;height:28px}
#hud .score .arena-conversion{top:79px;left:-120px;width:380px;font:12px/1.4 Arial,sans-serif!important;padding:6px 8px;border-color:#d1ab58;color:#dce7f3!important}
#hud .score .current-run-wallet{display:none!important}
#hud .score #activePowers{top:126px;font:12px Arial,sans-serif}
#hud .score .ranked-ticket-wallet{top:115px;left:0;font:12px Arial,sans-serif}
#hud .score .ranked-hud{left:-196px;top:128px}
#hud .match-counter{top:24px;width:280px;min-height:74px;padding:7px 18px 8px 62px;font:600 13px/1.2 Arial,sans-serif;color:#e6eaf1;overflow:visible;text-align:center}
#hud .match-counter::before{display:block;content:'';position:absolute;left:-44px;top:-17px;width:100px;height:100px;background:url('/assets/hud-crest.png') center/contain no-repeat;transform:none;border:0}
#hud .match-timer-label{display:block;text-transform:uppercase;font:600 11px/1.2 Arial,sans-serif;letter-spacing:.5px;color:#edf1f6}
#hud .match-timer-value{display:block;font:700 36px/1.15 Georgia,serif;color:#ffda80;text-shadow:0 2px 3px #000;margin-top:3px}
#hud .crate-counter{top:110px;padding:4px 14px;font:600 12px/1.4 Arial,sans-serif;color:#f4d891}
body:has(#hud:not([hidden])) .header-actions #shopButton,body:has(#hud:not([hidden])) .red-gem-wallet{height:50px;min-width:125px;font:700 20px Georgia,serif;padding:4px 15px}
body:has(#hud:not([hidden])) .header-actions .currency-icon{width:27px;height:27px}
#hud .leaders{top:108px;right:24px;width:270px;padding:10px 12px 12px}
#hud .alive-count{font:700 19px/1.4 Georgia,serif;color:#ffe091;margin:1px 0 11px;padding:0 0 7px;border-bottom:1px solid #bca36855}
#hud .alive-count::before{content:'♛';font:26px Georgia,serif;color:#f9cb58;margin-right:10px}
#hud .leaders>small{display:none}
#hud .leader-columns{display:grid;grid-template-columns:18px 1fr 46px;gap:7px;font:10px Arial,sans-serif;color:#ccd8e5;padding:0 0 5px;border-bottom:1px solid #bca36855}
#hud .leader-columns span:last-child{text-align:right}
#hud #leaderboard{margin:0;padding:0}
#hud #leaderboard li{display:grid;grid-template-columns:18px 11px minmax(0,1fr) 42px;gap:6px;padding:6px 0;line-height:17px;border-color:#47627b66}
#hud #leaderboard li::before{grid-column:1;grid-row:1;font:12px Arial,sans-serif;color:#e3e8f2}
#hud #leaderboard .leader-dot{grid-column:2;grid-row:1;width:9px;height:9px;background:#9ee287;border-radius:50%;box-shadow:inset 0 1px 3px #ffffff88}
#hud #leaderboard li:nth-child(3n+2) .leader-dot{background:#79d2ec}
#hud #leaderboard li:nth-child(3n) .leader-dot{background:#b89bea}
#hud #leaderboard .leader-name{grid-column:3;grid-row:1;font:500 13px Arial,sans-serif}
#hud #leaderboard .leader-score{grid-column:4;grid-row:1;font:700 14px Georgia,serif;text-align:right;color:#ffdc84}
#hud #upgradeButtons{grid-template-columns:repeat(4,176px);gap:12px}
#hud #upgradeButtons .upgrade{width:176px;min-height:94px;padding:6px 8px;filter:none;cursor:pointer}
#hud #upgradeButtons .upgrade strong{font:700 11px/1.25 Arial,sans-serif;color:#f1f4fb;letter-spacing:.1px}
#hud .upgrade-top{gap:8px;min-height:39px}
#hud .upgrade-icon{width:38px;height:38px;flex:0 0 38px;object-fit:contain;filter:none}
#hud .upgrade-meta{margin-top:4px;padding-top:6px;border-color:#bca36888}
#hud #upgradeButtons .run-cost{font:700 13px/1 Arial,sans-serif;color:#ffda79}
#hud .run-cost .currency-icon{width:20px;height:20px}
#hud .run-level{font:600 12px/1 Arial,sans-serif;color:#ffda79}
#hud .upgrade:disabled{filter:saturate(.85);cursor:default}
#hud .game-performance{font:600 12px/1.4 Arial,sans-serif;gap:12px;padding:4px 8px;color:#ffdc82;box-sizing:content-box}
#hud .minimap-dock #map{width:192px;height:192px;padding:0}
#hud .boost-status{font:10px Arial,sans-serif;letter-spacing:.5px}
@media(min-width:1300px) and (min-height:700px){#hud .boost-status{bottom:28px;left:57%}}
@media(max-width:1299px){
 body:has(#hud:not([hidden])) header .game-brand{width:150px;height:66px}
 body:has(#hud:not([hidden])) header .game-brand img{width:132px}
 #hud .score{left:24px;top:104px;width:350px;height:76px}
 #hud .hud-metric>strong,#hud .hud-metric .wallet{font-size:29px}
 #hud .score .arena-conversion{top:67px;left:0;width:350px;font-size:10px!important}
 #hud .score .ranked-hud{left:0;top:128px}
 #hud .score .ranked-ticket-wallet{top:107px}
 #hud .match-counter{width:250px;min-height:66px;padding-left:50px}
 #hud .match-counter::before{left:-29px;width:80px;height:80px;top:-12px}
 #hud .match-timer-value{font-size:30px}
 #hud .crate-counter{top:99px}
 #hud .leaders{width:220px}
 #hud #leaderboard .leader-name{font-size:12px}
 #hud #upgradeButtons{grid-template-columns:repeat(4,140px);gap:8px}
 #hud #upgradeButtons .upgrade{width:140px;min-height:87px;padding:6px}
 #hud .upgrade-icon{width:32px;height:32px;flex-basis:32px}
 #hud #upgradeButtons .upgrade strong{font-size:9px}
 #hud .run-level{font-size:10px}
 #hud .minimap-dock #map{width:140px;height:140px}
}
@media(max-width:650px){
 body:has(#hud:not([hidden]))>header{top:12px;left:12px;width:calc(100vw - 24px)}
 body:has(#hud:not([hidden])) header .game-brand{width:110px;height:48px;padding:1px}
 body:has(#hud:not([hidden])) header .game-brand img{width:96px}
 body:has(#hud:not([hidden])) .header-actions #shopButton,body:has(#hud:not([hidden])) .red-gem-wallet{height:36px;min-width:68px;font-size:14px;padding:2px 6px}
 body:has(#hud:not([hidden])) .header-actions .currency-icon{width:19px;height:19px}
 #hud .score{left:12px;top:143px;width:calc(100vw - 180px);min-width:177px;height:64px;padding:3px 0}
 #hud .hud-metric{padding:0 4px}
 #hud .hud-metric>small{font-size:7px;letter-spacing:0}
 #hud .hud-metric>strong,#hud .hud-metric .wallet{font-size:21px}
 #hud .hud-metric .wallet .currency-icon{width:17px;height:17px}
 #hud .score .arena-conversion{top:55px;width:100%;font-size:9px!important}
 #hud .score .ranked-ticket-wallet{top:99px;font-size:10px}
 #hud .score .ranked-hud{top:123px;width:150px}
 #hud .score #activePowers{top:183px;font-size:10px;width:170px}
 #hud .match-counter{top:65px;width:240px;min-height:46px;padding:4px 8px 4px 32px}
 #hud .match-counter::before{width:54px;height:54px;left:-25px;top:-8px}
 #hud .match-timer-label{font-size:9px}
 #hud .match-timer-value{font-size:23px;margin:0}
 #hud .crate-counter{top:116px;padding:2px 8px;font-size:10px}
 #hud .leaders{top:143px;right:12px;width:150px;padding:5px}
 #hud .alive-count{font-size:12px;margin:0 0 4px;padding-bottom:4px}
 #hud .alive-count::before{font-size:17px;margin-right:4px}
 #hud .leader-columns{font-size:7px;grid-template-columns:10px 1fr 28px;gap:3px}
 #hud #leaderboard li{grid-template-columns:10px 6px minmax(0,1fr) 26px;gap:3px;line-height:13px;padding:4px 0}
 #hud #leaderboard li::before,#hud #leaderboard .leader-name,#hud #leaderboard .leader-score{font-size:9px}
 #hud #leaderboard .leader-dot{width:6px;height:6px}
 #hud #upgradeButtons{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
 #hud #upgradeButtons .upgrade{width:100%;min-height:77px;padding:3px}
 #hud .upgrade-top{gap:4px;min-height:29px}
 #hud .upgrade-icon{width:26px;height:26px;flex-basis:26px}
 #hud #upgradeButtons .upgrade strong{font-size:8px}
 #hud .upgrade-meta{gap:3px;margin-top:2px;padding-top:5px}
 #hud #upgradeButtons .run-cost{font-size:10px}
 #hud .run-cost .currency-icon{width:15px;height:15px}
 #hud .run-level{font-size:8px}
 #hud .minimap-dock #map{width:125px;height:125px}
 #hud .game-performance{font-size:10px;padding:2px 4px;gap:6px}
 #hud .boost-status{font-size:8px;bottom:183px}
}
@media(max-height:600px) and (min-width:651px){
 body:has(#hud:not([hidden]))>header{top:12px;left:12px;width:calc(100vw - 24px)}
 body:has(#hud:not([hidden])) header .game-brand{width:125px;height:48px}
 body:has(#hud:not([hidden])) header .game-brand img{width:110px}
 body:has(#hud:not([hidden])) .header-actions #shopButton,body:has(#hud:not([hidden])) .red-gem-wallet{height:34px;min-width:76px;font-size:14px}
 #hud .score{left:12px;top:74px;width:270px;height:57px;padding:2px}
 #hud .hud-metric{padding:0 5px}
 #hud .hud-metric>small{font-size:8px}
 #hud .hud-metric>strong,#hud .hud-metric .wallet{font-size:22px}
 #hud .score .arena-conversion{top:48px;width:270px;font-size:8px!important;padding:3px}
 #hud .score .ranked-ticket-wallet{top:80px;font-size:10px}
 #hud .score .ranked-hud{top:108px}
 #hud .match-counter{top:12px;width:230px;min-height:47px;padding:3px 8px 3px 30px}
 #hud .match-counter::before{width:60px;height:60px;left:-30px;top:-10px}
 #hud .match-timer-value{font-size:24px;margin:0}
 #hud .match-timer-label{font-size:9px}
 #hud .crate-counter{top:65px;font-size:9px;padding:1px 8px}
 #hud .leaders{top:65px;width:170px;padding:4px}
 #hud .alive-count{font-size:12px;margin:0 0 4px;padding:0 0 3px}
 #hud .alive-count::before{font-size:18px;margin-right:5px}
 #hud .leader-columns{font-size:8px;padding-bottom:3px}
 #hud #leaderboard li{line-height:12px;padding:1px 0;gap:3px;grid-template-columns:14px 7px minmax(0,1fr) 32px}
 #hud #leaderboard li::before,#hud #leaderboard .leader-name,#hud #leaderboard .leader-score{font-size:10px}
 #hud #leaderboard .leader-dot{width:6px;height:6px}
 #hud #upgradeButtons{grid-template-columns:repeat(4,130px);gap:6px}
 #hud #upgradeButtons .upgrade{width:130px;min-height:74px;padding:3px}
 #hud .upgrade-top{min-height:29px;gap:5px}
 #hud .upgrade-icon{width:28px;height:28px;flex-basis:28px}
 #hud #upgradeButtons .upgrade strong{font-size:8px}
 #hud .run-level{font-size:9px}
 #hud .upgrade-meta{margin-top:2px;padding-top:4px}
 #hud .minimap-dock #map{width:64px;height:64px}
 #hud .game-performance{font-size:10px;padding:2px 4px;gap:6px}
 #hud .boost-status{bottom:100px;font-size:9px}
}
@media(max-height:600px) and (min-width:651px){
 #hud .leaders{padding:3px}
 #hud .alive-count{font-size:11px;line-height:14px;margin:0 0 3px;padding-bottom:2px}
 #hud .alive-count::before{font-size:15px;line-height:14px}
 #hud .leader-columns{font-size:7px;line-height:9px;padding-bottom:2px}
 #hud #leaderboard li{padding:0;line-height:12px;min-height:13px}
 #hud #leaderboard li::before,#hud #leaderboard .leader-name,#hud #leaderboard .leader-score{font-size:9px;line-height:12px}
 #hud .game-performance{border-width:4px;font-size:9px;line-height:12px;padding:2px 4px}
}
/* Keep the navy fill inside the frame's padding edge, never under transparent gold corners. */
body:has(#hud:not([hidden])) header .game-brand,#hud .score,#hud .leaders,#hud .match-counter,#hud .crate-counter,#hud #upgradeButtons .upgrade,#hud .game-performance,#hud .minimap-dock #map,body:has(#hud:not([hidden])) .header-actions #shopButton,body:has(#hud:not([hidden])) .red-gem-wallet{background-clip:padding-box}
/* Center diagnostics on the map, with a continuous gold perimeter under the ornaments. */
#hud .minimap-dock .game-performance{align-self:center}
#hud .minimap-dock #map{outline:1px solid #e8c75f;outline-offset:-5px}
#hud .minimap-dock{align-items:center}
/* Clean lining digits with stable widths for all live numeric readouts. */
#hud .hud-metric>strong,#hud .hud-metric .wallet,#hud .match-timer-value,#hud .alive-count,#hud #leaderboard .leader-score,#hud .run-cost,#hud .run-level,#hud .game-performance,body:has(#hud:not([hidden])) .header-wallet-content b{font-family:Arial,Helvetica,sans-serif;font-variant-numeric:lining-nums tabular-nums;font-feature-settings:'lnum' 1,'tnum' 1;font-kerning:none;letter-spacing:0;text-shadow:none}

/* Shared account wallet and compact live effects. */
img{-webkit-user-drag:none;user-select:none}
.game-wallet{display:flex;align-items:center;gap:12px}
body:has(#hud:not([hidden])) .game-wallet{display:flex;align-items:center;gap:0;background:radial-gradient(ellipse at 30% 0,#11365a,#031325);border:8px solid transparent;border-image:url('/assets/hud-frame.png') 125 / 28px / 8px stretch;background-clip:padding-box;min-height:54px;padding:0 6px}
body:has(#hud:not([hidden])) .game-wallet #shopButton,body:has(#hud:not([hidden])) .game-wallet .red-gem-wallet{border:0;border-image:none;background:none;box-shadow:none;height:36px;min-width:105px;padding:0 12px}
body:has(#hud:not([hidden])) .game-wallet .red-gem-wallet{border-left:1px solid #bba06377;border-radius:0}
body:has(#hud:not([hidden])) .game-wallet #shopButton b{margin-left:0}
#hud .leaders{translate:0 calc(120px / var(--royal-scale))}
#hud .score #activePowers{display:flex;flex-direction:column;align-items:flex-start;gap:6px;width:190px;max-width:190px}
#hud .active-effect{display:grid;grid-template-columns:24px 1fr auto;align-items:center;gap:8px;width:180px;box-sizing:border-box;padding:6px 9px;border:1px solid #a58a4b80;border-radius:8px;background:linear-gradient(120deg,#102e46ed,#051726ed);color:#e8edf0;font:12px Arial,sans-serif}
#hud .effect-icon{display:grid;place-items:center;width:22px;height:22px;object-fit:contain;color:#ffdc7e;font-size:26px;font-weight:bold}
#hud .active-effect strong{font:700 12px Arial,sans-serif;color:#ffdc7e;font-variant-numeric:tabular-nums}
#hud .active-effect[data-effect=zone]{border-color:#e87979;color:#ffb7b7}
#hud .boost-status{display:flex;align-items:center;gap:10px;border:1px solid #ad8e4d;border-radius:10px;padding:8px 12px;min-width:175px;background:linear-gradient(125deg,#102e46ed,#051726ed);text-align:left;letter-spacing:0}
#hud .boost-icon{font:bold 30px/1 Arial;color:#ffdc7e}
#hud .boost-copy{display:flex;flex-direction:column;gap:3px;min-width:85px}
#hud .boost-copy strong{font:700 11px Arial;color:#f9da87}
#hud .boost-copy small{font:10px Arial;color:#c5d5df}
#hud .boost-status progress{width:48px;height:6px;accent-color:#f3ca6b}
@media(max-width:650px){body:has(#hud:not([hidden])) .game-wallet{min-height:36px;border-width:5px;padding:0 3px}body:has(#hud:not([hidden])) .game-wallet #shopButton,body:has(#hud:not([hidden])) .game-wallet .red-gem-wallet{min-width:65px;height:25px;padding:0 5px;font-size:13px}body:has(#hud:not([hidden])) .game-wallet .currency-icon{width:19px;height:19px}#hud .score #activePowers{width:155px}#hud .active-effect{width:150px;gap:5px;font-size:10px;padding:4px 6px}#hud .active-effect strong{font-size:10px}#hud .boost-status{min-width:0;padding:6px 9px;gap:6px}}
@media(max-height:600px){#hud .leaders{translate:none}#hud .active-effect{padding:2px 6px}#hud .score #activePowers{top:105px;gap:3px}}

@media(max-width:650px){#hud .boost-status{left:12px;transform:none;width:200px;box-sizing:border-box}#hud .boost-icon{font-size:22px}#hud .boost-copy{min-width:75px}}
