/* ============================================================ tokens */
:root {
  --bg: #030604;
  --bg-2: #07100a;
  --panel: rgba(8, 20, 12, 0.82);
  --panel-solid: #08140c;
  --border: rgba(0, 255, 102, 0.18);
  --border-strong: rgba(0, 255, 102, 0.45);
  --text: #c9f7d6;
  --muted: #6f9c7c;
  --accent: #00ff66;
  --accent-2: #39ff14;
  --accent-ink: #001a0a;
  --danger: #ff4d6d;
  --warn: #ffd166;
  --glow: 0 0 18px rgba(0, 255, 102, 0.35);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
  --radius: 14px;
  --font: "JetBrains Mono", ui-monospace, "Cascadia Code", Consolas, "Courier New", monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #eef5ef;
  --bg-2: #e2ede4;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-solid: #ffffff;
  --border: rgba(0, 110, 45, 0.18);
  --border-strong: rgba(0, 130, 55, 0.5);
  --text: #0c2414;
  --muted: #4d6b56;
  --accent: #008f3a;
  --accent-2: #00a844;
  --accent-ink: #ffffff;
  --danger: #d0103a;
  --warn: #9a6a00;
  --glow: 0 0 0 transparent;
  --shadow: 0 8px 30px rgba(10, 60, 25, 0.12);
  color-scheme: light;
}

/* ============================================================ base */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(0, 255, 102, 0.09), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(0, 255, 102, 0.06), transparent 60%),
    linear-gradient(var(--bg), var(--bg-2));
  background-attachment: fixed;
  transition: background-color .3s, color .3s;
}
:root[data-theme="light"] body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(0, 170, 70, 0.10), transparent 60%),
    linear-gradient(var(--bg), var(--bg-2));
}
body::before { /* grid */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, rgba(0,0,0,.35), transparent 75%);
  opacity: .5;
}
.scanlines {
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply; opacity: .35;
}
:root[data-theme="light"] .scanlines { display: none; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
hr { border: 0; border-top: 1px dashed var(--border); margin: 18px 0; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.mono { font-family: var(--font); letter-spacing: .06em; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ============================================================ topbar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 20px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.2rem; }
.brand:hover { text-decoration: none; }
.brand-icon { color: var(--accent); display: grid; filter: drop-shadow(var(--glow)); }
body.is-playing .brand-icon { animation: pulse 1.6s ease-in-out infinite; }
.accent { color: var(--accent); animation: blink 1.1s steps(1) infinite; }

.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a {
  color: var(--muted); padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: .9rem; white-space: nowrap;
  transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: var(--border); text-decoration: none; }
.nav a.active { color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.nav a.nav-cta { border: 1px solid var(--border-strong); color: var(--accent); }

.top-tools { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.seg { display: flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button {
  font: inherit; font-size: .78rem; font-weight: 700; padding: 5px 9px; border: 0;
  background: transparent; color: var(--muted); cursor: pointer;
}
.seg button.active { background: var(--accent); color: var(--accent-ink); }
.icon-btn {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--border); border-radius: 8px; background: transparent;
  color: var(--text); cursor: pointer; font: inherit; transition: border-color .15s, color .15s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn.small { width: 28px; height: 28px; font-size: .8rem; }
.i-sun { display: none; }
:root[data-theme="light"] .i-sun { display: block; }
:root[data-theme="light"] .i-moon { display: none; }
.burger { display: none; }

.mini-play {
  display: flex; align-items: center; gap: 8px; max-width: 300px;
  font: inherit; font-size: .8rem; color: var(--text); cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 5px 12px 5px 6px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.mini-icon {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-size: .6rem; flex: none;
}
.mini-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================ layout */
.view { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 60px; outline: none; }
.page.enter { animation: rise .35s ease-out; }
.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  padding: 18px clamp(16px, 4vw, 40px); border-top: 1px solid var(--border);
  font-size: .8rem; color: var(--muted);
}
.card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); backdrop-filter: blur(6px);
}
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.page-head h1::before { content: "# "; color: var(--accent); }
.row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.row.center { justify-content: center; }
.grow { flex: 1; }
.empty { text-align: center; padding: 40px; color: var(--muted); }

/* ============================================================ buttons & inputs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-weight: 700; font-size: .9rem; cursor: pointer;
  padding: 10px 18px; border-radius: 10px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink);
  transition: transform .1s, box-shadow .15s, background .15s, opacity .15s;
}
.btn:hover { box-shadow: var(--glow); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.small { padding: 6px 12px; font-size: .8rem; border-radius: 8px; }
.btn.wide { width: 100%; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: var(--danger); color: #fff; box-shadow: none; }
.link-btn { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }

.input {
  width: 100%; font: inherit; color: var(--text);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
textarea.input { resize: vertical; min-height: 80px; }
select.input { cursor: pointer; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.pw-wrap { position: relative; display: block; width: 100%; }
.pw-wrap .input { padding-right: 44px; }
.pw-toggle {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer;
  transition: color .15s, background .15s;
}
.pw-toggle:hover { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pw-wrap.revealed .pw-toggle { color: var(--accent); }
.pw-wrap.revealed .input { border-color: var(--border-strong); letter-spacing: .04em; }
/* thin bar that drains while the password is visible */
.pw-wrap.revealed::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: 3px; height: 2px; border-radius: 1px;
  background: var(--accent); transform-origin: left; animation: pw-drain 5s linear forwards;
}
@keyframes pw-drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.modal .pw-wrap { margin: 10px 0; }
.modal .pw-wrap .input { margin: 0; }
.field-label { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.field-hint { font-size: .75rem; color: var(--muted); }
.form-error {
  border: 1px solid var(--danger); color: var(--danger); border-radius: 10px;
  padding: 9px 12px; margin-bottom: 14px; font-size: .85rem;
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}
.color-input { width: 64px; height: 42px; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: transparent; cursor: pointer; }
.check { display: flex; align-items: center; gap: 10px; margin: 16px 0; cursor: pointer; font-size: .9rem; }
.check input { accent-color: var(--accent); width: 18px; height: 18px; }

.chip {
  display: inline-block; font-size: .72rem; font-weight: 700; padding: 3px 9px;
  border-radius: 999px; border: 1px solid var(--border-strong); color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent); white-space: nowrap;
}
.chip-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, transparent); background: color-mix(in srgb, var(--warn) 8%, transparent); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.live-dot { background: #ff3355; box-shadow: 0 0 10px #ff3355; animation: pulse 1.4s infinite; }

/* ============================================================ hero */
.hero { margin-bottom: 28px; }
.glitch {
  position: relative; display: inline-block; margin: 0;
  font-size: clamp(2.4rem, 7vw, 4.6rem); font-weight: 800; letter-spacing: -.02em;
  color: var(--accent); text-shadow: var(--glow);
}
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none;
}
.glitch::before { color: var(--kuban-blue); clip-path: inset(0 0 67% 0); animation: glitch-flash 4.2s infinite steps(1); opacity: 0; }
.glitch::after { color: var(--kuban-crimson); clip-path: inset(33% 0 33% 0); animation: glitch-flash 4.2s infinite steps(1); animation-delay: -.07s; opacity: 0; }
/* The tricolour only shows during the brief glitch flashes, or when you hover the logo. */
.glitch:hover::before, .glitch:hover::after { animation: none; opacity: .8; transition: opacity .3s; }
.glitch:hover::before { transform: translate(2px, 0); }
.glitch:hover::after { transform: translate(-2px, 0); }
:root[data-theme="light"] .glitch:hover::before, :root[data-theme="light"] .glitch:hover::after { opacity: .6; }
.tagline { color: var(--muted); margin: 6px 0 0; }
.prompt { color: var(--accent); }
.cursor { color: var(--accent); animation: blink 1s steps(1) infinite; margin-left: 2px; }

/* ============================================================ player */
.player-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 22px; align-items: start; }
.deck { position: relative; overflow: hidden; }
.deck::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 25%, transparent), transparent 40%);
  opacity: .4;
}
.deck-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: .82rem; }
.status {
  font-weight: 800; letter-spacing: .15em; font-size: .75rem; padding: 4px 10px; border-radius: 6px;
  border: 1px solid var(--border); color: var(--muted);
}
.status.on { color: #fff; background: #e0133f; border-color: #e0133f; box-shadow: 0 0 16px rgba(255, 30, 70, .5); }
.deck-channel { display: flex; align-items: center; gap: 12px; font-size: 1.5rem; font-weight: 800; margin-bottom: 16px; flex-wrap: wrap; }
.screen {
  position: relative; border-radius: 12px; padding: 18px 18px 0;
  background: color-mix(in srgb, #000 55%, transparent); border: 1px solid var(--border-strong);
  box-shadow: inset 0 0 40px rgba(0, 255, 102, .08);
  overflow: hidden;
}
:root[data-theme="light"] .screen { background: #0b1a10; color: #c9f7d6; --accent: #00ff66; }
.screen-label { font-size: .72rem; color: var(--accent); letter-spacing: .15em; text-transform: uppercase; opacity: .8; }
.np-title { font-size: clamp(1.2rem, 2.6vw, 1.7rem); font-weight: 800; margin-top: 8px; color: var(--accent); text-shadow: var(--glow); min-height: 1.3em; overflow-wrap: anywhere; }
:root[data-theme="light"] .np-title { text-shadow: 0 0 14px rgba(0,255,102,.4); }
.np-artist { color: #9fd9b0; min-height: 1.5em; margin-top: 2px; }
.viz { display: block; width: 100%; height: 110px; margin-top: 12px; }
.controls { display: flex; align-items: center; gap: 24px; margin: 22px 0 8px; flex-wrap: wrap; }
.play-btn {
  position: relative; width: 76px; height: 76px; border-radius: 50%; cursor: pointer; flex: none;
  border: 2px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  box-shadow: var(--glow); transition: transform .12s;
}
.play-btn:hover { transform: scale(1.05); }
.play-btn.playing { background: transparent; color: var(--accent); animation: ring 2s infinite; }
.ico-play { position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%); width: 0; height: 0; border-left: 22px solid currentColor; border-top: 14px solid transparent; border-bottom: 14px solid transparent; }
.ico-pause { display: none; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 22px; height: 26px; border-left: 7px solid currentColor; border-right: 7px solid currentColor; }
.play-btn.playing .ico-play { display: none; }
.play-btn.playing .ico-pause { display: block; }
.volume { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 160px; }
.volume input { flex: 1; accent-color: var(--accent); cursor: pointer; }
.history { margin-top: 18px; }
.history ol { list-style: none; padding: 0; margin: 0; }
.history li { padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: .88rem; overflow-wrap: anywhere; }
.history li:last-child { border: 0; }
.h-time { color: var(--muted); margin-right: 10px; font-size: .78rem; }
.h-artist { color: var(--accent); }

.side { display: flex; flex-direction: column; gap: 22px; }
.channels { display: flex; flex-direction: column; gap: 8px; }
.channel {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  font: inherit; color: var(--text); cursor: pointer;
  padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border); background: transparent;
  transition: border-color .15s, background .15s, transform .1s;
}
.channel:hover { border-color: var(--border-strong); transform: translateX(3px); }
.channel.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ch-body { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.ch-name { font-weight: 700; }
.ch-genre { font-size: .75rem; color: var(--muted); }
.ch-count { font-size: .75rem; color: var(--accent); }
.ch-eq { display: flex; align-items: flex-end; gap: 2px; width: 16px; height: 16px; flex: none; }
.ch-eq i { flex: 1; height: 25%; background: var(--muted); border-radius: 1px; }
.channel.active .ch-eq i { background: var(--accent); }
.channel.live .ch-eq i { animation: eq .9s ease-in-out infinite; }
.channel.live .ch-eq i:nth-child(2) { animation-delay: -.3s; }
.channel.live .ch-eq i:nth-child(3) { animation-delay: -.6s; }
.next-ctf .next-title { display: block; font-weight: 800; font-size: 1.1rem; color: var(--text); margin-bottom: 4px; }
.next-ctf .link { display: inline-block; margin-top: 10px; font-size: .85rem; }
.countdown { font-weight: 700; color: var(--accent); font-size: .85rem; margin: 8px 0; font-variant-numeric: tabular-nums; }
.countdown.big { font-size: 1.25rem; text-shadow: var(--glow); }

/* ============================================================ events */
.filters { display: grid; grid-template-columns: 1fr 200px 200px; gap: 12px; margin-bottom: 26px; }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; margin: 26px 0 14px; }
.section-title .count { font-size: .75rem; color: var(--muted); border: 1px solid var(--border); padding: 1px 8px; border-radius: 999px; }
.events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.event { display: flex; flex-direction: column; gap: 10px; transition: border-color .2s, transform .2s; }
.event:hover { border-color: var(--border-strong); transform: translateY(-3px); }
.event.is-live { border-color: color-mix(in srgb, #ff3355 55%, transparent); }
.ev-head { display: flex; gap: 14px; align-items: center; }
.ev-logo { width: 56px; height: 56px; flex: none; border-radius: 12px; overflow: hidden; background: #fff; display: grid; place-items: center; border: 1px solid var(--border); }
.ev-logo img { width: 100%; height: 100%; object-fit: contain; }
.logo-ph { width: 100%; height: 100%; display: grid; place-items: center; font-weight: 800; background: var(--panel-solid); color: var(--accent); }
.ev-title { font-size: 1.05rem; text-transform: none; letter-spacing: 0; color: var(--text); margin: 0 0 2px; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ev-dates { font-size: .88rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.stats div { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.stats dt { font-size: .68rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.stats dd { margin: 0; font-weight: 800; color: var(--accent); }
.stats.big { grid-template-columns: repeat(2, 1fr); margin: 18px 0; }
.stats.big dd { font-size: 1.2rem; }
.ev-desc {
  margin: 0; font-size: .82rem; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.ev-desc.open { display: block; }
.ev-links { display: flex; gap: 8px; margin-top: auto; padding-top: 6px; flex-wrap: wrap; }
.link-btn { font-size: .8rem; align-self: flex-start; }
.loader { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 60px; color: var(--muted); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }

/* ============================================================ auth */
.auth-wrap { display: grid; place-items: center; padding: 20px 0; }
.auth-card { width: 100%; max-width: 440px; padding-top: 16px; }
.auth-card h1 { font-size: 1.6rem; margin-top: 18px; }
.auth-card > p { margin: 0 0 22px; }
.term-bar { display: flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--muted); margin: 0 -22px; padding: 0 16px 12px; border-bottom: 1px solid var(--border); }
.term-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term-bar i:nth-child(2) { background: #febc2e; }
.term-bar i:nth-child(3) { background: #28c840; }
.term-bar span { margin-left: auto; }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; font-size: .85rem; color: var(--muted); }

/* ============================================================ modal */
.modal-overlay { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .7); backdrop-filter: blur(4px); animation: fade .2s; }
.modal { width: 100%; max-width: 480px; text-align: center; animation: rise .25s; }
.modal .input { margin: 10px 0; }
.modal .row { justify-content: flex-end; margin-top: 10px; }
.modal .row .btn { flex: 1; }
.modal-icon { font-size: 2.4rem; }
.code-box {
  margin: 18px 0 14px; padding: 16px; border-radius: 12px; font-size: clamp(1rem, 3.6vw, 1.3rem); font-weight: 800;
  letter-spacing: .08em; color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent);
  border: 1px dashed var(--accent); user-select: all; overflow-wrap: anywhere; text-shadow: var(--glow);
}

/* ============================================================ profile */
.profile-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.profile-tools { display: flex; flex-direction: column; gap: 22px; }
.profile-top { display: flex; align-items: center; gap: 18px; }
.avatar {
  --c: var(--accent);
  width: 84px; height: 84px; flex: none; border-radius: 20px; display: grid; place-items: center;
  font-size: 1.8rem; font-weight: 800; color: var(--c);
  border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 12%, transparent);
  box-shadow: 0 0 24px color-mix(in srgb, var(--c) 35%, transparent);
}
.profile-nick { font-size: 1.8rem; margin: 0 0 4px; overflow-wrap: anywhere; text-shadow: 0 0 16px currentColor; }
:root[data-theme="light"] .profile-nick { text-shadow: none; filter: brightness(.7); }
.bio { white-space: pre-line; overflow-wrap: anywhere; margin: 0; }
.listening { margin-top: 22px; }
.listening h3 { display: flex; justify-content: space-between; align-items: baseline; }
.listen-total { text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--accent); }
.listen-row { display: grid; grid-template-columns: minmax(90px, 140px) 1fr auto; align-items: center; gap: 10px; padding: 5px 0; font-size: .85rem; }
.listen-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.listen-row.fav .listen-name { color: var(--accent); font-weight: 800; }
.listen-row.fav .listen-name::after { content: " ★"; }
.listen-bar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.listen-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); opacity: .55; box-shadow: var(--glow); }
.listen-row.fav .listen-bar i { opacity: 1; }
.listen-time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .8rem; }

/* ============================================================ chat */
.chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  border: 0; background: var(--accent); color: var(--accent-ink); box-shadow: var(--glow), var(--shadow);
  transition: transform .15s;
}
.chat-fab:hover { transform: scale(1.07); }
.chat-fab.hidden { transform: scale(0); }
.badge { position: absolute; top: -2px; right: -2px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #ff3355; color: #fff; font-size: .72rem; font-weight: 800; display: grid; place-items: center; }
.chat {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  width: min(380px, calc(100vw - 32px)); height: min(540px, calc(100vh - 110px));
  display: flex; flex-direction: column;
  background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow), var(--glow); overflow: hidden; animation: rise .25s;
}
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.chat-online { font-size: .75rem; margin-left: auto; }
.chat-log { flex: 1; overflow-y: auto; list-style: none; margin: 0; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; }
.chat-log::-webkit-scrollbar { width: 6px; }
.chat-log::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.msg { font-size: .85rem; overflow-wrap: anywhere; animation: fade .2s; }
.msg.mine { background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 6px; padding: 2px 6px; margin: 0 -6px; }
.msg-time { color: var(--muted); font-size: .7rem; margin-right: 6px; }
.msg-nick { font-weight: 800; margin-right: 6px; }
.msg-nick::after { content: ":"; color: var(--muted); }
:root[data-theme="light"] .msg-nick { filter: brightness(.65) saturate(1.4); }
.chat-empty { text-align: center; margin: auto; font-size: .85rem; }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.chat-form input { flex: 1; min-width: 0; font: inherit; font-size: .85rem; color: var(--text); background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.chat-form input:focus { outline: none; border-color: var(--accent); }
.chat-guest { margin: 0; padding: 14px; text-align: center; border-top: 1px solid var(--border); font-size: .85rem; }

/* ============================================================ toasts */
.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 10px 16px; border-radius: 10px; font-size: .85rem; font-weight: 600; background: var(--panel-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow); animation: rise .25s; transition: opacity .4s, transform .4s; }
.toast.ok { border-color: var(--accent); color: var(--accent); }
.toast.error { border-color: var(--danger); color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(10px); }

/* ============================================================ animations */
@keyframes blink { 50% { opacity: 0; } }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes eq { 0%, 100% { height: 20%; } 50% { height: 100%; } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); } 100% { box-shadow: 0 0 0 18px transparent; } }
@keyframes glitch-flash {
  0%, 86%, 100% { opacity: 0; transform: translate(0); }
  88% { opacity: .85; transform: translate(-3px, 1px); }
  91% { opacity: .85; transform: translate(3px, -1px); }
  94% { opacity: .85; transform: translate(-1px, 2px); }
  97% { opacity: 0; }
}
@keyframes glitch {
  0%, 88%, 100% { transform: translate(0); }
  90% { transform: translate(-3px, 1px); }
  93% { transform: translate(3px, -1px); }
  96% { transform: translate(-1px, 2px); }
}
/* ============================================================ hidden Kuban tricolour
   Krasnodar Krai flag: blue / crimson / green. It hides in the logo glitch layers
   (top slice blue, middle slice crimson, the text itself green) and in the header icon on hover. */
:root { --kuban-blue: #2a5bd7; --kuban-crimson: #c8175d; --kuban-green: #1faa4f; }
.brand-icon path, .brand-icon circle { transition: fill .35s ease, color .35s ease; }
.brand:hover .wave-outer { fill: var(--kuban-blue); }
.brand:hover .wave-inner { fill: var(--kuban-crimson); }
.brand:hover .wave-core { fill: var(--kuban-green); }
body.kuban .brand-icon .wave-outer { fill: var(--kuban-blue); }
body.kuban .brand-icon .wave-inner { fill: var(--kuban-crimson); }
body.kuban .brand-icon .wave-core { fill: var(--kuban-green); }

.kuban-wave {
  position: fixed; top: 0; left: 0; right: 0; height: 9px; z-index: 120; pointer-events: none;
  display: flex; flex-direction: column; animation: kuban-in .5s ease-out;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.kuban-wave i { flex: 1; background-size: 200% 100%; animation: kuban-flow 1.6s linear infinite; }
.kuban-wave i:nth-child(1) { background-image: linear-gradient(90deg, var(--kuban-blue), #5b86f0, var(--kuban-blue)); }
.kuban-wave i:nth-child(2) { flex: 1.6; background-image: linear-gradient(90deg, var(--kuban-crimson), #ec4f8c, var(--kuban-crimson)); }
.kuban-wave i:nth-child(3) { background-image: linear-gradient(90deg, var(--kuban-green), #52d17f, var(--kuban-green)); }
.kuban-wave.out { opacity: 0; transition: opacity .8s; }
@keyframes kuban-in { from { transform: scaleX(0); } }
@keyframes kuban-flow { to { background-position: -200% 0; } }

/* ============================================================ easter eggs */
.matrix-rain { position: fixed; inset: 0; z-index: 150; pointer-events: none; background: #000; opacity: .92; transition: opacity .6s; }
.matrix-rain.out { opacity: 0; }
body.leet-time .tagline-text { display: none; }
body.leet-time .tagline::before { content: attr(data-leet); color: var(--accent); order: 1; }
body.leet-time .tagline { display: flex; gap: 0; }
body.leet-time .tagline .prompt { order: 0; }
body.leet-time .tagline .cursor { order: 2; }

/* ============================================================ avatars */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
img.avatar { object-fit: cover; padding: 0; background: var(--panel-solid); }
.avatar.small { width: 64px; height: 64px; border-radius: 16px; font-size: 1.3rem; }
.avatar.tiny { width: 42px; height: 42px; border-radius: 12px; font-size: .9rem; border-width: 1px; box-shadow: none; }
.avatar.uploading { opacity: .5; animation: pulse 1s infinite; }
.avatar-row { display: flex; align-items: center; gap: 16px; }
.avatar-actions { display: flex; flex-direction: column; gap: 6px; }
.avatar-actions .row { align-items: center; gap: 8px; }
.avatar-actions label.btn { cursor: pointer; }
.admin-badge {
  display: inline-block; margin-left: 10px; vertical-align: middle; font-size: .7rem; font-weight: 800;
  padding: 2px 8px; border-radius: 999px; color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent);
  background: color-mix(in srgb, var(--warn) 10%, transparent); text-shadow: none; letter-spacing: .04em;
}
.chip-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 50%, transparent); background: color-mix(in srgb, var(--danger) 8%, transparent); }

/* ============================================================ chat additions */
.msg-avatar {
  display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; margin-right: 5px;
  vertical-align: -4px; object-fit: cover; font-size: .6rem; font-weight: 800;
}
.msg-avatar.ph { --c: var(--accent); color: var(--c); border: 1px solid var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.msg-badge { color: var(--warn); font-size: .7rem; margin: 0 4px 0 -2px; }
.msg.e2e .msg-text::before { content: "🔒 "; font-size: .75em; }
.msg.e2e.locked .msg-text { color: var(--muted); font-style: italic; }
.msg.e2e.locked .msg-text::before { content: ""; }
.msg.sys { color: var(--muted); font-style: italic; border-left: 2px solid var(--accent); padding-left: 8px; }
.msg.sys .msg-time { color: var(--accent); font-style: normal; }
.chat-lock { margin-left: 4px; }
.chat.e2e-on .chat-lock { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.chat.e2e-on { border-color: var(--accent); }
.chat-e2e-bar {
  font-size: .75rem; padding: 6px 14px; color: var(--accent); border-bottom: 1px solid var(--border);
  background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--accent) 8%, transparent) 0 8px, transparent 8px 16px);
}

/* ============================================================ admin panel */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tab {
  font: inherit; font-weight: 700; font-size: .88rem; cursor: pointer; padding: 9px 14px; margin-bottom: -1px;
  color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 10px 10px 0 0;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-color: var(--border); border-bottom-color: var(--bg); background: var(--panel); }
.admin-body { display: flex; flex-direction: column; gap: 18px; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.stat-tile { padding: 16px 18px; }
.stat-value { font-size: 1.8rem; font-weight: 800; color: var(--accent); text-shadow: var(--glow); font-variant-numeric: tabular-nums; }
.stat-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.filters.one { grid-template-columns: 1fr; margin-bottom: 0; }
.admin-users { display: flex; flex-direction: column; gap: 10px; }
.admin-user { display: flex; align-items: center; gap: 14px; padding: 12px 16px; flex-wrap: wrap; }
.admin-user.is-banned { opacity: .7; border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.admin-user-main { flex: 1; min-width: 200px; }
.admin-user-nick { font-weight: 800; }
.admin-user-main .chip { margin-left: 8px; }
.admin-user-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.howto summary { cursor: pointer; font-weight: 700; }
.howto ol { margin: 12px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 8px; font-size: .88rem; }
.howto pre, .howto code {
  display: block; margin: 6px 0 0; padding: 8px 10px; border-radius: 8px; font-family: var(--font); font-size: .8rem;
  color: var(--accent); background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid var(--border); overflow-x: auto;
}
.howto code { display: inline-block; margin: 0; padding: 1px 6px; }
.admin-msgs { list-style: none; margin: 0; padding: 8px 16px; }
.admin-msg { display: flex; align-items: baseline; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: .85rem; }
.admin-msg:last-child { border: 0; }
.admin-msg .msg-text { flex: 1; overflow-wrap: anywhere; }
.admin-msg.e2e .msg-text { color: var(--muted); font-style: italic; }
.admin-msg .icon-btn { flex: none; align-self: center; }
.load-more { align-self: center; }
.table-wrap { overflow-x: auto; padding: 8px; }
.admin-log { width: 100%; border-collapse: collapse; font-size: .85rem; }
.admin-log th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.admin-log td { padding: 8px 10px; border-bottom: 1px dashed var(--border); white-space: nowrap; }
.admin-log tr:last-child td { border: 0; }

/* ============================================================ tags & roles */
.tag-list { display: inline-flex; flex-wrap: wrap; gap: 5px; vertical-align: middle; }
.profile-top .tag-list, .dj-header .tag-list { display: flex; margin: 6px 0 4px; }
.tag {
  --c: var(--accent);
  display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
  font-size: .7rem; font-weight: 700; line-height: 1.5; padding: 1px 8px; border-radius: 999px;
  color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  background: color-mix(in srgb, var(--c) 12%, transparent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
:root[data-theme="light"] .tag { color: color-mix(in srgb, var(--c) 70%, #000); }
.tag.more { --c: var(--muted); }
.tag.removable button { font: inherit; border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 2px; opacity: .7; }
.tag.removable button:hover { opacity: 1; }
.tag-list.in-chat { margin-right: 5px; }
.tag-list.in-chat .tag { font-size: .62rem; padding: 0 6px; max-width: 110px; }
.dj-badge {
  display: inline-block; margin-left: 8px; vertical-align: middle; font-size: .68rem; font-weight: 800; letter-spacing: .04em;
  padding: 2px 8px; border-radius: 999px; color: #08d9d6; border: 1px solid rgba(8, 217, 214, .5); background: rgba(8, 217, 214, .1); text-shadow: none;
}
:root[data-theme="light"] .dj-badge { color: #047a78; border-color: rgba(4, 122, 120, .5); }
.msg-badge.dj { color: #08d9d6; }
.dj-page-link { display: inline-block; margin-top: 4px; }
.user-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin: 6px 0 2px; }
.tag-select { width: auto; padding: 2px 8px; font-size: .72rem; border-radius: 999px; }
.tag-form .row { align-items: flex-end; }
.tag-form .field { margin-bottom: 0; }
.tag-admin-list { display: flex; flex-direction: column; gap: 4px; }
.tag-admin-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.tag-admin-row:last-child { border: 0; }
.tag-admin-row .muted { flex: 1; }

/* ============================================================ DJ pages */
.dj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.dj-card { display: flex; gap: 14px; align-items: flex-start; color: var(--text); transition: border-color .2s, transform .2s; }
.dj-card:hover { text-decoration: none; border-color: var(--border-strong); transform: translateY(-2px); }
.dj-card-body { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.dj-card-nick { font-weight: 800; font-size: 1.05rem; overflow-wrap: anywhere; }
.dj-card-bio { margin: 0; font-size: .85rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dj-header { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 20px; }
.dj-header-main { min-width: 0; flex: 1; }
.dj-header .profile-nick { margin-bottom: 2px; }
.composer { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.composer h3 { margin: 0; }
.composer-bar { display: flex; align-items: center; gap: 12px; }
.composer-bar .muted { margin-left: auto; }
.composer-bar label.btn { cursor: pointer; }
.composer-preview { position: relative; align-self: flex-start; }
.composer-preview img { display: block; max-height: 180px; max-width: 100%; border-radius: 10px; border: 1px solid var(--border); }
.composer-preview .icon-btn { position: absolute; top: 6px; right: 6px; background: var(--panel-solid); }
.feed { display: flex; flex-direction: column; gap: 14px; }
.post { display: flex; flex-direction: column; gap: 10px; }
.post-head { display: flex; align-items: center; gap: 10px; }
.post-author { font-weight: 800; }
.post-actions { margin-left: auto; display: flex; gap: 6px; }
.post-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.post-text a { word-break: break-all; }
.post-image { display: block; max-width: 100%; max-height: 520px; border-radius: 12px; border: 1px solid var(--border); object-fit: contain; background: var(--bg-2); }
.post-foot { display: flex; align-items: center; }
.like-btn {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: .85rem; cursor: pointer;
  padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--muted);
  transition: color .15s, border-color .15s, transform .1s;
}
.like-btn:hover { color: #ff4d8d; border-color: rgba(255, 77, 141, .5); }
.like-btn:active { transform: scale(.95); }
.like-btn.liked { color: #ff4d8d; border-color: rgba(255, 77, 141, .6); background: rgba(255, 77, 141, .08); }
.heart { font-size: 1rem; line-height: 1; }
.post-edit-box { display: flex; flex-direction: column; gap: 8px; }
.post-edit-box .row { justify-content: flex-end; }

/* ============================================================ privacy & cookies */
.policy { max-width: 820px; line-height: 1.7; }
.policy h2 { font-size: 1.05rem; margin: 26px 0 8px; color: var(--accent); }
.policy h2:first-child { margin-top: 0; }
.policy p { margin: 0 0 10px; }
.policy ul { margin: 0 0 10px; padding-left: 20px; }
.policy li { margin-bottom: 6px; }
.consent { margin: -4px 0 14px; }
.cookie-notice {
  position: fixed; left: 22px; bottom: 22px; z-index: 70; max-width: min(520px, calc(100vw - 110px));
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; font-size: .82rem;
  background: var(--panel-solid); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow); animation: rise .3s; transition: opacity .3s, transform .3s;
}
.cookie-notice.out { opacity: 0; transform: translateY(10px); }
.cookie-icon { font-size: 1.6rem; }
.cookie-text { flex: 1; }
.cookie-notice .btn { flex: none; }
@media (max-width: 600px) {
  .cookie-notice { left: 12px; right: 12px; bottom: 90px; max-width: none; }
  .dj-header { flex-direction: column; }
  .dj-grid { grid-template-columns: 1fr; }
}

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

/* ============================================================ responsive */
@media (max-width: 960px) {
  .player-grid, .profile-grid { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters input { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .burger { display: grid; }
  .nav {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0; flex-direction: column;
    padding: 10px 16px 16px; background: var(--panel-solid); border-bottom: 1px solid var(--border);
    display: none;
  }
  .nav.open { display: flex; }
  .mini-play { max-width: 44px; padding: 5px; }
  .mini-title { display: none; }
  .brand-text { font-size: 1rem; }
  .topbar { gap: 10px; }
  .events-grid { grid-template-columns: 1fr; }
  .card { padding: 18px; }
  .term-bar { margin: 0 -18px; }
}
