/* =====================================================================
   Hallintapaneeli – "Kuunteluhuone": syvä violetti, lämmin hehku.
   ===================================================================== */
:root {
  --bg: #140F1D;
  --bg-2: #18122A;
  --surface: #201930;
  --surface-2: #29203D;
  --surface-3: #33284B;
  --line: #342A4C;
  --line-soft: rgba(255, 255, 255, .06);
  --ink: #F4EDFD;
  --ink-2: #D3C7E6;
  --mut: #A597BC;
  --lil: #C9A7FF;
  --pink: #FF8FB1;
  --peach: #FFB38A;
  --ok: #7BE3B5;
  --warn: #FFD27A;
  --bad: #FF7D8E;
  --grad: linear-gradient(120deg, var(--lil) 0%, var(--pink) 55%, var(--peach) 100%);
  --grad-soft: linear-gradient(120deg, rgba(201,167,255,.18), rgba(255,143,177,.14) 55%, rgba(255,179,138,.12));
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r-sm: 9px;
  --r: 14px;
  --r-lg: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --player-h: 88px;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 10px 30px -12px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body {
  font: 14.5px/1.5 var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 30px; font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; margin-top: 6px; }
p { margin: 0; }
a { color: inherit; }
code { font-family: "Cascadia Code", Consolas, monospace; font-size: .88em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; color: var(--lil); }
.muted { color: var(--mut); }
.small { font-size: 12.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lede { color: var(--mut); margin-top: 6px; font-size: 15px; }
.hint { color: var(--mut); font-size: 12.5px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lil); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(255, 143, 177, .35); }
svg { width: 1em; height: 1em; flex: none; }
.ic { width: 17px; height: 17px; }

/* scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }

/* =====================================================================
   Painikkeet
   ===================================================================== */
.btn {
  --bg-btn: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--line);
  background: var(--bg-btn);
  color: var(--ink);
  border-radius: 10px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  transition: transform .18s var(--ease), background-color .2s, border-color .2s, box-shadow .25s var(--ease), filter .2s;
}
.btn:hover { border-color: #4A3D69; background: var(--surface-3); transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.grad {
  background: var(--grad); background-size: 160% 100%; background-position: 0% 50%;
  color: #1A1024; border: 0; padding: 9px 16px;
  box-shadow: 0 6px 20px -8px rgba(255, 143, 177, .7);
  transition: transform .18s var(--ease), background-position .5s var(--ease), box-shadow .3s var(--ease);
}
.btn.grad:hover { background-position: 100% 50%; box-shadow: 0 10px 28px -8px rgba(255, 143, 177, .85); }
.btn.ghost { background: transparent; border-color: var(--line); }
.btn.ghost:hover { background: rgba(255,255,255,.04); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: rgba(255, 125, 142, .5); background: rgba(255, 125, 142, .08); }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 9px; }
.btn.sm .ic { width: 15px; height: 15px; }
.btn.big { padding: 12px 18px; font-size: 15px; width: 100%; }
.btn.discord { background: #5865F2; border: 0; color: #fff; }
.btn.discord:hover { background: #6974F5; box-shadow: 0 10px 26px -10px #5865F2; }
.link { background: none; border: 0; padding: 0; color: var(--lil); font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; position: relative; }
.link::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1.5px; background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
.link:hover::after { transform: scaleX(1); }

/* napautuksen aalto */
.ripple { position: absolute; border-radius: 50%; pointer-events: none; background: rgba(255,255,255,.35); transform: scale(0); animation: ripple .6s var(--ease) forwards; }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* ikonipainikkeet (soitin) */
.ibtn {
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: transparent; border: 0; color: var(--ink-2);
  cursor: pointer; position: relative;
  transition: color .2s, background-color .2s, transform .2s var(--ease);
}
.ibtn svg { width: 19px; height: 19px; }
.ibtn:hover { color: var(--ink); background: rgba(255,255,255,.07); transform: scale(1.08); }
.ibtn:active { transform: scale(.94); }
.ibtn:disabled { opacity: .35; cursor: not-allowed; transform: none; background: none; }
.ibtn.sm { width: 34px; height: 34px; }
.ibtn.sm svg { width: 17px; height: 17px; }
.ibtn[aria-pressed="true"] { color: var(--pink); }
.ibtn[aria-pressed="true"]::after { content: ""; position: absolute; bottom: 3px; width: 4px; height: 4px; border-radius: 50%; background: var(--pink); }
.ibtn .badge { position: absolute; top: 5px; right: 4px; font-size: 9px; font-weight: 800; background: var(--pink); color: #1A1024; border-radius: 6px; padding: 0 3px; line-height: 13px; }
.ibtn.play { width: 46px; height: 46px; background: var(--ink); color: #1A1024; box-shadow: 0 6px 22px -6px rgba(255,255,255,.4); }
.ibtn.play svg { width: 20px; height: 20px; }
.ibtn.play:hover { background: #fff; transform: scale(1.1); box-shadow: 0 0 0 6px rgba(255,255,255,.08), 0 8px 26px -6px rgba(255,143,177,.6); }

/* =====================================================================
   Lomakkeet
   ===================================================================== */
input:not([type="checkbox"]):not([type="range"]):not([type="file"]), select, textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--ink);
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
input::placeholder, textarea::placeholder { color: #7D7096; }
input:not([type="checkbox"]):not([type="range"]):hover, select:hover, textarea:hover { border-color: #47396A; }
input:not([type="checkbox"]):not([type="range"]):focus, select:focus, textarea:focus { outline: none; border-color: var(--lil); box-shadow: 0 0 0 3px rgba(201, 167, 255, .18); background: #1C1530; }
textarea { resize: vertical; line-height: 1.5; }
select {
  appearance: none; cursor: pointer; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6.5 9.5 5.5 5.5 5.5-5.5' fill='none' stroke='%23A597BC' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
select option { background: var(--surface); color: var(--ink); }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field.compact { gap: 4px; }
.form-error { color: var(--bad); min-height: 1.2em; font-size: 13px; }
.form-error:empty { display: none; }

/* kytkin */
.switch { display: flex; align-items: center; gap: 11px; cursor: pointer; user-select: none; font-size: 14px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  flex: none; width: 40px; height: 23px; border-radius: 23px; position: relative;
  background: #3A2F55; transition: background-color .25s var(--ease), box-shadow .25s;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 17px; height: 17px; border-radius: 50%;
  background: #9C8FB5; transition: transform .35s var(--spring), background-color .25s, width .2s var(--ease);
}
.switch:hover .track { box-shadow: 0 0 0 4px rgba(201,167,255,.08); }
.switch:active .track::after { width: 21px; }
.switch input:checked + .track { background: var(--grad); }
.switch input:checked + .track::after { transform: translateX(17px); background: #fff; }
.switch input:checked:active + .track::after { transform: translateX(13px); }
.switch input:focus-visible + .track { outline: 2px solid var(--lil); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .4; }
.switch.only { gap: 0; }

/* segmenttivalitsin */
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; color: var(--mut); padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 13px; transition: color .2s, background-color .25s var(--ease); }
.seg button:hover { color: var(--ink); }
.seg button[aria-checked="true"] { background: var(--surface-3); color: var(--ink); box-shadow: 0 2px 8px -2px rgba(0,0,0,.5); }

.chip-check { display: inline-flex; align-items: center; cursor: pointer; }
.chip-check input { position: absolute; opacity: 0; }
.chip-check span { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); color: var(--mut); font-weight: 600; font-size: 13px; transition: all .2s var(--ease); white-space: nowrap; }
.chip-check:hover span { color: var(--ink); border-color: #4A3D69; }
.chip-check input:checked + span { color: var(--ink); background: var(--grad-soft); border-color: rgba(255,143,177,.5); }
.chip-check input:focus-visible + span { outline: 2px solid var(--lil); outline-offset: 2px; }

/* liukusäädin */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; cursor: pointer; --p: 0%; }
.range::-webkit-slider-runnable-track { height: 5px; border-radius: 5px; background: linear-gradient(90deg, var(--peach), var(--pink)) 0 / var(--p) 100% no-repeat, rgba(255,255,255,.12); transition: height .15s; }
.range::-moz-range-track { height: 5px; border-radius: 5px; background: rgba(255,255,255,.12); }
.range::-moz-range-progress { height: 5px; border-radius: 5px; background: linear-gradient(90deg, var(--peach), var(--pink)); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; margin-top: -4px; box-shadow: 0 2px 6px rgba(0,0,0,.4); transform: scale(0); transition: transform .2s var(--spring); }
.range::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: #fff; transform: scale(0); transition: transform .2s var(--spring); }
.range:hover::-webkit-slider-thumb, .range:focus-visible::-webkit-slider-thumb, .range:active::-webkit-slider-thumb { transform: scale(1); }
.range:hover::-moz-range-thumb, .range:focus-visible::-moz-range-thumb { transform: scale(1); }
.range:disabled { cursor: default; opacity: .5; }
.range:disabled::-webkit-slider-thumb { transform: scale(0); }

/* =====================================================================
   Kirjautuminen
   ===================================================================== */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.login-glow { position: absolute; inset: -20%; background:
  radial-gradient(40% 40% at 30% 30%, rgba(124, 58, 160, .55), transparent 70%),
  radial-gradient(35% 35% at 75% 70%, rgba(255, 143, 177, .28), transparent 70%),
  radial-gradient(30% 30% at 70% 20%, rgba(255, 179, 138, .18), transparent 70%);
  filter: blur(20px); animation: drift 18s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate3d(-3%, 2%, 0) rotate(4deg); } }
.login-card {
  position: relative; width: min(400px, 100%);
  background: rgba(32, 25, 48, .78); backdrop-filter: blur(18px);
  border: 1px solid rgba(255,255,255,.08); border-radius: 24px;
  padding: 34px 30px 28px; display: grid; gap: 16px;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.8);
  animation: rise .7s var(--ease) both;
}
.login-card h1 { font-size: 26px; }
.login-card .lede { margin-top: -8px; font-size: 14px; }
.login-mark { width: 52px; height: 52px; border-radius: 16px; background: var(--grad); display: grid; place-items: center; color: #1A1024; box-shadow: 0 10px 30px -8px rgba(255,143,177,.7); }
.login-mark svg { width: 26px; height: 26px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--mut); font-size: 12.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* =====================================================================
   Sovelluksen runko
   ===================================================================== */
.app { min-height: 100vh; position: relative; }
.ambient {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 460px at 88% -8%, rgba(110, 46, 140, .55), transparent 62%),
    radial-gradient(760px 420px at -6% 4%, rgba(52, 38, 110, .7), transparent 60%),
    radial-gradient(600px 400px at 50% 120%, rgba(255, 143, 177, .07), transparent 70%);
  transition: background .8s;
}
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  padding: 11px 26px;
  background: rgba(20, 15, 29, .72);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 16px var(--font-display); letter-spacing: -.01em; flex: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--grad); display: grid; place-items: center; overflow: hidden; box-shadow: 0 4px 16px -4px rgba(255,143,177,.6); transition: transform .4s var(--spring); }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.08); }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }

.guild-btn {
  display: flex; align-items: center; gap: 9px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px;
  padding: 5px 10px 5px 5px; cursor: pointer; max-width: 230px;
  transition: border-color .2s, background-color .2s;
}
.guild-btn:hover { border-color: #4A3D69; background: var(--surface-2); }
.guild-btn .chev { width: 15px; height: 15px; color: var(--mut); transition: transform .25s var(--ease); }
.guild-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.guild-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gicon { width: 26px; height: 26px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; background: linear-gradient(135deg, #5865F2, #8B5CF6) center/cover; color: #fff; }

.mainnav { display: flex; gap: 2px; position: relative; margin-left: 6px; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a { padding: 8px 12px; border-radius: 9px; color: var(--mut); font-weight: 600; text-decoration: none; white-space: nowrap; position: relative; z-index: 1; transition: color .2s; }
.mainnav a:hover { color: var(--ink); }
.mainnav a.active { color: var(--ink); }
.nav-ink {
  position: absolute; left: 0; top: 0; height: 100%; z-index: 0; border-radius: 9px;
  background: rgba(255,255,255,.07); pointer-events: none;
  transition: transform .45s var(--spring), width .45s var(--spring), opacity .2s;
}
.nav-ink::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 2px; border-radius: 2px; background: var(--grad); }

.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; flex: none; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--mut); white-space: nowrap; }
.live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.live.on { color: var(--ok); }
.live.on::before { background: var(--ok); box-shadow: 0 0 0 0 rgba(123,227,181,.6); animation: pulse 2.4s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(123,227,181,.55); } 70% { box-shadow: 0 0 0 7px rgba(123,227,181,0); } 100% { box-shadow: 0 0 0 0 rgba(123,227,181,0); } }
.avatar-btn { width: 34px; height: 34px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: linear-gradient(135deg, var(--peach), #E8668F); overflow: hidden; display: grid; place-items: center; transition: transform .25s var(--spring), box-shadow .25s; }
.avatar-btn:hover { transform: scale(1.06); box-shadow: 0 0 0 3px rgba(255,143,177,.25); }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.initial { font-weight: 700; color: #1A1024; }

/* ponnahdusvalikot */
.pop-wrap { position: relative; }
.pop {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60; min-width: 220px;
  background: rgba(36, 28, 54, .96); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 14px; padding: 6px;
  box-shadow: 0 24px 50px -16px rgba(0,0,0,.8);
  transform-origin: top left; animation: popIn .22s var(--ease);
}
.pop.up { top: auto; bottom: calc(100% + 10px); transform-origin: bottom left; }
.pop.right, .user-pop { left: auto; right: 0; transform-origin: top right; }
.pop.up.right { transform-origin: bottom right; }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.96); } }
.pop-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 9px 11px; border-radius: 9px; border: 0; background: none; cursor: pointer; text-decoration: none; color: var(--ink-2); font-weight: 550; transition: background-color .15s, color .15s; }
.pop-item:hover, .pop-item:focus-visible { background: rgba(255,255,255,.07); color: var(--ink); }
.pop-item.on { color: var(--ink); background: var(--grad-soft); }
.pop-item.danger { color: var(--bad); }
.pop-item .grow { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-item .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.user-head { padding: 9px 11px 10px; display: grid; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.user-head .muted { font-size: 12px; }
.guild-pop { min-width: 260px; max-height: 60vh; overflow: auto; }

/* =====================================================================
   Näkymä ja sivuvaihdot
   ===================================================================== */
.view { position: relative; z-index: 1; max-width: 1280px; margin: 0 auto; padding: 30px 30px calc(var(--player-h) + 48px); }
.page { display: grid; gap: 22px; }
.page.enter > *, .sub.enter > * { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.page.leave { animation: fadeOut .14s ease-in both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeOut { to { opacity: 0; transform: translateY(-6px); } }
.stagger-in > * { animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 6px 0 -8px; }
.sec-head p { color: var(--mut); font-size: 13px; }

.subtabs { display: flex; gap: 4px; position: relative; border-bottom: 1px solid var(--line-soft); overflow-x: auto; scrollbar-width: none; }
.subtabs a { padding: 9px 14px 12px; color: var(--mut); font-weight: 600; text-decoration: none; white-space: nowrap; transition: color .2s; }
.subtabs a:hover { color: var(--ink); }
.subtabs a.active { color: var(--ink); }
.sub-ink { position: absolute; bottom: -1px; left: 0; height: 2px; border-radius: 2px; background: var(--grad); transition: transform .45s var(--spring), width .45s var(--spring); }
.sub { display: grid; gap: 18px; }

/* =====================================================================
   Kortit ja ruudukot
   ===================================================================== */
.card {
  background: linear-gradient(180deg, rgba(41, 32, 61, .72), rgba(32, 25, 48, .82));
  border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 18px 20px; box-shadow: var(--shadow);
  min-width: 0;
}
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head.pad { padding: 18px 20px 6px; margin: 0; }
.card-head .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.count { color: var(--mut); font-weight: 500; font-size: 13px; margin-left: 4px; }
.split { display: grid; grid-template-columns: 1.4fr 1fr; gap: 18px; align-items: start; }
.split.wide-left { grid-template-columns: 1.7fr 1fr; }
.split.wide-right { grid-template-columns: 1fr 1.4fr; }
.stack-col { display: grid; gap: 18px; min-width: 0; }
.form-card { display: grid; gap: 14px; align-content: start; }
.savebar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.form-msg { font-size: 13px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; align-items: center; }

/* KPI:t */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.kpis.three { grid-template-columns: repeat(3, 1fr); }
.kpi {
  background: linear-gradient(180deg, rgba(41, 32, 61, .75), rgba(32, 25, 48, .85));
  border: 1px solid var(--line); border-radius: 16px; padding: 15px 17px 14px;
  position: relative; overflow: hidden;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.kpi:hover { transform: translateY(-3px); border-color: #4A3D69; box-shadow: 0 16px 34px -18px rgba(0,0,0,.8); }
.kpi .l { color: var(--mut); font-size: 12.5px; font-weight: 550; display: flex; align-items: center; gap: 7px; }
.kpi .l svg { width: 15px; height: 15px; color: var(--lil); }
.kpi .n { font: 700 28px/1.05 var(--font-display); margin-top: 8px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 12px; margin-top: 6px; color: var(--mut); }
.kpi .d.up { color: var(--ok); }
.kpi .d.down { color: var(--bad); }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 30px; margin-top: 10px; }
.spark i { flex: 1; border-radius: 3px 3px 1px 1px; background: linear-gradient(180deg, var(--pink), rgba(107, 58, 134, .9)); transform-origin: bottom; animation: grow .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms + 150ms); min-height: 3px; }
.spark i.today { background: linear-gradient(180deg, var(--peach), var(--pink)); }
@keyframes grow { from { transform: scaleY(0); } }

/* ominaisuuskortit */
.modules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mod {
  position: relative; display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: start;
  background: linear-gradient(180deg, rgba(41, 32, 61, .72), rgba(32, 25, 48, .82));
  border: 1px solid var(--line); border-radius: 18px; padding: 17px;
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s, opacity .3s;
  isolation: isolate;
}
.mod::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; background: var(--grad); opacity: 0; transition: opacity .3s; z-index: -1;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.mod:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -20px rgba(255,143,177,.35); }
.mod:hover::before { opacity: .7; }
.mod .ic-tile { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; transition: transform .4s var(--spring); }
.mod .ic-tile svg { width: 21px; height: 21px; }
.mod:hover .ic-tile { transform: scale(1.08) rotate(-6deg); }
.mod h3 { margin: 1px 0 0; font-size: 15px; }
.mod p { margin: 4px 0 10px; color: var(--mut); font-size: 13px; line-height: 1.45; }
.mod.off .ic-tile, .mod.off h3, .mod.off p { opacity: .55; }
.mod .state { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: 8px; vertical-align: 2px; }
.mod .state.on { background: rgba(123,227,181,.14); color: var(--ok); }
.mod .state.off { background: rgba(255,255,255,.07); color: var(--mut); }
.tone-pink { background: rgba(255,143,177,.14); color: var(--pink); }
.tone-mint { background: rgba(123,227,181,.13); color: var(--ok); }
.tone-lil { background: rgba(201,167,255,.15); color: var(--lil); }
.tone-peach { background: rgba(255,179,138,.14); color: var(--peach); }
.tone-sky { background: rgba(110,190,255,.13); color: #8CCBFF; }
.tone-gold { background: rgba(255,210,122,.13); color: var(--warn); }

/* tapahtumat */
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { display: grid; grid-template-columns: 30px 1fr; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line-soft); align-items: start; transition: background-color .2s; border-radius: 8px; }
.feed li:last-child { border-bottom: 0; }
.feed .ev-ic { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; }
.feed .ev-ic svg { width: 15px; height: 15px; }
.feed small { color: var(--mut); display: block; font-size: 12px; margin-top: 1px; }

/* kappalelistat */
.tracks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tracks li {
  display: grid; grid-template-columns: 26px 44px minmax(0, 1fr) auto auto; gap: 12px; align-items: center;
  padding: 7px 8px; border-radius: 12px; position: relative;
  transition: background-color .2s, transform .25s var(--ease), box-shadow .25s;
}
.tracks li:hover { background: rgba(255,255,255,.045); }
.tracks.compact li { grid-template-columns: 38px minmax(0, 1fr) auto auto; padding: 6px 6px; }
.tracks .idx { color: var(--mut); text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; position: relative; }
.tracks li[draggable="true"] { cursor: grab; }
.tracks li[draggable="true"]:hover .idx span { opacity: 0; }
.tracks li[draggable="true"] .idx svg { position: absolute; right: -2px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; opacity: 0; transition: opacity .15s; }
.tracks li[draggable="true"]:hover .idx svg { opacity: 1; }
.tracks li.dragging { opacity: .4; transform: scale(.98); }
.tracks li.drop-target { box-shadow: inset 0 2px 0 var(--pink); background: rgba(255,143,177,.06); }
.thumb { width: 44px; height: 44px; border-radius: 10px; background: var(--surface-3) center/cover no-repeat; display: grid; place-items: center; color: var(--mut); font-size: 10px; font-weight: 700; overflow: hidden; }
.tracks.compact .thumb { width: 38px; height: 38px; border-radius: 9px; }
.thumb svg { width: 18px; height: 18px; }
.meta { min-width: 0; display: grid; }
.meta strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta > span { color: var(--mut); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src { display: inline-block; font-size: 10.5px; line-height: 16px; font-weight: 700; padding: 0 6px; border-radius: 5px; margin-right: 6px; vertical-align: 1px; }
.src.yt { background: rgba(255, 90, 90, .15); color: #FF8A8A; }
.src.sp { background: rgba(30, 215, 96, .14); color: #5BE38D; }
.src.mp3 { background: rgba(201,167,255,.15); color: var(--lil); }
.src.ap { background: rgba(255,210,122,.14); color: var(--warn); }
.dur { color: var(--mut); font-variant-numeric: tabular-nums; font-size: 13px; }
.row-actions { display: flex; gap: 2px; opacity: 0; transform: translateX(6px); transition: opacity .2s, transform .25s var(--ease); }
.tracks li:hover .row-actions, .tracks li:focus-within .row-actions, tr:hover .row-actions, tr:focus-within .row-actions { opacity: 1; transform: none; }
.row-actions .ibtn { width: 30px; height: 30px; }
.row-actions .ibtn svg { width: 15px; height: 15px; }
.row-actions .ibtn.danger:hover { color: var(--bad); }

.empty { display: grid; justify-items: center; gap: 10px; text-align: center; color: var(--mut); padding: 26px 16px; }
.empty svg { width: 34px; height: 34px; color: var(--surface-3); }
.empty.small { padding: 12px; font-size: 13px; }

/* jonon lisäyspalkki */
.addbar {
  display: flex; align-items: center; gap: 10px;
  background: rgba(32, 25, 48, .85); border: 1px solid var(--line); border-radius: 16px; padding: 7px 7px 7px 14px;
  transition: border-color .25s, box-shadow .3s var(--ease);
}
.addbar:focus-within { border-color: rgba(201,167,255,.55); box-shadow: 0 0 0 4px rgba(201,167,255,.12), 0 18px 40px -22px rgba(255,143,177,.5); }
.addbar .lead { color: var(--mut); width: 19px; height: 19px; }
.addbar input#add-query { border: 0; background: transparent; padding: 8px 4px; box-shadow: none; font-size: 15px; }
.addbar input#add-query:focus { box-shadow: none; background: transparent; }
.addbar select { width: auto; max-width: 200px; }

/* nyt soi -sankari */
.hero { position: relative; display: grid; grid-template-columns: 148px 1fr; gap: 24px; align-items: center; padding: 22px; border-radius: 24px; overflow: hidden; border: 1px solid var(--line); isolation: isolate; min-height: 192px; }
.hero-bg { position: absolute; inset: -40px; z-index: -1; background: radial-gradient(120% 140% at 0% 0%, #5B2E6E 0%, #2A1E3B 55%, #1E1630 100%) center/cover; filter: blur(0); transition: opacity .6s; }
.hero-bg.img { filter: blur(48px) saturate(1.4) brightness(.55); transform: scale(1.1); }
.hero-cover { width: 148px; height: 148px; border-radius: 18px; background: linear-gradient(160deg, #FFB38A, #C2477E 60%, #4A1E5C) center/cover; display: grid; place-items: center; color: rgba(255,255,255,.85); box-shadow: 0 24px 50px -18px rgba(0,0,0,.8); transition: transform .5s var(--ease); }
.hero-cover svg { width: 44px; height: 44px; }
.hero-cover.img svg { display: none; }
.hero:hover .hero-cover { transform: scale(1.03) rotate(-1deg); }
.hero.playing .hero-cover { animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.025); } }
.hero-info { min-width: 0; display: grid; gap: 6px; }
.eyebrow { font-size: 12.5px; font-weight: 650; color: var(--peach); }
.hero h2 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hero p { color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.1); backdrop-filter: blur(6px); font-size: 12px; font-weight: 600; color: var(--ink); }
.chip svg { width: 13px; height: 13px; }
.chip.warn { background: rgba(255,125,142,.18); color: #FFC0C8; }

/* kirjasto */
.lib-top { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; }
.dropzone {
  border: 1.5px dashed #4A3D69; border-radius: var(--r-lg); padding: 26px; display: grid; justify-items: center; align-content: center; gap: 6px; text-align: center; cursor: pointer;
  background: rgba(32, 25, 48, .5); transition: border-color .25s, background-color .25s, transform .25s var(--ease);
}
.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.dropzone:hover, .dropzone.over { border-color: var(--pink); background: rgba(255,143,177,.06); }
.dropzone.over { transform: scale(1.01); }
.dz-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--grad-soft); color: var(--pink); display: grid; place-items: center; margin-bottom: 4px; transition: transform .4s var(--spring); }
.dz-icon svg { width: 22px; height: 22px; }
.dropzone:hover .dz-icon, .dropzone.over .dz-icon { transform: translateY(-4px); }
.lib-stats { display: grid; gap: 10px; align-content: center; }
.stat-line { display: flex; justify-content: space-between; align-items: baseline; }
.stat-line strong { font: 700 24px var(--font-display); }
.meter { height: 6px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--grad); transition: width .8s var(--ease); }
.upload-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.upload-results:empty { display: none; }
.upload-results li { padding: 6px 12px; border-radius: 9px; background: var(--surface); }
.upload-results .ok { color: var(--ok); }
.upload-results .err { color: var(--bad); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar.end { justify-content: flex-end; }
.toolbar select { width: auto; min-width: 170px; }
.search { position: relative; flex: 1; min-width: 220px; }
.search svg { position: absolute; left: 12px; top: 50%; translate: 0 -50%; color: var(--mut); }
.search input { padding-left: 38px !important; }
.search.sm { flex: 0 1 260px; min-width: 180px; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; font-weight: 650; color: var(--mut); padding: 12px 14px; border-bottom: 1px solid var(--line); }
.table td { padding: 9px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr { transition: background-color .15s; }
.table tbody tr:hover { background: rgba(255,255,255,.035); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--ink-2); }
.table select { padding: 6px 30px 6px 10px; font-size: 13px; min-width: 120px; }
.title-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.title-cell .meta { max-width: 360px; }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px; align-items: center; }
.preview-btn.on { color: var(--pink); }

.inline-form { display: flex; gap: 8px; }
.inline-form input { flex: 1; }
.cat-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.cat-grid li { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 8px 8px 8px 14px; transition: border-color .2s, transform .25s var(--ease); }
.cat-grid li:hover { border-color: #4A3D69; transform: translateY(-2px); }
.cat-grid .grow { flex: 1; min-width: 0; display: grid; }
.cat-grid .grow strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-grid .grow span { font-size: 12px; color: var(--mut); }

/* soittolistat */
.pl-layout { display: grid; grid-template-columns: 290px 1fr; gap: 18px; align-items: start; }
.pl-side { display: grid; gap: 12px; padding: 14px; }
.inline-form.stack input { min-width: 0; }
.pl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.pl-list button { width: 100%; display: grid; grid-template-columns: 40px 1fr; gap: 10px; align-items: center; text-align: left; border: 0; background: none; padding: 7px; border-radius: 11px; cursor: pointer; transition: background-color .2s; }
.pl-list button:hover { background: rgba(255,255,255,.05); }
.pl-list button[aria-current="true"] { background: var(--grad-soft); }
.pl-art { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #1A1024; font-weight: 800; font-size: 15px; }
.pl-list .meta span { font-size: 12px; }
.pl-detail { min-height: 280px; }
.pl-hero { display: flex; gap: 18px; align-items: flex-end; margin-bottom: 16px; }
.pl-hero .pl-art { width: 96px; height: 96px; border-radius: 18px; font-size: 36px; box-shadow: 0 18px 40px -16px rgba(0,0,0,.7); }
.pl-hero h2 { font-size: 24px; }
.pl-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 14px; }

/* tilastot */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; }
.bars .rank { color: var(--mut); font-size: 12.5px; text-align: right; font-variant-numeric: tabular-nums; }
.bars .bar-wrap { min-width: 0; display: grid; gap: 4px; }
.bars .bar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13.5px; }
.bars .bar-label span { color: var(--mut); }
.bars .bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.06); overflow: hidden; }
.bars .bar i { display: block; height: 100%; border-radius: inherit; background: var(--grad); transform-origin: left; animation: growX .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); }
@keyframes growX { from { transform: scaleX(0); } }
.bars .val { color: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; text-align: right; }
.colchart { display: grid; grid-template-columns: repeat(8, 1fr); gap: 12px; align-items: end; height: 190px; padding-top: 10px; }
.colchart .col { display: grid; grid-template-rows: auto 1fr auto; gap: 6px; height: 100%; text-align: center; }
.colchart .col .v { font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.colchart .col .track { position: relative; border-radius: 9px; background: rgba(255,255,255,.04); overflow: hidden; }
.colchart .col .track i { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 9px; background: linear-gradient(180deg, var(--pink), rgba(107,58,134,.95)); transform-origin: bottom; animation: grow .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.colchart .col:hover .track i { background: linear-gradient(180deg, var(--peach), var(--pink)); }
.colchart .col .k { font-size: 11.5px; color: var(--mut); }

/* asetukset */
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; align-items: start; }
.settings-grid fieldset { margin: 0; display: grid; gap: 14px; }
.settings-grid fieldset.wide { grid-column: 1 / -1; }
.settings-grid legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; font: 650 16px var(--font-display); }
.settings-grid .savebar { grid-column: 1 / -1; position: sticky; bottom: calc(var(--player-h) + 26px); z-index: 5; background: rgba(32,25,48,.9); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; }

/* moderointi */
.cmd-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 9px; }
.cmd-list li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13.5px; }
.cmd-list span { color: var(--mut); margin-left: auto; font-size: 12.5px; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.u-av { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #1A1024; flex: none; }
.reason { max-width: 280px; color: var(--ink-2); }

/* tervetulo */
.notice { display: flex; gap: 12px; align-items: flex-start; background: rgba(255,210,122,.08); border: 1px solid rgba(255,210,122,.3); color: #FFE3A8; border-radius: 14px; padding: 12px 16px; font-size: 13.5px; }
.notice svg { width: 18px; height: 18px; margin-top: 1px; color: var(--warn); }
.tokens { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.tokens button { border: 1px solid var(--line); background: var(--bg-2); border-radius: 9px; padding: 4px 9px; cursor: pointer; font-family: "Cascadia Code", Consolas, monospace; font-size: 12px; color: var(--lil); display: inline-flex; gap: 6px; align-items: baseline; transition: border-color .2s, transform .2s var(--ease); }
.tokens button small { font-family: var(--font); color: var(--mut); font-size: 11px; }
.tokens button:hover { border-color: var(--lil); transform: translateY(-1px); }
.role-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.role-pill { position: relative; }
.role-pill input { position: absolute; opacity: 0; }
.role-pill span { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); transition: all .2s var(--ease); }
.role-pill span::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--rc, #99AAB5); }
.role-pill span:hover { border-color: #4A3D69; color: var(--ink); }
.role-pill input:checked + span { background: var(--grad-soft); border-color: rgba(255,143,177,.55); color: var(--ink); }
.role-pill input:checked + span::after { content: "✓"; font-size: 12px; color: var(--pink); }
.role-pill input:disabled + span { opacity: .4; cursor: not-allowed; }
.role-pill input:focus-visible + span { outline: 2px solid var(--lil); outline-offset: 2px; }

/* Discord-esikatselu */
.preview-card { position: sticky; top: 84px; display: grid; gap: 14px; }
.dc-msg { display: grid; grid-template-columns: 40px 1fr; gap: 14px; background: #313338; border-radius: 12px; padding: 14px 16px; color: #DBDEE1; font-family: "gg sans", "Segoe UI", sans-serif; }
.dc-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--grad) center/cover; }
.dc-name { display: flex; align-items: center; gap: 6px; font-weight: 600; color: #F2F3F5; }
.dc-tag { background: #5865F2; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 4px; border-radius: 4px; }
.dc-time { color: #949BA4; font-size: 12px; font-weight: 400; }
.dc-text { margin-top: 3px; white-space: pre-wrap; word-break: break-word; line-height: 1.4; }
.dc-text .mention { background: rgba(88,101,242,.3); color: #C9CDFB; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dc-text strong { color: #F2F3F5; }
.dc-embed { margin-top: 6px; background: #2B2D31; border-left: 4px solid #5865F2; border-radius: 4px; padding: 10px 14px; display: grid; gap: 4px; }
.dc-embed strong { color: #F2F3F5; }
.dc-embed p { color: #DBDEE1; white-space: pre-wrap; font-size: 14px; }
.dc-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dc-btn { padding: 6px 14px; border-radius: 4px; font-size: 14px; font-weight: 500; color: #fff; background: #4E5058; }
.dc-btn.primary { background: #5865F2; }
.dc-btn.success { background: #248046; }
.dc-btn.danger { background: #DA373C; }

/* roolivalikot */
.rp-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.rp-card { display: grid; gap: 10px; transition: transform .3s var(--ease), border-color .3s; }
.rp-card:hover { transform: translateY(-3px); border-color: #4A3D69; }
.rp-card .role-dots { display: flex; flex-wrap: wrap; gap: 5px; }
.rp-card .role-dots span { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--ink-2); }
.rp-card .foot { display: flex; justify-content: space-between; align-items: center; }
.rp-roles { display: grid; gap: 8px; }
.rp-role-row { display: grid; grid-template-columns: 1.3fr 1.3fr 70px 110px 34px; gap: 6px; align-items: center; animation: rise .35s var(--ease) both; }
.rp-role-row input, .rp-role-row select { padding: 7px 10px; font-size: 13px; }
.rp-role-row select { padding-right: 28px; }
.rp-editor { animation: rise .45s var(--ease) both; }

/* pelit */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 14px; align-items: end; max-width: 760px; margin: 0 auto; width: 100%; }
.podium:empty { display: none; }
.pod { text-align: center; display: grid; justify-items: center; gap: 8px; }
.pod .u-av { width: 56px; height: 56px; font-size: 20px; box-shadow: 0 10px 26px -10px rgba(0,0,0,.8); }
.pod.p1 .u-av { width: 70px; height: 70px; font-size: 24px; }
.pod .name { font-weight: 650; }
.pod .pts { color: var(--mut); font-size: 13px; }
.pod .step { width: 100%; border-radius: 16px 16px 6px 6px; display: grid; place-items: center; font: 800 26px var(--font-display); color: rgba(26,16,36,.85); transform-origin: bottom; animation: grow .8s var(--spring) both; }
.pod.p1 .step { height: 120px; background: linear-gradient(180deg, #FFE08A, #F4B54A); animation-delay: .2s; }
.pod.p2 .step { height: 88px; background: linear-gradient(180deg, #E6E1F0, #A99FBF); animation-delay: .05s; }
.pod.p3 .step { height: 66px; background: linear-gradient(180deg, #FFC79E, #D98A5C); animation-delay: .35s; }
.pod .crown { color: var(--warn); width: 24px; height: 24px; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px); } }
.lb { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; counter-reset: lb; }
.lb li { display: grid; grid-template-columns: 30px 30px 1fr auto; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 11px; transition: background-color .2s; }
.lb li:hover { background: rgba(255,255,255,.04); }
.lb .rank { color: var(--mut); text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; }
.lb .pts { font-weight: 700; font-variant-numeric: tabular-nums; }
.gw-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gw-list li { display: grid; grid-template-columns: 38px 1fr auto; gap: 12px; align-items: center; padding: 10px; border-radius: 13px; background: rgba(255,255,255,.03); border: 1px solid var(--line-soft); }
.gw-list .gw-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; }
.gw-list .gw-ic svg { width: 18px; height: 18px; }
.gw-list .meta span.live-tag { color: var(--ok); }

/* ajastukset */
.sched-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sched-list li { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: start; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line-soft); transition: border-color .2s, transform .25s var(--ease); }
.sched-list li:hover { border-color: var(--line); transform: translateX(2px); }
.sched-list li.off { opacity: .55; }
.date-tile { border-radius: 12px; background: var(--grad-soft); border: 1px solid rgba(255,143,177,.25); text-align: center; padding: 6px 4px; }
.date-tile b { display: block; font: 700 20px/1.1 var(--font-display); }
.date-tile span { font-size: 11px; color: var(--ink-2); }
.sched-list .msg { white-space: pre-wrap; word-break: break-word; font-size: 13.5px; color: var(--ink-2); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sched-list .tags { display: flex; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--mut); }
.sched-list .acts { display: flex; gap: 4px; }

/* ylläpito */
.action-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.tile { text-align: left; display: grid; gap: 4px; padding: 18px; border-radius: 18px; cursor: pointer; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(41, 32, 61, .72), rgba(32, 25, 48, .82)); color: var(--ink); transition: transform .3s var(--ease), border-color .3s, box-shadow .3s; }
.tile svg { width: 24px; height: 24px; color: var(--lil); margin-bottom: 8px; transition: transform .4s var(--spring); }
.tile strong { font-size: 15px; }
.tile span { color: var(--mut); font-size: 13px; }
.tile:hover { transform: translateY(-3px); border-color: #4A3D69; box-shadow: 0 18px 40px -22px rgba(201,167,255,.45); }
.tile:hover svg { transform: scale(1.12) rotate(-6deg); }
.tile.danger svg { color: var(--bad); }
.tile:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.tile.busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 10px 18px; margin: 0; font-size: 13.5px; }
.kv.two { grid-template-columns: max-content 1fr max-content 1fr; }
.kv dt { color: var(--mut); }
.kv dd { margin: 0; word-break: break-word; }
.kv dd.bad { color: var(--bad); font-weight: 600; }
.kv dd.good { color: var(--ok); }
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.files li { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 7px; border-radius: 11px; transition: background-color .2s; }
.files li:hover { background: rgba(255,255,255,.04); }
.files .f-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(201,167,255,.12); color: var(--lil); }
.files .f-ic svg { width: 17px; height: 17px; }
.logs { background: #0E0A15; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; max-height: 420px; overflow: auto; font: 12.5px/1.55 "Cascadia Code", Consolas, monospace; color: #CFC4E2; white-space: pre-wrap; margin: 0; }

/* =====================================================================
   Soitinpalkki
   ===================================================================== */
.player {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50;
  height: var(--player-h);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; gap: 18px;
  padding: 0 18px 0 14px; border-radius: 22px;
  background: linear-gradient(100deg, rgba(64, 32, 84, .92) 0%, rgba(42, 30, 61, .94) 45%, rgba(34, 26, 52, .95) 100%);
  backdrop-filter: blur(20px) saturate(150%);
  border: 1px solid rgba(255,255,255,.09);
  box-shadow: 0 24px 60px -18px rgba(0,0,0,.85), 0 0 0 1px rgba(0,0,0,.2);
  animation: slideUp .6s var(--ease) both .15s;
}
@keyframes slideUp { from { transform: translateY(130%); } }
.pl-now { display: flex; align-items: center; gap: 13px; min-width: 0; }
.pl-cover { width: 58px; height: 58px; border-radius: 13px; flex: none; position: relative; overflow: hidden; display: grid; place-items: center; color: rgba(255,255,255,.8); background: linear-gradient(160deg, #FFB38A, #C2477E 60%, #4A1E5C) center/cover; box-shadow: 0 8px 22px -8px rgba(194,71,126,.7); transition: transform .3s var(--ease); }
.pl-cover:hover { transform: scale(1.05); }
.pl-cover svg { width: 22px; height: 22px; }
.pl-cover.img svg { display: none; }
.eq { position: absolute; inset: auto 0 0 0; height: 24px; display: flex; align-items: flex-end; justify-content: center; gap: 3px; padding-bottom: 6px; background: linear-gradient(0deg, rgba(0,0,0,.55), transparent); opacity: 0; transition: opacity .3s; }
.eq i { width: 3px; height: 4px; border-radius: 2px; background: #fff; }
.player.playing .eq { opacity: 1; }
.player.playing .eq i { animation: eq 1s ease-in-out infinite; }
.player.playing .eq i:nth-child(2) { animation-delay: -.4s; animation-duration: .8s; }
.player.playing .eq i:nth-child(3) { animation-delay: -.2s; animation-duration: 1.15s; }
.player.playing .eq i:nth-child(4) { animation-delay: -.6s; animation-duration: .9s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }
.pl-meta { min-width: 0; display: grid; }
.pl-meta strong { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-meta span { color: var(--mut); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-meta strong.swap, .pl-meta span.swap { animation: swapIn .45s var(--ease); }
@keyframes swapIn { from { opacity: 0; transform: translateY(6px); } }
.pl-center { display: grid; gap: 2px; justify-items: center; min-width: 0; }
.pl-buttons { display: flex; align-items: center; gap: 6px; }
.pl-progress { display: flex; align-items: center; gap: 10px; width: 100%; font-size: 11.5px; color: var(--mut); font-variant-numeric: tabular-nums; }
.pl-progress span { min-width: 34px; text-align: center; }
.pl-right { display: flex; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.pl-volume { display: flex; align-items: center; gap: 2px; width: 140px; }
.chan-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid transparent; font-size: 12.5px; font-weight: 600; cursor: pointer; margin-left: 6px; max-width: 170px; transition: background-color .2s, border-color .2s; }
.chan-chip:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.12); }
.chan-chip span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chan-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mut); flex: none; }
.player.connected .chan-chip .dot { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.player.idle .pl-buttons .ibtn:not(.play) { opacity: .5; }
.chan-pop { min-width: 250px; }
.chan-pop p { padding: 6px 10px 8px; }
.filter-pop { min-width: 190px; }

/* =====================================================================
   Dialogi ja ilmoitukset
   ===================================================================== */
.dlg { border: 1px solid var(--line); border-radius: 22px; background: rgba(36, 28, 54, .98); color: var(--ink); padding: 24px; width: min(460px, calc(100vw - 32px)); box-shadow: 0 40px 100px -30px rgba(0,0,0,.9); }
.dlg[open] { animation: dlgIn .3s var(--spring); }
.dlg::backdrop { background: rgba(8, 5, 14, .6); backdrop-filter: blur(4px); animation: fadeIn .25s; }
@keyframes dlgIn { from { opacity: 0; transform: translateY(10px) scale(.95); } }
@keyframes fadeIn { from { opacity: 0; } }
.dlg form { display: grid; gap: 14px; }
.dlg h2 { font-size: 19px; }
.dlg p:empty, .dlg #dlg-body:empty { display: none; }
.dlg p { color: var(--ink-2); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.dlg .pick { display: grid; gap: 4px; max-height: 50vh; overflow: auto; }
.dlg .pick button { text-align: left; }
.dlg.danger #dlg-ok { background: var(--bad); color: #1A0B10; box-shadow: none; }

.toasts { position: fixed; right: 22px; bottom: calc(var(--player-h) + 34px); z-index: 100; display: grid; gap: 8px; justify-items: end; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; background: rgba(43, 34, 64, .97); border: 1px solid var(--line); border-radius: 14px; padding: 11px 15px; box-shadow: 0 20px 40px -16px rgba(0,0,0,.8); pointer-events: auto; max-width: 420px; animation: toastIn .4s var(--spring); }
.toast svg { width: 18px; height: 18px; color: var(--ok); }
.toast.error svg { color: var(--bad); }
.toast.error { border-color: rgba(255,125,142,.45); }
.toast.out { animation: toastOut .3s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(30px); } }

/* luurangot latauksen ajaksi */
.skel { background: linear-gradient(90deg, rgba(255,255,255,.04), rgba(255,255,255,.09), rgba(255,255,255,.04)); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* =====================================================================
   Responsiivisuus
   ===================================================================== */
@media (max-width: 1180px) {
  .top-right .live { display: none; }
  .modules { grid-template-columns: repeat(2, 1fr); }
  .pl-volume { width: 100px; }
}
@media (max-width: 980px) {
  .topbar { flex-wrap: wrap; padding: 10px 16px; }
  .mainnav { order: 3; width: 100%; margin: 0; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .split, .split.wide-left, .split.wide-right, .lib-top, .pl-layout, .settings-grid { grid-template-columns: 1fr; }
  .preview-card { position: static; }
  .player { grid-template-columns: minmax(0, 1fr) auto; height: auto; padding: 10px 12px; gap: 10px; }
  .pl-center { grid-column: 1 / -1; order: 3; }
  .pl-right .pl-volume, .pl-right #pl-autoplay { display: none; }
  :root { --player-h: 128px; }
  .action-tiles { grid-template-columns: 1fr; }
  .kv.two { grid-template-columns: max-content 1fr; }
}
@media (max-width: 640px) {
  .view { padding: 20px 14px calc(var(--player-h) + 40px); }
  h1 { font-size: 24px; }
  .modules, .kpis, .kpis.three, .cols-2 { grid-template-columns: 1fr; }
  .addbar { flex-wrap: wrap; }
  .addbar input#add-query { flex: 1 1 calc(100% - 40px); min-width: 0; }
  .addbar .btn.grad { flex: 1; }
  .addbar select { max-width: none; flex: 1; }
  .hero { grid-template-columns: 1fr; text-align: left; }
  .hero-cover { width: 110px; height: 110px; }
  .tracks li { grid-template-columns: 22px 40px minmax(0, 1fr) auto; }
  .tracks li .dur { display: none; }
  .row-actions { opacity: 1; transform: none; }
  .rp-role-row { grid-template-columns: 1fr 1fr; }
  .player { left: 8px; right: 8px; bottom: 8px; border-radius: 18px; }
  .guild-btn { max-width: 160px; }
  .table th:nth-child(2), .table td:nth-child(2), .table th:nth-child(4), .table td:nth-child(4) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
