/* Elite AI — design system. Neutral black/white with a single calm accent. */
:root {
  --accent: #10b981;
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 35%, transparent);
  --bg: #f6f7f9; --surface: #ffffff; --surface-2: #f8fafc; --hover: #f2f4f7;
  --border: #e8eaee; --border-strong: #d9dce2;
  --text: #0b0b0f; --text-2: #3f4350; --muted: #6b7280;
  --chrome: #0a0a0c; --chrome-2: #141418; --chrome-text: #ededf0; --chrome-muted: #8b8f99; --chrome-border: #1f1f25;
  --danger: #e5484d; --warn: #f5a524;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 60px -12px rgba(16, 24, 40, .25);
  --top-h: 60px; --side-w: 248px;
  --font: 'Inter', 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
[data-theme='dark'] {
  --bg: #0a0a0c; --surface: #121215; --surface-2: #17171b; --hover: #1b1b20;
  --border: #222228; --border-strong: #2e2e36;
  --text: #f5f5f7; --text-2: #c9cbd2; --muted: #8f939d;
  --chrome: #0a0a0c; --chrome-2: #141418; --chrome-border: #1c1c22;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}
[dir='rtl'] { --font: 'IBM Plex Sans Arabic', 'Inter', system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14.5px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, textarea, select { font: inherit; color: inherit; }
.en { direction: ltr; unicode-bidi: isolate; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 14px; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[dir='rtl'] .flip { transform: scaleX(-1); }

/* ---------- buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 10px; font-weight: 600; font-size: 13.5px; transition: .15s; white-space: nowrap; }
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { opacity: .88; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(1.06); }
.btn-ghost { border: 1px solid var(--border); background: var(--surface); }
.btn-ghost:hover { background: var(--hover); }
.btn-danger { color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn-lg { height: 46px; padding: 0 22px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 10px; color: inherit; transition: .15s; }
.icon-btn:hover { background: var(--hover); }
.field { display: block; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--text-2); }
.field small { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.input { width: 100%; height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); outline: none; transition: .15s; }
textarea.input { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.6; }
.input:focus { border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 8%, transparent); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-size: 5px 5px; background-repeat: no-repeat; background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; padding-inline-end: 34px; }
[dir='rtl'] select.input { background-position: 18px 50%, 13px 50%; }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-inline-start: 40px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-left: 40px; padding-right: 40px; }
.pw-toggle { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 8px; display: inline-grid; place-items: center; color: var(--muted); transition: .15s; }
.pw-toggle:hover { color: var(--text); background: var(--hover); }
.forgot-link { font-size: 12.5px; font-weight: 600; color: #2563eb; }
[data-theme='dark'] .forgot-link { color: #60a5fa; }
.forgot-link:hover { text-decoration: underline; }

/* ---------- chips & badges */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.badge-elite { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.badge-coach { background: var(--text); color: var(--bg); border-color: var(--text); }
.badge-trial { color: #6d5bd0; background: color-mix(in srgb, #6d5bd0 10%, transparent); border-color: color-mix(in srgb, #6d5bd0 25%, transparent); }
.badge-expired { color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, transparent); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.badge-rank { font-family: Inter, sans-serif; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: inline-block; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.tab { height: 32px; padding: 0 14px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--muted); }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- avatar */
.av { --s: 36px; width: var(--s); height: var(--s); border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: calc(var(--s) * .38); color: #fff; overflow: hidden; background: #2a2a31; position: relative; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av-sm { --s: 28px; } .av-lg { --s: 56px; } .av-xl { --s: 96px; }

/* ---------- layout */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--top-h); background: var(--chrome); color: var(--chrome-text); display: flex; align-items: center; padding: 0 16px; gap: 12px; border-bottom: 1px solid var(--chrome-border); }
.brand { display: flex; align-items: center; gap: 10px; min-width: calc(var(--side-w) - 16px); font-weight: 800; letter-spacing: -.01em; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; background: #fff; color: #0a0a0c; display: grid; place-items: center; font-family: Inter, sans-serif; font-weight: 900; font-size: 17px; position: relative; overflow: hidden; }
.logo-mark img { width: 100%; height: 100%; object-fit: cover; }
.logo-mark .spark { position: absolute; top: 4px; right: 4px; width: 9px; height: 9px; color: var(--accent); }
.topnav { flex: 1; display: flex; justify-content: center; gap: 4px; }
.topnav a { height: 34px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--chrome-muted); transition: .15s; }
.topnav a:hover { color: var(--chrome-text); }
.topnav a.active { background: var(--chrome-2); color: #fff; box-shadow: inset 0 0 0 1px var(--chrome-border); }
.top-actions { display: flex; align-items: center; gap: 4px; }
.top-actions .icon-btn { color: var(--chrome-muted); }
.top-actions .icon-btn:hover { background: var(--chrome-2); color: #fff; }
.menu-trigger { display: none; }

.shell { display: flex; min-height: calc(100vh - var(--top-h)); }
.sidebar { width: var(--side-w); flex: none; background: var(--chrome); color: var(--chrome-text); padding: 14px 10px 24px; position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #26262c transparent; }
.side-group { margin-bottom: 18px; }
.side-title { font-size: 11.5px; font-weight: 700; color: var(--chrome-muted); text-transform: uppercase; letter-spacing: .06em; padding: 0 10px 6px; }
[dir='rtl'] .side-title { text-transform: none; letter-spacing: 0; }
.side-link { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 9px; color: #c9cbd2; font-size: 13.5px; font-weight: 500; transition: .12s; }
.side-link:hover { background: var(--chrome-2); color: #fff; }
.side-link.active { background: #1c1c22; color: #fff; }
.side-link.active svg { color: var(--accent); }
.side-link .count { margin-inline-start: auto; font-size: 11px; color: var(--chrome-muted); }
.side-link .lock { margin-inline-start: auto; width: 14px; height: 14px; color: var(--chrome-muted); }
.access-card { margin: 6px 4px 0; padding: 14px; border-radius: 12px; background: var(--chrome-2); border: 1px solid var(--chrome-border); }
.access-card .badge { background: transparent; }
.main { flex: 1; min-width: 0; padding: 24px 24px 80px; }
.page { max-width: 1080px; margin: 0 auto; }
.page-narrow { max-width: 760px; margin: 0 auto; }
.grid-feed { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.aside-col { position: sticky; top: calc(var(--top-h) + 24px); display: grid; gap: 16px; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-title { font-size: 14px; font-weight: 700; margin: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; margin-bottom: 18px; }
.page-head h1 { font-size: 20px; margin: 0; letter-spacing: -.01em; }
.section-title { font-size: 13px; font-weight: 700; color: var(--muted); margin: 26px 0 12px; }

/* ---------- feed */
.hero { position: relative; overflow: hidden; border-radius: var(--radius); background: #0a0a0c; color: #fff; padding: 28px; border: 1px solid #1c1c22; }
.hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(600px 240px at 85% -10%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%), radial-gradient(400px 200px at 0% 120%, rgba(255,255,255,.06), transparent 70%); pointer-events: none; }
.hero > * { position: relative; }
.hero h2 { margin: 6px 0 6px; font-size: 22px; letter-spacing: -.01em; }
.hero p { margin: 0; color: #a7abb5; max-width: 560px; }
.hero .eyebrow { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .04em; }
.hero-progress { height: 4px; border-radius: 4px; background: #24242a; overflow: hidden; margin: 16px 0 0; max-width: 360px; }
.hero-progress > i { display: block; height: 100%; background: var(--accent); }
.composer { display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: text; }
.composer .fake { flex: 1; color: var(--muted); }
.feed-tabs { display: flex; gap: 6px; margin: 18px 0 14px; overflow-x: auto; }
.post { padding: 20px; }
.post + .post { margin-top: 14px; }
.post-head { display: flex; align-items: center; gap: 12px; }
.post-meta { min-width: 0; flex: 1; }
.post-author { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.post-sub { font-size: 12px; color: var(--muted); }
.post-body { margin: 14px 0 0; white-space: pre-wrap; word-wrap: break-word; color: var(--text-2); font-size: 14.5px; }
.post-media { margin-top: 14px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.post-media img { width: 100%; max-height: 520px; object-fit: cover; cursor: zoom-in; }
.post-actions { display: flex; align-items: center; gap: 6px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.react { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 13px; transition: .15s; }
.react:hover { background: var(--hover); color: var(--text); }
.react.liked { color: #e5484d; }
.react.liked svg { fill: currentColor; animation: pop .35s ease; }
@keyframes pop { 40% { transform: scale(1.3); } }
.cat-pill { font-size: 11.5px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.cat-pill.win { color: var(--accent); }
.comments { margin-top: 12px; display: grid; gap: 12px; }
.comment { display: flex; gap: 10px; }
.comment-bubble { background: var(--surface-2); border: 1px solid var(--border); padding: 9px 12px; border-radius: 12px; flex: 1; min-width: 0; }
.comment-bubble b { font-size: 13px; }
.comment-bubble p { margin: 2px 0 0; white-space: pre-wrap; word-wrap: break-word; font-size: 13.5px; color: var(--text-2); }
.comment-form { display: flex; gap: 10px; align-items: center; }
.comment-form .input { height: 38px; border-radius: 999px; }
.event { display: flex; gap: 12px; align-items: center; }
.event + .event { margin-top: 12px; }
.datebox { width: 44px; height: 46px; border-radius: 10px; border: 1px solid var(--border); display: grid; place-items: center; text-align: center; line-height: 1.05; flex: none; background: var(--surface); }
.datebox b { font-size: 16px; display: block; }
.datebox span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; font-weight: 600; }
.mini-member { display: flex; align-items: center; gap: 10px; padding: 6px 0; }

/* ---------- course */
.course-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: center; padding: 32px; }
.course-hero h1 { font-size: 30px; line-height: 1.15; margin: 8px 0 10px; letter-spacing: -.02em; }
.ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; background: conic-gradient(var(--accent) calc(var(--p) * 1%), #24242a 0); display: grid; place-items: center; margin-inline-start: auto; }
.ring > div { width: 100px; height: 100px; border-radius: 50%; background: #0a0a0c; display: grid; place-items: center; text-align: center; line-height: 1.1; }
.ring b { font-size: 24px; font-family: Inter, sans-serif; }
.phase { margin-top: 30px; }
.phase-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.phase-num { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--text); color: var(--bg); font-weight: 800; font-family: Inter, sans-serif; flex: none; }
.phase-head h2 { font-size: 16.5px; margin: 0; line-height: 1.35; letter-spacing: -.01em; }
.phase-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.ep-card { overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s, border-color .2s; }
.ep-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.cover { position: relative; aspect-ratio: 16 / 9; background: #0b0b0e; overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-gen { position: absolute; inset: 0; padding: 18px; display: flex; flex-direction: column; justify-content: space-between; color: #fff; background: radial-gradient(420px 200px at 100% 0%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%), linear-gradient(160deg, #18181d, #0a0a0c 70%); }
.cover-gen::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(180deg, transparent, #000 60%); }
.cover-gen .big { font-family: Inter, sans-serif; font-weight: 900; font-size: 56px; line-height: 1; letter-spacing: -.04em; opacity: .95; }
.cover-gen .lbl { font-family: Inter, sans-serif; font-size: 11px; font-weight: 700; letter-spacing: .14em; color: #9da2ad; }
.cover .state { position: absolute; top: 12px; inset-inline-end: 12px; z-index: 2; }
.cover .lock-veil { position: absolute; inset: 0; background: rgba(5, 5, 7, .55); backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 1; color: #fff; }
.cover .lock-veil svg { width: 28px; height: 28px; }
.cover .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.12); z-index: 2; }
.cover .bar i { display: block; height: 100%; background: var(--accent); }
.cover .dur { position: absolute; bottom: 10px; inset-inline-start: 10px; z-index: 2; font-family: Inter, sans-serif; font-size: 11.5px; font-weight: 600; background: rgba(0,0,0,.6); color: #fff; padding: 2px 8px; border-radius: 6px; }
.ep-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ep-code { font-family: Inter, sans-serif; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.ep-title { font-weight: 700; font-size: 15px; line-height: 1.4; margin: 0; font-family: Inter, sans-serif; letter-spacing: -.01em; }
.ep-desc { color: var(--muted); font-size: 13.5px; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- player */
.player-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.video-wrap { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; border: 1px solid #1c1c22; }
.video-wrap video { width: 100%; height: 100%; display: block; background: #000; }
.video-veil { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #fff; padding: 24px; background: radial-gradient(500px 260px at 50% 0%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 70%), #0a0a0c; }
.video-veil h3 { margin: 12px 0 6px; font-size: 18px; }
.video-veil p { margin: 0 0 16px; color: #a7abb5; }
.ep-list a { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border); transition: .12s; }
.ep-list a:hover { background: var(--hover); }
.ep-list a.active { background: var(--accent-soft); }
.ep-list .n { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-family: Inter, sans-serif; font-size: 12px; font-weight: 700; background: var(--surface-2); border: 1px solid var(--border); flex: none; }
.ep-list .n.done { background: var(--accent); color: #fff; border-color: var(--accent); }
.ep-list .t { font-family: Inter, sans-serif; font-size: 13px; font-weight: 600; line-height: 1.35; }
.unlock-box { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 12px; border: 1px dashed var(--border-strong); background: var(--surface-2); }
.unlock-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }

/* ---------- lives */
.live-hero { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.countdown { display: flex; gap: 8px; font-family: Inter, sans-serif; }
.countdown div { min-width: 64px; padding: 10px 6px; border-radius: 12px; background: #16161b; border: 1px solid #24242a; text-align: center; }
.countdown b { display: block; font-size: 24px; line-height: 1; }
.countdown span { font-size: 10.5px; color: #8b8f99; text-transform: uppercase; letter-spacing: .08em; }
.live-now { display: inline-flex; align-items: center; gap: 6px; color: #ff5a5f; font-weight: 700; font-size: 12px; }
.live-now::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

/* ---------- chat */
.chat-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); height: calc(100vh - var(--top-h) - 48px); overflow: hidden; }
.chat-channels { border-inline-end: 1px solid var(--border); padding: 14px 10px; background: var(--surface-2); }
.chat-channels a { display: flex; gap: 8px; align-items: center; height: 36px; padding: 0 10px; border-radius: 9px; font-weight: 600; font-size: 13.5px; color: var(--text-2); }
.chat-channels a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.chat-main { display: flex; flex-direction: column; min-height: 0; }
.chat-head { padding: 14px 20px; border-bottom: 1px solid var(--border); font-weight: 700; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; }
.msg { display: flex; gap: 10px; max-width: 78%; }
.msg.mine { margin-inline-start: auto; flex-direction: row-reverse; }
.msg .bub { background: var(--surface-2); border: 1px solid var(--border); padding: 8px 12px; border-radius: 14px; min-width: 0; }
.msg.mine .bub { background: var(--text); color: var(--bg); border-color: var(--text); }
.msg .bub p { margin: 0; white-space: pre-wrap; word-wrap: break-word; }
.msg .who { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.msg .time { font-size: 10.5px; opacity: .55; margin-top: 3px; }
.msg img { border-radius: 10px; max-height: 280px; cursor: zoom-in; }
.msg audio { height: 36px; max-width: 260px; }
.msg.cont { margin-top: -1px; }
.msg.cont .av { visibility: hidden; }
.msg.cont .who { display: none; }
.msg-gap { height: 10px; }
.file-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: color-mix(in srgb, currentColor 8%, transparent); font-weight: 600; font-size: 13px; }
.chat-input { display: flex; gap: 8px; align-items: flex-end; padding: 12px 14px; border-top: 1px solid var(--border); }
.chat-input textarea { flex: 1; min-height: 42px; max-height: 140px; height: 42px; resize: none; padding: 10px 14px; border-radius: 12px; }
.rec-indicator { flex: 1; height: 42px; display: flex; align-items: center; gap: 10px; color: var(--danger); font-weight: 600; padding: 0 14px; }

/* ---------- leaderboard */
.ranks-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 20px; margin-top: 20px; }
.rank-item { display: flex; gap: 10px; align-items: center; }
.rank-ico { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-size: 12px; font-weight: 700; flex: none; font-family: Inter, sans-serif; }
.rank-item.on .rank-ico { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.rank-item b { display: block; font-size: 13px; font-family: Inter, sans-serif; }
.rank-item span { font-size: 11.5px; color: var(--muted); }
.rank-item:not(.on) b { color: var(--muted); font-weight: 600; }
.lb-row { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-top: 1px solid var(--border); }
.lb-row:first-child { border-top: 0; }
.lb-row.me { background: var(--accent-soft); }
.lb-pos { width: 28px; text-align: center; font-family: Inter, sans-serif; font-weight: 700; color: var(--muted); }
.medal { width: 26px; height: 26px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: #fff; }
.medal.m1 { background: linear-gradient(135deg, #f7d774, #d4a017); } .medal.m2 { background: linear-gradient(135deg, #e3e7ee, #9aa3b2); } .medal.m3 { background: linear-gradient(135deg, #f0b48a, #b8743f); }
.lb-score { font-family: Inter, sans-serif; font-weight: 700; }

/* ---------- profile / settings */
.profile-card { text-align: center; overflow: hidden; }
.profile-card .band { height: 84px; background: radial-gradient(300px 120px at 50% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent), var(--chrome); }
.profile-card .av-xl { margin: -48px auto 0; border: 4px solid var(--surface); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { padding: 18px; }
.stat b { display: block; font-size: 26px; font-family: Inter, sans-serif; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 12.5px; font-weight: 600; }

/* ---------- admin */
.admin-tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 18px; }
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: start; font-size: 11.5px; color: var(--muted); font-weight: 700; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 12.5px; letter-spacing: .02em; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.codes-box { padding: 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border-strong); }
.admin-ep { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 18px; padding: 18px; }
.admin-ep + .admin-ep { border-top: 1px solid var(--border); }
.admin-ep .cover { border-radius: 10px; }

/* ---------- auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); }
.auth-form { display: flex; flex-direction: column; justify-content: center; padding: 48px; }
.auth-form .inner { width: 100%; max-width: 380px; margin: 0 auto; }
.auth-form h1 { font-size: 28px; margin: 22px 0 4px; letter-spacing: -.02em; }
.auth-side { position: relative; overflow: hidden; background: #0a0a0c; color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 64px; }
.auth-side::before { content: ''; position: absolute; inset: 0; background: radial-gradient(700px 400px at 100% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 65%), linear-gradient(115deg, transparent 40%, rgba(255,255,255,.025) 50%, transparent 60%); }
.auth-side::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(circle at 70% 40%, #000, transparent 70%); }
.auth-side > * { position: relative; z-index: 1; }
.auth-side h2 { font-size: 46px; margin: 26px 0 10px; letter-spacing: -.03em; line-height: 1.05; font-family: Inter, sans-serif; }
.auth-side p { color: #a7abb5; font-size: 16px; max-width: 420px; margin: 0; }
.auth-top { display: flex; justify-content: space-between; align-items: center; }
.auth-lang { position: absolute; top: 20px; inset-inline-end: 20px; z-index: 2; }
.auth-feats { margin-top: 40px; display: grid; gap: 14px; }
.auth-feats div { display: flex; gap: 12px; align-items: center; color: #cfd2d8; }
.auth-feats svg { color: var(--accent); }
.form-error { color: var(--danger); font-size: 13px; min-height: 20px; margin: 8px 0 0; }

/* ---------- overlays */
.menu { position: absolute; z-index: 60; min-width: 230px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; }
.menu a, .menu button { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 10px; border-radius: 8px; font-size: 13.5px; text-align: start; }
.menu a:hover, .menu button:hover { background: var(--hover); }
.menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 0; }
.menu .danger { color: var(--danger); }
.modal-bg { position: fixed; inset: 0; z-index: 80; background: rgba(5, 5, 8, .55); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 20px; animation: fade .15s; }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); animation: rise .2s ease; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 18px 18px; }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.9); display: grid; place-items: center; padding: 30px; cursor: zoom-out; }
.lightbox img { max-height: 100%; border-radius: 10px; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 13.5px; box-shadow: var(--shadow-lg); animation: rise .2s; }
.toast.err { background: var(--danger); color: #fff; }
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty svg { width: 36px; height: 36px; margin: 0 auto 12px; opacity: .6; }
.lock-panel { text-align: center; padding: 44px 24px; }
.lock-panel .unlock-icon { margin: 0 auto 14px; width: 52px; height: 52px; border-radius: 14px; }
.lock-panel .unlock-icon svg { width: 24px; height: 24px; }
.lock-panel h3 { margin: 0 0 6px; font-size: 18px; }
.lock-panel p { margin: 0 auto 18px; color: var(--muted); max-width: 420px; }
.skel { background: linear-gradient(90deg, var(--surface-2), var(--hover), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); }
@keyframes sk { to { background-position: -200% 0; } }
.boot { min-height: 100vh; display: grid; place-items: center; background: #0a0a0c; }
.boot .logo-mark { width: 52px; height: 52px; font-size: 26px; border-radius: 14px; animation: breathe 1.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(.92); opacity: .7; } }

/* ---------- mobile */
.bottom-nav { display: none; }
@media (max-width: 1100px) {
  .grid-feed { grid-template-columns: minmax(0, 1fr); }
  .aside-col { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .player-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .topnav { display: none; }
  .menu-trigger { display: inline-grid; }
  .brand { min-width: 0; flex: 1; }
  .sidebar { position: fixed; top: var(--top-h); inset-inline-start: 0; z-index: 50; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  [dir='rtl'] .sidebar { transform: translateX(100%); }
  body.side-open .sidebar { transform: none; }
  .main { padding: 16px 14px 96px; }
  .course-hero { grid-template-columns: 1fr; padding: 24px; }
  .ring { margin: 0; }
  .ranks-grid { grid-template-columns: repeat(2, 1fr); }
  .chat-wrap { grid-template-columns: 1fr; height: calc(100vh - var(--top-h) - 120px); }
  .chat-channels { display: flex; gap: 4px; padding: 8px; border-inline-end: 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
  .chat-channels .side-title { display: none; }
  .admin-ep { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-form { padding: 32px 22px; }
  .live-hero { grid-template-columns: 1fr; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 45; background: var(--chrome); border-top: 1px solid var(--chrome-border); padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); }
  .bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--chrome-muted); padding: 4px 0; }
  .bottom-nav a.active { color: #fff; }
  .bottom-nav a.active svg { color: var(--accent); }
  .msg { max-width: 92%; }
}
