:root{
  --bg:#0d0f11;--surface:#15181a;--surface2:#1e2225;--panel:#121416;--panel-soft:#15181a;--line:rgba(63,224,197,.2);--line2:rgba(63,224,197,.38);--mint:#b9f1e5;
  --fg:#eef1f1;--muted:#a3adb0;--accent:#3fe0c5;--ink:#06201b;
  --win:#4ade80;--lose:#ef7a7f;--wait:#f0c674;
  --font:'Manrope',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  --gutter:clamp(16px,4vw,32px);--radius:18px;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{color-scheme:dark}
body{margin:0;min-height:100vh;display:flex;flex-direction:column;background:var(--bg);color:var(--fg);font:16px/1.55 var(--font);-webkit-font-smoothing:antialiased;overflow-x:hidden}
.antigravity{position:fixed;inset:0;z-index:-1;width:100%;height:100%;pointer-events:none}
h1,h2,h3,p{margin:0}
h1,h2,h3{line-height:1.2;font-weight:700;letter-spacing:-.01em}
a{color:inherit;text-decoration:none}
img{display:block}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:6px}
.muted{color:var(--muted)}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:9px;min-height:44px;padding:0 20px;border-radius:12px;border:0;background:var(--surface2);font-weight:700;font-size:15px;cursor:pointer;transition:background .15s}
.btn:hover{background:#272c30}
.btn:disabled{opacity:.55;cursor:default}
.btn img{width:20px;height:20px}
.btn-primary{background:var(--accent);color:var(--ink)}
.btn-primary:hover{background:#63e8d2}
.btn-primary img{filter:brightness(0) opacity(.8)}
.btn-small{min-height:38px;padding:0 14px;font-size:14px}
.btn-small img{width:16px;height:16px}
.btn-block{width:100%}
.icon-btn{display:grid;place-items:center;width:36px;height:36px;border:0;border-radius:10px;background:transparent;cursor:pointer;flex:none;transition:background .15s}
.icon-btn:hover{background:var(--surface2)}
.icon-btn img{width:18px;height:18px}

.status{display:inline-flex;align-items:center;gap:7px;font-size:14px;font-weight:500;color:var(--muted);white-space:nowrap}
.dot{width:7px;height:7px;border-radius:50%;background:#4a565c;flex:none}
[data-tone=on] .dot{background:var(--win)}
[data-tone=off] .dot{background:var(--lose)}
[data-tone=wait] .dot{background:var(--wait)}
.chev{width:7px;height:7px;border-right:1.6px solid var(--muted);border-bottom:1.6px solid var(--muted);flex:none;transition:transform .15s}
.chev.down{transform:rotate(45deg)}
.chev.up{transform:rotate(225deg)}
.avatar{width:32px;height:32px;border-radius:50%;background:var(--surface2);flex:none}

/* Panel */
.app{flex:1;display:grid;grid-template-columns:248px minmax(0,1fr);gap:clamp(24px,5vw,72px);width:100%;max-width:1180px;margin:0 auto;padding:24px var(--gutter)}
.side{position:sticky;top:24px;height:calc(100vh - 48px);display:flex;flex-direction:column;gap:22px}
.bot-button{display:flex;align-items:center;gap:12px;width:100%;padding:8px;border:0;border-radius:14px;background:transparent;cursor:pointer;text-align:left;transition:background .15s}
.bot-button:hover{background:var(--surface)}
.bot-button img{width:42px;height:42px;border-radius:13px;object-fit:cover;flex:none}
.bot-text{flex:1;min-width:0;display:flex;flex-direction:column;line-height:1.35}
.bot-text strong{font-size:16px}
.bot-text .status{font-size:13px}
.bot-button .chev{margin-right:6px}
.bot-menu{display:flex;align-items:center;gap:11px;padding:9px 12px;border-radius:11px;font-size:15px;font-weight:600;color:var(--muted)}
.bot-menu:hover{background:var(--surface);color:var(--fg)}
.bot-menu img{width:20px;height:20px;border-radius:5px}
.side-nav{flex:1;display:flex;flex-direction:column;gap:2px}
.nav-item{display:flex;align-items:center;gap:12px;width:100%;min-height:44px;padding:0 12px;border:0;border-radius:12px;background:transparent;color:var(--muted);font-weight:600;font-size:15px;cursor:pointer;text-align:left;white-space:nowrap;transition:color .15s,background .15s}
.nav-item:hover{color:var(--fg)}
.nav-item img{width:20px;height:20px;flex:none}
.nav-item[aria-current=page]{color:var(--fg);background:var(--surface)}
.side-user{display:flex;align-items:center;gap:10px;padding:0 4px}
.side-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px;font-weight:600}

.content{display:flex;flex-direction:column;gap:18px;min-width:0;max-width:760px;padding:16px 0 40px}
.panel-loading{padding:60px 0;text-align:center}
.page-head{display:flex;align-items:center;gap:14px;margin-bottom:10px}
.back{display:grid;place-items:center;width:34px;height:34px;border:0;border-radius:10px;background:var(--surface);color:var(--muted);font-size:18px;line-height:1;cursor:pointer;flex:none}
.back:hover{color:var(--fg)}
.guild-icon{display:grid;place-items:center;width:48px;height:48px;border-radius:14px;object-fit:cover;background:var(--surface2);font-weight:800;font-size:15px;flex:none}
.page-title{min-width:0}
.page-title h1{font-size:26px;overflow-wrap:anywhere}
.page-title p{color:var(--muted);font-size:15px}

.panel-card,.tile,.mod,.state-card{box-shadow:inset 0 0 0 1px var(--line)}
.side{border-right:1px solid var(--line);padding-right:18px}
.panel-card{display:flex;flex-direction:column;gap:14px;padding:24px;border-radius:var(--radius);background:var(--surface);min-width:0}
.tiles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0}
.tile{padding:20px 22px;border-radius:var(--radius);background:var(--surface);min-width:0}
.tile dt{color:var(--muted);font-size:14px}
.tile dd{margin:4px 0 0;font-size:28px;font-weight:700;line-height:1.2;letter-spacing:-.02em;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}

.chart-area{position:relative;padding-top:0}
.chart-max{display:none}
.chart-plot{display:flex;align-items:flex-end;gap:3px;height:150px}
.chart-col{flex:1;min-width:0;height:100%;display:flex;align-items:flex-end}
.chart-bar{display:block;width:100%;max-width:12px;margin:0 auto;border-radius:4px 4px 0 0;background:var(--accent);opacity:.85}
.chart-col:hover .chart-bar{opacity:1}
.chart-tip{position:absolute;top:-8px;transform:translateX(-50%);display:flex;flex-direction:column;padding:6px 10px;border-radius:9px;background:var(--surface2);font-size:13px;white-space:nowrap;pointer-events:none;z-index:2}
.chart-tip span{color:var(--muted)}
.chart-axis{display:flex;justify-content:space-between;font-size:13px;color:var(--muted);margin-top:10px}

.state-card{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center;padding:64px 22px;border-radius:var(--radius);background:var(--surface)}
.state-card>img{width:44px;height:44px;margin-bottom:8px}
.state-card h2{font-size:19px}
.state-card p{color:var(--muted);max-width:28em}
.state-card .btn{margin-top:14px}

.level-top{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.level-top strong{font-size:20px}
.progress{height:6px;border-radius:3px;background:var(--surface2);overflow:hidden}
.progress i{display:block;height:100%;border-radius:3px;background:var(--accent);transition:width .4s}

.segments{display:flex;gap:2px;align-self:flex-start;max-width:100%;overflow-x:auto;scrollbar-width:none}
.segments button{min-height:36px;padding:0 14px;border:0;border-radius:10px;background:transparent;color:var(--muted);font-weight:600;cursor:pointer;white-space:nowrap}
.segments button:hover{color:var(--fg)}
.segments button[aria-pressed=true]{background:var(--surface);color:var(--fg)}
.board{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:14px}
.board li{display:flex;align-items:center;gap:12px}
.board-rank{width:22px;text-align:center;font-weight:700;color:var(--muted);flex:none;font-variant-numeric:tabular-nums}
.board-rank.podium{color:var(--accent)}
.board-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
.board-value{color:var(--muted);font-variant-numeric:tabular-nums;white-space:nowrap;font-size:15px}

.mod-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(170px,1fr));gap:12px}
.mod{display:flex;flex-direction:column;align-items:flex-start;gap:14px;padding:20px;border:0;border-radius:var(--radius);background:var(--surface);font-weight:700;font-size:16px;cursor:pointer;text-align:left;transition:background .15s}
.mod:hover{background:var(--surface2)}
.mod img{width:28px;height:28px}

.field{width:100%;min-height:42px;padding:8px 12px;border-radius:11px;border:0;background:var(--surface2)}
textarea.field{resize:vertical}
.settings{gap:18px}
.setting{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,260px);align-items:center;gap:14px;font-size:15px}
.switch{appearance:none;justify-self:end;position:relative;width:42px;height:24px;margin:0;border-radius:12px;background:#333c41;cursor:pointer;transition:background .15s}
.switch::after{content:'';position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:#fff;transition:transform .15s}
.switch:checked{background:var(--accent)}
.switch:checked::after{transform:translateX(18px)}
.inline{display:flex;gap:6px;min-width:0}
.opt{display:flex;flex-direction:column;gap:6px;margin-bottom:12px;font-size:14px;font-weight:600}
.actions{display:flex;justify-content:flex-end}
.output{margin:0;padding:14px;border-radius:11px;background:var(--bg);white-space:pre-wrap;overflow-wrap:anywhere;font:14px/1.5 ui-monospace,Consolas,monospace}

.toast{position:fixed;left:50%;bottom:20px;transform:translateX(-50%);z-index:60;max-width:calc(100% - 32px);padding:10px 18px;border-radius:12px;background:var(--surface2);font-weight:600;font-size:15px}
.toast[data-tone=win]{color:var(--win)}
.toast[data-tone=lose]{color:var(--lose)}
.empty-page{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;min-height:100vh;padding:16px;text-align:center}
.empty-page h1{font-size:64px;font-weight:800}

@media (prefers-reduced-motion:reduce){*,*::before,*::after{transition:none!important}}

@media (max-width:820px){
  .app{grid-template-columns:minmax(0,1fr);gap:8px;padding:12px var(--gutter)}
  .side{position:static;height:auto;border-right:0;padding-right:0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px}
  .side-nav{grid-column:1/-1;grid-row:2;flex-direction:row;overflow-x:auto;scrollbar-width:none}
  .nav-item{flex:none;width:auto}
  .side-name{display:none}
  .side-user .btn-block{width:auto}
  .content{max-width:none}
}
@media (max-width:640px){
  .tiles{grid-template-columns:minmax(0,1fr)}
  .tile{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:16px 18px}
  .tile dd{margin:0;font-size:22px}
  .setting{grid-template-columns:minmax(0,1fr)}
  .switch{justify-self:start}
}
