/* Administration workspace: scoped styles, no changes to public games. */
.admin-page{max-width:1180px;margin-inline:auto}
.admin-navigation{display:flex;flex-wrap:wrap;gap:.45rem;padding:.65rem 0;margin:1rem 0 1.5rem;border-block:1px solid rgba(140,150,165,.25)}
.admin-navigation a{display:inline-flex;align-items:center;min-height:42px;padding:.55rem .85rem;border-radius:.7rem;text-decoration:none;border:1px solid transparent}
.admin-navigation a.active{border-color:currentColor;font-weight:700}
.admin-page section[id="adminEconomy"],.admin-page section[id="adminSystem"]{padding:1rem;border:1px solid rgba(140,150,165,.25);border-radius:1rem}
@media(max-width:620px){.admin-navigation{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.admin-navigation a{justify-content:center;text-align:center}.admin-page{min-width:0}}

/* Distinct admin identity: restrained indigo/teal control-plane palette. */
body:has(.admin-page){--admin-accent:#64d9c5;--admin-ink:#d8e8f3;background:linear-gradient(180deg,#12243a 0,#111c2b 290px,#10151e 100%);color:var(--admin-ink)}
body:has(.admin-page) .site-header{background:#172b43;border-bottom:2px solid var(--admin-accent)}
body:has(.admin-page) .site-header .game-identity{display:none}
body:has(.admin-page) .admin-page>.eyebrow{color:var(--admin-accent);letter-spacing:.12em}
body:has(.admin-page) .admin-page>h1{color:#f2f8fc}
body:has(.admin-page) .admin-navigation{border-color:#365269;background:#17293d;padding:.65rem;border-radius:.85rem}
body:has(.admin-page) .admin-navigation a{color:#cbdbe7}
body:has(.admin-page) .admin-navigation a.active{color:#092a30;background:var(--admin-accent);border-color:var(--admin-accent)}
body:has(.admin-page) .admin-navigation a:hover:not(.active){background:#24425b}
body:has(.admin-page) #adminStatus{color:var(--admin-accent)}
body:has(.admin-page) .admin-page>section:not([hidden]){border-top:1px solid #365269;padding-top:1rem}
body:has(.admin-page) .admin-page a:focus-visible,body:has(.admin-page) .admin-navigation a:focus-visible{outline:3px solid var(--admin-accent);outline-offset:2px}
@media(prefers-reduced-motion:no-preference){body:has(.admin-page) .admin-navigation a{transition:background-color .15s ease,color .15s ease}}

/* Dedicated, compact administration header */
.admin-site-header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:56px;padding:8px 16px}.admin-site-header .publisher-logo{display:inline-flex;align-items:center;gap:8px;text-decoration:none}.admin-site-header .publisher-logo small{font-size:.72em;opacity:.7}.admin-header-actions{display:flex;align-items:center;gap:10px;min-width:0}.admin-header-actions #adminIdentity{font-size:.85rem;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.admin-navigation{display:flex;flex-wrap:wrap;gap:6px}@media(max-width:640px){.admin-site-header{padding:6px 10px;min-height:48px}.admin-header-actions{gap:6px}.admin-header-actions #adminIdentity{max-width:95px;font-size:.75rem}.admin-site-header .publisher-logo img{width:28px;height:30px}.admin-navigation{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:thin}}

/* Responsive administration menu */
.admin-menu-toggle{display:none;align-items:center;justify-content:center;border:1px solid #365269;background:#17293d;color:#f2f8fc;border-radius:9px;width:38px;height:38px;font-size:1.35rem;cursor:pointer}
@media(max-width:700px){
 body:has(.admin-page) .admin-site-header{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:6px;padding:7px 10px;min-height:52px}
 body:has(.admin-page) .admin-site-header .publisher-logo{min-width:0;white-space:nowrap;font-size:1rem;gap:5px}
 body:has(.admin-page) .admin-site-header .publisher-logo img{width:26px;height:28px}
 body:has(.admin-page) .admin-header-actions{flex:0 0 auto;gap:5px}
 body:has(.admin-page) .admin-header-actions #adminIdentity,body:has(.admin-page) .admin-header-actions #adminLogout{display:none}
 body:has(.admin-page) .admin-header-actions .lang-button{min-height:38px;padding:5px 8px}
 .admin-menu-toggle{display:inline-flex}
 body:has(.admin-page) .admin-navigation{display:none;flex-direction:column;flex-wrap:nowrap;overflow:visible;gap:3px;margin:8px 0 14px;padding:7px;border:1px solid #365269;border-radius:12px}
 body:has(.admin-page) .admin-navigation.mobile-open:not([hidden]){display:flex}
 body:has(.admin-page) .admin-navigation a{display:flex;justify-content:flex-start;min-height:40px;padding:8px 12px;font-size:.9rem;white-space:normal;text-align:left}
 body:has(.admin-page) .admin-page>h1{font-size:clamp(1.5rem,6vw,2.3rem)}
}

/* Admin header logo must not inherit absolute positioning from portal lockup. */
body:has(.admin-page) .admin-site-header .publisher-logo{position:relative;padding-left:0;display:inline-flex;align-items:center;gap:7px;flex-shrink:1;min-width:0}
body:has(.admin-page) .admin-site-header .publisher-logo img{position:static;left:auto;top:auto;transform:none;display:block;flex:0 0 auto;object-fit:contain}

/* Compact mobile admin with an overlay anchored to the header. */
.admin-mobile-account{display:none}
@media(max-width:700px){
 body:has(.admin-page) .admin-site-header{position:relative;z-index:30}
 body:has(.admin-page) .admin-page{position:relative;padding-top:12px}
 body:has(.admin-page) .admin-navigation{position:fixed;z-index:29;top:var(--admin-menu-top,72px);left:12px;right:12px;width:auto;max-height:calc(100dvh - var(--admin-menu-top,72px) - 16px);overflow-y:auto;margin:0;box-shadow:0 14px 35px #0009;background:#17293d}
 body:has(.admin-page) .admin-navigation.mobile-open:not([hidden]){display:flex}
 body:has(.admin-page) .admin-mobile-account{display:flex;flex-direction:column;align-items:stretch;gap:8px;padding:12px;border-top:1px solid #365269;margin-top:6px}
 body:has(.admin-page) #adminMobileIdentity{font-size:.8rem;overflow-wrap:anywhere;color:#cbdbe7}
 body:has(.admin-page) #adminMobileLogout{width:100%;min-height:38px}
 body:has(.admin-page) .admin-page>section{margin-top:0}
}

/* Unified administration palette across all six sections. */
body:has(.admin-page){--panel:#192b3d;--line:#365269;--muted:#b8cbd9;--lime:#64d9c5;accent-color:var(--admin-accent)}
body:has(.admin-page) .admin-page :is(#adminPlayers,#adminAccounts,#gameRegistry,#feedbackAdmin,#adminEconomy,#adminSystem){color:var(--admin-ink)}
body:has(.admin-page) .admin-page :is(#adminPlayers,#adminAccounts,#gameRegistry,#feedbackAdmin,#adminEconomy,#adminSystem) :is(h2,h3,strong,th,label){color:#f2f8fc}
body:has(.admin-page) .admin-page :is(#adminPlayers,#adminAccounts,#gameRegistry,#feedbackAdmin,#adminEconomy,#adminSystem) :is(p,.micro,small){color:#b8cbd9}
body:has(.admin-page) .admin-page :is(#adminPlayers,#adminAccounts,#gameRegistry,#feedbackAdmin,#adminEconomy,#adminSystem) :is(input,select,textarea){background:#101c2a;border-color:#52718a;color:#f2f8fc}
body:has(.admin-page) .admin-page :is(#adminPlayers,#adminAccounts,#gameRegistry,#feedbackAdmin,#adminEconomy,#adminSystem) :is(input,select,textarea)::placeholder{color:#9bb0c1}
body:has(.admin-page) .admin-page :is(#adminPlayers,#adminAccounts,#gameRegistry,#feedbackAdmin,#adminEconomy,#adminSystem) :is(input,select,textarea):focus-visible{outline:2px solid var(--admin-accent);outline-offset:2px}
body:has(.admin-page) .admin-page :is(#adminPlayers,#adminAccounts,#gameRegistry,#feedbackAdmin,#adminEconomy,#adminSystem) .button.primary{background:var(--admin-accent);border-color:var(--admin-accent);color:#092a30}
body:has(.admin-page) .admin-page :is(#adminPlayers,#adminAccounts,#gameRegistry,#feedbackAdmin,#adminEconomy,#adminSystem) .button.ghost{border-color:#52718a;color:#e0eff7;background:#22394d}
body:has(.admin-page) .admin-page :is(#adminPlayers,#adminAccounts,#gameRegistry,#feedbackAdmin,#adminEconomy,#adminSystem) :is(table,td,th){border-color:#365269}
body:has(.admin-page) .admin-page :is(#adminPlayers,#adminAccounts,#gameRegistry,#feedbackAdmin,#adminEconomy,#adminSystem) :is(a:not(.button)){color:var(--admin-accent)}
body:has(.admin-page) .admin-page :is(#adminPlayers,#adminAccounts,#gameRegistry,#feedbackAdmin,#adminEconomy,#adminSystem) :is(button,a):focus-visible{outline-color:var(--admin-accent)}

/* Header action order: language immediately before the rightmost menu. */
body:has(.admin-page) .admin-site-header .admin-header-actions{display:flex;flex-direction:row;align-items:center;justify-content:flex-end;margin-left:auto;gap:8px}
body:has(.admin-page) .admin-site-header #siteLang{flex:0 0 auto}
body:has(.admin-page) .admin-site-header #adminMenuToggle{flex:0 0 auto;margin:0}
@media(max-width:700px){body:has(.admin-page) .admin-site-header{width:100%;max-width:none}body:has(.admin-page) .admin-site-header .admin-header-actions{margin-left:auto;gap:6px}body:has(.admin-page) .admin-site-header #siteLang{min-width:44px}body:has(.admin-page) .admin-site-header #adminMenuToggle{display:inline-flex}}


/* Follow HTML order for the two mobile header controls. */
body:has(.admin-page) .admin-header-actions #siteLang,body:has(.admin-page) .admin-header-actions #adminMenuToggle{order:initial!important}

/* Single explicit admin action layout: language first, menu last. */
@media(max-width:700px){
 body:has(.admin-page) .admin-site-header .admin-header-actions{display:grid!important;grid-template-columns:auto auto;align-items:center;justify-content:end;column-gap:6px}
 body:has(.admin-page) .admin-site-header #siteLang{grid-column:1;grid-row:1;order:0!important;margin:0!important}
 body:has(.admin-page) .admin-site-header #adminMenuToggle{grid-column:2;grid-row:1;order:0!important;margin:0!important}
 body:has(.admin-page) .admin-site-header #adminIdentity,body:has(.admin-page) .admin-site-header #adminLogout{display:none!important}
}

/* Consistent compact navigation icons without increasing the menu height. */
.admin-navigation a[data-admin-tab]{display:inline-flex;align-items:center;gap:8px}
.admin-navigation .admin-nav-icon{display:inline-flex;align-items:center;justify-content:center;width:1.2em;flex:0 0 1.2em;font-size:1em;line-height:1;color:inherit;opacity:.8}

/* Dedicated shell: no public game navigation, footer or offline installation. */
.admin-footer{display:flex;flex-wrap:wrap;justify-content:space-between;gap:12px;max-width:1100px;margin:24px auto;padding:16px;color:var(--muted);font-size:.85rem}
.admin-footer div{display:flex;flex-wrap:wrap;gap:16px}
.admin-footer a{color:inherit}
.admin-wallet-transactions{list-style:none;padding:0}
.admin-wallet-accounts tbody tr{cursor:pointer}
.admin-wallet-accounts td{overflow-wrap:anywhere}
.admin-wallet-accounts td:last-child{text-align:right}
.admin-wallet-accounts .wallet-details-icon{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;min-width:28px;min-height:28px;padding:0;font-size:1rem;border-radius:6px}
.admin-wallet-accounts tbody tr:hover{background:#22394d}
#walletDialog{width:min(760px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow-y:auto;background:var(--panel);color:var(--admin-ink);border:1px solid var(--line);border-radius:14px;padding:16px}
.admin-wallet-dialog-header{display:flex;align-items:center;justify-content:space-between;gap:12px;position:sticky;top:0;background:var(--panel);z-index:1;padding-bottom:12px}
.admin-wallet-dialog-header h2{margin:0;font-size:1.5rem}
.admin-wallet-dialog-header form{margin:0}
#walletDialog::backdrop{background:#0009}
.admin-wallet-summary{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:12px}
.admin-wallet-summary div{padding:12px;border:1px solid var(--line);border-radius:10px}
.admin-wallet-summary dd{margin:8px 0 0;font-weight:700;font-size:1.2rem}
.admin-wallet-transactions li{padding:12px 0;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.admin-wallet-transactions p{margin:0 0 5px}
.admin-wallet-transactions{max-height:60vh;overflow-y:auto;overscroll-behavior:contain}
.admin-wallet-transactions:focus-visible{outline:2px solid var(--admin-accent);outline-offset:2px}
#walletAccount{overflow-wrap:anywhere}
@media(max-width:700px){
 body:has(.admin-page) .admin-site-header .admin-header-actions{grid-template-columns:auto}
 body:has(.admin-page) .admin-site-header #adminMenuToggle{grid-column:1}
 body:has(.admin-page) .admin-site-header #adminMenuToggle{min-width:44px;min-height:44px}
 body:has(.admin-page) .admin-page{max-width:100%;min-width:0;padding-left:12px;padding-right:12px}
 .admin-page .users-table{max-width:100%;overflow-x:auto}
 .admin-page input,.admin-page select{min-width:0;max-width:100%}
 .admin-page dialog{max-width:calc(100vw - 24px)}
}

.admin-wallet-icon-legend{display:flex;align-items:center;justify-content:flex-end;gap:8px;margin:8px 0;color:var(--muted);font-size:.85rem}
