/* Accessible Slack-inspired application navigation, isolated from game content. */
:root {
  --side-bg:#ffffff;
  --side-surface:#fff8e9;
  --side-text:#172335;
  --side-muted:#5e6875;
  --side-border:#e6d9c5;
  --side-gold:#9a6a19;
  --side-hover:#f8edda;
  --side-active:#faedcd;
}
:root[data-theme-mode="dark"],:root[data-arena-mode="dark"]{
  --side-bg:#14233a;
  --side-surface:#1d304b;
  --side-text:#f4f7ff;
  --side-muted:#ced8e7;
  --side-border:#52637b;
  --side-gold:#f0c66a;
  --side-hover:#243c5b;
  --side-active:#2f4663;
}
body.app-has-sidebar{box-sizing:border-box;padding-left:264px!important;min-width:0}
body.app-has-sidebar.app-replace-header > header{display:none!important}
body.app-has-sidebar > main,body.app-has-sidebar > footer{max-width:1440px}
body.app-has-sidebar *{scroll-margin-top:75px}
.app-sidebar,.app-sidebar *,.app-sidebar-mobilebar,.app-sidebar-mobilebar *{box-sizing:border-box}
.app-sidebar{position:fixed;z-index:9500;top:0;left:0;bottom:0;width:264px;display:flex;flex-direction:column;
 background:var(--side-bg);color:var(--side-text);border-right:1px solid var(--side-border);
 box-shadow:3px 0 18px rgba(30,40,55,.04);font:500 14px/1.35 system-ui,-apple-system,"Segoe UI",sans-serif;
 overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}
.app-sidebar :is(a,button){font:inherit}
.app-sidebar a{color:var(--side-text)!important;text-decoration:none}
.app-sidebar a:hover{color:var(--side-text)!important}
.app-sidebar :is(a,button):focus-visible,.app-sidebar-mobilebar button:focus-visible{outline:3px solid var(--side-gold);outline-offset:2px}
.app-sidebar-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:22px 17px 17px;border-bottom:1px solid var(--side-border)}
.app-sidebar-brand{display:flex;align-items:center;gap:10px;font-size:15px!important;font-weight:850!important;letter-spacing:-.025em}
.app-sidebar-emblem{display:grid;place-items:center;flex:0 0 36px;width:36px;height:36px;border-radius:11px;
  background:#f1dcab;color:#402b0d;font-size:20px;font-weight:900}
.app-sidebar-close{display:none}
.app-sidebar-scroll{padding:18px 12px 22px;flex:1}
.app-sidebar-caption{font-size:10px;letter-spacing:.14em;text-transform:uppercase;color:var(--side-muted);font-weight:850;
 margin:8px 13px 12px}
.app-sidebar-nav{display:flex;flex-direction:column;gap:3px}
.app-sidebar-link{display:flex;align-items:center;gap:12px;width:100%;min-height:43px;border-radius:11px;
 padding:10px 12px;font-weight:720!important;white-space:normal;overflow-wrap:anywhere}
.app-sidebar-link:hover,.app-sidebar-add:hover,.app-sidebar-profile:hover{background:var(--side-hover)}
.app-sidebar-link[aria-current="page"]{background:var(--side-active);color:var(--side-gold)!important;font-weight:850!important}
.app-sidebar-link .side-icon{display:inline-grid;place-items:center;width:24px;flex:0 0 24px;font-size:18px}
.app-sidebar-divider{height:1px;background:var(--side-border);margin:17px 12px}
.app-sidebar-add{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;min-height:45px;width:100%;
 background:transparent;color:var(--side-text);border:1px solid var(--side-border);border-radius:12px;font-weight:800!important;cursor:pointer}
.app-sidebar-add .side-plus{width:27px;height:27px;display:grid;place-items:center;border-radius:8px;
 background:var(--side-surface);color:var(--side-gold);font-size:22px;font-weight:700}
.app-sidebar-more[hidden]{display:none}
.app-sidebar-more{padding-top:8px}
.app-sidebar-more .app-sidebar-link{font-weight:650!important}
.app-sidebar-upcoming{padding:9px 12px;font-size:12px;color:var(--side-muted);line-height:1.55}
.app-sidebar-bottom{padding:14px 12px 18px;border-top:1px solid var(--side-border);background:var(--side-bg)}
.app-sidebar-profile{display:flex;align-items:center;gap:11px;min-height:67px;padding:9px 10px;
 border:1px solid var(--side-border);border-radius:13px}
.app-sidebar-avatar{width:42px;height:42px;flex:0 0 42px;border-radius:13px;
 background:var(--side-surface);border:1px solid var(--side-border);display:grid;place-items:center;
 color:var(--side-gold);font-weight:850;font-size:18px;position:relative;overflow:hidden}
.app-sidebar-avatar img{width:100%;height:100%;object-fit:cover;position:absolute;inset:0}
.app-sidebar-avatar img[hidden]{display:none}
.app-sidebar-profile-text{min-width:0;flex:1}
.app-sidebar-profile-name{display:block;font-size:13px;font-weight:850;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.app-sidebar-profile-hint{display:block;margin-top:2px;font-size:11px;color:var(--side-muted)}
.app-sidebar-settings{padding:12px 3px 0}
.app-sidebar-settings .theme-controls{display:flex!important;align-items:center;gap:8px;justify-content:center;flex-wrap:wrap;width:100%!important}
.app-sidebar-settings .theme-icon-button,.app-sidebar-settings .theme-preferences-button{
 background:var(--side-surface)!important;color:var(--side-text)!important;border-color:var(--side-border)!important;
 border-radius:10px!important;margin:0!important;font-size:12px!important}
.app-sidebar-settings .theme-icon-button{min-width:42px!important}
.app-sidebar-settings .theme-preferences-button{flex:1}
.app-sidebar-overlay{display:none}
.app-sidebar-mobilebar{display:none}
@media(max-width:900px){
 body.app-has-sidebar{padding-left:0!important;padding-top:62px!important}
 .app-sidebar{width:min(288px,88vw);transform:translateX(-103%);visibility:hidden;transition:transform .2s ease,visibility .2s ease;box-shadow:8px 0 30px #0003}
 body.app-sidebar-open .app-sidebar{transform:translateX(0);visibility:visible}
 .app-sidebar-mobilebar{position:fixed;z-index:9400;inset:0 0 auto;display:flex;align-items:center;gap:14px;
 height:62px;padding:0 14px;background:var(--side-bg);border-bottom:1px solid var(--side-border);color:var(--side-text)}
 .app-sidebar-mobilebar .side-mobile-logo{font-weight:850;color:var(--side-text)!important;text-decoration:none;font-size:15px}
 .app-sidebar-toggle,.app-sidebar-close{display:grid;place-items:center;width:43px;height:43px;flex:0 0 43px;
 border:1px solid var(--side-border);border-radius:11px;background:var(--side-surface);
 color:var(--side-text);font-size:24px;font-weight:600;cursor:pointer}
 .app-sidebar-overlay{position:fixed;z-index:9450;inset:0;background:rgba(5,12,25,.52)}
 body.app-sidebar-open .app-sidebar-overlay:not([hidden]){display:block}
 body.app-sidebar-open{overflow:hidden}
 .app-sidebar-head .app-sidebar-close{display:grid}
 body.app-has-sidebar > main,body.app-has-sidebar > footer{width:100%;max-width:100%}
}
@media(prefers-reduced-motion:reduce){.app-sidebar{transition:none}}
/* Profile photo is stored in an owner-only private bucket. */
.profile-avatar-editor{margin:24px 0;border:1px solid var(--side-border);border-radius:16px;padding:20px;background:var(--side-bg);color:var(--side-text)}
.profile-avatar-editor h2{color:var(--side-gold);margin:0 0 8px}
.profile-avatar-editor p,.profile-avatar-editor small{color:var(--side-muted)}
.profile-avatar-editor .avatar-controls{display:flex;align-items:center;gap:17px;flex-wrap:wrap}
.profile-avatar-editor .avatar-preview{display:grid;place-items:center;flex:0 0 86px;width:86px;height:86px;
 border-radius:22px;background:var(--side-surface);border:2px solid var(--side-border);font-size:32px;
 font-weight:850;overflow:hidden;color:var(--side-gold)}
.profile-avatar-editor .avatar-preview img{width:100%;height:100%;object-fit:cover}
.profile-avatar-editor .avatar-preview img[hidden]{display:none}
.profile-avatar-editor input[type="file"]{max-width:100%;width:min(100%,270px);padding:9px}
.profile-avatar-editor button{margin:8px 8px 0 0}
.profile-avatar-editor #avatarNotice{min-height:24px}
