:root {
  --bg: #060a14; --side: #090e1b; --card: #0c1322; --card2: #0f182b; --line: #18233a;
  --text: #e9eefb; --muted: #7f8ba6; --brand: #3d72ff; --gold: #f2b84b; --cyan: #39d0ff;
  --ok: #2ecc71; --bad: #ef4b4b; --warn: #f39c12; --radius: 16px;
}
* { box-sizing: border-box; }
html { scrollbar-color: #1c2740 var(--bg); }
body { margin: 0; color: var(--text); min-height: 100vh;
  font: 15px/1.55 "Segoe UI", system-ui, -apple-system, sans-serif;
  background: radial-gradient(900px 500px at 85% -5%, #1b2f7a38, transparent), radial-gradient(700px 400px at 0% 100%, #f2b84b10, transparent), var(--bg); }
a { color: var(--cyan); text-decoration: none; }
code { background: var(--card2); border: 1px solid var(--line); padding: 1px 6px; border-radius: 6px; }
.muted { color: var(--muted); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; cursor: pointer; padding: 10px 18px;
  border-radius: 12px; font: inherit; font-weight: 600; color: #fff; background: linear-gradient(135deg, var(--brand), #2a52c9); }
.btn:hover { filter: brightness(1.12); }
.btn.gold { background: linear-gradient(135deg, var(--gold), #d68f1e); color: #1a1205; }
.btn.ghost { background: #ffffff08; border-color: var(--line); color: var(--text); }
.btn.danger { background: linear-gradient(135deg, #ef4b4b, #b32a2a); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- cards & banner ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h3 { margin: 0 0 6px; font-size: 17px; }
.card > p, .card p.sub { color: var(--muted); margin: 0 0 12px; }
.banner { position: relative; overflow: hidden; border-radius: 22px; padding: 34px;
  background: linear-gradient(115deg, #1c3a9e 0%, #121c52 52%, #2c2415 100%); border: 1px solid #25397d; }
.banner::after { content: ""; position: absolute; right: -10px; top: 50%; transform: translateY(-50%); width: 340px; height: 340px;
  background: url(/logo.webp) center / contain no-repeat; mix-blend-mode: screen; opacity: .22; pointer-events: none; }
.hero-logo { width: 150px; height: 150px; object-fit: cover; border-radius: 50%; margin: 0 auto 10px; display: block;
  box-shadow: 0 0 40px #2fd3ff40; border: 1px solid #2a3f86; }
.logo-img { width: 34px; height: 34px; border-radius: 50%; vertical-align: middle; margin-right: 10px; object-fit: cover; border: 1px solid #2a3f86; }
.hero::after { display: none; }
.banner > * { position: relative; z-index: 1; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: #0b1b2f99; border: 1px solid #1f6e5a; color: #6ff0c3;
  border-radius: 999px; padding: 4px 14px; font-size: 13px; font-weight: 600; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #2ecc71; box-shadow: 0 0 8px #2ecc71; }
.banner h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.1; margin: 16px 0 10px; }
.banner h1 .grad { background: linear-gradient(135deg, #8db4ff, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.chip { background: #ffffff10; border: 1px solid #ffffff1f; color: var(--text); padding: 9px 16px; border-radius: 11px; font: inherit; font-weight: 600; cursor: pointer; }
.chip:hover { background: #ffffff1c; }
.chip.gold { background: linear-gradient(135deg, #5b8cff, var(--gold)); color: #0b0f1d; border-color: transparent; }

/* ---------- landing page ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
nav.top { display: flex; align-items: center; justify-content: space-between; padding: 18px 0; }
nav.top .logo, .logo { font-weight: 800; font-size: 20px; color: var(--text); }
nav.top .links { display: flex; gap: 10px; align-items: center; }
.hero { text-align: center; padding: 64px 24px; margin-top: 10px; }
.hero h1 { font-size: clamp(34px, 7vw, 60px); margin: 0 0 12px; background: linear-gradient(135deg, #fff, #8db4ff 60%, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: #b6c3e0; max-width: 560px; margin: 0 auto 26px; font-size: 18px; }
.hero .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
h2 { margin: 42px 0 16px; font-size: 24px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.game { display: flex; gap: 14px; }
.game img { width: 76px; height: 76px; border-radius: 16px; background: var(--card2); object-fit: cover; flex: none; border: 1px solid var(--line); }
.stats { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin: 8px 0 12px; }
.stats b { color: var(--text); }
.updates { display: grid; gap: 14px; }
.update-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.update h3 { margin: 0 0 8px; }
.update-text { color: #c5d0e8 !important; white-space: pre-wrap; word-break: break-word; margin: 0 !important; }
footer { text-align: center; color: var(--muted); padding: 50px 0 30px; font-size: 14px; }

/* ---------- dashboard shell ---------- */
.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--side); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 12px; gap: 14px; }
.brand { display: flex; gap: 12px; align-items: center; padding: 4px 6px 10px; color: var(--text); }
.brand .logo-c { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; flex: none; background: #000; border: 2px solid #2a3f86; }
.brand .logo-c img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand b { display: block; font-size: 15px; } .brand small { color: var(--muted); font-size: 12px; }
.side { display: flex; flex-direction: column; gap: 4px; }
.side button { display: flex; align-items: center; gap: 12px; text-align: left; background: transparent; border: 1px solid transparent;
  border-left: 3px solid transparent; color: #aab6d3; padding: 11px 12px; border-radius: 10px; font: inherit; font-weight: 500; cursor: pointer; }
.side button:hover { background: #ffffff08; color: var(--text); }
.side button.active { background: linear-gradient(90deg, #f2b84b22, #ffffff08); border-color: #f2b84b44; border-left-color: var(--gold); color: #fff; font-weight: 700; }
.side .badge { margin-left: auto; background: #3d72ff33; color: #9db8ff; font-size: 12px; border-radius: 999px; padding: 0 8px; }
.sidefoot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.user { display: flex; align-items: center; gap: 10px; }
.user img { width: 38px; height: 38px; border-radius: 50%; border: 2px solid #2a3f86; }
.user small { color: var(--muted); display: block; font-size: 12px; line-height: 1.2; }
.user b { display: block; line-height: 1.2; }
.user .out { margin-left: auto; background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 18px; }
.user .out:hover { color: var(--bad); }
.main { padding: 26px; min-width: 0; }
.panel { display: none; } .panel.active { display: block; }
.title { margin: 0 0 16px; font-size: 22px; }

.kpis { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin: 16px 0; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi .l { color: var(--muted); font-size: 13px; } .kpi .v { font-size: 32px; font-weight: 800; line-height: 1.2; margin-top: 4px; }
.kpi:nth-child(1) .v { color: #6b95ff; } .kpi:nth-child(2) .v { color: var(--cyan); } .kpi:nth-child(3) .v { color: #b48bff; }
.kpi:nth-child(4) .v { color: var(--bad); } .kpi:nth-child(5) .v { color: var(--gold); } .kpi:nth-child(6) .v { color: var(--ok); }
.cols { display: grid; gap: 16px; grid-template-columns: 1.5fr 1fr; align-items: start; }
.stack { display: grid; gap: 16px; }
.section-label { color: var(--gold); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; margin: 14px 0 6px; }
.barrow { display: grid; grid-template-columns: 1fr 1.6fr 40px; align-items: center; gap: 12px; padding: 5px 0; font-size: 14px; }
.track { height: 8px; background: #101a2e; border-radius: 999px; overflow: hidden; }
.fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--cyan)); }
.barrow.notif .fill { background: linear-gradient(90deg, var(--gold), #ff8a4c); }
.barrow .n { text-align: right; color: var(--muted); }
.listrow { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.listrow:last-child { border-bottom: 0; }
.tag { background: #3d72ff; color: #fff; font-size: 11px; padding: 1px 6px; border-radius: 5px; margin-left: 6px; }

/* ---------- forms & tables ---------- */
label { display: block; margin: 12px 0 4px; font-size: 13px; color: var(--muted); }
input, select, textarea { width: 100%; background: #08101f; border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 10px 12px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid #3d72ff66; border-color: #3d72ff; }
textarea { min-height: 140px; resize: vertical; }
.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
table { width: 100%; border-collapse: collapse; } th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- ban appeals ---------- */
.status { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.status.open { background: #f2b84b22; color: var(--gold); border: 1px solid #f2b84b55; }
.status.accepted { background: #2ecc7122; color: #6ff0a8; border: 1px solid #2ecc7155; }
.status.denied { background: #ef4b4b22; color: #ff8c8c; border: 1px solid #ef4b4b55; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; margin: 12px 0; }
.kv > div:nth-child(odd) { color: var(--muted); font-size: 13px; }
.kv code { user-select: all; }
.box { background: #08101f; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 8px 0; white-space: pre-wrap; word-break: break-word; }
.bubble { margin-bottom: 12px; max-width: 85%; padding: 10px 14px; border-radius: 12px; white-space: pre-wrap; word-break: break-word; }
.bubble.user { background: #16243b; border: 1px solid var(--line); }
.bubble.mod { margin-left: auto; background: #1d3a7a; }
.bubble small { display: block; color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.decision { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; margin-top: 8px; }
@media (max-width: 700px) { .kv, .decision { grid-template-columns: 1fr; } }

/* ---------- role picker ---------- */
.rolebox { border: 1px solid var(--line); border-radius: 12px; background: #08101f; padding: 10px; }
.rolebar { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.rolebar input { flex: 1; }
.rolebar .muted { white-space: nowrap; font-size: 13px; }
.rolelist { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; max-height: 220px; overflow-y: auto; }
.roleitem { display: flex; align-items: center; gap: 8px; margin: 0; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px;
  color: var(--text); font-size: 14px; cursor: pointer; background: var(--card); }
.roleitem:hover { border-color: #3d72ff88; }
.roleitem input { width: auto; }
.roleitem.on { border-color: var(--gold); background: #f2b84b14; }
.roleitem .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: #7f8ba6; }

/* ---------- ticket chat ---------- */
.chathead { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.chathead h3 { margin: 0; }
.chatlog { height: 400px; overflow-y: auto; background: #08101f; border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.msg { display: flex; gap: 10px; margin-bottom: 14px; }
.msg img { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.msg .meta { font-size: 13px; color: var(--muted); } .msg .meta b { color: var(--text); }
.msg .body { white-space: pre-wrap; word-break: break-word; }
.chatbar { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 10px; }

#toast { position: fixed; bottom: 20px; right: 20px; padding: 12px 18px; border-radius: 12px; background: var(--card2);
  border: 1px solid var(--line); display: none; z-index: 10; max-width: 340px; box-shadow: 0 10px 30px #0008; }
#toast.ok { border-color: var(--ok); } #toast.err { border-color: var(--bad); }
.center { text-align: center; padding: 100px 0; }

@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .side { flex-direction: row; flex-wrap: wrap; }
  .cols, .row { grid-template-columns: 1fr; }
  .banner::after { width: 200px; height: 200px; }
}
