#ranking-dialog{width:min(1160px,calc(100vw - 32px));max-height:92dvh;overflow:auto;padding:28px;background:linear-gradient(140deg,#15232e,#0d171f);border:1px solid #37545e;border-radius:16px;color:#dfebe9}
#ranking-dialog .ranking-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px;gap:16px}#ranking-dialog .ranking-heading h1{font-size:28px;margin:5px 0}#ranking-dialog .ranking-heading small{font-size:9px;letter-spacing:1.7px;color:#8da8ae}
#ranking-own.player-profile-card{display:block;padding:22px;background:linear-gradient(110deg,#20343d,#14222d);border:1px solid #49666b;border-radius:12px;margin:0 0 22px}
.profile-heading{display:flex;gap:18px;align-items:center}.profile-heading>.secondary-action{margin-left:auto}.profile-rank{width:76px;height:76px;flex:0 0 76px;display:grid;place-items:center;background:#0b192466;border-radius:12px}.profile-rank img{width:76px;height:76px;object-fit:contain}.profile-rank>span{font-size:54px;color:#9eb5b9}.profile-identity h2{font-size:26px;margin:3px 0 5px}.profile-identity>small{font-size:9px;letter-spacing:1.7px;color:#83d5bd}.profile-identity>span{font-size:12px;color:#b7c7c8}
.account-quick-stats:not([hidden]){display:flex;justify-content:space-between;gap:14px;flex-wrap:wrap;padding:11px 14px;margin:0 0 18px;border:1px solid #607b80;background:#142831;color:#dce9dd;font:12px system-ui}.account-quick-stats strong{color:#e8d5a6}
.profile-metrics{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:12px;border-top:1px solid #ffffff12;margin-top:18px;padding-top:18px}.profile-metric{display:flex;flex-direction:column;gap:6px;min-width:0}.profile-metric small{font-size:10px;color:#90a8af;white-space:normal}.profile-metric strong{font-size:21px;color:#e9e1bd}.profile-metric.own-trophies strong{color:#f0cf84}.profile-metric.own-leaves{margin:0;white-space:normal}.profile-metric.own-leaves strong{color:#d8a38c}.profile-progress{display:flex;align-items:center;gap:16px;margin-top:18px;font-size:11px;color:#aec4c6}.profile-progress progress{margin-left:auto;max-width:200px;width:28%;height:6px;accent-color:#91d4b7}
#ranking-dialog .ranking-tabs{display:flex;align-items:center;gap:8px;margin-bottom:14px;flex-wrap:wrap}#ranking-dialog .ranking-tabs select{margin-left:auto;background:#13252d;border:1px solid #4d696e;color:#e1e6d6;border-radius:6px;padding:10px;font:12px system-ui}#ranking-dialog .ranking-tabs [aria-pressed=true]{background:#2a474a;border-color:#81baa9;color:#ccf1df}#ranking-state{font-size:11px;color:#9bb5b9;margin:10px 0 16px}
#ranking-dialog .ranking-scroll{max-height:340px;overflow:auto;border:1px solid #ffffff12;border-radius:8px}#ranking-dialog table{border-collapse:collapse;width:100%;min-width:890px;font:12px system-ui}#ranking-dialog th{text-align:left;background:#0c1a22;padding:14px 12px;color:#8fb6b7;font-size:9px;text-transform:uppercase;letter-spacing:.7px;position:sticky;top:0;z-index:1;white-space:nowrap}#ranking-dialog td{padding:13px 12px;border-bottom:1px solid #ffffff09;white-space:nowrap}#ranking-dialog tbody tr:nth-child(even){background:#ffffff03}#ranking-dialog tbody tr:hover{background:#7cdfc008}.ladder-player strong{font-weight:600}.ladder-badge{width:32px;height:32px;object-fit:contain;vertical-align:middle;margin-right:8px}#ranking-dialog td.ladder-empty{height:105px;text-align:center;color:#99b2b8;white-space:normal}
#ranking-dialog .ranking-note{font-size:11px;color:#859fa6;margin:16px 0}.rank-guide,.ranking-rules{font-size:12px;color:#a7bfc2;border-top:1px solid #ffffff12;padding:12px 0}.rank-guide summary,.ranking-rules summary{cursor:pointer;color:#c7d3cd}.ranking-rules p{font-size:12px;line-height:1.8;max-width:95ch}#ranking-dialog .rank-tiers{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin:16px 0 5px}#ranking-dialog .rank-tiers>div{display:flex;flex-direction:column;align-items:center;gap:5px;padding:12px 3px;background:#0c1b23;border-radius:7px;border:1px solid #ffffff0c;border-bottom:2px solid var(--rank-color)}#ranking-dialog .rank-tiers img{width:64px;height:64px;object-fit:contain}#ranking-dialog .rank-tiers b{font-size:12px;color:var(--rank-color)}#ranking-dialog .rank-tiers small{font-size:10px;color:#99b4b9}
.account-dialog{width:min(460px,calc(100vw - 32px));max-height:92dvh;box-sizing:border-box;overflow-y:auto;padding:28px;border-radius:14px;background:#13232e;color:#e4eee9;border:1px solid #506c70;font:14px system-ui}.account-dialog::backdrop{background:#02090cbb;backdrop-filter:blur(5px)}.account-dialog header{display:flex;justify-content:space-between;align-items:center;gap:16px}.account-dialog header small{font-size:9px;letter-spacing:2px;color:#89c7b6}.account-dialog h2{margin:7px 0;font-size:24px}.account-dialog header button{padding:5px 12px;font-size:22px}.account-dialog button{border:1px solid #5b7478;border-radius:6px;background:#243b44;color:#e0e9df;padding:10px 14px;cursor:pointer}.account-tabs{display:flex;gap:8px;margin:20px 0}.account-tabs button{flex:1}.account-tabs [aria-pressed=true]{border-color:#9ad8bc;background:#314f4b}.account-dialog label{display:block;margin-top:15px}.account-dialog label[hidden],.account-dialog [hidden]{display:none!important}.account-dialog label span{display:block;font-size:11px;color:#a2babf;margin-bottom:7px}.account-dialog input,.account-dialog select{box-sizing:border-box;width:100%;padding:11px 12px;border:1px solid #425e68;border-radius:6px;background:#0b1923;color:#edf0e1;font:14px system-ui}.account-dialog input:focus,.account-dialog select:focus{outline:2px solid #88b9a3;outline-offset:1px}.account-dialog form>[type=submit]{width:100%;margin:7px 0;background:#b9d5b4;color:#142b23;font-weight:700}.account-dialog .account-help{font-size:11px;line-height:1.7;color:#8fa8ae;margin-top:16px}.account-status{font-size:12px;line-height:1.5;color:#eed3a1;min-height:1.5em}.account-dialog [data-logout]{width:100%;margin-top:12px}.account-dialog button:disabled{opacity:.5;cursor:default}
@media(max-width:760px){#ranking-dialog{padding:18px;width:calc(100vw - 24px)}#ranking-dialog .ranking-heading h1{font-size:23px}#ranking-own.player-profile-card{padding:15px}.profile-heading{gap:12px;flex-wrap:wrap}.profile-rank{width:58px;height:58px;flex-basis:58px}.profile-rank img{width:58px;height:58px}.profile-identity h2{font-size:22px}.profile-heading>.secondary-action{margin-left:0}.profile-metrics{grid-template-columns:repeat(3,minmax(0,1fr));row-gap:18px}.profile-metric strong{font-size:18px}.profile-progress{align-items:flex-start;flex-direction:column;gap:8px}.profile-progress progress{width:100%;max-width:none;margin-left:0}#ranking-dialog .ranking-tabs select{margin-left:0}#ranking-dialog .rank-tiers{grid-template-columns:repeat(3,minmax(0,1fr))}.account-dialog{padding:20px}}

/* Local SVG flags: no OS emoji-font dependency. */
.country-label{display:inline-flex;align-items:center;gap:8px;vertical-align:middle;line-height:1.4}.country-label .country-flag{display:inline-block;flex:0 0 24px;width:24px;height:18px;max-width:none;object-fit:contain;border-radius:2px;box-shadow:0 0 0 1px #ffffff25,0 2px 5px #0004;vertical-align:middle}.profile-nationality{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}
.account-mail-controls{display:grid;gap:12px;margin:14px 0}.account-mail-controls p{margin:0;font-size:12px;color:#a2babf}.account-mail-controls a{color:#bce5ff;font-size:13px}

/* Keep the ladder visible before the fold, especially for guests. */
#ranking-dialog{padding:22px 26px}
#ranking-dialog .ranking-heading{margin-bottom:13px}
#ranking-own.player-profile-card{padding:15px 18px;margin-bottom:14px}
#ranking-own.is-guest{display:grid;grid-template-columns:46px minmax(0,1fr) auto;align-items:center;gap:14px;background:linear-gradient(110deg,#18313a,#10212a)}
#ranking-own.is-guest .guest-rank-mark{display:grid;place-items:center;width:42px;height:42px;border:1px solid #7d9ea055;border-radius:50%;font:27px Georgia,serif;color:#b6d3d2}
#ranking-own.is-guest .profile-identity h2{margin:2px 0;font-size:18px}
#ranking-own.is-guest .profile-identity p{margin:2px 0 0;color:#b7c8c8;font:11px/1.4 system-ui}
#ranking-own.is-guest>.secondary-action{white-space:nowrap}
#ranking-dialog .profile-metrics{margin-top:12px;padding-top:12px}
#ranking-dialog .profile-progress{margin-top:11px}
#ranking-dialog .ranking-tabs{margin-bottom:5px}
#ranking-dialog .ranking-tabs select{min-width:175px}
#ranking-dialog .ranking-scroll{max-height:260px}
#ranking-dialog .ranking-note{margin:10px 0}
#ranking-dialog .ladder-empty-panel{min-height:152px;box-sizing:border-box;display:grid;place-items:center;padding:22px;border:1px solid #ffffff1c;background:linear-gradient(130deg,#10212a,#152a32)}
#ranking-dialog .ladder-empty-panel[hidden]{display:none}
#ranking-dialog .ladder-empty-content{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px}
#ranking-dialog .ladder-empty-content{text-align:center}
#ranking-dialog .ladder-empty-content strong{font:600 17px Georgia,serif;color:#e9dfc2}
#ranking-dialog .ladder-empty-content span{font:12px system-ui;color:#a9bfc1}
#ranking-dialog .ladder-empty-content button{margin-top:5px}
@media(max-width:760px){#ranking-dialog{padding:16px}#ranking-own.is-guest{grid-template-columns:36px minmax(0,1fr)}#ranking-own.is-guest .guest-rank-mark{width:34px;height:34px}#ranking-own.is-guest>.secondary-action{grid-column:2;justify-self:start}#ranking-dialog .ranking-tabs select{min-width:0}}
#trophy-dialog{width:min(760px,calc(100vw - 24px));max-height:90dvh;box-sizing:border-box;overflow:auto;padding:26px;background:linear-gradient(140deg,#15232e,#0d171f);border:1px solid #8a7048;border-radius:10px;color:#e9e4d6}
#trophy-dialog::backdrop{background:#02090cd9;backdrop-filter:blur(5px)}
#trophy-dialog header{display:flex;align-items:center;justify-content:space-between;gap:16px}
#trophy-dialog header small{font:10px system-ui;letter-spacing:2px;color:#d6bc80}
#trophy-dialog h2{margin:5px 0;font:small-caps 30px Georgia,serif}
#trophy-dialog .trophy-hint{font:12px/1.5 system-ui;color:#b4c4c3}
#trophy-dialog .trophy-filters{display:flex;gap:15px;flex-wrap:wrap;margin:22px 0}
#trophy-dialog .trophy-filters label{display:grid;gap:6px;flex:1 1 180px;font:11px system-ui;color:#a9c2c2}
#trophy-dialog select{width:100%;padding:10px;background:#0c1c24;border:1px solid #6d6c5b;color:#eee4c6}
#trophy-dialog .trophy-own{display:flex;align-items:center;justify-content:space-between;gap:15px;flex-wrap:wrap;padding:15px;border:1px solid #8a7048;background:#b1914b19;font:13px system-ui}
#trophy-dialog .trophy-own b{color:#ead081;font-size:21px}
#trophy-dialog .trophy-status{min-height:18px;color:#9db7b8;font:12px system-ui}
#trophy-dialog .trophy-scroll{max-height:42dvh;overflow:auto;border:1px solid #34464d}
#trophy-dialog table{width:100%;border-collapse:collapse;font:12px system-ui}
#trophy-dialog th,#trophy-dialog td{padding:11px 13px;border-bottom:1px solid #ffffff14;text-align:left}
#trophy-dialog th{position:sticky;top:0;background:#0c1a22;color:#d9bd81;font-size:10px;text-transform:uppercase}
#trophy-dialog td:nth-child(3){font-weight:700;color:#edcf81}
#trophy-dialog td img{width:28px;height:28px;object-fit:contain;vertical-align:middle;margin-right:9px}
