/* Constrain the lobby to the space left by the fixed sidebar, including Safari. */
body[data-page="lobby"] { overflow-y:auto; overflow-x:hidden; }
body[data-page="lobby"] main { min-width:0; }
body[data-page="lobby"] .content { width:min(1500px,100%); min-width:0; }
body[data-page="lobby"] .modes { min-width:0; }
@media(min-width:1101px) {
  body[data-page="lobby"] .topbar { position:relative; top:auto; right:auto; flex-wrap:wrap; justify-content:flex-end; padding:20px 25px 0; max-width:100%; }
  body[data-page="lobby"] .stat { min-width:0; max-width:100%; }
  body[data-page="lobby"] .stat b { overflow-wrap:anywhere; }
  body[data-page="lobby"] .stage { min-height:100dvh; box-sizing:border-box; padding:24px 20px; }
  body[data-page="lobby"] .modes { width:max-content; max-width:100%; box-sizing:border-box; overflow-x:auto; -webkit-overflow-scrolling:touch; }
}
.public-profile-overlay { position:fixed; inset:0; z-index:11000; align-items:center; justify-content:center; }
.public-profile-card { position:relative; width:min(560px,100%); padding:28px; }
.public-profile-card .modal-close-btn { position:absolute; top:16px; right:16px; }
.public-profile-card #ppTitle { margin:8px 48px 22px 0; padding:0; }
.public-profile-card #ppTitle::before { content:none; }
.public-profile-identity { display:flex; align-items:center; gap:18px; padding:18px; border:1px solid #385569; border-radius:16px; background:#08182c99; }
.public-profile-identity > div { min-width:0; }
.public-profile-avatar { width:80px; height:80px; flex:none; padding:8px; display:grid; place-items:center; border:2px solid #ffd43b; border-radius:50%; background:#071426; }
.public-profile-avatar img { width:100%; height:100%; object-fit:contain; image-rendering:pixelated; }
#ppNickname { font-size:22px; overflow-wrap:anywhere; }
.public-profile-league { color:#a9bfd7; font-size:12px; margin-top:8px; }
.public-profile-league strong { color:#ffd43b; margin-left:6px; }
#ppStatus { color:#a9bfd7; font-size:13px; margin:12px 0; }
#ppStatus:empty { display:none; }
.public-profile-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:18px 0; }
.public-profile-stats > div { display:flex; flex-direction:column; justify-content:space-between; gap:10px; padding:14px 8px; border:1px solid #304b60; border-radius:12px; background:#07142699; text-align:center; }
.public-profile-stats span { font-size:9px; color:#a9bfd7; font-weight:800; }
.public-profile-stats strong { font-size:21px; color:#38bdf8; }
.public-profile-collection { margin-top:18px; }
.public-profile-collection h3 { font-size:11px; color:#ffe798; letter-spacing:1px; margin-bottom:10px; }
.public-profile-collection > div { display:flex; gap:10px; flex-wrap:wrap; padding:14px; border:1px solid #304b60; border-radius:12px; background:#07142699; min-height:64px; }
.public-profile-collection .public-profile-badge { width:42px; height:42px; display:grid; place-items:center; border:1px solid #80662e; border-radius:50%; background:#173042; font-size:24px; }
.public-profile-badge img { width:75%; height:75%; object-fit:contain; }
.public-profile-empty { font-size:12px; color:#a9bfd7; align-self:center; }
@media(max-width:500px) { .public-profile-card { padding:20px; } .public-profile-identity { padding:12px; gap:12px; } .public-profile-avatar { width:64px; height:64px; } #ppNickname { font-size:20px; } }
/* Compact pilot summary: keep account data together without taking space from modes. */
body[data-page="lobby"] .sidebar-pilot-stats { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; padding-top:8px; border-top:1px solid #28465e; }
body[data-page="lobby"] .sidebar-pilot-stats .stat { display:flex; align-items:center; justify-content:flex-start; gap:7px; min-width:0; min-height:32px; padding:5px 7px; border:1px solid #263f54; border-radius:8px; background:#08192a; font-size:11px; }
body[data-page="lobby"] .sidebar-pilot-stats .stat img { width:19px!important; height:19px!important; display:block; object-fit:contain; }
body[data-page="lobby"] .sidebar-pilot-stats .stat b { min-width:0; overflow-wrap:anywhere; }
body[data-page="lobby"] .sidebar-pilot-stats .pilot-kart { grid-column:1/-1; padding:0 8px; }
body[data-page="lobby"] .sidebar-pilot-stats #previewContainer { flex:none; }
body[data-page="lobby"] .sidebar-pilot-stats #kartName { white-space:normal!important; font-size:11px!important; line-height:1.3; }
body[data-page="lobby"] .profile-top { transform:none!important; }
body[data-page="lobby"] .profile-top:focus-visible { outline:2px solid #ffd43b; outline-offset:4px; }
/* The shared emoji replacement uses margins and a source span: center its visible artwork. */
.badge-slot, .public-profile-collection .public-profile-badge { flex:none; box-sizing:border-box; line-height:1; }
.badge-slot > img, .public-profile-badge > img { display:block; width:72%!important; height:72%!important; object-fit:contain; margin:0; }
.badge-slot > .pk-icon, .public-profile-badge > .pk-icon { --pk-icon-size:30px; width:30px; height:30px; margin:0; display:block; }
.badge-slot > .pk-icon > img, .public-profile-badge > .pk-icon > img { width:100%; height:100%; object-fit:contain; }
.public-profile-collection .public-profile-badge { display:flex; align-items:center; justify-content:center; }
/* League standings use the same navy/gold card treatment as the other dialogs. */
#rankingModal .league-ranking-modal { width:min(600px,100%); padding:26px; max-height:calc(100dvh - 32px); }
#rankingModal .league-ranking-header { gap:10px; border-bottom:0; padding:0 0 18px; }
#rankingModal .league-eyebrow { color:#ffe58d; letter-spacing:2px; font-size:9px; font-weight:900; padding-right:48px; }
#rankingModal .modal-title { margin:0; font-size:25px; text-align:left; }
#rankingModal .modal-title::before { content:none; }
#rankingModal .league-description { margin:0 44px 6px 0; color:#9db3c9; font-size:12px; line-height:1.5; }
#rankingModal .league-switcher { width:100%; box-sizing:border-box; padding:12px; border-color:#5e5532!important; background:linear-gradient(120deg,#182f40,#0a182b)!important; }
#rankingModal .league-switcher button { color:#ffe58d; }
.league-title-block { min-width:0; text-align:center; }
#rankingLeagueTitle { font-size:16px; gap:8px; }
#rankingLeagueRange { display:block; margin-top:6px; color:#9db3c9; font-size:10px; }
.league-list-heading { display:flex; justify-content:space-between; color:#8ba5bc; letter-spacing:1px; font-size:9px; font-weight:800; padding:0 12px 10px; }
#rankingModal #rankingListContainer { min-height:100px; padding:0 2px 2px!important; }
#rankingModal .league-player-row { width:100%; flex-shrink:0; min-height:64px; text-align:left; font:inherit; padding:10px; }
#rankingModal .league-player-position { display:grid; place-items:center; flex:0 0 36px; height:36px; background:#152c40; border:1px solid #304b60; border-radius:10px; font-size:14px; }
#rankingModal .league-player-name { font-size:13px; line-height:1.4; }
#rankingModal .league-player-name small { display:block; margin-top:4px; font-size:8px; letter-spacing:1px; color:#ffe58d; }
#rankingModal .league-player-score { border:0; background:transparent; padding:6px; font-size:15px; }
#rankingModal .league-player-score .pk-icon { --pk-icon-size:20px; }
#rankingModal .league-player-row:focus-visible { outline:2px solid #ffe58d; outline-offset:-3px; }
@media(max-width:500px) { #rankingModal .league-ranking-modal { padding:18px; } #rankingModal .modal-title { font-size:21px; } #rankingModal .league-description { font-size:11px; } }
@media(max-height:650px) { body[data-page="lobby"] .sidebar-pilot-stats { gap:4px; padding-top:6px; } body[data-page="lobby"] .sidebar-pilot-stats .stat { min-height:26px; padding:3px 6px; } body[data-page="lobby"] .profile { padding:9px; } }

/* Normalize transparent padding in badge artwork without changing the source images. */
.badge-slot img[src$="insig_azalea.png"], .public-profile-badge img[src$="insig_azalea.png"] { transform:translate(0.00%,0.00%) scale(1.000); }
.badge-slot img[src$="insig_blackthorn.png"], .public-profile-badge img[src$="insig_blackthorn.png"] { transform:translate(0.00%,0.00%) scale(1.000); }
.badge-slot img[src$="insig_celadon.png"], .public-profile-badge img[src$="insig_celadon.png"] { transform:translate(0.00%,0.00%) scale(1.000); }
.badge-slot img[src$="insig_cerulean.png"], .public-profile-badge img[src$="insig_cerulean.png"] { transform:translate(1.00%,0.00%) scale(1.000); }
.badge-slot img[src$="insig_cianwood.png"], .public-profile-badge img[src$="insig_cianwood.png"] { transform:translate(0.00%,0.00%) scale(1.000); }
.badge-slot img[src$="insig_cinnabar.png"], .public-profile-badge img[src$="insig_cinnabar.png"] { transform:translate(0.00%,0.00%) scale(1.000); }
.badge-slot img[src$="insig_dewford.png"], .public-profile-badge img[src$="insig_dewford.png"] { transform:translate(0.00%,-1.09%) scale(1.087); }
.badge-slot img[src$="insig_ecruteak.png"], .public-profile-badge img[src$="insig_ecruteak.png"] { transform:translate(0.00%,0.00%) scale(1.000); }
.badge-slot img[src$="insig_fortree.png"], .public-profile-badge img[src$="insig_fortree.png"] { transform:translate(-2.38%,0.00%) scale(1.190); }
.badge-slot img[src$="insig_fuchsia.png"], .public-profile-badge img[src$="insig_fuchsia.png"] { transform:translate(-1.00%,0.00%) scale(1.000); }
.badge-slot img[src$="insig_goldenrod.png"], .public-profile-badge img[src$="insig_goldenrod.png"] { transform:translate(0.00%,0.00%) scale(1.000); }
.badge-slot img[src$="insig_lavaridge.png"], .public-profile-badge img[src$="insig_lavaridge.png"] { transform:translate(0.00%,-1.00%) scale(1.000); }
.badge-slot img[src$="insig_mahogany.png"], .public-profile-badge img[src$="insig_mahogany.png"] { transform:translate(0.00%,0.00%) scale(1.000); }
.badge-slot img[src$="insig_mauville.png"], .public-profile-badge img[src$="insig_mauville.png"] { transform:translate(0.00%,0.00%) scale(1.000); }
.badge-slot img[src$="insig_mossdeep.png"], .public-profile-badge img[src$="insig_mossdeep.png"] { transform:translate(-1.02%,-1.02%) scale(1.061); }
.badge-slot img[src$="insig_olivine.png"], .public-profile-badge img[src$="insig_olivine.png"] { transform:translate(0.00%,0.00%) scale(1.000); }
.badge-slot img[src$="insig_petalburg.png"], .public-profile-badge img[src$="insig_petalburg.png"] { transform:translate(-1.16%,-1.16%) scale(1.163); }
.badge-slot img[src$="insig_pewter.png"], .public-profile-badge img[src$="insig_pewter.png"] { transform:translate(0.00%,0.00%) scale(1.000); }
.badge-slot img[src$="insig_rustboro.png"], .public-profile-badge img[src$="insig_rustboro.png"] { transform:translate(1.02%,0.00%) scale(1.020); }
.badge-slot img[src$="insig_saffron.png"], .public-profile-badge img[src$="insig_saffron.png"] { transform:translate(-0.98%,0.00%) scale(1.000); }
.badge-slot img[src$="insig_sootopolis.png"], .public-profile-badge img[src$="insig_sootopolis.png"] { transform:translate(1.06%,-2.13%) scale(1.170); }
.badge-slot img[src$="insig_vermilion.png"], .public-profile-badge img[src$="insig_vermilion.png"] { transform:translate(0.00%,0.00%) scale(1.000); }
.badge-slot img[src$="insig_violet.png"], .public-profile-badge img[src$="insig_violet.png"] { transform:translate(0.00%,0.00%) scale(1.000); }
.badge-slot img[src$="insig_viridian.png"], .public-profile-badge img[src$="insig_viridian.png"] { transform:translate(0.00%,0.00%) scale(1.041); }
body[data-page="lobby"] .sidebar-pilot-stats .stat { height:32px; box-sizing:border-box; }
body[data-page="lobby"] .sidebar-pilot-stats .stat b { font-size:11px; }
body[data-page="lobby"] .sidebar-pilot-stats .pilot-kart { height:38px; }

/* Keep level beside the nickname and trophies beside the selected kart. */
.pilot-identity-copy { display:flex; flex-direction:column; justify-content:center; min-width:0; flex:1; }
.pilot-name-row { display:flex; align-items:center; justify-content:space-between; gap:8px; min-width:0; }
body[data-page="lobby"] .pilot-name-row #sideMenuNick { min-width:0; flex:1; }
body[data-page="lobby"] .pilot-name-row #topbarLevelStat { display:flex; align-items:center; gap:3px; height:auto; padding:0; border:0; background:none; backdrop-filter:none; flex:none; }
body[data-page="lobby"] .pilot-name-row #topbarLevelStat img { width:14px!important; height:14px!important; display:block; }
body[data-page="lobby"] .pilot-name-row #topbarLevelText { font-size:10px; white-space:nowrap; color:#ffe58d; }
body[data-page="lobby"] .sidebar-pilot-stats { grid-template-columns:minmax(0,.7fr) minmax(0,1.3fr); }
body[data-page="lobby"] .sidebar-pilot-stats .pilot-kart { grid-column:auto; height:38px; padding:0 4px; gap:3px; }
body[data-page="lobby"] .sidebar-pilot-stats .stat[title="Troféus da liga"] { height:38px; }
body[data-page="lobby"] .sidebar-pilot-stats #previewContainer { width:32px!important; height:32px!important; }
body[data-page="lobby"] .sidebar-pilot-stats #previewContainer canvas { width:32px!important; height:32px!important; }
body[data-page="lobby"] .sidebar-pilot-stats #kartName { font-size:10px!important; }

.pilot-profile-header { display:flex; align-items:center; gap:8px; min-width:0; }
body[data-page="lobby"] .pilot-profile-header .profile-top { flex:1; min-width:0; gap:8px; }
body[data-page="lobby"] .pilot-power-button { display:grid; place-items:center; flex:0 0 32px; width:32px; height:32px; min-height:32px; padding:0; border:1px solid #70404b; border-radius:9px; background:linear-gradient(145deg,#302132,#101c2d); cursor:pointer; transition:border-color .18s,background .18s; }
body[data-page="lobby"] .pilot-power-button:hover { border-color:#ff6070; background:#382535; }
body[data-page="lobby"] .pilot-power-button:focus-visible { outline:2px solid #ffe48a; outline-offset:3px; }
body[data-page="lobby"] .pilot-power-button svg { display:block; width:21px; height:21px; filter:drop-shadow(0 2px 3px #0006); }
