/* ---------------------------------------------------------------- tokens
   Dark by default. <html data-theme="light|dark"> forces a theme; without it the system setting decides.
   The theme preview on the account page uses the same tokens via data-base. */
:root, .theme-preview {
  --bg: #0e1014;
  --surface: #171a20;
  --surface-2: #1f232b;
  --surface-3: #272c36;
  --border: #2b313c;
  --text: #e9ecf2;
  --muted: #98a1b0;
  --accent: #8aa4ff;
  --accent-strong: #6f8cff;
  --accent-text: #0b1020;
  --danger: #ff7a7a;
  --ok: #4fd39a;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --radius: 12px;
  --radius-sm: 8px;
  --topbar-h: 60px;
  /* The biggest player that still leaves room for the title below it, kept at 16:9 so it has no black bars. */
  --player-max-h: calc(100vh - var(--topbar-h) - 150px);
  --player-max-w: calc(var(--player-max-h) * 16 / 9);
  --bottomnav-h: 60px;
  /* Newer glass sections: a dark tint in the dark theme, a light one in the light theme (blocks below). */
  --glass-tint: 8 12 24;
  --pop-bg: linear-gradient(155deg, rgba(16, 22, 38, .96), rgba(11, 15, 28, .96));
  --pop-text: #eef4ff;
  --pop-line: rgba(255, 255, 255, .08);
  --ghost-bg: linear-gradient(155deg, rgba(16, 22, 38, .48), rgba(14, 18, 30, .35));
  --brand-mint: #5eead4;
  --name-grad: linear-gradient(90deg, #fff, #c7f9f2, #ffd6e6);
  /* Role badge colours on a dark background; dark areas use these in the light theme too (rule below). */
  --owner-ink-dark: #fef3c7;
  --owner-label-dark: linear-gradient(90deg, #fef3c7 0%, #fffbeb 38%, #fde68a 65%, #fef3c7 100%);
  --admin-ink-dark: #fcd34d;
  --admin-label-dark: linear-gradient(90deg, #fcd34d 0%, #fff6d6 36%, #f59e0b 66%, #fcd34d 100%);
  --dev-ink-dark: #38bdf8;
  --dev-label-dark: linear-gradient(90deg, #38bdf8 0%, #e0f7ff 36%, #a855f7 66%, #38bdf8 100%);
  --owner-ink: var(--owner-ink-dark);
  --owner-label: var(--owner-label-dark);
  --admin-ink: var(--admin-ink-dark);
  --admin-label: var(--admin-label-dark);
  --dev-ink: var(--dev-ink-dark);
  --dev-label: var(--dev-label-dark);
  color-scheme: dark;
}

/* Areas that stay dark in either theme (the player and its danmaku, the profile pop-up card, the welcome screen). */
.player, .profile-mini-popover, .auth-welcome {
  --owner-ink: var(--owner-ink-dark);
  --owner-label: var(--owner-label-dark);
  --admin-ink: var(--admin-ink-dark);
  --admin-label: var(--admin-label-dark);
  --dev-ink: var(--dev-ink-dark);
  --dev-label: var(--dev-label-dark);
}

:root[data-theme="light"], .theme-preview[data-base="light"] {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e6e9ee;
  --border: #dde1e8;
  --text: #151821;
  --muted: #5f6878;
  --accent: #3d63f5;
  --accent-strong: #2c50de;
  --accent-text: #ffffff;
  --danger: #d43c3c;
  --ok: #13915a;
  --shadow: 0 10px 30px rgba(20, 30, 60, .14);
  --glass-tint: 255 255 255;
  --pop-bg: linear-gradient(155deg, rgba(255, 255, 255, .98), rgba(243, 245, 249, .98));
  --pop-text: #151821;
  --pop-line: rgba(15, 23, 42, .08);
  --ghost-bg: linear-gradient(155deg, rgba(226, 232, 240, .6), rgba(241, 245, 249, .45));
  --brand-mint: #0f766e;
  --name-grad: linear-gradient(90deg, #151821, #0f766e, #be185d);
  --owner-ink: #be185d;
  --owner-label: linear-gradient(90deg, #be185d 0%, #b45309 38%, #7c3aed 65%, #be185d 100%);
  --admin-ink: #b45309;
  --admin-label: linear-gradient(90deg, #b45309 0%, #c2410c 36%, #92400e 66%, #b45309 100%);
  --dev-ink: #0369a1;
  --dev-label: linear-gradient(90deg, #0369a1 0%, #2563eb 36%, #7c3aed 66%, #0369a1 100%);
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]), .theme-preview[data-base="system"] {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --surface-2: #f0f2f5;
    --surface-3: #e6e9ee;
    --border: #dde1e8;
    --text: #151821;
    --muted: #5f6878;
    --accent: #3d63f5;
    --accent-strong: #2c50de;
    --accent-text: #ffffff;
    --danger: #d43c3c;
    --ok: #13915a;
    --shadow: 0 10px 30px rgba(20, 30, 60, .14);
    --glass-tint: 255 255 255;
    --pop-bg: linear-gradient(155deg, rgba(255, 255, 255, .98), rgba(243, 245, 249, .98));
    --pop-text: #151821;
    --pop-line: rgba(15, 23, 42, .08);
    --ghost-bg: linear-gradient(155deg, rgba(226, 232, 240, .6), rgba(241, 245, 249, .45));
    --brand-mint: #0f766e;
    --name-grad: linear-gradient(90deg, #151821, #0f766e, #be185d);
    --owner-ink: #be185d;
    --owner-label: linear-gradient(90deg, #be185d 0%, #b45309 38%, #7c3aed 65%, #be185d 100%);
    --admin-ink: #b45309;
    --admin-label: linear-gradient(90deg, #b45309 0%, #c2410c 36%, #92400e 66%, #b45309 100%);
    --dev-ink: #0369a1;
    --dev-label: linear-gradient(90deg, #0369a1 0%, #2563eb 36%, #7c3aed 66%, #0369a1 100%);
    color-scheme: light;
  }
}

/* Custom background (colours/picture come from /theme.css). Cards and bars sit on top. */
.bg-layer, .bg-dim { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.bg-layer { inset: -40px; background-size: cover; background-position: center; }
body.has-bg .topbar { background: color-mix(in srgb, var(--bg) 70%, transparent); }
body.has-bg .tabs a:not([aria-current]), body.has-bg .chip { background: color-mix(in srgb, var(--surface-2) 80%, transparent); }

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html {
  -webkit-text-size-adjust: 100%;
  scrollbar-width: thin;
  scrollbar-color: rgba(94, 234, 212, .32) transparent;
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(94, 234, 212, .42), rgba(255, 122, 158, .38));
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(94, 234, 212, .72), rgba(255, 122, 158, .66));
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  font: 15px/1.55 "Inter", system-ui, -apple-system, "Segoe UI", "Noto Sans TC", "Noto Sans JP", "PingFang TC", "Microsoft JhengHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { display: block; max-width: 100%; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.15rem; }
p { margin: 0 0 .8em; }
code { background: var(--surface-2); padding: .1em .4em; border-radius: 6px; font-size: .9em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.error-text { color: var(--danger); }
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.page { max-width: 1320px; margin: 0 auto; padding: 24px 24px 64px; }
/* Pages with a player use more of a wide screen, so the video is bigger. */
.page-wide .page { max-width: 1840px; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  width: 100%; margin: 0;
  height: var(--topbar-h); padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 18px; pointer-events: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 52%, transparent), transparent);
}
.brand { display: inline-flex; align-items: center; gap: 9px; height: 38px; line-height: 1; font-weight: 700; font-size: 1.05rem; white-space: nowrap; flex: none; letter-spacing: .02em; }
.brand-icon { width: 34px; height: 34px; color: #eef4ff; transition: transform .22s cubic-bezier(.34, 1.56, .64, 1); overflow: visible; }
.brand:hover .brand-icon { transform: scale(1.08); }
.brand:hover .logo-eye { transform: scaleY(0.2); transform-origin: center 35.6px; transition: transform .15s ease; }
.brand:hover .logo-ears { filter: drop-shadow(0 0 6px #5eead4); }
body.is-media-playing .logo-ring { transform-origin: 32px 32px; animation: vinyl-spin 14s linear infinite; }
.topbar.is-moon-sweep { animation: moon-sweep .55s ease-out; }
@keyframes moon-sweep {
  0% { box-shadow: inset 0 0 0 1px rgba(94, 234, 212, .7), 0 0 24px rgba(255, 122, 158, .4); }
  100% { box-shadow: none; }
}
.search { position: relative; flex: 1; max-width: 520px; margin: 0 auto; }
.search input { width: 100%; height: 38px; padding: 0 14px 0 36px; border-radius: 999px; line-height: 1; }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; width: 1.15em; height: 1.15em; vertical-align: 0; }
.search-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 90;
  padding: 10px; border-radius: 16px; max-height: min(68vh, 460px); overflow-y: auto;
  background: var(--pop-bg), url("/static/img/noise.svg");
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(94, 234, 212, .35);
  box-shadow: 0 20px 54px rgba(0, 0, 0, .58), 0 0 22px rgba(94, 234, 212, .12);
}
.search-suggest[hidden] { display: none; }
.suggest-group + .suggest-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--pop-line); }
.suggest-group-title { padding: 2px 8px 4px; font-size: .74rem; font-weight: 700; color: var(--brand-mint); letter-spacing: .04em; }
.suggest-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 10px; border-radius: 10px; color: var(--text); text-decoration: none;
  transition: background .16s ease, color .16s ease;
}
.suggest-item:hover { background: rgba(94, 234, 212, .12); color: var(--pop-text); }
.suggest-title { font-size: .88rem; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-sub { font-size: .76rem; color: var(--muted); flex: none; }
.suggest-empty { padding: 8px 10px; text-align: center; }
.suggest-all-link {
  display: block; margin-top: 8px; padding: 7px 10px 4px; border-top: 1px solid var(--pop-line);
  text-align: center; font-size: .8rem; font-weight: 600; color: var(--accent);
}
.mainnav { position: relative; display: flex; align-items: center; gap: 6px; flex: none; }
.nav-aurora-pill {
  position: absolute; left: 0; top: 0; height: 38px; border-radius: 999px; pointer-events: none; z-index: 0; opacity: 0;
  background: color-mix(in srgb, var(--surface-2) 92%, rgba(94, 234, 212, .12));
  border: 1px solid color-mix(in srgb, var(--border) 60%, rgba(94, 234, 212, .38));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 4px 14px rgba(0, 0, 0, .2);
  transition: transform .34s cubic-bezier(.34, 1.45, .64, 1), width .32s cubic-bezier(.34, 1.45, .64, 1), opacity .18s ease;
}
.nav-aurora-pill::after {
  content: ""; position: absolute; left: 16%; right: 16%; bottom: 2px; height: 2px; border-radius: 999px;
  background: linear-gradient(90deg, #5eead4, #ff7a9e);
  box-shadow: 0 0 8px rgba(94, 234, 212, .65);
}
.nav-aurora-pill.is-instant { transition: none !important; }
.mainnav a { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 13px; border-radius: 999px; color: var(--muted); font-size: .92rem; line-height: 1; white-space: nowrap; }
.mainnav a .icon { width: 1.15em; height: 1.15em; vertical-align: 0; }
.mainnav a:hover { background: var(--surface-2); color: var(--text); }
.mainnav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.mainnav.has-pill a[aria-current="page"]:not(.nav-upload),
.mainnav.has-pill a[aria-current="page"]:not(.nav-upload):hover { background: transparent; color: var(--text); }
.mainnav .nav-upload { color: var(--accent-text); background: var(--accent); box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 32%, transparent); }
.mainnav .nav-upload:hover, .mainnav .nav-upload[aria-current="page"] { color: var(--accent-text); background: var(--accent-strong); }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex: none; }
.sound-toggle-btn { flex: none; width: 38px; height: 38px; border: 1px solid var(--border); background: var(--surface-2); }
.sound-toggle-btn .icon { width: 1.15em; height: 1.15em; vertical-align: 0; }
.sound-toggle-btn.is-on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 42%, var(--border)); }
.usermenu { position: relative; display: flex; align-items: center; flex: none; }
.usermenu summary {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  padding: 0; border-radius: 50%; list-style: none; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.usermenu summary:hover { transform: scale(1.06); }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary .avatar { width: 38px; height: 38px; display: block; box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--border) 90%, rgba(255, 255, 255, .18)); }
.usermenu summary.role-ring-owner .avatar { box-shadow: 0 0 0 2px rgba(254, 240, 138, .85), 0 0 12px rgba(251, 113, 133, .45); }
.usermenu summary.role-ring-admin .avatar { box-shadow: 0 0 0 2px rgba(252, 211, 77, .75), 0 0 10px rgba(245, 158, 11, .35); }
.usermenu summary.role-ring-dev .avatar { box-shadow: 0 0 0 2px rgba(56, 189, 248, .75), 0 0 10px rgba(168, 85, 247, .35); }
.usermenu summary span.avatar { display: grid; place-items: center; }
.avatar {
  display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface-3); color: var(--text); font-weight: 700; object-fit: cover; overflow: hidden;
}
.avatar-sm { width: 26px; height: 26px; font-size: .8rem; }
.avatar-lg { width: 48px; height: 48px; font-size: 1.25rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 2.4rem; }
.usermenu .menu { right: 0; left: auto; min-width: 264px; }
.menu-head { padding: 8px 12px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; font-weight: 600; }
.menu-head-profile { display: flex; align-items: center; gap: 11px; padding: 10px 12px 12px; }
.menu-head-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.menu-head small { display: block; color: var(--muted); font-weight: 400; }
.menu > a .icon, .menu-button .icon { width: 16px; height: 16px; color: var(--muted); flex: none; }
.menu > a:hover .icon, .menu-button:hover .icon { color: var(--text); }
.menu-button.danger .icon { color: currentColor; }
.theme-switch-label { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); margin-bottom: 8px; }
.theme-switch-label .icon { width: 14px; height: 14px; }
.segmented-icons { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
.segmented-icons button { display: inline-flex; align-items: center; justify-content: center; gap: 4px; padding: 6px 6px; font-size: .78rem; }
.segmented-icons .icon { width: 13px; height: 13px; }

.bottomnav { display: none; }

@media (max-width: 860px) {
  .mainnav span { display: none; }
}
@media (max-width: 720px) {
  .page { padding: 16px 14px calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 34px); }
  .topbar { top: 0; width: 100%; gap: 8px; padding: 0 12px; }
  .brand-name, .mainnav, .sound-toggle-btn { display: none; }
  .topbar-actions { gap: 6px; }
  .usermenu summary, .usermenu summary .avatar { width: 34px; height: 34px; }
  .search input { height: 34px; font-size: .9rem; }
  .bottomnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    height: calc(var(--bottomnav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 92%, rgb(var(--glass-tint) / .75)); backdrop-filter: blur(14px);
    border-top: 1px solid color-mix(in srgb, var(--border) 75%, rgba(255, 255, 255, .1));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  }
  .bottomnav a {
    position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; font-size: .72rem; color: var(--muted); -webkit-tap-highlight-color: transparent;
    transition: color .18s ease, transform .18s cubic-bezier(.34, 1.56, .64, 1);
  }
  .bottomnav a:active { transform: scale(0.9); }
  .bottomnav a[aria-current="page"] { color: var(--accent); font-weight: 600; }
  .bottomnav a[aria-current="page"]::before {
    content: ""; position: absolute; top: 0; left: 24%; right: 24%; height: 2.5px; border-radius: 999px;
    background: linear-gradient(90deg, #5eead4, #ff7a9e); box-shadow: 0 0 10px rgba(94, 234, 212, .65);
  }
  .bottomnav .icon { width: 21px; height: 21px; }
  h1 { font-size: 1.32rem; }
  .page-head { flex-wrap: wrap; gap: 10px 14px; }
}
@media (max-width: 560px) {
  .hero-stage { min-height: 248px; padding: 18px 16px; border-radius: 16px; }
  .hero-cta .btn { flex: 1 1 auto; }
  .home-mode-tabs { width: 100%; }
}

/* ---------------------------------------------------------------- forms & buttons */
input, select { min-height: 40px; }
input, select, textarea {
  font: inherit; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 12px; width: 100%; min-width: 0;
  transition: border-color .18s ease, box-shadow .18s ease;
}
select {
  appearance: none; -webkit-appearance: none;
  padding: 8px 34px 8px 12px; line-height: 1.3; cursor: pointer;
  background-image: url("/static/img/chevron-down.svg");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 14px 14px;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(244, 114, 182, .85);
  box-shadow: 0 0 10px rgba(244, 114, 182, .25);
}
textarea { resize: vertical; }
label { display: block; font-size: .88rem; color: var(--muted); margin: 12px 0 6px; }
.form label:first-of-type { margin-top: 0; }
.form .btn { margin-top: 16px; }
.form-inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.form-inline input { flex: 1 1 220px; width: auto; }
.form-inline .btn { margin-top: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr 110px; gap: 12px; }
.form-actions { display: flex; gap: 8px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 36px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--border) 82%, rgba(255, 255, 255, .12));
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
  color: var(--text); font: inherit; font-weight: 500; line-height: 1;
  cursor: pointer; white-space: nowrap; user-select: none;
}
.btn .icon { width: 1em; height: 1em; vertical-align: 0; }
.btn:hover { background: var(--surface-3); color: var(--text); border-color: color-mix(in srgb, var(--border) 55%, rgba(94, 234, 212, .38)); }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-text);
  box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 30%, transparent), inset 0 1px 0 rgba(255, 255, 255, .28);
}
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-text); }
.btn-small { min-height: 30px; padding: 6px 12px; font-size: .84rem; }
.btn-block { width: 100%; }
.btn.danger, .menu-button.danger { color: var(--danger); }
.btn.is-on { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.btn.is-on .icon path { fill: currentColor; }
.btn[disabled] { opacity: .5; cursor: default; }
summary.btn { list-style: none; }
summary.btn::-webkit-details-marker { display: none; }
form.inline { display: inline; }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn[aria-pressed="true"] { color: var(--accent); }
.icon-btn-main { width: 48px; height: 48px; background: var(--accent); color: var(--accent-text); }
.icon-btn-main:hover { background: var(--accent-strong); color: var(--accent-text); }

/* ---------------------------------------------------------------- dropdown menus */
.dropdown { position: relative; display: inline-block; }
.menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  min-width: 200px; max-width: calc(100vw - 32px);
  padding: 6px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--border) 82%, rgba(255, 255, 255, .12));
  background: color-mix(in srgb, var(--surface) 96%, rgb(var(--glass-tint) / .88)); backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), var(--shadow);
  transform-origin: top left;
}
details[data-menu][open] > .menu { animation: menu-pop .24s cubic-bezier(.34, 1.45, .64, 1); }
@keyframes menu-pop {
  from { opacity: 0; transform: scale(0.95) translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.menu-wide { width: min(340px, calc(100vw - 24px)); }
.series-edit-menu { width: min(370px, calc(100vw - 24px)); padding: 10px; }
.cover-drop-box {
  margin: 0; display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 12px; border: 1.5px dashed color-mix(in srgb, var(--border) 75%, rgba(94, 234, 212, .45));
  background: color-mix(in srgb, var(--surface-2) 72%, transparent); cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}
.cover-drop-box:hover { border-color: #5eead4; background: color-mix(in srgb, var(--accent) 8%, var(--surface-2)); }
.cover-drop-preview { width: 42px; height: 60px; border-radius: 6px; overflow: hidden; flex: none; border: 1px solid rgba(255, 255, 255, .16); }
.cover-drop-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-drop-meta { display: inline-flex; align-items: center; gap: 8px; font-size: .84rem; color: var(--muted); min-width: 0; }
.cover-drop-meta .icon { color: #5eead4; flex: none; }
.series-extra-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.series-edit-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
}
.btn.is-saved-tick {
  background: #4fd39a !important; border-color: #4fd39a !important; color: #061812 !important;
  box-shadow: 0 0 18px rgba(79, 211, 154, .55) !important;
}
.dropdown-right .menu { left: auto; right: 0; }
.menu > a, .menu-button {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 12px; border-radius: var(--radius-sm); border: 0; background: none;
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.menu > a:hover, .menu-button:hover { background: var(--surface-2); color: var(--text); }
.menu-form { padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.menu-form label { margin: 4px 0 0; }
.menu-form .btn { align-self: flex-start; margin-top: 6px; }
.menu-note { padding: 4px 12px; margin: 0; font-size: .85rem; }

/* ---------------------------------------------------------------- page head, tabs, chips */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; }
.page-head p { margin: 0; }
.library-head { margin-bottom: 14px; }
.sort-form select {
  width: auto; height: 36px; padding: 0 34px 0 15px; border-radius: 999px;
  font-size: .88rem; line-height: 34px; background-position: right 12px center;
}
.library-filter-panel {
  padding: 14px 16px; border-radius: 16px; margin-bottom: 20px;
  background: linear-gradient(155deg, color-mix(in srgb, var(--surface) 64%, transparent), color-mix(in srgb, var(--surface-2) 56%, transparent));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid color-mix(in srgb, var(--border) 78%, rgba(255, 255, 255, .1));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 8px 24px rgba(0, 0, 0, .18);
  display: flex; flex-direction: column; gap: 12px;
}
.library-filter-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.library-filter-top .tabs { margin-bottom: 0; }
.library-sort-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.library-view-toggle {
  display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.view-toggle-btn { width: 30px; height: 28px; border-radius: 999px; color: var(--muted); }
.view-toggle-btn.is-active { background: var(--accent); color: var(--accent-text); box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 35%, transparent); }
.library-filter-panel .chips { margin-bottom: 0; }
.library-filter-panel .facet-title { margin: 0 0 6px; }

.tabs { display: flex; gap: 6px; margin-bottom: 16px; overflow-x: auto; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.tabs a[aria-current="page"] { background: var(--text); color: var(--bg); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: .88rem; line-height: 1.1; }
.chip-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: rgba(255, 255, 255, .07); color: color-mix(in srgb, var(--muted) 80%, transparent);
  font-size: .72rem; font-weight: 600; font-variant-numeric: tabular-nums;
}
.chip-active { background: color-mix(in srgb, var(--accent) 18%, var(--surface-2)); border-color: color-mix(in srgb, var(--accent) 52%, var(--border)); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 22%, transparent); }
.chip-active .chip-count { background: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--text); }
.chip .icon { width: 1em; height: 1em; }
.facet-title { font-size: .85rem; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.pill { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 22px; padding: 3px 9px; border: 1px solid transparent; border-radius: 999px; background: var(--surface-3); font-size: .78rem; line-height: 1; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill .icon { width: 1em; height: 1em; }
.pill-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.pill-err { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }

/* ---------------------------------------------------------------- cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 22px 16px; }
@media (max-width: 720px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; } }
.library-grid-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; flex-wrap: wrap; }
.library-grid-head .grid-title { margin: 0; display: flex; align-items: center; gap: 6px; }
.grid-title-count { color: var(--muted); font-weight: 500; font-size: .92rem; }
.library-reset-btn { gap: 5px; border-radius: 999px; }
.library-grid.is-compact { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.library-grid.is-compact .card { flex-direction: row; align-items: center; gap: 12px; padding: 8px 12px 8px 8px; }
.library-grid.is-compact .thumb { width: 124px; flex: none; }
.library-grid.is-compact .card-body { flex: 1; padding: 0; }
.library-resume-grid { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.resume-card-wrap { position: relative; }
.resume-card-wrap .card {
  display: grid; grid-template-columns: 142px minmax(0, 1fr); align-items: center; gap: 12px;
  padding: 8px 34px 8px 8px;
}
.resume-card-wrap .card-body { min-width: 0; padding: 0; }
.resume-clear-btn {
  position: absolute; top: 8px; right: 8px; z-index: 4;
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(10, 14, 26, .84);
  color: var(--muted); display: grid; place-items: center; cursor: pointer;
  opacity: 0; transform: scale(.9);
  transition: opacity .18s ease, transform .18s ease, color .18s ease, border-color .18s ease;
}
.resume-clear-btn .icon { width: 13px; height: 13px; }
.resume-card-wrap:hover .resume-clear-btn,
.resume-card-wrap:focus-within .resume-clear-btn { opacity: 1; transform: scale(1); }
.resume-clear-btn:hover { color: #ff7a9e; border-color: rgba(255, 122, 158, .65); }
@media (hover: none), (pointer: coarse) { .resume-clear-btn { opacity: .88; transform: none; } }
.library-resume-section .watch-bar { height: 4px; z-index: 3; background: rgba(10, 14, 26, .72); }
.library-resume-section .watch-bar > span {
  background: linear-gradient(90deg, #5eead4, #ff7a9e);
  box-shadow: 0 0 10px rgba(255, 122, 158, .55);
}

.card {
  display: flex; flex-direction: column; min-width: 0; height: 100%;
  padding: 8px; border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(155deg, color-mix(in srgb, var(--surface) 88%, transparent), color-mix(in srgb, var(--surface-2) 82%, transparent)), url("/static/img/noise.svg");
  border: 1px solid color-mix(in srgb, var(--border) 75%, rgba(255, 255, 255, .08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 10px 26px rgba(0, 0, 0, .24);
  transition: transform .24s cubic-bezier(.22, 1, .36, 1), border-color .22s ease, box-shadow .24s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  box-shadow: inset 0 1px 0 rgba(94, 234, 212, .26), 0 14px 32px rgba(0, 0, 0, .34);
}
.card:hover .thumb img { transform: scale(1.05); }
.card:hover .watch-bar > span { filter: brightness(1.18); box-shadow: 0 0 8px var(--accent); }
.thumb {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: var(--surface-2); background-size: cover; background-position: center;
}
.thumb::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 52%, rgba(6, 10, 22, .48) 100%);
  transition: opacity .28s ease;
}
.card:hover .thumb::after { opacity: .65; }
.thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .42s cubic-bezier(.22, 1, .36, 1), opacity .32s ease; }
.progressive-img { opacity: 0; }
.progressive-img.is-loaded { opacity: 1; }
.thumb-audio img { object-fit: cover; }
.audio-thumb-art {
  position: absolute; inset: 0; pointer-events: none; z-index: 1; overflow: hidden;
  background: linear-gradient(135deg, rgba(255, 255, 255, .2) 0%, rgba(255, 255, 255, .03) 40%, transparent 62%, rgba(8, 12, 24, .42) 100%);
}
.audio-thumb-art.is-blank-art {
  background:
    radial-gradient(circle at 22% 24%, rgba(94, 234, 212, .16), transparent 55%),
    radial-gradient(circle at 80% 78%, rgba(255, 122, 158, .16), transparent 58%),
    linear-gradient(135deg, rgba(255, 255, 255, .08) 0%, transparent 56%, rgba(8, 12, 24, .35) 100%);
}
.audio-thumb-vinyl {
  position: absolute; right: -20%; bottom: -40%; width: 64%; aspect-ratio: 1; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .24); opacity: .52;
  background:
    repeating-radial-gradient(circle, rgba(255, 255, 255, .08) 0 1px, transparent 1px 5px),
    radial-gradient(circle, rgba(255, 122, 158, .36) 0 22%, rgba(255, 255, 255, .14) 23% 26%, transparent 27%);
  transition: transform .45s cubic-bezier(.22, 1, .36, 1), opacity .28s ease;
}
.card:hover .audio-thumb-vinyl { transform: rotate(28deg) scale(1.06); opacity: .78; }
.thumb-icon { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); background: radial-gradient(circle at 50% 40%, var(--surface-3), var(--surface-2)); }
.thumb-icon .icon { width: 34%; max-width: 44px; height: auto; aspect-ratio: 1; }
/* Curated neon-pastel dusk gradients for coverless pure audio tracks */
.is-audio-blank .thumb-icon { color: rgba(255, 255, 255, .82); }
.is-audio-blank[data-audio-tone="0"] .thumb-icon, .vinyl-art.is-audio-blank[data-audio-tone="0"] {
  background: radial-gradient(circle at 22% 22%, rgba(255, 166, 198, .42), transparent 55%), linear-gradient(135deg, #4b1d3f, #7d2f5e 52%, #251940);
}
.is-audio-blank[data-audio-tone="1"] .thumb-icon, .vinyl-art.is-audio-blank[data-audio-tone="1"] {
  background: radial-gradient(circle at 22% 22%, rgba(110, 231, 245, .38), transparent 55%), linear-gradient(135deg, #103247, #1c5b6e 52%, #182348);
}
.is-audio-blank[data-audio-tone="2"] .thumb-icon, .vinyl-art.is-audio-blank[data-audio-tone="2"] {
  background: radial-gradient(circle at 22% 22%, rgba(196, 181, 253, .42), transparent 55%), linear-gradient(135deg, #2d1f54, #593582 52%, #192042);
}
.is-audio-blank[data-audio-tone="3"] .thumb-icon, .vinyl-art.is-audio-blank[data-audio-tone="3"] {
  background: radial-gradient(circle at 22% 22%, rgba(253, 186, 116, .38), transparent 55%), linear-gradient(135deg, #4c2322, #823c2f 52%, #241937);
}
.is-audio-blank[data-audio-tone="4"] .thumb-icon, .vinyl-art.is-audio-blank[data-audio-tone="4"] {
  background: radial-gradient(circle at 22% 22%, rgba(94, 234, 212, .38), transparent 55%), linear-gradient(135deg, #113a38, #20685f 52%, #15223e);
}
.is-audio-blank[data-audio-tone="5"] .thumb-icon, .vinyl-art.is-audio-blank[data-audio-tone="5"] {
  background: radial-gradient(circle at 22% 22%, rgba(253, 224, 71, .34), transparent 55%), linear-gradient(135deg, #3c2a1e, #6e482f 52%, #23193b);
}
.duration-badge, .kind-badge, .private-badge {
  position: absolute; z-index: 2; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  padding: 3px 7px; border-radius: 6px; font-size: .75rem; font-weight: 600; line-height: 1;
  background: rgba(0, 0, 0, .72); color: #fff; font-variant-numeric: tabular-nums;
}
.duration-badge { right: 8px; bottom: 8px; }
.kind-badge { left: 8px; bottom: 8px; padding: 4px 5px; border: 1px solid rgba(255, 255, 255, .1); transition: color .22s ease, border-color .22s ease, box-shadow .22s ease, background .22s ease; }
.card:hover .thumb-video .kind-badge { color: #5eead4; background: rgba(10, 20, 34, .9); border-color: rgba(94, 234, 212, .55); box-shadow: 0 0 12px rgba(94, 234, 212, .45); }
.card:hover .thumb-audio .kind-badge { color: #ff7a9e; background: rgba(28, 12, 24, .9); border-color: rgba(255, 122, 158, .55); box-shadow: 0 0 12px rgba(255, 122, 158, .45); }
.private-badge { left: 8px; top: 8px; padding: 4px 5px; }
.kind-badge .icon, .private-badge .icon { width: 14px; height: 14px; }
.card-body { padding: 10px 4px 2px; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; flex: 1; }
.card-title { font-weight: 600; line-height: 1.4; min-height: 2.8em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.card-sub { color: var(--muted); font-size: .85rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: auto; }

.pager { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 32px; }

.empty {
  text-align: center; max-width: 520px; margin: 28px auto; padding: 38px 24px;
  border-radius: var(--radius); color: var(--muted);
  border: 1px dashed color-mix(in srgb, var(--border) 82%, rgba(94, 234, 212, .32));
  background: linear-gradient(160deg, color-mix(in srgb, var(--surface) 78%, transparent), color-mix(in srgb, var(--surface-2) 72%, transparent)), url("/static/img/noise.svg");
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.empty .mascot-art-empty { margin: 0 auto 10px; }
.empty-icon { width: 48px; height: 48px; margin-bottom: 12px; opacity: .6; }
.empty .btn { margin-top: 8px; }

/* ---------------------------------------------------------------- player & watch page */
.player { position: relative; border-radius: var(--radius); overflow: hidden; background: #000; }
.player-media { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 74vh; background: #000; }
.player-audio .player-media { background: radial-gradient(circle at 50% 35%, #2a2f3a, #0b0c10); }

/* custom controls (player.js) */
.player.is-enhanced { user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; color: #fff; }
.player.is-enhanced:focus { outline: none; }
.player.is-enhanced:not(.pc-show).is-playing { cursor: none; }
.player:fullscreen, .player.is-fullscreen { border-radius: 0; display: flex; align-items: center; background: #000; }
.player:fullscreen .player-media, .player.is-fullscreen .player-media { max-height: none; height: 100%; aspect-ratio: auto; }
.player-media::cue { background: rgba(0, 0, 0, .68); color: #fff; font-size: 1.05em; line-height: 1.35; }
.player.is-fullscreen .player-media::cue { font-size: 1.5em; }
.pc-gesture { position: absolute; inset: 0; z-index: 1; touch-action: manipulation; }

.pc-bottom {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 36px 10px 6px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .78));
  transition: opacity .2s ease;
}
.pc-center { position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; gap: 44px; pointer-events: none; transition: opacity .2s ease; }
.pc-center button { pointer-events: auto; }
.player.is-enhanced.is-playing:not(.pc-show) .pc-bottom,
.player.is-enhanced.is-playing:not(.pc-show) .pc-center { opacity: 0; pointer-events: none; }
.player.is-enhanced.is-playing:not(.pc-show) .pc-center button { pointer-events: none; }
/* Computers: the big button only while paused. Phones: play and ±10 s in the middle with the controls. */
.player.is-enhanced:not(.is-touch).is-playing .pc-center { opacity: 0; }
.player.is-enhanced:not(.is-touch).is-playing .pc-center button { pointer-events: none; }
.player.is-enhanced:not(.is-touch) .pc-skip { display: none; }

.pc-big, .pc-skip {
  display: grid; place-items: center; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(12, 16, 26, .68); color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
.pc-big { width: 68px; height: 68px; }
.pc-big svg { width: 32px; height: 32px; }
.pc-skip { width: 52px; height: 52px; }
.pc-skip svg { width: 28px; height: 28px; }
.player.is-waiting .pc-big { opacity: 0; }

.pc-row { display: flex; align-items: center; gap: 2px; }
.pc-btn {
  position: relative; display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border: 0; border-radius: 50%; background: none; color: #fff; cursor: pointer;
}
.pc-btn:hover { background: rgba(255, 255, 255, .14); }
.pc-btn svg { width: 22px; height: 22px; }
.pc-btn[hidden] { display: none; }
.pc-cc[aria-pressed="true"] { color: var(--accent); }
.pc-cc[aria-pressed="true"]::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 6px; height: 2px; border-radius: 1px; background: var(--accent); }
.pc-badge { position: absolute; right: -2px; top: 2px; font-size: .62rem; font-weight: 700; background: var(--accent); color: var(--accent-text); border-radius: 6px; padding: 0 3px; line-height: 1.4; }
.pc-badge:empty { display: none; }
.pc-queue { display: none; }
.has-queue .pc-queue { display: grid; }
.pc-time { padding: 0 8px; font-size: .82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pc-spacer { flex: 1; min-width: 0; }
.pc-volume { display: flex; align-items: center; }
.pc-vol { width: 0; opacity: 0; padding: 0; border: 0; background: none; accent-color: #fff; transition: width .2s, opacity .2s; }
.pc-volume:hover .pc-vol, .pc-vol:focus { width: 84px; opacity: 1; margin-right: 6px; }

.pc-progress { position: relative; height: 20px; margin: 0 6px 2px; display: flex; align-items: center; }
.pc-rail { position: absolute; left: 0; right: 0; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .28); overflow: hidden; transition: height .15s; }
.pc-progress:hover .pc-rail, .is-scrubbing .pc-rail { height: 6px; }
.pc-buffered, .pc-played { position: absolute; left: 0; top: 0; bottom: 0; width: 0; }
.pc-buffered { background: rgba(255, 255, 255, .38); }
.pc-played { background: linear-gradient(90deg, #5eead4, #ff7a9e); box-shadow: 0 0 10px rgba(94, 234, 212, .45); }
.pc-knob { position: absolute; left: 0; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #fff; transform: scale(0); transition: transform .15s; pointer-events: none; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.pc-progress:hover .pc-knob, .is-scrubbing .pc-knob, .is-touch .pc-knob { transform: scale(1); }
.pc-seek { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; opacity: 0; cursor: pointer; border: 0; }
.pc-progress:focus-within .pc-rail { outline: 2px solid var(--accent); outline-offset: 3px; }

.pc-spinner {
  position: absolute; left: 50%; top: 50%; z-index: 3; transform: translate(-50%, -50%);
  display: none; pointer-events: none;
}
.player.is-waiting .pc-spinner { display: block; }
.chibi-loader {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 20px; border-radius: 20px;
  background: rgba(12, 16, 28, .82); border: 1px solid rgba(255, 255, 255, .18);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .55), 0 0 24px rgba(94, 234, 212, .16);
}
.chibi-loader-stage { position: relative; width: 76px; height: 76px; display: grid; place-items: center; }
.chibi-loader-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .14); border-top-color: #6ee7f5; border-right-color: #ff7a9e;
  animation: pc-spin .9s linear infinite;
}
.chibi-loader-char { width: 64px; height: 64px; display: grid; place-items: center; animation: runner-stride .5s ease-in-out infinite; }
.chibi-loader-img { width: 62px; height: 62px; object-fit: contain; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .45)); }
.chibi-loader-text { font-size: .8rem; font-weight: 600; color: #eef4ff; white-space: nowrap; }
@keyframes pc-spin { to { transform: rotate(360deg); } }

.pc-flash { position: absolute; top: 0; bottom: 0; width: 38%; z-index: 2; display: flex; align-items: center; justify-content: center; pointer-events: none; opacity: 0; }
.pc-flash-left { left: 0; border-radius: 0 50% 50% 0; }
.pc-flash-right { right: 0; border-radius: 50% 0 0 50%; }
.pc-flash span { padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .55); font-weight: 600; font-size: .9rem; }
.pc-flash.is-on { animation: pc-flash .7s ease-out; }
@keyframes pc-flash { 0% { opacity: 1; background: rgba(255, 255, 255, .12); } 100% { opacity: 0; background: rgba(255, 255, 255, 0); } }

/* Settings menu, YouTube style: rows (畫質 / 播放速度 / 字幕) that open a list, popping up from the bar. */
.pc-menu {
  position: absolute; right: 10px; bottom: 62px; z-index: 5;
  width: min(280px, calc(100% - 20px)); max-height: calc(100% - 76px); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px 0; border-radius: 12px; background: rgba(28, 28, 32, .95); backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5); transform-origin: bottom right;
  animation: pc-pop .16s ease-out;
}
@keyframes pc-pop { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.pc-menu[hidden], .pc-panel[hidden], .pc-item[hidden], .pc-panel-note[hidden] { display: none; }
.pc-panel { animation: pc-panel .14s ease-out; }
@keyframes pc-panel { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.pc-item, .pc-back, .pc-option {
  display: flex; align-items: center; width: 100%; min-height: 44px; padding: 8px 16px;
  border: 0; background: none; color: #fff; font: inherit; font-size: .92rem; text-align: left; cursor: pointer;
}
.pc-item:hover, .pc-back:hover, .pc-option:hover { background: rgba(255, 255, 255, .1); }
.pc-item:focus-visible, .pc-back:focus-visible, .pc-option:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pc-item { gap: 14px; }
.pc-item > svg { width: 22px; height: 22px; flex: none; }
.pc-item-label { flex: 1; min-width: 0; }
.pc-item-value { color: rgba(255, 255, 255, .7); font-size: .88rem; white-space: nowrap; max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
.pc-chev { display: grid; margin-right: -6px; opacity: .65; }
.pc-chev svg { width: 18px; height: 18px; }
.pc-back { gap: 8px; padding-left: 10px; font-weight: 600; border-bottom: 1px solid rgba(255, 255, 255, .14); margin-bottom: 4px; }
.pc-back svg { width: 20px; height: 20px; }
.pc-options { display: flex; flex-direction: column; }
.pc-option { position: relative; gap: 10px; padding-left: 46px; }
.pc-option[aria-selected="true"]::before {
  content: ""; position: absolute; left: 19px; top: 50%; width: 11px; height: 6px; margin-top: -5px;
  border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: rotate(-45deg);
}
.pc-option[aria-selected="true"] .pc-option-main { font-weight: 700; }
.pc-option-main { min-width: 3.2em; }
.pc-option-note { color: rgba(255, 255, 255, .6); font-size: .82rem; }
.pc-panel-note { margin: 6px 16px 8px; color: rgba(255, 255, 255, .6); font-size: .8rem; line-height: 1.5; }

/* phones: bigger targets, and the menu slides up as a sheet along the bottom of the screen */
.is-touch .pc-btn { width: 44px; height: 44px; }
.is-touch .pc-progress { height: 28px; }
.is-touch .pc-rail { height: 5px; }
.is-touch .pc-volume { display: none; }
.is-touch .pc-menu {
  position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 1000;
  width: auto; max-height: 75vh; border-radius: 16px 16px 0 0;
  padding: 8px 0 calc(10px + env(safe-area-inset-bottom));
  animation: pc-sheet .22s ease-out;
}
.is-touch .pc-menu::before { content: ""; display: block; width: 38px; height: 4px; margin: 2px auto 8px; border-radius: 2px; background: rgba(255, 255, 255, .3); }
.is-touch .pc-item, .is-touch .pc-back, .is-touch .pc-option { min-height: 52px; padding-left: 20px; padding-right: 20px; font-size: 1rem; }
.is-touch .pc-back { padding-left: 14px; }
.is-touch .pc-option { padding-left: 52px; }
.is-touch .pc-option[aria-selected="true"]::before { left: 23px; }
.is-touch .pc-item-value { max-width: 12em; }
.pc-scrim { display: none; }
.is-touch .pc-scrim.is-on { display: block; position: fixed; inset: 0; z-index: 999; background: rgba(0, 0, 0, .45); }
@keyframes pc-sheet { from { transform: translateY(100%); } to { transform: none; } }
@media (max-width: 480px) {
  .pc-bottom { padding: 28px 4px 2px; }
  .pc-time { padding: 0 4px; font-size: .76rem; }
  .pc-center { gap: 28px; }
  .pc-big { width: 60px; height: 60px; }
  .player-audio .pc-pip { display: none; }
  /* keep every button on one row at phone width */
  .is-touch .pc-btn { width: 40px; }
  .is-touch .pc-pip { display: none; }
}

/* avatars, profile, thumbnail editor, small lists */
.uploader { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.uploader-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.uploader-text strong { font-size: 1rem; }
.user-cell { display: flex; align-items: center; gap: 8px; line-height: 1.25; }
.user-cell-meta { display: inline-flex; align-items: baseline; gap: 6px; line-height: 1.25; }
.account-shell { max-width: 1140px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.account-shell .panel-wide, .account-shell .settings-split, .account-shell .profile-head-card { max-width: none; width: 100%; margin-bottom: 0; }
.account-shell .profile-head-card {
  display: flex; align-items: center; justify-content: space-between; gap: 20px 28px; flex-wrap: wrap;
  padding: 22px 24px;
  background: linear-gradient(155deg, color-mix(in srgb, var(--surface) 90%, rgb(var(--glass-tint) / .7)), color-mix(in srgb, var(--surface-2) 86%, rgb(var(--glass-tint) / .75))), url("/static/img/noise.svg");
}
.profile-head-left { display: flex; align-items: center; gap: 20px; min-width: 0; flex: 1 1 300px; }
.profile-head-identity { min-width: 0; }
.profile-head-identity h1 { margin: 0 0 2px; }
.profile-head-identity p { margin: 0 0 10px; }
.profile-head-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-left: auto; }
.profile-head-stats { display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.head-stat-pill {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 96px; min-height: 60px; padding: 8px 14px;
  border-radius: 12px; background: color-mix(in srgb, var(--surface-2) 78%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 80%, rgba(255, 255, 255, .1));
  font-variant-numeric: tabular-nums;
}
.head-stat-pill strong { font-size: .98rem; line-height: 1.2; }
.account-security-card .panel-head-row { margin-bottom: 8px; }
.account-logout-pill {
  border-radius: 999px; gap: 5px;
  background: rgba(244, 63, 94, .12); border: 1px solid rgba(244, 63, 94, .32); color: #fda4af;
}
.account-logout-pill:hover { background: rgba(244, 63, 94, .22); border-color: rgba(244, 63, 94, .55); color: #fecdd3; }
.is-dirty-pulse {
  box-shadow: 0 0 0 2px rgba(94, 234, 212, .55), 0 0 18px rgba(255, 122, 158, .55) !important;
}
.account-save-dock {
  position: fixed; left: 0; right: 0; margin-inline: auto;
  bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 75;
  width: min(680px, calc(100vw - 24px));
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  padding: 11px 16px; border-radius: 999px;
  background: linear-gradient(155deg, rgba(16, 22, 38, .94), rgba(10, 14, 26, .95)), url("/static/img/noise.svg");
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(94, 234, 212, .45);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .55), 0 0 24px rgba(255, 122, 158, .22);
  opacity: 0; transform: translateY(20px) scale(0.96); pointer-events: none;
  transition: opacity .26s cubic-bezier(.22, 1, .36, 1), transform .32s cubic-bezier(.34, 1.45, .64, 1), border-color .24s ease, box-shadow .24s ease;
}
.account-save-dock.is-visible {
  opacity: 1; transform: translateY(0) scale(1); pointer-events: auto;
}
.account-save-dock.is-saved {
  border-color: #4fd39a;
  box-shadow: 0 18px 46px rgba(0, 0, 0, .55), 0 0 28px rgba(79, 211, 154, .48);
}
.account-save-dock.is-saved .save-dock-dot {
  background: #4fd39a; box-shadow: 0 0 12px #4fd39a; transform: scale(1.25);
}
.account-save-dock[hidden] { display: none; }
.save-dock-msg { display: inline-flex; align-items: center; gap: 9px; font-size: .88rem; font-weight: 600; color: #f3f6ff; }
.save-dock-dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: #5eead4; box-shadow: 0 0 10px #5eead4; animation: ws-breath 1.8s ease-in-out infinite;
  transition: background .24s ease, box-shadow .24s ease, transform .24s ease;
}
.save-dock-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; transition: opacity .2s ease; }
.account-save-dock.is-saved .save-dock-actions { opacity: 0; pointer-events: none; }
@media (max-width: 720px) {
  .account-save-dock { bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 12px); border-radius: 18px; }
}
.account-profile-form { max-width: none !important; display: flex; flex-direction: column; gap: 6px; }
.account-profile-form .form-actions { margin-top: 8px; }
.account-accent-chips { margin: 0 0 12px; }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.file-form { display: inline-block; margin: 0; }
.file-btn { position: relative; overflow: hidden; margin: 0; color: var(--text); font-size: inherit; }
.btn-small.file-btn { font-size: .85rem; }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; width: 100%; padding: 0; border: 0; }
.thumb-editor { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 20px; align-items: start; }
.thumb-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.thumb-actions p { margin: 0; }
@media (max-width: 600px) {
  .thumb-editor { grid-template-columns: 1fr; }
  .profile-head-card { padding: 16px; }
  .profile-head-left { gap: 14px; }
  .avatar-xl { width: 76px; height: 76px; font-size: 2rem; }
  .profile-head-right { width: 100%; justify-content: space-between; }
}
.plain-list { list-style: none; margin: 0 0 16px; padding: 0; }
.plain-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.plain-list li:last-child { border-bottom: 0; }
.form-row-2 { grid-template-columns: 1fr 1fr; }
.subtitle-form { max-width: 520px; }
.subtitle-form input[type=file] { padding: 8px; }

/* The player column is as wide as the window height allows (like YouTube); extra width goes to the margins. */
.watch { display: grid; grid-template-columns: minmax(0, var(--player-max-w)) 380px; gap: 28px; align-items: start; justify-content: center; }
.watch.no-side { grid-template-columns: minmax(0, var(--player-max-w)); }
.watch .player-media, .queue-player .player-media { max-height: var(--player-max-h); }
.watch .player, .queue-player .player { max-width: var(--player-max-w); margin-inline: auto; }
.watch .player:fullscreen, .queue-player .player:fullscreen,
.watch .player.is-fullscreen, .queue-player .player.is-fullscreen { max-width: none; margin: 0; }
@media (max-width: 1100px) { .watch { grid-template-columns: minmax(0, 1fr); } }
.watch-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 10px; }
.watch-head-row .watch-title { margin: 0; }
.watch-head-tags { margin: 0; }
.watch-author-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.watch-author-bar .watch-meta { margin: 0; flex: 1 1 280px; min-width: 0; }
.watch-author-bar .actions { margin: 0; }
.watch-music-sub { font-size: .88rem; margin-bottom: 6px; }
.watch-meta a { color: var(--accent); }
.watch-meta .sep { margin: 0 6px; color: var(--muted); }
.watch-meta .pill { margin-left: 6px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.description { white-space: pre-wrap; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; overflow-wrap: anywhere; }
.tech { color: var(--muted); font-size: .88rem; }
.tech summary { cursor: pointer; padding: 4px 0; }
.tech dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 8px 0; }
.tech dd { margin: 0; overflow-wrap: anywhere; }
.watch-info-card, .watch-comments-card, .watch-side-card {
  background: linear-gradient(160deg, color-mix(in srgb, var(--surface) 84%, rgb(var(--glass-tint) / .72)), color-mix(in srgb, var(--surface-2) 82%, rgb(var(--glass-tint) / .78))), url("/static/img/noise.svg");
  backdrop-filter: blur(14px);
  border: 1px solid color-mix(in srgb, var(--border) 80%, rgba(255, 255, 255, .1));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 12px 32px rgba(0, 0, 0, .28);
  border-radius: var(--radius); padding: 18px 20px;
}
.watch-info-card { margin-top: 16px; }
.watch-info-card .watch-title { margin-top: 0; }
.watch-info-card .danmaku-bar { margin-bottom: 14px; }
.watch-comments-card { margin-top: 16px; display: flex; flex-direction: column; gap: 14px; }
.comments-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.comment-form { display: flex; gap: 8px; align-items: center; }
.comment-form input { flex: 1; }
.comments-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.comment-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: color-mix(in srgb, var(--surface-2) 85%, transparent); border: 1px solid var(--border); }
.comment-body-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.comment-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .86rem; }
.comment-del-btn { margin-left: auto; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 4px; }
.comment-del-btn:hover { color: var(--danger); }
.comment-text { margin: 0; line-height: 1.5; overflow-wrap: anywhere; }

.side-title { font-size: 1rem; margin-bottom: 12px; }
.side-list { display: flex; flex-direction: column; gap: 12px; }
.side-item { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 10px; align-items: start; padding: 6px; border-radius: var(--radius-sm); transition: background .18s ease, border-color .18s ease; border: 1px solid transparent; }
.side-item:hover { background: color-mix(in srgb, var(--surface-2) 75%, transparent); }
.side-item.is-current {
  border-color: rgba(94, 234, 212, .52);
  background: linear-gradient(135deg, rgba(94, 234, 212, .12), rgba(255, 122, 158, .08));
  box-shadow: 0 0 16px rgba(94, 234, 212, .18);
}
.side-now-pill {
  position: absolute; left: 5px; bottom: 5px; padding: 2px 7px; border-radius: 999px;
  background: rgba(10, 14, 26, .88); border: 1px solid rgba(94, 234, 212, .65);
  color: #5eead4; font-size: .68rem; font-weight: 700; line-height: 1.1;
}
.side-item .thumb { border-radius: var(--radius-sm); position: relative; }
@media (max-width: 600px) {
  .watch-info-card, .watch-comments-card, .watch-side-card { padding: 14px; }
  .comment-form { flex-direction: column; align-items: stretch; }
  .side-item { grid-template-columns: 126px minmax(0, 1fr); }
}

.processing-box { aspect-ratio: 16 / 9; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px dashed var(--border); }
.processing-box .progress { width: min(360px, 100%); }
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 8px 0; }
.progress-bar { height: 100%; width: 0; background: var(--accent); border-radius: inherit; transition: width .3s ease; }
.progress-bar.indeterminate { width: 35%; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

/* ---------------------------------------------------------------- queue (playlist / favorites) */
.queue-layout { display: grid; grid-template-columns: minmax(0, var(--player-max-w)) clamp(320px, 26vw, 440px); gap: 24px; align-items: start; justify-content: center; }
@media (max-width: 1000px) { .queue-layout { grid-template-columns: minmax(0, 1fr); } }
.queue-player { position: sticky; top: calc(var(--topbar-h) + 16px); }
@media (max-width: 1000px) { .queue-player { position: static; } }
.now-playing { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.now-title { font-weight: 700; font-size: 1.1rem; overflow-wrap: anywhere; }
.transport { display: flex; align-items: center; gap: 4px; }
.when-playing { display: none; }
.is-playing .when-playing { display: block; }
.is-playing .when-paused { display: none; }
.queue-list { list-style: none; margin: 0; padding: 6px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); max-height: calc(100vh - var(--topbar-h) - 120px); overflow-y: auto; }
@media (max-width: 1000px) { .queue-list { max-height: none; } }
.queue-row { display: flex; align-items: center; gap: 4px; border-radius: var(--radius-sm); }
.queue-row:hover { background: var(--surface-2); }
.queue-row[aria-current="true"] { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.queue-row[aria-current="true"] .queue-num { color: var(--accent); font-weight: 700; }
.queue-play { flex: 1; min-width: 0; display: grid; grid-template-columns: 26px 88px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 6px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.queue-play .thumb { border-radius: 6px; }
.queue-num { color: var(--muted); text-align: center; font-size: .85rem; }
.queue-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.queue-text .card-title { -webkit-line-clamp: 1; min-height: 0; }
.queue-dur { font-size: .85rem; font-variant-numeric: tabular-nums; }
.queue-tools { display: flex; flex: none; }
.queue-tools .icon-btn { width: 32px; height: 32px; }
@media (max-width: 600px) {
  .queue-play { grid-template-columns: 20px 64px minmax(0, 1fr); }
  .queue-dur { display: none; }
}

/* ---------------------------------------------------------------- watch progress */
.watch-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; height: 4px; background: rgba(255, 255, 255, .35); }
.watch-bar > span { display: block; width: 0; height: 100%; background: var(--accent); }
.thumb .watch-bar ~ .duration-badge { bottom: 10px; }
.watched { color: var(--accent); font-weight: 600; }
.watch-where { color: var(--accent); }
.resume-row { margin-bottom: 28px; }
.resume-row h2, .grid-title { font-size: 1.05rem; margin: 0 0 12px; }
.series-where { margin: 0 0 12px; }
.series-where strong { color: var(--accent); margin-left: 6px; }

/* ---------------------------------------------------------------- 動漫 */
.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 22px 16px; }
@media (max-width: 720px) { .poster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; } }
@media (max-width: 420px) { .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.poster-card {
  display: flex; flex-direction: column; min-width: 0; height: 100%;
  padding: 8px; border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(155deg, color-mix(in srgb, var(--surface) 88%, transparent), color-mix(in srgb, var(--surface-2) 82%, transparent)), url("/static/img/noise.svg");
  border: 1px solid color-mix(in srgb, var(--border) 75%, rgba(255, 255, 255, .08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 10px 26px rgba(0, 0, 0, .24);
  transition: transform .24s cubic-bezier(.22, 1, .36, 1), border-color .22s ease, box-shadow .24s ease;
}
.poster-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  box-shadow: inset 0 1px 0 rgba(94, 234, 212, .26), 0 14px 32px rgba(0, 0, 0, .34);
}
.poster { position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; background: var(--surface-2); background-size: cover; background-position: center; }
.poster::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, transparent 58%, rgba(6, 10, 22, .52) 100%);
  transition: opacity .28s ease;
}
.poster-card:hover .poster::after { opacity: .65; }
.poster img { width: 100%; height: 100%; object-fit: cover; transition: transform .42s cubic-bezier(.22, 1, .36, 1), opacity .32s ease; }
.poster-card:hover .poster img { transform: scale(1.045); }
.poster-default-art {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background:
    radial-gradient(circle at 25% 22%, rgba(244, 114, 182, .22), transparent 55%),
    radial-gradient(circle at 78% 76%, rgba(94, 234, 212, .18), transparent 58%),
    linear-gradient(155deg, #1b173a 0%, #24194a 48%, #0e1730 100%);
}
.poster-default-moon { color: rgba(255, 226, 240, .86); filter: drop-shadow(0 0 14px rgba(244, 114, 182, .45)); }
.poster-default-moon .icon { width: 42px; height: 42px; }
.poster-default-stars { font-size: .82rem; letter-spacing: .28em; color: rgba(94, 234, 212, .65); }
.poster-status-pill {
  position: absolute; left: 8px; top: 8px; z-index: 2; padding: 3px 8px; border-radius: 999px;
  font-size: .72rem; font-weight: 700; line-height: 1.2;
  background: rgba(10, 14, 26, .74); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .18); color: rgba(226, 232, 240, .88);
}
.poster-status-pill.is-watching { color: #5eead4; border-color: rgba(94, 234, 212, .52); }
.poster-status-pill.is-done { color: #ff7a9e; border-color: rgba(255, 122, 158, .52); }
.poster .private-badge { left: auto; right: 8px; top: 8px; }
.poster-upload-trigger {
  position: relative; width: 100%; height: 100%; padding: 0; border: 0; background: none;
  color: inherit; font: inherit; cursor: pointer; display: block; text-align: center;
}
.poster-upload-hint {
  position: absolute; left: 8px; right: 8px; bottom: 10px; z-index: 2;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  padding: 4px 8px; border-radius: 999px; font-size: .74rem; font-weight: 600;
  background: rgba(10, 14, 26, .72); border: 1px solid rgba(255, 255, 255, .2); color: rgba(226, 232, 240, .88);
  transition: border-color .2s ease, color .2s ease;
}
.poster-upload-trigger:hover .poster-upload-hint { border-color: #5eead4; color: #5eead4; }
.series-play-cta { box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 42%, transparent); }
.series-play-cta.is-disabled { opacity: .48; cursor: not-allowed; box-shadow: none; }
.playlist-ghost-card {
  border-style: dashed; border-color: rgba(148, 163, 184, .32);
  background: var(--ghost-bg);
  box-shadow: none; text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.playlist-ghost-card:hover { border-color: rgba(94, 234, 212, .52); box-shadow: 0 10px 26px rgba(0, 0, 0, .28); }
.playlist-ghost-thumb {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  background: radial-gradient(circle at 50% 45%, rgba(94, 234, 212, .08), rgba(244, 114, 182, .05) 70%, transparent);
}
.playlist-ghost-thumb::after { display: none; }
.playlist-ghost-plus {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  border: 1px dashed rgba(94, 234, 212, .45); color: #5eead4; background: rgba(94, 234, 212, .08);
}
.playlist-ghost-note { font-size: .78rem; color: var(--muted); }
.series-head { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 24px; }
.series-poster { flex: none; width: 180px; }
.series-info { min-width: 0; flex: 1; }
.series-info h1 { margin: 0 0 4px; overflow-wrap: anywhere; }
.series-info > p { margin: 0 0 12px; }
.series-desc { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 70ch; }
@media (max-width: 600px) {
  .series-head { gap: 14px; }
  .series-poster { width: 108px; }
  .series-info h1 { font-size: 1.3rem; }
}
.series-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 14px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.series-bar-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--accent); min-width: 0; }
.series-bar-name span { overflow-wrap: anywhere; }
.series-bar-nav { display: flex; gap: 6px; margin-left: auto; }
.series-bar + .watch-title { margin-top: 10px; }
.menu-button .icon { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- upload */
.upload-panel {
  background: linear-gradient(160deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--surface-2) 86%, transparent)), url("/static/img/noise.svg");
  border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
}
.upload-quota-progress { height: 4px; margin-top: 8px; background: rgba(255, 255, 255, .1); }
.upload-quota-progress .progress-bar {
  background: linear-gradient(90deg, #38bdf8, #5eead4, #b48cff);
  box-shadow: 0 0 10px rgba(94, 234, 212, .6);
}
.dropzone {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0;
  padding: 46px 16px; border: 2px dashed color-mix(in srgb, var(--border) 80%, rgba(94, 234, 212, .35));
  border-radius: var(--radius); color: var(--text); text-align: center; cursor: pointer;
  transition: border-color .22s ease, background .22s ease, box-shadow .22s ease;
}
.dropzone-watermark {
  position: absolute; width: 210px; height: 116px; opacity: .08; color: #eef4ff; pointer-events: none;
}
.dropzone-icon {
  position: relative; z-index: 1; width: 42px; height: 42px; color: #5eead4;
  animation: dropzone-float 3s ease-in-out infinite;
  transition: transform .22s cubic-bezier(.34, 1.56, .64, 1);
}
.dropzone strong, .dropzone span { position: relative; z-index: 1; }
.dropzone:hover { border-color: rgba(94, 234, 212, .55); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.dropzone.is-over {
  border-style: solid; border-color: #5eead4;
  background: linear-gradient(135deg, rgba(94, 234, 212, .16), rgba(255, 122, 158, .12));
  box-shadow: 0 0 28px rgba(94, 234, 212, .25), inset 0 0 24px rgba(255, 122, 158, .12);
}
.dropzone.is-over .dropzone-icon { transform: scale(1.2) translateY(-4px); animation: none; }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
@keyframes dropzone-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

.upload-options { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; }
.upload-options label { margin: 0; }
.upload-options label span { display: block; margin-bottom: 6px; }
.upload-options .grow { flex: 1 1 280px; }
.tags-hint { display: block; margin-top: 6px; color: var(--muted); font-size: .8rem; }
.tags-hint.is-over { color: var(--danger); font-weight: 600; }
.upload-auto-oped {
  margin-top: 14px; padding: 10px 14px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: color-mix(in srgb, var(--surface-2) 86%, transparent);
  border: 1px solid color-mix(in srgb, var(--border) 80%, rgba(94, 234, 212, .28));
}
.upload-oped-label { display: inline-flex; align-items: center; gap: 8px; font-size: .88rem; }
.upload-oped-label .icon { color: #5eead4; }

.batch-queue-box {
  margin-top: 16px; padding: 14px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-2) 90%, transparent); border: 1px solid var(--border);
}
.batch-queue-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.batch-queue-actions { display: inline-flex; align-items: center; gap: 8px; }
.batch-queue-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.batch-item {
  display: grid; grid-template-columns: 118px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border);
}
@media (max-width: 640px) { .batch-item { grid-template-columns: 1fr; } }
.batch-thumb {
  position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden;
  background: #101628; display: grid; place-items: center;
}
.batch-thumb-img { width: 100%; height: 100%; object-fit: cover; }
.batch-kind-pill {
  position: absolute; left: 4px; bottom: 4px; padding: 2px 6px; border-radius: 999px;
  background: rgba(10, 14, 26, .82); color: #eef4ff; font-size: .68rem; font-weight: 600;
}
.batch-fields { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.batch-sub-inputs { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.batch-ep-in { width: 110px; padding: 6px 10px; font-size: .84rem; }
.batch-sec-lbl { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-size: .8rem; color: var(--muted); }
.batch-sec-in { width: 72px; padding: 5px 8px; font-size: .82rem; }

.upload-list { list-style: none; padding: 0; margin: 16px 0 8px; display: flex; flex-direction: column; gap: 10px; }
.upload-item {
  position: relative; overflow: hidden; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
}
.upload-item-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.upload-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.upload-status { font-size: .85rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.upload-item.is-error .upload-status { color: var(--danger); white-space: normal; }
.upload-item.is-done .upload-status { color: var(--ok); font-weight: 600; }
.upload-runner-track { position: relative; margin-top: 28px; padding-bottom: 4px; }
.upload-runner-track .progress { margin: 0; height: 6px; background: rgba(255, 255, 255, .14); }
.upload-runner-track .progress-bar { background: linear-gradient(90deg, #38bdf8, #5eead4); box-shadow: 0 0 10px rgba(94, 234, 212, .5); }
.upload-item.is-transcoding .upload-runner-track .progress-bar {
  background: linear-gradient(90deg, #fb7185, #c084fc, #5eead4);
  animation: transcode-pulse 1.2s ease-in-out infinite;
}
.upload-chibi-runner {
  position: absolute; left: 0; bottom: 8px; width: 34px; height: 34px; pointer-events: none; will-change: transform;
  display: flex; align-items: center;
}
.upload-chibi-runner img { width: 34px; height: 34px; object-fit: contain; animation: runner-stride .42s ease-in-out infinite; }
.upload-orb {
  position: absolute; right: -4px; top: 8px; font-size: .78rem; color: #5eead4;
  text-shadow: 0 0 8px rgba(94, 234, 212, .9);
}
.upload-item.is-done-flash::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(79, 211, 154, .28), transparent);
  animation: role-sweep 1s ease-out 1;
}
@keyframes transcode-pulse { 0%, 100% { opacity: .78; } 50% { opacity: 1; } }

.section { margin-top: 32px; }
.recent-list { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.recent-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border); transition: background .16s ease; }
.recent-row:first-child { border-top: 0; }
.recent-row:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.recent-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.recent-title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-quick-actions { display: inline-flex; align-items: center; gap: 6px; opacity: 0; transition: opacity .18s ease; }
.recent-row:hover .recent-quick-actions, .recent-row:focus-within .recent-quick-actions { opacity: 1; }
.recent-icon-btn {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); cursor: pointer; padding: 0;
}
.recent-icon-btn .icon { width: 13px; height: 13px; vertical-align: 0; }
.recent-icon-btn:hover { background: var(--surface-3); color: var(--text); border-color: rgba(94, 234, 212, .45); }
.recent-icon-btn.is-danger:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, var(--border)); }
@media (max-width: 720px) {
  .recent-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .recent-row > .small { display: none; }
  .recent-quick-actions { opacity: 1; }
}

/* ---------------------------------------------------------------- panels, tables, callouts */
.panel {
  background: linear-gradient(160deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--surface-2) 86%, transparent)), url("/static/img/noise.svg");
  border: 1px solid color-mix(in srgb, var(--border) 82%, rgba(255, 255, 255, .08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 12px 30px rgba(0, 0, 0, .24);
  border-radius: var(--radius); padding: 20px; margin-bottom: 20px; max-width: 760px;
}
.panel .form { max-width: 420px; }
.table-wrap { overflow-x: auto; margin-top: 8px; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: .82rem; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; line-height: 1.25; font-variant-numeric: tabular-nums; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td .btn { margin: 0; }
.table-actions-cell, .table th:last-child:empty { width: 1%; text-align: right; white-space: nowrap; }
.table-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 8px; }
.callout { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px; }
.copy-row { display: flex; gap: 8px; margin-top: 10px; }
.copy-row input { flex: 1; font-family: ui-monospace, Consolas, monospace; font-size: .88rem; }
.link-list { display: none; }
@media (max-width: 720px) {
  .link-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; }
  .link-list a { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-top: 1px solid var(--border); }
  .link-list a:first-child { border-top: 0; }
}

/* ---------------------------------------------------------------- flash / toast */
.flash {
  position: fixed; top: calc(var(--topbar-h) + 12px); left: 50%; transform: translateX(-50%); z-index: 100;
  max-width: calc(100vw - 32px); padding: 10px 18px; border-radius: 999px;
  background: var(--surface-3); color: var(--text); box-shadow: var(--shadow); font-weight: 500;
  transition: opacity .3s, transform .3s;
}
.flash-ok { border: 1px solid color-mix(in srgb, var(--ok) 50%, transparent); }
.flash-err { border: 1px solid color-mix(in srgb, var(--danger) 60%, transparent); color: var(--danger); }
.flash.is-hiding { opacity: 0; transform: translate(-50%, -8px); }
.public .flash { top: 16px; }

/* ---------------------------------------------------------------- public pages (login, share) */
.public .page { max-width: 980px; }
.auth-card { max-width: 420px; margin: 8vh auto 0; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 28px; }
.auth-card h1 { margin-top: 12px; }
.share-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--muted); margin-bottom: 16px; }
.share-page .share-brand { margin-bottom: 20px; }

/* ---------------------------------------------------------------- appearance settings */
.panel-wide { max-width: 980px; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); }
.segmented button, .segmented label span {
  display: inline-block; padding: 5px 11px; border: 0; border-radius: 999px; background: none; color: var(--muted);
  font: inherit; font-size: .85rem; cursor: pointer; white-space: nowrap;
}
.segmented button[aria-pressed="true"], .segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
.segmented label { margin: 0; color: inherit; font-size: inherit; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }
.segmented-lg button, .segmented-lg label span { padding: 8px 16px; font-size: .92rem; }
.theme-switch { padding: 8px 12px 10px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 4px 0; }

.appearance-form fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.appearance-form legend { padding: 0; margin-bottom: 8px; font-size: .88rem; color: var(--muted); }
.mode-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.mode-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0; padding: 12px 8px; border-radius: var(--radius); border: 2px solid var(--border); background: var(--surface-2); color: var(--text); font-size: .92rem; cursor: pointer; }
.mode-card input { position: absolute; opacity: 0; }
.mode-card:has(input:checked) { border-color: var(--accent); }
.mode-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.mode-swatch { width: 100%; max-width: 92px; aspect-ratio: 16 / 10; border-radius: 8px; border: 1px solid var(--border); }
.mode-swatch-light { background: linear-gradient(#ffffff 0 28%, #f0f2f5 28%); }
.mode-swatch-dark { background: linear-gradient(#171a20 0 28%, #0e1014 28%); }
.mode-swatch-system { background: linear-gradient(90deg, #f0f2f5 50%, #0e1014 50%); }
.mode-swatch-custom { background: linear-gradient(135deg, #1fa2ff, #a6ffcb 55%, #ff7a90); }
@media (max-width: 520px) { .mode-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.theme-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 410px); gap: 26px; align-items: start; margin-bottom: 4px; }
@media (max-width: 820px) { .theme-grid { grid-template-columns: minmax(0, 1fr); } .theme-preview-col { order: -1; } }
.theme-preview-col { display: flex; flex-direction: column; gap: 8px; }
.theme-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .88rem; color: var(--muted); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.swatch {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid transparent; cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18);
  transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), border-color .18s ease, box-shadow .22s ease;
}
.swatch[aria-pressed="true"] {
  border-color: #ffffff; transform: scale(1.15);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .9), 0 0 14px color-mix(in srgb, var(--accent) 55%, transparent);
}
.swatch-picker { position: relative; width: 36px; height: 36px; margin: 0; border-radius: 50%; overflow: hidden; background: conic-gradient(#ff6b6b, #ffb454, #4fd39a, #40c4ff, #8aa4ff, #b48cff, #ff6b6b); cursor: pointer; }
.swatch-picker input { position: absolute; inset: -8px; width: 52px; height: 52px; opacity: 0; cursor: pointer; padding: 0; border: 0; }
.bg-options { margin-top: 12px; }
.color-row { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--text); }
.color-row input, .swatch-picker input { width: 48px; height: 36px; padding: 2px; }
.preset-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.preset-tile { position: relative; margin: 0; cursor: pointer; color: var(--text); font-size: .85rem; text-align: center; }
.preset-tile input { position: absolute; opacity: 0; }
.preset-swatch { display: block; aspect-ratio: 16 / 10; border-radius: 10px; border: 3px solid transparent; background: var(--surface-3); }
.preset-tile input:checked + .preset-swatch { border-color: var(--text); }
.preset-tile input:focus-visible + .preset-swatch { outline: 2px solid var(--accent); outline-offset: 2px; }
.preset-name { display: block; margin-top: 4px; }
.bg-sliders { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.slider-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 52px; align-items: center; gap: 10px; margin: 0; color: var(--text); }
.slider-row input { padding: 0; border: 0; background: none; accent-color: var(--accent); }
.slider-row output { font-size: .85rem; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.check-row { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; color: var(--text); }
.check-row input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }

/* mini mock-up of the library using the chosen tokens */
.theme-preview {
  position: relative; isolation: isolate; overflow: hidden; border-radius: 14px;
  border: 1px solid rgba(94, 234, 212, .38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 24px rgba(94, 234, 212, .12), 0 12px 28px rgba(0, 0, 0, .3);
  background: var(--bg); color: var(--text); aspect-ratio: 4 / 3.2;
}
.preview-bg, .preview-dim { position: absolute; inset: 0; z-index: -1; }
.preview-bg { inset: -12px; background-size: cover; background-position: center; }
.preview-body { padding: 10px; display: flex; flex-direction: column; gap: 10px; height: 100%; }
.preview-bar { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; background: color-mix(in srgb, var(--bg) 70%, transparent); border: 1px solid var(--border); }
.preview-logo { width: 16px; height: 16px; border-radius: 4px; border: 2px solid var(--accent); }
.preview-search { flex: 1; height: 14px; border-radius: 999px; background: var(--surface-2); }
.preview-btn { width: 40px; height: 16px; border-radius: 999px; background: var(--accent); }
.preview-tabs { display: flex; gap: 6px; }
.preview-tabs span { font-size: .7rem; padding: 2px 9px; border-radius: 999px; background: color-mix(in srgb, var(--surface-2) 85%, transparent); color: var(--muted); }
.preview-tabs .is-on { background: var(--text); color: var(--bg); }
.preview-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.preview-card { display: flex; flex-direction: column; gap: 4px; }
.preview-thumb { aspect-ratio: 16 / 9; border-radius: 6px; background: linear-gradient(135deg, var(--surface-3), var(--surface-2)); }
.preview-card:nth-child(2) .preview-thumb { background: linear-gradient(135deg, var(--accent), var(--surface-3)); }
.preview-line { height: 6px; border-radius: 3px; background: var(--text); opacity: .75; }
.preview-line.short { width: 60%; background: var(--muted); }
.preview-progress { margin-top: auto; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.preview-progress span { display: block; width: 45%; height: 100%; background: var(--accent); }
.preview-label { position: absolute; right: 8px; bottom: 8px; font-size: .7rem; padding: 1px 7px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #fff; }

/* ---------------------------------------------------------------- simplified visual settings & admin dashboard */
.panel-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head-row h2, .panel h2 { display: flex; align-items: center; gap: 8px; }
.settings-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; max-width: 980px; }
.settings-stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.settings-stack > .panel:last-child, .settings-split > .panel { flex: 1; display: flex; flex-direction: column; }
.settings-split .panel { max-width: none; margin-bottom: 0; }
.form-actions-split { justify-content: space-between; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.form-actions-split .btn { margin-top: 0; }
@media (max-width: 760px) { .settings-split { grid-template-columns: 1fr; } }
.compact-collapse summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 600; }
.collapse-head > span:first-child { display: inline-flex; align-items: center; gap: 8px; }
.compact-collapse summary::-webkit-details-marker { display: none; }
.compact-collapse[open] summary { margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.logout-inline { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }

.stat-grid { display: grid; grid-template-columns: minmax(220px, 2fr) repeat(3, minmax(110px, 1fr)); gap: 12px; margin-bottom: 20px; }
@media (max-width: 780px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stat-card-wide { grid-column: 1 / -1; } }
.stat-card {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--radius);
  background: linear-gradient(155deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--surface-2) 86%, transparent)), url("/static/img/noise.svg");
  border: 1px solid var(--border);
}
.stat-card-wide { flex-direction: column; align-items: stretch; gap: 6px; }
.stat-top { display: flex; align-items: center; gap: 8px; font-size: .9rem; }
.stat-top strong { margin-left: auto; font-variant-numeric: tabular-nums; }
.stat-top-second { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
/* Storage card: one bar per drive, one coloured segment per kind of data */
.storage-bar { display: flex; height: 10px; margin: 8px 0 6px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.storage-seg { flex: 0 0 auto; width: 0; height: 100%; transition: width .4s ease; }
.storage-seg + .storage-seg { box-shadow: -1px 0 0 var(--surface); }
.storage-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 6px; padding: 0; font-size: .8rem; color: var(--muted); }
.storage-legend li { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.storage-legend strong { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.seg-dot { width: 9px; height: 9px; border-radius: 3px; flex: 0 0 auto; }
.seg-video { background: #6f8cff; }
.seg-audio { background: #ff7a9e; }
.seg-pictures { background: #2dd4bf; }
.seg-subtitles { background: #f59e0b; }
.seg-database { background: #a78bfa; }
.seg-incoming { background: #38bdf8; }
.seg-other { background: #8a93a6; }
.stat-card-wide .pill { margin-right: 4px; }
.upload-offline { color: var(--danger); font-weight: 600; }
.stat-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); flex: none; }
.stat-icon.ok { color: var(--ok); }
.stat-icon.err { color: var(--danger); }
.stat-num { font-size: 1.35rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.admin-tabs { margin-bottom: 16px; }
.tab-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* Admin: tag management */
.tag-admin-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.tag-admin-head input { flex: 1 1 200px; max-width: 300px; }
.tag-admin-head p { flex: 1 1 260px; margin: 0; }
.tag-table .chip { max-width: 100%; overflow-wrap: anywhere; line-height: 1.3; }
.tag-table tr:has(+ .tag-rename-row:not([hidden])) td { border-bottom: 0; }
.tag-rename-row td { padding-top: 0; }
.tag-rename-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tag-rename-form input[name="name"] { flex: 1 1 200px; max-width: 320px; width: auto; min-height: 34px; padding: 6px 12px; }
.tag-rename-form .btn { margin: 0; }
@media (max-width: 600px) {
  /* Phones: one card per tag (name and count on the left, buttons on the right) instead of a wide table. */
  .tag-table, .tag-table tbody { display: block; }
  .tag-table thead { display: none; }
  .tag-table tr[data-tag-row] {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 10px;
    padding: 10px 0; border-bottom: 1px solid var(--border);
  }
  .tag-table tr[data-tag-row] td { display: block; padding: 0; border: 0; }
  .tag-table tr[data-tag-row] td.table-actions-cell { grid-column: 2; grid-row: 1 / span 2; width: auto; }
  .tag-table tr:has(+ .tag-rename-row:not([hidden])) { border-bottom: 0; }
  .tag-table .tag-rename-row { display: block; }
  .tag-table .tag-rename-row td { display: block; padding: 0 0 12px; border-bottom: 1px solid var(--border); }
  .tag-table .table-actions { flex-direction: column; align-items: stretch; gap: 6px; }
}

/* Two-step sign-in */
.two-factor-card { max-width: 420px; }
.two-factor-panel { max-width: 720px; }
.two-factor-panel h2 { display: flex; align-items: center; gap: 8px; }
.code-input { font-size: 1.25rem; letter-spacing: .3em; font-variant-numeric: tabular-nums; text-align: center; max-width: 220px; }
.two-factor-steps { padding-left: 1.3em; display: grid; gap: 16px; }
.two-factor-steps .form-inline { margin-top: 8px; max-width: none; }
.secret-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 8px 0 6px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px dashed var(--border); }
.secret-box code { font-size: 1.02rem; letter-spacing: .08em; word-break: break-all; user-select: all; }
.recovery-list { list-style: none; padding: 0; margin: 12px 0 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.recovery-list code { display: block; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); text-align: center; font-size: 1rem; letter-spacing: .06em; user-select: all; }
.account-2fa-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.account-2fa-row span:first-child { flex: 1 1 180px; }

/* Sign in with Google */
.google-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin: 4px 0 2px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; font-weight: 600; }
.google-btn:hover { background: #f6f8fb; color: #1f1f1f; }
.google-g { width: 18px; height: 18px; flex: 0 0 auto; }
.google-note { text-align: center; margin: 4px 0 10px; }
.google-unlink { flex: 1 1 100%; max-width: none; }
.google-unlink input { flex: 0 1 220px; min-height: 32px; padding: 5px 10px; }

/* Adult-verified tick next to a name */
.verified-badge {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 1.05em; height: 1.05em;
  min-width: 15px; min-height: 15px; border-radius: 50%; background: #16a34a; color: #fff; vertical-align: -0.12em;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .18);
}
.verified-badge svg { width: 68%; height: 68%; }

/* Age rating */
.adult-badge {
  display: inline-flex; align-items: center; justify-content: center; padding: 2px 6px; border-radius: 6px;
  background: #dc2626; color: #fff; font-size: .68rem; font-weight: 800; letter-spacing: .02em; line-height: 1.2;
  vertical-align: middle;
}
.thumb .adult-badge, .poster .adult-badge { position: absolute; top: 8px; right: 8px; z-index: 2; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
.check-row { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; color: var(--text); font-size: .9rem; cursor: pointer; }
.check-row input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; padding: 0; flex: 0 0 auto; accent-color: #dc2626; }
.upload-adult .check-row { margin: 0; min-height: 40px; }
.account-birthday { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.account-birthday .form-inline { width: 100%; max-width: none; }
.account-birthday .form-inline label { flex: 1 1 100%; margin: 0; }
.account-birthday .form-inline input { flex: 0 1 200px; }
.float-field-date label { top: 7px; transform: none; font-size: .72rem; color: #8df2ff; right: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.float-field-date input { color-scheme: dark; }

/* 動漫: when it first aired (year + month) */
.air-date-row { display: flex; gap: 8px; }
.air-date-row input { flex: 1 1 0; min-width: 0; }
.air-date-row select { flex: 0 0 104px; width: auto; }
.card-air { color: var(--brand-mint); font-variant-numeric: tabular-nums; }

/* Admin page: panels as wide as the stat cards above them, inline forms not squeezed to the 420px form width */
.admin-page .panel, .admin-page .panel .form-inline { max-width: none; }
.admin-empty { margin: 12px 0 0; }
#audit > .admin-empty { margin: 0 0 4px; }
.announcement-form #ann-title { flex: 0 1 220px; }
.announcement-form #ann-body { flex: 1 1 320px; }

/* Admin: audit log filters, and how big each change is */
.audit-filter { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.audit-filter label { margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: .8rem; }
.audit-filter select, .audit-filter input { width: auto; min-width: 120px; min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
.audit-filter-actions { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.audit-filter-actions .btn { margin: 0; }
.audit-count { margin: 12px 0 0; }
.audit-level-major { color: var(--danger); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.audit-level-medium { color: var(--admin-ink); background: color-mix(in srgb, var(--admin-ink) 14%, transparent); }
.audit-summary { min-width: 220px; }
@media (max-width: 600px) {
  /* Phones: one card per entry */
  .audit-filter label { flex: 1 1 130px; }
  .audit-filter select, .audit-filter input { width: 100%; }
  .audit-table, .audit-table tbody { display: block; }
  .audit-table thead { display: none; }
  .audit-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .audit-table tbody tr:last-child { border-bottom: 0; }
  .audit-table td { display: block; padding: 0; border: 0; }
  .audit-table td.audit-summary { flex: 1 1 100%; min-width: 0; }
  .audit-table td.table-actions-cell { flex: 1 1 100%; width: auto; text-align: left; }
  .audit-table td.table-actions-cell:empty { display: none; }
}

/* A member's avatar and name open their profile */
.user-cell-link { color: inherit; text-decoration: none; }
.user-cell-link .avatar { transition: box-shadow .18s ease; }
.user-cell-link:hover .avatar, .user-cell-link:focus-visible .avatar { box-shadow: 0 0 0 2px var(--accent); }
.user-cell-link:hover .user-cell-name, .user-cell-link:focus-visible .user-cell-name { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 600px) {
  /* Phones: one card per member, so the buttons are on screen without scrolling sideways. */
  .user-table, .user-table tbody { display: block; }
  .user-table thead { display: none; }
  .user-table tr { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 0; border-bottom: 1px solid var(--border); }
  .user-table tbody tr:last-child { border-bottom: 0; }
  .user-table td { display: block; padding: 0; border: 0; }
  .user-table td:first-child { flex: 1 1 100%; }
  .user-table td[data-label] { order: 3; font-size: .8rem; color: var(--muted); }
  .user-table td[data-label]::before { content: attr(data-label) " "; }
  .user-table td.table-actions-cell { order: 4; flex: 1 1 100%; width: auto; text-align: left; }
  .user-table .table-actions { justify-content: flex-start; flex-wrap: wrap; }
}

.edit-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 20px; align-items: start; }
.edit-grid .panel { max-width: none; }
.edit-col { display: flex; flex-direction: column; gap: 0; }
@media (max-width: 860px) { .edit-grid { grid-template-columns: 1fr; } }
.thumb-preview-lg { max-width: 100%; margin-bottom: 12px; }
.thumb-btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.upload-quota-bar { margin-top: 6px; max-width: 560px; }
.upload-empty-series { height: 40px; border-radius: var(--radius-sm); font-size: .88rem; }

/* ---------------------------------------------------------------- role badges, announcements & cross-device handoff */
.menu-head-row { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.uploader-name { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.badge-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.role-badge {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-height: 22px; padding: 3px 8px; border-radius: 6px;
  font-size: .72rem; font-weight: 700; letter-spacing: .04em; font-family: "Inter", ui-monospace, Consolas, monospace;
  line-height: 1; white-space: nowrap;
}
.role-badge::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; left: -65%; width: 52%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .42), transparent);
  transform: skewX(-22deg); pointer-events: none;
  animation: role-sweep 3.2s cubic-bezier(.4, 0, .2, 1) infinite;
}
.role-badge-ic { position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.role-badge-ic .icon { width: 14px; height: 14px; vertical-align: 0; overflow: visible; }
.role-badge-label {
  position: relative; z-index: 1;
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: role-text-flow 3.2s linear infinite;
}
.role-owner {
  color: var(--owner-ink);
  background: linear-gradient(135deg, rgba(251, 113, 133, .16), rgba(253, 224, 71, .13), rgba(192, 132, 252, .14));
  border: 1px solid rgba(251, 146, 178, .62);
  box-shadow: 0 0 14px rgba(251, 113, 133, .28), inset 0 0 0 1px rgba(253, 224, 71, .14);
}
.role-owner .role-badge-label { background-image: var(--owner-label); }
.role-owner .ic-crown-star { transform-origin: 12px 3.6px; animation: owner-twinkle 3s ease-in-out infinite; }
.role-dev {
  color: var(--dev-ink);
  background: linear-gradient(135deg, rgba(56, 189, 248, .15), rgba(168, 85, 247, .2));
  border: 1px solid rgba(56, 189, 248, .55);
  box-shadow: 0 0 12px rgba(56, 189, 248, .24), inset 0 0 6px rgba(168, 85, 247, .18);
}
.role-dev .role-badge-label { background-image: var(--dev-label); }
.role-dev .ic-dev-lt, .role-dev .ic-dev-gt, .role-dev .ic-dev-sparkle { transition: transform .26s cubic-bezier(.34, 1.56, .64, 1); transform-origin: 12px 12px; }
.role-dev:hover .ic-dev-lt { transform: translateX(-2px); }
.role-dev:hover .ic-dev-gt { transform: translateX(2px); }
.role-dev:hover .ic-dev-sparkle { transform: rotate(90deg) scale(1.1); }
.role-admin {
  color: var(--admin-ink);
  background: linear-gradient(135deg, rgba(252, 211, 77, .18), rgba(245, 158, 11, .16));
  border: 1px solid rgba(252, 211, 77, .58);
  box-shadow: 0 0 14px rgba(245, 158, 11, .24), inset 0 0 0 1px rgba(252, 211, 77, .18);
}
.role-admin .role-badge-label { background-image: var(--admin-label); }
.role-admin .ic-shield-hex { opacity: 0; transform-origin: 12px 11px; }
.role-admin:hover .ic-shield-hex { animation: shield-hex-ripple .55s ease-out; }
.owner-hover-petal {
  position: fixed; z-index: 9999; pointer-events: none; font-size: .78rem; color: #fb7185;
  text-shadow: 0 0 8px rgba(251, 113, 133, .75);
  animation: owner-petal-fly .65s ease-out forwards;
}
@keyframes owner-twinkle {
  0%, 72%, 100% { transform: scale(1) rotate(0deg); opacity: .88; }
  84% { transform: scale(1.45) rotate(18deg); opacity: 1; }
}
@keyframes owner-halo-border {
  0% { background-position: 0 0, 0% 50%; }
  100% { background-position: 0 0, 240% 50%; }
}
@keyframes shield-hex-ripple {
  0% { opacity: .95; transform: scale(.7); }
  100% { opacity: 0; transform: scale(1.38); }
}
@keyframes owner-petal-fly {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--dx, 10px), -18px) rotate(120deg); }
}
@keyframes role-sweep {
  0% { left: -65%; opacity: 0; }
  10% { opacity: 1; }
  45%, 100% { left: 135%; opacity: 0; }
}
@keyframes role-text-flow {
  0% { background-position: 200% 50%; }
  100% { background-position: -20% 50%; }
}

.site-announcement {
  background: linear-gradient(90deg, rgba(64, 196, 255, .1), rgba(255, 166, 198, .12), rgba(255, 212, 121, .1));
  background-size: 200% 100%;
  animation: ann-flow 10s ease infinite;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, var(--border));
}
@keyframes ann-flow { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.announcement-inner {
  max-width: 1320px; margin: 0 auto; padding: 8px 24px;
  display: flex; align-items: center; gap: 10px; font-size: .9rem;
}
.announcement-body { flex: 1; min-width: 0; }
.announcement-close {
  border: 0; background: none; color: var(--muted); font-size: 1.2rem; line-height: 1;
  cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.announcement-close:hover { background: var(--surface-2); color: var(--text); }

.handoff-pill {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 24px);
  padding: 10px 14px; border-radius: 999px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--surface) 94%, transparent), color-mix(in srgb, var(--surface-2) 92%, transparent)), url("/static/img/noise.svg");
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 14px 36px rgba(0, 0, 0, .42);
  animation: pc-pop .25s ease-out;
}
@media (max-width: 720px) { .handoff-pill { bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 12px); } }
.handoff-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); flex: none; }
.handoff-text { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 48vw; }
.handoff-close { border: 0; background: none; color: var(--muted); font-size: 1.15rem; cursor: pointer; padding: 2px 6px; border-radius: 50%; }
.handoff-close:hover { color: var(--text); background: var(--surface-2); }

/* ---------------------------------------------------------------- player ambient glow, vinyl pure mode, danmaku & chapters */
.player-stage { position: relative; max-width: var(--player-max-w); margin-inline: auto; isolation: isolate; }
.player-stage .player { max-width: 100%; }
.ambient-glow-canvas {
  position: absolute; inset: -16px; width: calc(100% + 32px); height: calc(100% + 32px);
  z-index: -1; border-radius: 28px; pointer-events: none;
  filter: blur(42px) saturate(1.35); opacity: .52; transform: scale(1.02);
  transition: opacity .5s ease;
}
.player.is-fullscreen ~ .ambient-glow-canvas,
.player-stage:has(.player:fullscreen) .ambient-glow-canvas { display: none; }

.pc-freeze-canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1;
  pointer-events: none; opacity: 0; transition: opacity .22s ease; object-fit: contain;
}
.pc-freeze-canvas.is-active { opacity: 1; }

.vinyl-stage {
  position: absolute; inset: 0; z-index: 1; display: none; align-items: center; justify-content: center; gap: clamp(20px, 4vw, 48px);
  padding: 24px 32px 68px;
  background: radial-gradient(circle at 35% 45%, rgba(64, 196, 255, .14), rgba(11, 13, 20, .94) 68%);
  color: #fff; pointer-events: none;
}
.player.is-vinyl-mode .vinyl-stage { display: flex; }
.vinyl-disc-wrap { position: relative; width: clamp(136px, 24vw, 220px); aspect-ratio: 1; flex: none; }
.vinyl-disc {
  width: 100%; height: 100%; border-radius: 50%; padding: 22%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, .16) 1px, transparent 1px),
    repeating-radial-gradient(circle at center, #141720 0 3px, #1e2330 3px 5px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .65), inset 0 0 0 2px rgba(255, 255, 255, .08);
  animation: vinyl-spin 16s linear infinite;
  animation-play-state: paused;
}
.player.is-playing.is-vinyl-mode:not(.is-hidden-tab) .vinyl-disc { animation-play-state: running; }
@keyframes vinyl-spin { to { transform: rotate(360deg); } }
.vinyl-cover { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; border: 3px solid rgba(255, 255, 255, .22); }
.vinyl-info { min-width: 0; max-width: 380px; display: flex; flex-direction: column; gap: 10px; }
.vinyl-badge { align-self: flex-start; font-size: .72rem; letter-spacing: .08em; padding: 2px 9px; border-radius: 999px; background: rgba(110, 231, 245, .16); border: 1px solid rgba(110, 231, 245, .4); color: #9cf5ff; }
.vinyl-title { font-size: clamp(1.05rem, 2.2vw, 1.45rem); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.vinyl-artist { color: rgba(255, 255, 255, .7); font-size: .92rem; }
.vinyl-viz { width: 100%; height: 54px; border-radius: 8px; }
@media (max-width: 560px) { .vinyl-stage { flex-direction: column; gap: 12px; padding: 16px 16px 60px; } .vinyl-disc-wrap { width: 112px; } .vinyl-viz { height: 36px; } }

.danmaku-layer {
  position: absolute; inset: 0 0 54px 0; z-index: 2; overflow: hidden; pointer-events: none;
}
.danmaku-layer.is-off { display: none; }
.dm-item {
  position: absolute; white-space: nowrap; font-weight: 700; font-size: clamp(14px, 1.8vw, 19px);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .85), 0 0 2px rgba(0, 0, 0, .9);
  will-change: transform; pointer-events: auto; cursor: default;
  display: inline-flex; align-items: center; gap: 5px;
}
.dm-scroll { left: 100%; animation: dm-fly var(--dm-dur, 7s) linear forwards; }
.player:not(.is-playing) .dm-scroll { animation-play-state: paused; }
@keyframes dm-fly { to { transform: translateX(calc(-100% - 105vw)); } }
.dm-top, .dm-bottom { left: 50%; transform: translateX(-50%); }
.dm-role-dev { text-shadow: 0 0 10px rgba(110, 231, 245, .75), 0 1px 3px rgba(0, 0, 0, .9); }
.dm-role-admin { text-shadow: 0 0 12px rgba(255, 212, 121, .85), 0 1px 3px rgba(0, 0, 0, .9); }

.skip-chapter-btn {
  position: absolute; right: 16px; bottom: 68px; z-index: 4;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-radius: 999px; border: 1px solid rgba(110, 231, 245, .5);
  background: rgba(16, 22, 36, .82); color: #fff; font: inherit; font-size: .88rem; font-weight: 600;
  cursor: pointer; box-shadow: 0 8px 24px rgba(0, 0, 0, .45); transition: transform .15s, background .15s;
}
.skip-chapter-btn:hover { transform: translateY(-1px); background: rgba(26, 36, 58, .92); }
.skip-chapter-btn kbd { padding: 1px 6px; border-radius: 4px; background: rgba(255, 255, 255, .18); font-size: .78rem; }

.pc-hud {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 4;
  padding: 5px 14px; border-radius: 999px; background: rgba(14, 18, 28, .78); color: #fff;
  font-size: .84rem; font-weight: 600; pointer-events: none; opacity: 0; transition: opacity .2s ease;
}
.pc-hud.is-on { opacity: 1; }

.danmaku-bar {
  margin: 12px 0 16px; padding: 12px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface-2) 86%, transparent);
  border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
}
.danmaku-tools-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.danmaku-tools-btns { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.danmaku-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.danmaku-form input[type="text"] { flex: 1 1 260px; }
.danmaku-form select { width: auto; }
@media (max-width: 640px) {
  .danmaku-form input[type="text"] { flex: 1 1 100%; }
}
.danmaku-ws-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; line-height: 1; color: #fcd34d; white-space: nowrap; }
.ws-breath-dot { width: 7px; height: 7px; border-radius: 50%; background: #fcd34d; box-shadow: 0 0 8px rgba(252, 211, 77, .65); display: inline-block; animation: ws-breath 2s ease-in-out infinite; }
.danmaku-ws-pill.is-live { color: #5eead4; }
.danmaku-ws-pill.is-live .ws-breath-dot { background: #5eead4; box-shadow: 0 0 10px rgba(94, 234, 212, .85); }
@keyframes ws-breath { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.8); } }
.purify-drawer { border-top: 1px solid var(--border); padding-top: 10px; }
.purify-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.purify-list { list-style: none; margin: 0; padding: 0; max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.purify-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 8px; background: var(--surface-2); font-size: .86rem; }

.shortcuts-modal {
  position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 16px;
  background: rgba(5, 8, 16, .68);
}
.shortcuts-modal[hidden] { display: none; }
.shortcuts-card {
  width: min(460px, 100%); padding: 20px 22px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.shortcuts-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin-top: 12px; font-size: .9rem; align-items: center; }
.shortcuts-grid kbd { display: inline-block; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-family: ui-monospace, Consolas, monospace; font-size: .82rem; text-align: center; }

/* ---------------------------------------------------------------- ambient login / register scene */
.auth-scene { background: #070b14; color: #eef2fb; min-height: 100vh; overflow-x: hidden; }
.auth-scene .page { max-width: none; min-height: 100vh; padding: 24px 16px; display: grid; place-items: center; position: relative; }
.auth-ambient-canvas { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.auth-ambient-scrim {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(circle at 50% 45%, rgba(8, 12, 24, .18) 0%, rgba(6, 9, 18, .55) 100%);
}
.auth-sound-btn {
  position: fixed; top: 18px; right: 20px; z-index: 10;
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .18); background: rgba(15, 20, 34, .55); color: #e9ecf2;
  font: inherit; font-size: .82rem; cursor: pointer; transition: border-color .2s, background .2s;
}
.auth-sound-btn:hover, .auth-sound-btn.is-on { border-color: rgba(110, 231, 245, .6); background: rgba(20, 32, 54, .75); }
.sound-waves { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.sound-waves span { width: 2px; height: 4px; border-radius: 2px; background: currentColor; transition: height .2s; }
.auth-sound-btn.is-on .sound-waves span { animation: wave-eq .9s ease-in-out infinite; background: #6ee7f5; }
.auth-sound-btn.is-on .sound-waves span:nth-child(2) { animation-delay: .18s; }
.auth-sound-btn.is-on .sound-waves span:nth-child(3) { animation-delay: .36s; }
@keyframes wave-eq { 0%, 100% { height: 4px; } 50% { height: 12px; } }

.auth-watermark {
  position: fixed; left: 20px; bottom: 18px; z-index: 10;
  display: inline-flex; align-items: center; gap: 8px; font-size: .8rem;
  color: rgba(226, 236, 255, .62); letter-spacing: .03em; pointer-events: none;
}
.watermark-dot { width: 6px; height: 6px; border-radius: 50%; background: #6ee7f5; box-shadow: 0 0 10px #6ee7f5; }

.auth-stage { position: relative; z-index: 5; width: min(430px, 100%); }
.auth-glass {
  position: relative; margin: 0; padding: 2px; border-radius: 22px; overflow: hidden;
  background: transparent; border: 0; box-shadow: 0 24px 64px rgba(0, 0, 0, .62);
}
.auth-border-glow {
  position: absolute; inset: -60%; z-index: 0; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0deg 65deg, rgba(110, 231, 245, .85) 95deg, transparent 130deg 245deg, rgba(255, 166, 198, .85) 275deg, transparent 310deg 360deg);
  animation: border-orbit 9s linear infinite;
}
@keyframes border-orbit { to { transform: rotate(360deg); } }
.auth-glass-inner {
  position: relative; z-index: 1; padding: 30px 28px 24px; border-radius: 20px;
  background: rgba(14, 18, 30, .74);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, .1);
}
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 1.2rem; font-weight: 700; }
.auth-logo-halo { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: rgba(110, 231, 245, .12); box-shadow: 0 0 22px rgba(110, 231, 245, .24); animation: logo-breathe 3.6s ease-in-out infinite; }
@keyframes logo-breathe { 0%, 100% { box-shadow: 0 0 18px rgba(110, 231, 245, .2); } 50% { box-shadow: 0 0 28px rgba(255, 166, 198, .35); } }
.auth-title { text-align: center; font-size: 1.3rem; margin: 12px 0 4px; }
.auth-slogan { text-align: center; font-size: .86rem; color: rgba(215, 224, 245, .72); margin: 8px 0 18px; letter-spacing: .04em; }

.liquid-tabs {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 18px;
  border-radius: 999px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1);
  --tab-index: 0;
}
.liquid-pill {
  position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px;
  background: linear-gradient(135deg, rgba(110, 231, 245, .26), rgba(180, 140, 255, .26));
  border: 1px solid rgba(255, 255, 255, .22);
  transform: translateX(calc(var(--tab-index) * 100%));
  transition: transform .36s cubic-bezier(.34, 1.45, .64, 1);
}
.liquid-tab {
  position: relative; z-index: 1; padding: 8px 12px; border: 0; background: none; color: rgba(220, 228, 245, .75);
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; transition: color .2s;
}
.liquid-tab.is-active { color: #fff; }

.auth-callout { font-size: .85rem; margin-bottom: 14px; }
.auth-error { text-align: center; font-size: .88rem; margin: 0 0 12px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-form[hidden] { display: none; }
.auth-form.is-active .stagger-item { animation: stagger-in .35s ease both; }
.auth-form.is-active .stagger-item:nth-child(2) { animation-delay: .05s; }
.auth-form.is-active .stagger-item:nth-child(3) { animation-delay: .1s; }
.auth-form.is-active .stagger-item:nth-child(4) { animation-delay: .15s; }
.auth-form.is-active .stagger-item:nth-child(5) { animation-delay: .2s; }
@keyframes stagger-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.float-field { position: relative; }
.float-field input {
  width: 100%; padding: 20px 12px 8px; border-radius: 10px;
  background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .14);
  color: #fff; font-size: .96rem; transition: border-color .2s, background .2s;
}
.float-field-pass input { padding-right: 42px; }
.float-field input:focus { outline: none; box-shadow: none; background: rgba(255, 255, 255, .08); border-color: rgba(110, 231, 245, .45); }
.float-field label {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%); margin: 0;
  color: rgba(210, 220, 240, .62); font-size: .92rem; pointer-events: none;
  transition: top .18s ease, font-size .18s ease, color .18s ease, transform .18s ease;
}
.float-field input:focus + label,
.float-field input:not(:placeholder-shown) + label {
  top: 7px; transform: none; font-size: .72rem; color: #8df2ff;
}
.float-line {
  position: absolute; left: 50%; right: 50%; bottom: 0; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #6ee7f5, #b48cff, #ffa6c6);
  transition: left .28s ease, right .28s ease; pointer-events: none;
}
.float-field input:focus ~ .float-line { left: 8px; right: 8px; }

.eye-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 0; background: none; color: rgba(220, 230, 250, .7); cursor: pointer; border-radius: 50%;
}
.eye-toggle:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.eye-toggle svg { width: 19px; height: 19px; }
.eye-toggle .eye-slash { transition: opacity .18s ease; }
.eye-toggle.is-open .eye-slash { opacity: 0; }
.eye-toggle .eye-lid { transform-origin: center; transition: transform .18s ease; }
.eye-toggle.is-open .eye-lid { transform: scaleY(1.06); }
.float-field input.is-decoding { animation: star-decode .16s ease; }
@keyframes star-decode { 0% { letter-spacing: .16em; opacity: .65; } 100% { letter-spacing: normal; opacity: 1; } }

.puzzle-gate { padding: 10px 12px; border-radius: 12px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); }
.puzzle-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: .84rem; }
.puzzle-track { position: relative; height: 28px; border-radius: 999px; background: rgba(0, 0, 0, .35); display: flex; align-items: center; padding: 0 8px; }
.puzzle-slot { position: absolute; top: 4px; bottom: 4px; width: 20px; margin-left: -10px; border-radius: 50%; border: 2px dashed rgba(110, 231, 245, .8); pointer-events: none; }
.puzzle-gate.is-solved .puzzle-slot { border-style: solid; border-color: #4fd39a; background: rgba(79, 211, 154, .25); }
.puzzle-slider { width: 100%; margin: 0; padding: 0; border: 0; background: none; accent-color: #6ee7f5; }

.btn-enter {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 100%; height: 46px; margin-top: 4px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22);
  background: linear-gradient(120deg, #40c4ff, #8aa4ff, #ffa6c6); background-size: 200% 200%;
  color: #08101f; font: inherit; font-weight: 700; font-size: .98rem; cursor: pointer;
  transition: width .32s ease, background-position .5s ease, transform .15s ease, box-shadow .3s ease;
  margin-inline: auto;
}
.btn-enter:hover { background-position: 100% 50%; box-shadow: 0 0 24px rgba(110, 231, 245, .38); }
.btn-enter.is-loading { width: 46px; border-radius: 50%; background: rgba(15, 22, 38, .9); color: transparent; border-color: transparent; }
.enter-ring { display: none; width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #ffffff; animation: pc-spin .75s linear infinite; }
.btn-enter.is-loading .enter-text { display: none; }
.btn-enter.is-loading .enter-ring { display: block; }
.btn-enter.is-role-dev .enter-ring { border-top-color: #6ee7f5; border-right-color: #b48cff; box-shadow: 0 0 18px rgba(110, 231, 245, .65); }
.btn-enter.is-role-admin .enter-ring { border-top-color: #ffd479; border-right-color: #ff9f43; box-shadow: 0 0 18px rgba(255, 212, 121, .75); }
.btn-enter.is-role-owner .enter-ring { border-top-color: #ffe394; border-right-color: #ff7a9e; box-shadow: 0 0 20px rgba(255, 212, 121, .8); }

.auth-guard { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: .78rem; color: rgba(205, 215, 238, .6); }
.guard-dot { width: 6px; height: 6px; border-radius: 50%; background: #4fd39a; box-shadow: 0 0 8px #4fd39a; }
.auth-invite-note { margin: 0; line-height: 1.5; }
.auth-quick-row { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, .1); }
.glass-chip-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06);
  color: rgba(235, 242, 255, .86); font: inherit; font-size: .8rem; cursor: pointer;
}
.glass-chip-btn:hover { background: rgba(255, 255, 255, .12); }
.glass-chip-btn svg { width: 15px; height: 15px; }

.auth-ripple {
  position: fixed; left: 50%; top: 50%; width: 20px; height: 20px; border-radius: 50%;
  transform: translate(-50%, -50%) scale(0); z-index: 90; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, .9), rgba(140, 175, 255, .35) 55%, transparent 72%);
  transition: transform .65s cubic-bezier(.16, 1, .3, 1), opacity .65s ease;
}
.auth-ripple.is-role-dev { background: radial-gradient(circle, rgba(110, 231, 245, .9), rgba(180, 140, 255, .4) 55%, transparent 72%); }
.auth-ripple.is-role-admin { background: radial-gradient(circle, rgba(255, 226, 154, .95), rgba(255, 160, 64, .4) 55%, transparent 72%); }
.auth-ripple.is-role-owner { background: radial-gradient(circle, rgba(255, 235, 168, .95), rgba(255, 122, 158, .45) 55%, transparent 72%); }
.auth-ripple.is-expanding { opacity: 1; transform: translate(-50%, -50%) scale(160); }

.auth-welcome {
  position: fixed; inset: 0; z-index: 95; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, rgba(18, 28, 56, .92), rgba(7, 11, 20, .96));
  backdrop-filter: blur(16px); opacity: 0; transition: opacity .34s ease, background .26s ease; overflow: hidden;
}
.auth-welcome[hidden] { display: none; }
.auth-welcome.is-visible { opacity: 1; }
.welcome-inner {
  position: relative; z-index: 2; text-align: center; padding: 28px 24px; max-width: 560px; width: calc(100vw - 24px);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  transition: opacity .24s ease, transform .28s ease;
}
.welcome-orbit-rings { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 1; }
.orbit-ring {
  position: absolute; border-radius: 50%; border: 1px dashed rgba(94, 234, 212, .26);
  box-shadow: 0 0 36px rgba(94, 234, 212, .12);
}
.orbit-outer { width: min(460px, 86vw); height: min(460px, 86vw); animation: pc-spin 26s linear infinite; }
.orbit-inner { width: min(320px, 64vw); height: min(320px, 64vw); border-color: rgba(255, 122, 158, .28); animation: pc-spin 18s linear infinite reverse; }
.welcome-emblem { position: relative; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 6px; }
.welcome-avatar-slot {
  width: 86px; height: 86px; border-radius: 50%; padding: 3px;
  background: linear-gradient(135deg, #5eead4, #ff7a9e);
  box-shadow: 0 0 28px rgba(94, 234, 212, .42), 0 0 42px rgba(255, 122, 158, .25);
  display: grid; place-items: center; animation: vt-page-in .4s cubic-bezier(.22, 1, .36, 1) both;
}
.auth-welcome.is-role-owner .welcome-avatar-slot { background: linear-gradient(135deg, #fde047, #fb7185, #c084fc); box-shadow: 0 0 32px rgba(251, 113, 133, .55); }
.auth-welcome.is-role-admin .welcome-avatar-slot { background: linear-gradient(135deg, #fcd34d, #f59e0b); box-shadow: 0 0 28px rgba(252, 211, 77, .5); }
.auth-welcome.is-role-dev .welcome-avatar-slot { background: linear-gradient(135deg, #38bdf8, #a855f7); box-shadow: 0 0 30px rgba(56, 189, 248, .55); }
.welcome-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: #0c1222; }
.welcome-avatar-initial {
  width: 100%; height: 100%; border-radius: 50%; background: #0d1426; color: #eef4ff;
  display: grid; place-items: center; font-size: 2rem; font-weight: 700;
}
.welcome-kohi-side {
  position: absolute; right: -42px; bottom: -8px; width: 58px; height: 58px; object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .55));
  animation: runner-stride .55s ease-in-out infinite;
}
.welcome-new-pill { background: linear-gradient(135deg, rgba(94, 234, 212, .2), rgba(255, 122, 158, .2)); border-color: rgba(94, 234, 212, .65); color: #bdfcf2; }
.welcome-member-pill { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .24); color: #e2ebff; }
.welcome-sub { margin: 0; font-size: .92rem; color: rgba(215, 228, 250, .82); line-height: 1.5; }
.welcome-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }
.welcome-pill-chip {
  padding: 4px 12px; border-radius: 999px; font-size: .78rem; color: #dbeafe;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(8px);
}
.welcome-warp-bar {
  width: min(260px, 72vw); height: 4px; margin-top: 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .12); overflow: hidden;
}
.welcome-warp-fill {
  display: block; width: 100%; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #5eead4, #ff7a9e, #fde047);
  transform-origin: left; transform: scaleX(0);
}
.auth-welcome.is-visible .welcome-warp-fill {
  animation: warp-fill 1.1s cubic-bezier(.22, 1, .36, 1) forwards;
}
.auth-welcome.is-newcomer.is-visible .welcome-warp-fill { animation-duration: 1.3s; }
@keyframes warp-fill { to { transform: scaleX(1); } }
.welcome-mote {
  position: absolute; font-size: .9rem; pointer-events: none; opacity: 0;
  animation: welcome-float 1.6s ease-out infinite;
}
.welcome-mote.is-sakura { color: #ff8fb8; text-shadow: 0 0 10px rgba(255, 143, 184, .7); }
.welcome-mote.is-aurora { color: #6ee7f5; text-shadow: 0 0 10px rgba(110, 231, 245, .7); }
@keyframes welcome-float {
  0% { opacity: 0; transform: translateY(12px) scale(.6); }
  30% { opacity: .9; }
  100% { opacity: 0; transform: translateY(-28px) rotate(35deg) scale(1); }
}
.auth-welcome.is-curtain-seal { background: #070b14; }
.auth-welcome.is-curtain-seal .welcome-inner { opacity: 0; transform: scale(1.04); }
@media (max-width: 480px) {
  .auth-glass-inner { padding: 24px 18px 20px; }
  .auth-sound-btn { top: 12px; right: 12px; padding: 6px 11px; }
  .auth-watermark { display: none; }
}

/* Pre-paint Login -> Home Portal Curtain Dissolve (entry.js + micro.js) */
html.has-entry-portal::after {
  content: ""; position: fixed; inset: 0; z-index: 9999; pointer-events: none; opacity: 1;
  background: radial-gradient(circle at 50% 42%, rgba(94, 234, 212, .12), #070b14 68%);
  transition: opacity .48s cubic-bezier(.22, 1, .36, 1);
}
html.has-entry-portal.is-role-dev::after { background: radial-gradient(circle at 50% 42%, rgba(110, 231, 245, .18), #070b14 68%); }
html.has-entry-portal.is-role-admin::after { background: radial-gradient(circle at 50% 42%, rgba(255, 212, 121, .16), #070b14 68%); }
html.has-entry-portal.is-role-owner::after { background: radial-gradient(circle at 50% 42%, rgba(255, 166, 198, .18), #070b14 68%); }
html.has-entry-portal main.page {
  opacity: 0; transform: scale(0.985) translateY(10px);
  transition: opacity .46s cubic-bezier(.22, 1, .36, 1), transform .48s cubic-bezier(.22, 1, .36, 1);
}
html.has-entry-portal.is-portal-open::after { opacity: 0; }
html.has-entry-portal.is-portal-open main.page { opacity: 1; transform: none; }
.welcome-badge { display: inline-block; margin-bottom: 10px; padding: 4px 12px; border-radius: 8px; font-family: ui-monospace, Consolas, monospace; font-weight: 700; letter-spacing: .08em; }
.auth-welcome.is-role-dev .welcome-badge { color: #8df2ff; border: 1px solid rgba(110, 231, 245, .6); box-shadow: 0 0 24px rgba(110, 231, 245, .45); }
.auth-welcome.is-role-admin .welcome-badge { color: #ffe29a; border: 1px solid rgba(255, 212, 121, .6); box-shadow: 0 0 24px rgba(255, 212, 121, .5); }
.welcome-text { font-size: clamp(1.3rem, 3vw, 1.9rem); font-weight: 700; color: #fff; margin: 0; letter-spacing: .04em; text-shadow: 0 0 24px rgba(255, 255, 255, .35); }
.auth-welcome.is-role-dev .welcome-scanline {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(110, 231, 245, .04) 3px 4px);
}
.auth-welcome.is-role-admin .welcome-particles {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 30% 40%, rgba(255, 212, 121, .22), transparent 35%),
              radial-gradient(circle at 70% 60%, rgba(255, 176, 84, .18), transparent 40%);
}

/* ---------------------------------------------------------------- Global Micro-Interaction System */
[data-squish] { transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), box-shadow .16s ease; }
[data-squish="down"] { transform: scale(0.94) !important; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .28); }
[data-squish="spring"] { animation: jelly-spring .24s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes jelly-spring { 0% { transform: scale(0.94); } 55% { transform: scale(1.03); } 100% { transform: scale(1); } }

.tap-ripple {
  position: fixed; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; z-index: 9999; pointer-events: none;
  border: 1.5px solid rgba(94, 234, 212, .82);
  box-shadow: 0 0 12px rgba(255, 122, 158, .55), inset 0 0 6px rgba(94, 234, 212, .4);
  animation: tap-ripple-go .36s cubic-bezier(.16, 1, .3, 1) forwards;
}
.tap-ripple.is-dev { border-color: rgba(110, 231, 245, .85); box-shadow: 0 0 12px rgba(180, 140, 255, .55); }
.tap-ripple.is-admin { border-color: rgba(255, 212, 121, .85); box-shadow: 0 0 12px rgba(255, 180, 84, .5); }
.tap-ripple.is-owner { border-color: rgba(255, 230, 154, .9); box-shadow: 0 0 14px rgba(255, 122, 158, .65); }
@keyframes tap-ripple-go { 0% { transform: scale(.8); opacity: .9; } 100% { transform: scale(5.4); opacity: 0; } }

.tap-dust {
  position: fixed; z-index: 9999; pointer-events: none; font-size: .68rem; line-height: 1;
  color: #5eead4; text-shadow: 0 0 8px rgba(255, 122, 158, .85);
  margin: -5px 0 0 -5px;
  animation: tap-dust-fly .38s cubic-bezier(.16, 1, .3, 1) forwards;
}
.tap-dust.dust-pink { color: #ff7a9e; text-shadow: 0 0 8px rgba(94, 234, 212, .75); }
.tap-dust.dust-gold { color: #ffd479; text-shadow: 0 0 8px rgba(255, 180, 84, .8); }
.tap-dust.is-dev { color: #6ee7f5; text-shadow: 0 0 8px #b48cff; }
.tap-dust.is-admin { color: #ffd479; text-shadow: 0 0 8px #ffb454; }
.tap-dust.is-owner { color: #ffe394; text-shadow: 0 0 8px #ff7a9e; }
@keyframes tap-dust-fly { to { transform: translate(var(--dx, 14px), var(--dy, -14px)) rotate(var(--rot, 65deg)) scale(0.2); opacity: 0; } }

.heart-spark {
  position: fixed; z-index: 9999; pointer-events: none; font-size: .78rem; color: #ff7a90;
  transform: translate(-50%, -50%);
  animation: tap-dust-fly .35s ease-out forwards;
}
.is-star-glint { box-shadow: 0 0 18px rgba(110, 231, 245, .55) !important; border-color: #6ee7f5 !important; }
.is-card-chosen { transform: scale(0.98); box-shadow: 0 0 24px color-mix(in srgb, var(--accent) 45%, transparent) !important; border-color: var(--accent) !important; }
.is-card-yield { opacity: .45; transform: scale(0.96); transition: opacity .22s ease, transform .22s ease; }

.ui-sound-setting, .runner-picker-wrap { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.ui-sound-setting { flex-direction: row; align-items: center; justify-content: space-between; font-size: .9rem; }
.ui-sound-first { margin-top: 0; padding-top: 0; border-top: 0; }
.switch-pill {
  position: relative; width: 44px; height: 24px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-3); padding: 0; cursor: pointer; transition: background .22s ease, border-color .22s ease;
}
.switch-pill[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 75%, var(--surface-2)); border-color: var(--accent); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 35%, transparent); }
.switch-knob {
  position: absolute; left: 3px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
.switch-pill[aria-pressed="true"] .switch-knob { transform: translateX(19px); }

/* ---------------------------------------------------------------- SVG Play/Pause Morph & Progress Runner */
.morph-play-icon path { transition: d .2s ease, transform .2s ease; transform-origin: center; }
.player.is-playing .morph-play-icon .mp-bar-1,
.mini-controls .is-playing .morph-play-icon .mp-bar-1 { d: path("M6 4.5 L10 4.5 L10 19.5 L6 19.5 Z"); }
.player.is-playing .morph-play-icon .mp-bar-2,
.mini-controls .is-playing .morph-play-icon .mp-bar-2 { d: path("M14 4.5 L18 4.5 L18 19.5 L14 19.5 Z"); }

.pc-chapters { position: absolute; inset: 0; pointer-events: none; }
.pc-chapter-seg { position: absolute; top: 0; bottom: 0; background: rgba(110, 231, 245, .55); box-shadow: 0 0 8px rgba(110, 231, 245, .6); }

.pc-runner {
  position: absolute; left: 0; bottom: 9px; width: 48px; height: 48px; margin-left: -24px;
  color: #ffffff; pointer-events: none; z-index: 3; will-change: transform;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .58));
  transition: opacity .2s ease;
}
.runner-sprite { display: block; width: 48px; height: 48px; }
.runner-art {
  position: relative; display: block; width: 100%; height: 100%;
  transform-origin: center bottom;
  transition: transform .18s cubic-bezier(.34, 1.56, .64, 1);
}
.runner-body-wrap { display: block; width: 100%; height: 100%; transform-origin: center bottom; }
.runner-img { display: block; width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
.runner-oped-note {
  position: absolute; top: -4px; right: -4px; display: none;
  font-size: .82rem; font-weight: 700; color: #5eead4;
  text-shadow: 0 0 8px rgba(94, 234, 212, .85), 0 0 14px rgba(255, 122, 158, .6);
  pointer-events: none;
}
.pc-runner[data-role="DEV"] .runner-img { filter: drop-shadow(0 0 6px rgba(94, 234, 212, .42)); }
.pc-runner[data-role="ADMIN"] .runner-img { filter: drop-shadow(0 0 6px rgba(255, 212, 121, .45)); }
.pc-runner[data-role="OWNER"] .runner-img { filter: drop-shadow(0 0 7px rgba(255, 212, 121, .55)); }
.pc-runner[data-accent="sakura"] .runner-img { filter: drop-shadow(-6px 0 9px rgba(255, 122, 158, .7)); }
.pc-runner[data-accent="aurora"] .runner-img { filter: drop-shadow(-6px 0 9px rgba(94, 234, 212, .72)); }
.pc-runner[data-accent="gold"] .runner-img { filter: drop-shadow(-6px 0 9px rgba(253, 224, 71, .7)); }
.pc-runner[data-accent="violet"] .runner-img { filter: drop-shadow(-6px 0 9px rgba(192, 132, 252, .72)); }
.pc-runner.is-op-ed .runner-oped-note { display: block; animation: runner-hop .45s ease-in-out infinite; }

.runner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.runner-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 8px;
  border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font: inherit; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.runner-card:hover { background: var(--surface-3); transform: translateY(-2px); }
.runner-card[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, var(--surface-2)); box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 28%, transparent); }
.runner-card-svg { width: 64px; height: 64px; display: grid; place-items: center; }
.runner-card-svg .runner-overlay-svg { display: none; }
.runner-card-name { font-size: .84rem; font-weight: 600; line-height: 1.2; }
.runner-card-sub { font-size: .72rem; color: var(--muted); line-height: 1.1; }

/* 4 Runner States */
.player.is-playing .pc-runner .runner-body-wrap { animation: runner-stride .42s ease-in-out infinite; }
.player.is-playing .pc-runner.is-op-ed .runner-body-wrap { animation: runner-hop .36s ease-in-out infinite; }
.player:not(.is-playing) .pc-runner .runner-body-wrap { transform: translateY(2px); animation: runner-idle 2.4s ease-in-out infinite; }
.pc-runner.is-braking .runner-art { transform: rotate(-10deg) translateY(2px); }
.pc-runner.is-braking .runner-dust {
  position: absolute; left: 2px; bottom: 1px; width: 16px; height: 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .58); filter: blur(2px); animation: runner-dust .4s ease-out forwards;
}
.pc-runner.is-sprint-right .runner-art { transform: rotate(15deg) scaleX(1.06); filter: drop-shadow(-6px 0 8px rgba(94, 234, 212, .45)); }
.pc-runner.is-sprint-left .runner-art { transform: scaleX(-1) rotate(15deg) scaleX(1.06); filter: drop-shadow(-6px 0 8px rgba(255, 122, 158, .45)); }
.player.is-waiting .pc-runner .runner-body-wrap { animation: runner-skid .26s linear infinite; }
.pc-runner.is-charging .runner-art { transform: scaleY(0.76) scaleX(1.14); }
.pc-runner.is-dashing { transition: transform .18s cubic-bezier(.22, 1, .36, 1); }
.pc-runner.is-splashing .runner-splash-ring {
  position: absolute; left: 50%; bottom: 0; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%;
  border: 2px solid var(--accent); animation: tap-ripple-go .38s ease-out forwards;
}
.runner-jump-bubble {
  position: absolute; left: 50%; bottom: 48px; transform: translateX(-50%);
  padding: 2px 7px; border-radius: 999px; background: rgba(12, 18, 32, .85); color: #fff;
  font-size: .7rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; opacity: 0; pointer-events: none;
}
.pc-runner.is-splashing .runner-jump-bubble { animation: bubble-pop .42s ease-out; }
.runner-particle {
  position: absolute; left: 8px; bottom: 6px; font-size: .76rem; font-weight: 700; color: #fff;
  pointer-events: none; animation: runner-part .48s ease-out forwards;
}
.runner-particle.is-dev { color: #5eead4; text-shadow: 0 0 6px #b48cff; }
.runner-particle.is-gold { color: #ffd479; text-shadow: 0 0 6px #ffb454; }
.runner-particle.is-coral { color: #ff7a9e; text-shadow: 0 0 6px #5eead4; }

@keyframes glowstick-wave { 0%, 100% { transform: rotate(-18deg); } 50% { transform: rotate(22deg); } }
@keyframes runner-stride { 0%, 100% { transform: translateY(0) rotate(-2deg) scale(1, 1); } 50% { transform: translateY(-4px) rotate(3deg) scale(.98, 1.03); } }
@keyframes runner-idle { 0%, 100% { transform: translateY(2px) scaleY(1); } 50% { transform: translateY(1px) scaleY(.97); } }
@keyframes runner-hop { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(5deg); } }
@keyframes runner-leg-a { 0%, 100% { transform: rotate(-28deg); } 50% { transform: rotate(28deg); } }
@keyframes runner-leg-b { 0%, 100% { transform: rotate(28deg); } 50% { transform: rotate(-28deg); } }
@keyframes runner-scarf { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(12deg); } }
@keyframes runner-skid { 0%, 100% { transform: translateX(-2px); } 50% { transform: translateX(2px); } }
@keyframes runner-dust { 0% { opacity: .8; transform: scale(0.6); } 100% { opacity: 0; transform: scale(1.8) translateX(-6px); } }
@keyframes bubble-pop { 0% { opacity: 0; transform: translate(-50%, 6px); } 30% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -6px); } }
@keyframes runner-part { 0% { opacity: .9; transform: translate(0, 0); } 100% { opacity: 0; transform: translate(-14px, -14px); } }

/* ---------------------------------------------------------------- Home Dashboard */
.home-shell { display: flex; flex-direction: column; gap: 24px; }
.home-mode-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.home-greeting h1 { margin: 0 0 2px; font-size: clamp(1.32rem, 2.5vw, 1.85rem); letter-spacing: .01em; }
.home-greeting p { margin: 0; }
.site-stats { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 8px; }
.site-stat {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .78rem;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); font-variant-numeric: tabular-nums;
}
.site-stat strong { color: var(--text); font-weight: 700; }
.site-stat .icon { width: 13px; height: 13px; }
.site-stat-dot { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.home-mode-tabs { grid-template-columns: repeat(3, 1fr); margin-bottom: 0; width: min(360px, 100%); background: var(--surface-2); border-color: var(--border); }
.home-mode-tabs .liquid-pill { width: calc(33.333% - 3px); }
.home-mode-tabs .liquid-tab { color: var(--muted); font-size: .86rem; padding: 7px 10px; }
.home-mode-tabs .liquid-tab.is-active { color: var(--text); }

.hero-stage {
  position: relative; min-height: clamp(238px, 37vh, 390px); border-radius: 22px; overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 70%, rgba(255, 255, 255, .14));
  background: #0d1220; display: flex; align-items: flex-end; padding: clamp(18px, 3.4vw, 32px);
  box-shadow: 0 20px 54px rgba(0, 0, 0, .42);
}
.hero-stage.is-coverless .hero-layer-far {
  background:
    radial-gradient(ellipse at 72% 28%, rgba(94, 234, 212, .24), transparent 52%),
    radial-gradient(ellipse at 22% 22%, rgba(244, 114, 182, .26), transparent 55%),
    radial-gradient(ellipse at 52% 85%, rgba(99, 102, 241, .32), transparent 62%),
    linear-gradient(135deg, #131832 0%, #1c1738 48%, #0d1527 100%);
}
.hero-parallax, .hero-layer, .hero-mask { position: absolute; inset: 0; pointer-events: none; }
.hero-layer { transition: transform .18s ease-out; }
.hero-layer-far { background: radial-gradient(circle at 25% 25%, rgba(64, 196, 255, .28), transparent 55%), radial-gradient(circle at 80% 75%, rgba(255, 132, 178, .22), transparent 55%); }
.hero-backdrop-img { width: 100%; height: 100%; object-fit: cover; opacity: .62; transition: opacity .25s ease; }
.hero-backdrop-img[hidden] { display: none; }
.hero-stage.is-switching .hero-backdrop-img { opacity: .2; }
.hero-layer-dust {
  background:
    radial-gradient(circle at 18% 60%, rgba(255, 255, 255, .18) 1px, transparent 2px) 0 0 / 72px 72px,
    radial-gradient(circle at 64% 32%, rgba(94, 234, 212, .22) 1px, transparent 2px) 18px 24px / 96px 96px;
  opacity: .55;
}
.hero-watermark {
  position: absolute; right: clamp(16px, 5vw, 72px); top: 50%; width: clamp(220px, 34vw, 390px);
  height: auto; transform: translateY(-54%); opacity: .55; transition: transform .2s ease-out, opacity .25s ease;
  pointer-events: none;
}
.hero-stage.is-coverless .hero-watermark { opacity: .88; }
.hero-mask { background: linear-gradient(90deg, rgba(9, 12, 22, .92) 0%, rgba(9, 12, 22, .56) 54%, rgba(9, 12, 22, .22) 100%), linear-gradient(0deg, rgba(9, 12, 22, .94) 0%, transparent 56%); }
.hero-content { position: relative; z-index: 2; max-width: 580px; color: #f3f6ff; }
.hero-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: rgba(110, 231, 245, .18); border: 1px solid rgba(110, 231, 245, .45); color: #9cf5ff; margin-bottom: 10px; }
.hero-title { font-size: clamp(1.75rem, 3.6vw, 2.7rem); letter-spacing: .02em; line-height: 1.16; margin: 0 0 8px; text-shadow: 0 4px 18px rgba(0, 0, 0, .42); }
.hero-sub { color: rgba(220, 230, 250, .82); font-size: .92rem; margin: 0 0 8px; }
.hero-desc { color: rgba(210, 220, 240, .78); font-size: .92rem; margin: 0 0 16px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-ost-btn { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .24); color: #fff; }
.hero-ost-btn:hover { background: rgba(255, 255, 255, .2); color: #fff; }

.hero-filmstrip { position: absolute; right: 22px; bottom: 20px; z-index: 3; display: flex; gap: 10px; }
.film-card {
  width: 60px; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; padding: 0;
  border: 2px solid rgba(255, 255, 255, .22); background: rgba(15, 20, 34, .82); cursor: pointer;
  transition: transform .2s ease, border-color .2s ease;
}
.film-card img { width: 100%; height: 100%; object-fit: cover; }
.film-card.is-active { transform: translateY(-6px) scale(1.06); border-color: #6ee7f5; box-shadow: 0 8px 20px rgba(110, 231, 245, .35); }
@media (max-width: 720px) { .hero-filmstrip { display: none; } .hero-watermark { opacity: .35; width: 220px; } }

/* Distinct glowing cyan-pink progress rail on Home Continue Watching section */
.home-resume-section .watch-bar { height: 4px; z-index: 3; background: rgba(10, 14, 26, .68); }
.home-resume-section .watch-bar > span {
  background: linear-gradient(90deg, #5eead4, #ff7a9e);
  box-shadow: 0 0 10px rgba(255, 122, 158, .55);
}

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; }
.home-section.is-mode-enter { animation: stagger-in .28s ease; }

.weekday-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.day-pill {
  padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--muted); font: inherit; font-size: .82rem; font-weight: 600; cursor: pointer;
}
.day-pill.is-active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 40%, transparent); }
.poster-card.is-wave-in { animation: stagger-in .28s ease both; }
.poster-card.poster-ghost {
  background: var(--ghost-bg);
  border: 1px dashed rgba(148, 163, 184, .28);
  box-shadow: none; opacity: .78;
}
.poster-card.poster-ghost:hover {
  opacity: 1; border-color: rgba(94, 234, 212, .45);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .24);
}
.poster-ghost-frame {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  padding: 14px; text-align: center;
  background: radial-gradient(circle at 50% 40%, rgba(94, 234, 212, .08), rgba(244, 114, 182, .05) 65%, transparent);
}
.poster-ghost-frame::after { display: none; }
.poster-ghost-emblem {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  border: 1px dashed rgba(94, 234, 212, .35); color: rgba(94, 234, 212, .75); background: rgba(94, 234, 212, .06);
}
.poster-ghost-note { font-size: .78rem; color: var(--muted); line-height: 1.45; }

/* Vinyl Wall */
.vinyl-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 18px; }
.vinyl-card {
  display: flex; flex-direction: column; height: 100%;
  padding: 12px; border-radius: 16px;
  background: linear-gradient(155deg, color-mix(in srgb, var(--surface) 90%, transparent), color-mix(in srgb, var(--surface-2) 85%, transparent)), url("/static/img/noise.svg");
  border: 1px solid color-mix(in srgb, var(--border) 78%, rgba(255, 255, 255, .08));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 10px 26px rgba(0, 0, 0, .24);
  transition: transform .24s cubic-bezier(.22, 1, .36, 1), border-color .22s ease, box-shadow .24s ease;
}
.vinyl-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  box-shadow: inset 0 1px 0 rgba(94, 234, 212, .26), 0 14px 32px rgba(0, 0, 0, .34);
}
.vinyl-card.is-vinyl-active {
  border-color: rgba(94, 234, 212, .58);
  box-shadow: inset 0 1px 0 rgba(94, 234, 212, .32), 0 0 22px rgba(94, 234, 212, .22);
}
.vinyl-sleeve { position: relative; aspect-ratio: 1; margin-bottom: 10px; }
.vinyl-card.is-vinyl-active .vinyl-sleeve::after {
  content: "♪ 播放中"; position: absolute; right: 6px; top: 6px; z-index: 3;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(10, 14, 26, .88); border: 1px solid rgba(94, 234, 212, .65);
  color: #5eead4; font-size: .68rem; font-weight: 700; line-height: 1.2;
}
.vinyl-platter {
  position: absolute; right: 2px; top: 6%; width: 88%; height: 88%; border-radius: 50%;
  background: conic-gradient(from 35deg, rgba(255,255,255,.12), transparent 22%, rgba(255,255,255,.07) 50%, transparent 72%, rgba(255,255,255,.12)), radial-gradient(circle, #141824 0 58%, #090b12 100%);
  border: 1.5px solid rgba(255, 255, 255, .16);
  display: grid; place-items: center; overflow: hidden;
  transform: translateX(0); transition: transform .34s cubic-bezier(.34, 1.45, .64, 1);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .45);
}
.vinyl-grooves {
  position: absolute; inset: 4px; border-radius: 50%;
  background: repeating-radial-gradient(circle, rgba(255, 255, 255, .07) 0 1px, transparent 1px 4px);
}
.vinyl-center-pin {
  position: relative; width: 34%; height: 34%; border-radius: 50%;
  background: radial-gradient(circle, #0d1220 0 22%, #ff7a9e 23% 76%, #f43f5e 77% 100%);
  border: 1.5px solid rgba(255, 255, 255, .28);
  box-shadow: 0 0 12px rgba(255, 122, 158, .35);
}
.vinyl-card:hover .vinyl-platter, .vinyl-card.is-vinyl-active .vinyl-platter { transform: translateX(26%); }
.vinyl-card:hover .vinyl-platter { animation: vinyl-spin 14s linear infinite; }
.vinyl-card.is-vinyl-active .vinyl-platter { animation: vinyl-spin 9s linear infinite; }
.vinyl-art {
  position: relative; z-index: 1; width: 88%; height: 88%; border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg, #1b243f, #271a38); background-size: cover; box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
}
.vinyl-art img { width: 100%; height: 100%; object-fit: cover; }
.vinyl-art-sheen {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, .24) 0%, rgba(255, 255, 255, .04) 38%, transparent 56%, rgba(9, 12, 22, .45) 100%);
  display: flex; align-items: flex-end; justify-content: flex-end; padding: 8px;
}
.vinyl-art-sheen.is-minimal-art {
  background: linear-gradient(135deg, rgba(94, 234, 212, .22) 0%, rgba(244, 114, 182, .2) 55%, rgba(15, 23, 42, .62) 100%);
}
.vinyl-wave-svg { width: 58px; height: 18px; color: rgba(255, 255, 255, .36); opacity: .72; transition: opacity .2s ease, transform .2s ease; }
.vinyl-card:hover .vinyl-wave-svg, .vinyl-card.is-vinyl-active .vinyl-wave-svg { opacity: .95; transform: scale(1.04); color: rgba(94, 234, 212, .75); }
.vinyl-play-fab {
  position: absolute; left: 8px; bottom: 16%; z-index: 2; width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .4);
}
.vinyl-meta { display: flex; flex-direction: column; justify-content: space-between; gap: 4px; flex: 1; }

/* Spotlight / Live Community */
.spotlight-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.spotlight-card {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  background: linear-gradient(155deg, color-mix(in srgb, var(--surface) 90%, transparent), color-mix(in srgb, var(--surface-2) 85%, transparent)), url("/static/img/noise.svg");
  border: 1px solid var(--border);
}
.spotlight-avatar-wrap { padding: 2px; border-radius: 50%; flex: none; }
.spotlight-avatar-wrap.is-owner { background: linear-gradient(135deg, #ffe394, #ff7a9e, #b48cff); box-shadow: 0 0 16px rgba(255, 212, 121, .52); }
.spotlight-avatar-wrap.is-admin { background: linear-gradient(135deg, #ffd479, #ff9f43); box-shadow: 0 0 14px rgba(255, 212, 121, .45); }
.spotlight-avatar-wrap.is-dev { background: linear-gradient(135deg, #6ee7f5, #b48cff); box-shadow: 0 0 14px rgba(110, 231, 245, .4); }
.spotlight-info { min-width: 0; flex: 1; }
.spotlight-top { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.spotlight-info .card-title { min-height: 0; -webkit-line-clamp: 1; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }

/* Persistent Floating Vinyl Mini-Player */
.mini-player {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 70;
  width: min(680px, calc(100vw - 24px)); padding: 8px 14px; border-radius: 999px;
  display: flex; align-items: center; gap: 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 16px 40px rgba(0, 0, 0, .48);
}
.mini-player[hidden] { display: none; }
@media (max-width: 720px) {
  .mini-player {
    bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 10px);
    width: calc(100vw - 16px); padding: 6px 10px; gap: 8px;
  }
  .mini-viz { display: none; }
}
.mini-vinyl-wrap { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none; border: 2px solid rgba(255, 255, 255, .2); }
.mini-player.is-playing .mini-vinyl-wrap { animation: vinyl-spin 10s linear infinite; }
.mini-vinyl-img { width: 100%; height: 100%; object-fit: cover; }
.mini-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.mini-title { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-controls { display: flex; align-items: center; gap: 4px; flex: none; }
.mini-controls .icon-btn-main { width: 38px; height: 38px; }

.blank-quote-float {
  position: fixed; z-index: 9998; pointer-events: none; padding: 6px 14px; border-radius: 999px;
  background: rgba(14, 18, 30, .78); border: 1px solid rgba(110, 231, 245, .35); color: #eaf4ff;
  font-size: .84rem; animation: quote-float 1.5s ease-out forwards;
}
@keyframes quote-float { 0% { opacity: 0; transform: translateY(8px); } 20% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-14px); } }

/* ---------------------------------------------------------------- audio ambient backdrop & favorites/queue upgrades */
.audio-stage {
  position: absolute; inset: 0; z-index: 1; display: none; overflow: hidden;
  align-items: center; justify-content: center; padding: 24px 32px 68px; color: #fff; pointer-events: none;
}
.player.player-audio:not(.is-vinyl-mode) .audio-stage { display: flex; }
.audio-backdrop-img {
  position: absolute; inset: -30px; width: calc(100% + 60px); height: calc(100% + 60px);
  object-fit: cover; filter: blur(40px) brightness(0.56) saturate(1.28); transform: scale(1.08);
}
.audio-backdrop-scrim {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 40% 45%, rgba(16, 22, 38, .18), rgba(7, 10, 18, .72));
}
.audio-stage-inner {
  position: relative; z-index: 1; display: flex; align-items: center; gap: clamp(18px, 4vw, 40px);
  max-width: 720px; width: 100%; justify-content: center;
}
.player.player-audio:not(.is-fullscreen) .player-media { aspect-ratio: 21 / 9; min-height: 290px; }
.audio-aurora-glow {
  position: absolute; inset: -20%; pointer-events: none;
  background: radial-gradient(circle at 28% 35%, rgba(94, 234, 212, .24), transparent 52%),
              radial-gradient(circle at 74% 66%, rgba(255, 122, 158, .22), transparent 52%);
  animation: aurora-breathe 6s ease-in-out infinite alternate;
}
@keyframes aurora-breathe { 0% { opacity: .65; transform: scale(1); } 100% { opacity: 1; transform: scale(1.06); } }
.audio-cover-3d {
  position: relative; width: clamp(132px, 24vw, 200px); aspect-ratio: 1; border-radius: 50%; overflow: visible; flex: none;
  box-shadow: 0 22px 48px rgba(0, 0, 0, .58);
  background: radial-gradient(circle, #182036, #0a0d18);
}
.audio-vinyl-platter {
  position: absolute; inset: -6px; border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 255, 255, .14) 1px, transparent 1px),
    repeating-radial-gradient(circle at center, #111522 0 4px, #1c2235 4px 7px);
  border: 1.5px solid rgba(94, 234, 212, .45);
  box-shadow: 0 0 26px rgba(94, 234, 212, .22), 0 0 40px rgba(255, 122, 158, .18);
  display: grid; place-items: center;
  animation: vinyl-spin 16s linear infinite; animation-play-state: paused;
}
.player.is-playing .audio-vinyl-platter { animation-play-state: running; }
.audio-vinyl-core {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, #ff7a9e, #a855f7); color: #fff; font-size: 1.25rem; font-weight: 700;
  box-shadow: 0 0 14px rgba(255, 122, 158, .6);
}
.mizuhiki-ring {
  position: absolute; inset: -14px; border-radius: 50%; pointer-events: none;
  border: 1.5px dashed rgba(255, 122, 158, .48);
  box-shadow: 0 0 24px rgba(94, 234, 212, .22), inset 0 0 18px rgba(255, 122, 158, .15);
  animation: vinyl-spin 22s linear infinite;
}
.audio-cover-img {
  position: relative; z-index: 1; width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .16);
  animation: vinyl-spin 16s linear infinite; animation-play-state: paused;
}
.player.is-playing .audio-cover-img { animation-play-state: running; }
.player.is-audio-no-cover .audio-cover-img { opacity: .28; }
.audio-lyrics-card {
  display: flex; flex-direction: column; gap: 3px; padding: 8px 12px; border-radius: 10px;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12); font-size: .8rem;
}
.lyrics-line.is-dim { color: rgba(220, 232, 255, .62); }
.lyrics-line.is-glow { color: #eef4ff; text-shadow: 0 0 10px rgba(94, 234, 212, .45); }
.audio-stage-meta { min-width: 0; flex: 1; max-width: 340px; display: flex; flex-direction: column; gap: 8px; }
.audio-stage-pill { align-self: flex-start; font-size: .72rem; padding: 3px 10px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); color: #dceaff; }
.audio-stage-title { font-size: clamp(1.05rem, 2.2vw, 1.45rem); font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.audio-stage-artist { font-size: .92rem; color: rgba(235, 242, 255, .75); }
.audio-stage-viz { width: 100%; height: 44px; border-radius: 8px; margin-top: 4px; }
@media (max-width: 560px) { .audio-stage-inner { flex-direction: column; text-align: center; gap: 12px; } .audio-stage-pill { align-self: center; } .audio-cover-3d { width: 112px; } .audio-stage-viz { height: 30px; } }

.queue-page-head { align-items: center; flex-wrap: wrap; }
.queue-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.queue-view-switch button { display: inline-flex; align-items: center; justify-content: center; padding: 5px 10px; }
.queue-filter-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }

.queue-detail-panel {
  margin-top: 16px; padding: 16px; border-radius: var(--radius);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 18px;
  background: linear-gradient(155deg, color-mix(in srgb, var(--surface) 90%, transparent), color-mix(in srgb, var(--surface-2) 85%, transparent)), url("/static/img/noise.svg");
  border: 1px solid var(--border);
}
@media (max-width: 760px) { .queue-detail-panel { grid-template-columns: 1fr; } }
.queue-detail-info { display: flex; flex-direction: column; gap: 8px; }
.queue-detail-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.queue-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.queue-detail-notes { display: flex; flex-direction: column; gap: 8px; border-left: 1px solid var(--border); padding-left: 16px; }
@media (max-width: 760px) { .queue-detail-notes { border-left: 0; border-top: 1px solid var(--border); padding-left: 0; padding-top: 12px; } }
.queue-notes-head { display: flex; align-items: center; gap: 6px; font-size: .86rem; font-weight: 600; color: var(--muted); }
.queue-notes-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; max-height: 112px; overflow-y: auto; font-size: .85rem; }
.queue-notes-list li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.queue-notes-form { display: flex; gap: 8px; margin-top: auto; }
.queue-notes-form input { flex: 1; padding: 6px 10px; font-size: .86rem; }

.queue-side-panel { display: flex; flex-direction: column; gap: 12px; }
.queue-side-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
}
.queue-counter { font-weight: 600; font-size: .9rem; font-variant-numeric: tabular-nums; }
.queue-autoplay-wrap { display: inline-flex; align-items: center; gap: 8px; margin: 0; cursor: pointer; }
.queue-suggest {
  padding: 12px; border-radius: var(--radius);
  background: linear-gradient(155deg, color-mix(in srgb, var(--surface) 86%, transparent), color-mix(in srgb, var(--surface-2) 82%, transparent)), url("/static/img/noise.svg");
  border: 1px solid var(--border);
}
.queue-suggest-head { display: flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.queue-suggest-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.queue-suggest-row { display: flex; align-items: center; gap: 8px; padding: 4px; border-radius: 8px; }
.queue-suggest-row:hover { background: var(--surface-2); }
.queue-suggest-link { flex: 1; min-width: 0; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; align-items: center; }
.queue-suggest-link .thumb { border-radius: 6px; }
.queue-suggest-link .card-title { -webkit-line-clamp: 1; min-height: 0; font-size: .86rem; }
.queue-card-wall { margin-top: 8px; }

/* ---------------------------------------------------------------- Tsukuyomi Mascot "月見小輝" */
.tsukuyomi-mascot {
  position: fixed; right: 18px; bottom: 18px; z-index: 65;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
}
@media (max-width: 720px) {
  .tsukuyomi-mascot { bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 12px); right: 10px; }
  .mini-player:not([hidden]) ~ .tsukuyomi-mascot { bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 74px); }
  .mini-player:not([hidden]) ~ .handoff-pill { bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 74px); }
  .mascot-avatar-btn { width: 64px; height: 64px; }
}
.mascot-avatar-btn {
  position: relative; width: 82px; height: 82px; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle, rgba(16, 24, 44, .88), rgba(10, 14, 26, .92));
  border: 1.5px solid rgba(94, 234, 212, .48);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .48), 0 0 18px rgba(255, 122, 158, .22);
  display: grid; place-items: center; overflow: visible;
  transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), box-shadow .22s ease;
}
.mascot-avatar-btn:hover { transform: translateY(-4px) scale(1.05); box-shadow: 0 14px 32px rgba(0, 0, 0, .52), 0 0 24px rgba(94, 234, 212, .35); }
.tsukuyomi-mascot.is-bounce .mascot-avatar-btn { transform: scale(1.12, 0.9); }
.mascot-art-wrap { position: relative; display: grid; place-items: center; width: 100%; height: 100%; }
.mascot-ring-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.mascot-moon-bg { transform-origin: 44px 44px; animation: pc-spin 22s linear infinite; }
body.is-media-playing .mascot-moon-bg { animation-duration: 7s; stroke: rgba(255, 122, 158, .65); }
.mascot-img {
  position: relative; z-index: 1; width: 102%; height: 102%; object-fit: contain;
  transform-origin: center bottom;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .48));
  animation: mascot-breathe 3.4s ease-in-out infinite;
  transition: transform .22s cubic-bezier(.34, 1.56, .64, 1);
}
body.is-media-playing .mascot-img { animation: mascot-groove .76s ease-in-out infinite; }
.tsukuyomi-mascot.is-cheering .mascot-img { animation: mascot-cheer .65s cubic-bezier(.34, 1.56, .64, 1); }
.mascot-avatar-btn:hover .mascot-img { animation: mascot-hop .55s ease-in-out infinite; }
.mascot-mood-sparkle {
  position: absolute; top: -2px; right: 2px; z-index: 2; font-size: .95rem;
  opacity: 0; transform: scale(.5); pointer-events: none;
  transition: opacity .2s ease, transform .22s cubic-bezier(.34, 1.56, .64, 1);
}
.tsukuyomi-mascot.is-happy .mascot-mood-sparkle,
.login-mascot-peek.is-happy .mascot-mood-sparkle { opacity: 1; transform: scale(1.18) translateY(-4px); }
.mascot-vinyl-badge { position: absolute; right: -4px; bottom: -2px; z-index: 2; width: 32px; height: 32px; animation: pc-spin 6s linear infinite; }
.mascot-vinyl-badge svg { width: 100%; height: 100%; display: block; }

@keyframes mascot-breathe {
  0%, 100% { transform: translateY(0) rotate(-1.5deg) scale(1, 1); }
  50% { transform: translateY(-3px) rotate(1.5deg) scale(1.02, 1.03); }
}
@keyframes mascot-groove {
  0%, 100% { transform: translateY(0) rotate(-3deg) scale(1, 1); }
  50% { transform: translateY(-5px) rotate(3deg) scale(.98, 1.04); }
}
@keyframes mascot-hop {
  0%, 100% { transform: translateY(-2px) scale(1.06); }
  50% { transform: translateY(-7px) rotate(2deg) scale(1.08); }
}
@keyframes mascot-cheer {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-10px) rotate(-8deg) scale(1.12); }
  70% { transform: translateY(-6px) rotate(8deg) scale(1.1); }
  100% { transform: translateY(0) scale(1); }
}

.mascot-hide-btn {
  position: absolute; top: -4px; right: -4px; width: 20px; height: 20px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .25); background: rgba(15, 20, 34, .92); color: #cbd5e1;
  font-size: .78rem; line-height: 1; display: grid; place-items: center; cursor: pointer;
}
.mascot-hide-btn:hover { background: #ff7a9e; color: #0b1020; }
.mascot-wake-pill {
  display: none; padding: 6px 12px; border-radius: 999px;
  border: 1px solid rgba(94, 234, 212, .5); background: rgba(14, 18, 32, .86); color: #eef4ff;
  font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .4);
}
.tsukuyomi-mascot.is-collapsed .mascot-avatar-btn,
.tsukuyomi-mascot.is-collapsed .mascot-speech,
.tsukuyomi-mascot.is-empty-stage:not(.is-expanded) .mascot-avatar-btn,
.tsukuyomi-mascot.is-empty-stage:not(.is-expanded) .mascot-speech { display: none; }
.tsukuyomi-mascot.is-collapsed .mascot-wake-pill,
.tsukuyomi-mascot.is-empty-stage:not(.is-expanded) .mascot-wake-pill { display: inline-flex; align-items: center; gap: 4px; }
.tsukuyomi-mascot.is-empty-stage:not(.is-expanded) .mascot-wake-pill {
  border-color: rgba(244, 114, 182, .58);
  box-shadow: 0 0 18px rgba(244, 114, 182, .35), 0 0 12px rgba(94, 234, 212, .22);
}

.mascot-speech {
  max-width: 240px; padding: 9px 13px; border-radius: 14px 14px 4px 14px;
  background: rgba(16, 22, 38, .92); border: 1px solid rgba(94, 234, 212, .45); color: #eef4ff;
  font-size: .82rem; line-height: 1.45; box-shadow: 0 12px 28px rgba(0, 0, 0, .45);
  animation: pc-pop .2s ease-out;
}
.mascot-speech[hidden] { display: none; }

.concert-petal {
  position: fixed; top: -20px; z-index: 9999; pointer-events: none; font-size: 1.05rem;
  animation: concert-fall 1.8s linear forwards;
}
.concert-petal.is-sakura { color: #ff7a9e; text-shadow: 0 0 8px rgba(255, 122, 158, .7); }
.concert-petal.is-cyber { color: #5eead4; text-shadow: 0 0 8px rgba(94, 234, 212, .7); }
@keyframes concert-fall { to { transform: translateY(105vh) rotate(260deg); opacity: 0; } }

.login-mascot-peek {
  position: absolute; right: 16px; top: -56px; z-index: 4; width: 76px; height: 76px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center;
  transition: transform .22s cubic-bezier(.34, 1.56, .64, 1);
}
.login-mascot-peek:hover { transform: translateY(-5px); }
.mascot-mini-tag {
  margin-top: -6px; z-index: 3; padding: 2px 8px; border-radius: 999px; font-size: .68rem; font-weight: 600;
  background: rgba(14, 18, 32, .88); border: 1px solid rgba(94, 234, 212, .45); color: #eef4ff; white-space: nowrap;
}

.favorites-mascot-banner {
  margin-top: 22px; padding: 16px 20px; border-radius: 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(94, 234, 212, .08), rgba(255, 122, 158, .09)), url("/static/img/noise.svg");
  border: 1px dashed rgba(94, 234, 212, .35);
}
.mascot-art-slot { width: 84px; height: 84px; flex: none; opacity: .96; }
.mascot-art-slot .mascot-art-wrap { width: 100%; height: 100%; }
.mascot-art-empty { margin: 0 auto 10px; width: 104px; height: 104px; }
.favorites-mascot-copy { flex: 1 1 240px; display: flex; flex-direction: column; gap: 3px; }

.mascot-guide-link {
  display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 999px;
  background: rgba(94, 234, 212, .14); border: 1px solid rgba(94, 234, 212, .4);
  color: #6ee7f5; font-size: .74rem; font-weight: 600;
}
.mascot-guide-link:hover { background: rgba(94, 234, 212, .25); color: #fff; }

/* ---------------------------------------------------------------- Danmaku Spoiler Shield */
.danmaku-layer.is-spoiler-shield .dm-item.is-spoiler-dm {
  filter: blur(7px); padding: 2px 10px; border-radius: 8px;
  background: rgba(18, 24, 40, .65); transition: filter .24s ease; pointer-events: auto; cursor: pointer;
}
.danmaku-layer.is-spoiler-shield .dm-item.is-spoiler-dm:hover { filter: none; }

/* ---------------------------------------------------------------- Beginner Unlocked Frame & Runner Trail */
body.has-beginner-frame .usermenu summary .avatar,
body.has-beginner-frame .profile-head .avatar-xl {
  box-shadow: 0 0 0 2px #5eead4, 0 0 0 4px rgba(255, 122, 158, .52), 0 0 18px rgba(94, 234, 212, .45);
}
.pc-runner.has-beginner-trail .runner-img {
  filter: drop-shadow(-4px 0 6px rgba(94, 234, 212, .55)) drop-shadow(-8px 2px 10px rgba(255, 122, 158, .48));
}
.beginner-reward-row { color: #8ef7eb; }

/* ---------------------------------------------------------------- 3-Step Liquid Spotlight Tour */
.spotlight-tour-overlay {
  position: fixed; inset: 0; z-index: 200; pointer-events: auto;
}
.spotlight-hole {
  position: fixed; border-radius: 16px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(6, 10, 24, .74), 0 0 32px rgba(94, 234, 212, .52), inset 0 0 0 2px rgba(255, 255, 255, .42);
  transition: left .46s cubic-bezier(.34, 1.56, .64, 1), top .46s cubic-bezier(.34, 1.56, .64, 1),
              width .46s cubic-bezier(.34, 1.56, .64, 1), height .46s cubic-bezier(.34, 1.56, .64, 1);
}
.tour-popover {
  position: fixed; width: min(390px, calc(100vw - 24px)); padding: 16px 18px; border-radius: 18px;
  background: linear-gradient(155deg, rgba(16, 22, 38, .96), rgba(11, 15, 28, .96)), url("/static/img/noise.svg");
  border: 1px solid rgba(94, 234, 212, .48); color: #eef4ff;
  box-shadow: 0 22px 54px rgba(0, 0, 0, .65), 0 0 26px rgba(255, 122, 158, .2);
  transition: left .42s cubic-bezier(.34, 1.56, .64, 1), top .42s cubic-bezier(.34, 1.56, .64, 1);
}
.tour-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.tour-step-tag { font-size: .76rem; font-weight: 700; color: #5eead4; letter-spacing: .04em; }
.tour-skip-btn {
  border: 0; background: transparent; color: rgba(203, 213, 225, .75); font: inherit; font-size: .78rem; cursor: pointer; padding: 2px 6px;
}
.tour-skip-btn:hover { color: #fff; }
.tour-body { display: flex; align-items: center; gap: 12px; }
.tour-kohi { width: 66px; height: 66px; object-fit: contain; flex: none; animation: mascot-breathe 3s ease-in-out infinite; }
.tour-speech { margin: 0; font-size: .9rem; line-height: 1.55; color: #eef4ff; min-height: 3.1em; }
.tour-runner-preview, .tour-dual-preview { margin-top: 12px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .1); display: flex; flex-direction: column; gap: 10px; }
.tour-dual-btn { align-self: flex-start; }
.tour-dual-stage { position: relative; height: 76px; border-radius: 10px; background: #0d1322; border: 1px solid rgba(255, 255, 255, .12); display: grid; place-items: center; overflow: hidden; }
.tour-dual-stage .dual-screen { width: 112px; height: 54px; }
.tour-dual-stage .dual-vinyl-disc { width: 58px; height: 58px; }
.tour-dual-stage.is-vinyl .dual-screen { transform: scale(.45); opacity: 0; }
.tour-dual-stage.is-vinyl .dual-vinyl-disc { opacity: 1; transform: scale(1); animation: pc-spin 4s linear infinite; }
.tour-dual-stage.is-vinyl .dual-waves { opacity: 1; }
.tour-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.tour-dots { display: flex; gap: 6px; }
.tour-dots span { width: 7px; height: 7px; border-radius: 999px; background: rgba(255, 255, 255, .24); transition: width .22s ease, background .22s ease; }
.tour-dots span.is-on { width: 18px; background: #5eead4; }
.tour-actions { display: flex; align-items: center; gap: 8px; }

/* ---------------------------------------------------------------- Contextual Micro-Tooltips & Geek HUD */
.micro-tip {
  position: fixed; z-index: 150; max-width: min(320px, calc(100vw - 24px));
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 14px;
  background: rgba(14, 19, 34, .95); color: #eef4ff; font-size: .82rem; line-height: 1.4;
  border: 1px solid rgba(94, 234, 212, .5); box-shadow: 0 14px 32px rgba(0, 0, 0, .55);
  animation: pc-pop .22s ease-out;
}
.micro-tip.is-sakura { border-color: rgba(255, 122, 158, .6); }
.micro-tip.is-gold { border-color: rgba(255, 212, 121, .65); }
.micro-tip-star { color: #5eead4; flex: none; }
.micro-tip.is-sakura .micro-tip-star { color: #ff7a9e; }
.micro-tip.is-gold .micro-tip-star { color: #ffd479; }
.micro-tip-close { border: 0; background: transparent; color: rgba(255, 255, 255, .6); font-size: 1rem; line-height: 1; cursor: pointer; padding: 0 2px; }
.micro-tip-close:hover { color: #fff; }

.reward-toast-banner {
  position: fixed; right: 20px; top: calc(var(--topbar-h) + 16px); z-index: 180;
  max-width: min(380px, calc(100vw - 32px)); display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(16, 24, 44, .96), rgba(24, 20, 42, .96));
  border: 1px solid rgba(94, 234, 212, .58); color: #eef4ff;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .6), 0 0 24px rgba(255, 122, 158, .25);
  animation: pc-pop .25s ease-out;
}
.reward-toast-ic { font-size: 1.3rem; flex: none; }
.reward-toast-copy { display: flex; flex-direction: column; gap: 2px; font-size: .82rem; }
.reward-toast-close { border: 0; background: transparent; color: rgba(255, 255, 255, .65); font-size: 1.1rem; cursor: pointer; }

.geek-perf-hud {
  position: fixed; left: 18px; bottom: 18px; z-index: 160; width: 256px; padding: 12px 14px; border-radius: 14px;
  background: rgba(10, 14, 24, .92); border: 1px solid rgba(94, 234, 212, .45); color: #e2e8f0;
  font-family: ui-monospace, Consolas, monospace; font-size: .74rem;
  box-shadow: 0 14px 36px rgba(0, 0, 0, .6);
}
.geek-hud-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: #5eead4; }
.geek-hud-close { border: 0; background: transparent; color: #94a3b8; cursor: pointer; font-size: 1rem; }
.geek-hud-stats { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0; }
.geek-hud-stats dt { color: #94a3b8; }
.geek-hud-stats dd { margin: 0; text-align: right; color: #f8fafc; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Interactive Playground Guide (/guide) */
.guide-shell { display: flex; flex-direction: column; gap: 20px; max-width: 1100px; margin: 0 auto; }
.guide-hero { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.guide-hero-art { width: 108px; height: 108px; flex: none; display: grid; place-items: center; border-radius: 22px; background: radial-gradient(circle, rgba(94, 234, 212, .16), rgba(255, 122, 158, .1)); border: 1px solid rgba(94, 234, 212, .35); }
.guide-kohi-img { width: 92px; height: 92px; object-fit: contain; animation: mascot-breathe 3.4s ease-in-out infinite; }
.guide-hero-copy { flex: 1 1 320px; display: flex; flex-direction: column; gap: 8px; }
.guide-eyebrow { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--accent); }
.guide-hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 820px) { .guide-grid { grid-template-columns: 1fr; } }
.guide-card { max-width: none; margin-bottom: 0; display: flex; flex-direction: column; gap: 10px; transition: border-color .22s ease, box-shadow .22s ease; }
.guide-card.is-completed { border-color: color-mix(in srgb, var(--ok) 55%, var(--border)); }
.guide-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.guide-card-head h2 { margin: 0; font-size: 1.05rem; }
.guide-demo-stage {
  flex: 1; justify-content: center; padding: 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--surface-2) 92%, transparent); border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 12px;
}
.guide-rail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.guide-rail-wrap { padding-top: 38px; padding-bottom: 4px; }
.guide-pc-progress { position: relative; height: 22px; display: flex; align-items: center; }
.guide-pc-rail { position: relative; width: 100%; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .18); overflow: hidden; }
.guide-pc-played { width: 32%; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #5eead4, #ff7a9e); }
.guide-pc-seek { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.guide-pc-runner { position: absolute; left: 0; bottom: 10px; width: 44px; height: 44px; margin-left: -22px; pointer-events: none; will-change: transform; }
.guide-runner-body { display: block; width: 100%; height: 100%; animation: runner-stride .45s ease-in-out infinite; }
.guide-runner-body img { width: 100%; height: 100%; object-fit: contain; }
.guide-pc-runner.is-sprint-right .guide-runner-body { transform: rotate(15deg) scaleX(1.06); }
.guide-pc-runner.is-sprint-left .guide-runner-body { transform: scaleX(-1) rotate(15deg) scaleX(1.06); }
.guide-pc-runner.is-paused .guide-runner-body { animation: runner-idle 2.4s ease-in-out infinite; }
.guide-pc-runner.is-charging .guide-runner-body { transform: scaleY(.76) scaleX(1.14); }
.guide-pc-runner.is-op-ed .guide-runner-body { animation: runner-hop .36s ease-in-out infinite; }
.guide-pc-runner.is-op-ed .runner-oped-note { display: block; }
.guide-pc-runner.is-splashing .runner-splash-ring { position: absolute; left: 50%; bottom: 0; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; border: 2px solid var(--accent); animation: tap-ripple-go .38s ease-out forwards; }
.guide-pc-runner.is-splashing .runner-jump-bubble { animation: bubble-pop .42s ease-out; }

.guide-keycaps { display: flex; flex-wrap: wrap; gap: 8px; }
.guide-kbd {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-3); color: var(--text); font: inherit; font-size: .78rem; cursor: pointer;
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.guide-kbd kbd { padding: 1px 6px; border-radius: 5px; background: rgba(0, 0, 0, .35); border: 1px solid rgba(255, 255, 255, .18); font-size: .74rem; }
.guide-kbd.is-lit { transform: translateY(-2px) scale(1.05); border-color: #5eead4; box-shadow: 0 0 14px rgba(94, 234, 212, .5); color: #5eead4; }

.spoiler-sample-row { display: flex; align-items: center; gap: 8px; }
.spoiler-shield-box {
  position: relative; width: 100%; padding: 16px 14px; border-radius: 12px; text-align: left;
  border: 1px dashed rgba(94, 234, 212, .45); background: rgba(12, 16, 28, .65); color: var(--text);
  font: inherit; cursor: pointer; overflow: hidden;
}
.spoiler-real-text { display: block; line-height: 1.5; transition: filter .35s ease, opacity .35s ease; }
.spoiler-shield-box.is-sealed .spoiler-real-text { filter: blur(8px); opacity: .45; }
.spoiler-frost-veil {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: radial-gradient(circle at 25% 30%, rgba(94, 234, 212, .18), transparent 45%), rgba(16, 22, 38, .62);
  backdrop-filter: blur(4px); transition: opacity .32s ease, transform .32s ease;
}
.spoiler-shield-box:not(.is-sealed) .spoiler-frost-veil { opacity: 0; transform: scale(1.05); pointer-events: none; }
.spoiler-veil-tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: rgba(15, 22, 38, .9); border: 1px solid rgba(94, 234, 212, .5); font-size: .8rem; font-weight: 600; color: #eef4ff; }

.guide-badges-stage { gap: 8px; }
.badge-dex-item {
  width: 100%; padding: 10px 12px; border-radius: 12px; text-align: left;
  border: 1px solid var(--border); background: var(--surface-3); color: var(--text); font: inherit;
  display: flex; flex-direction: column; gap: 4px; cursor: pointer; transition: border-color .2s ease, transform .18s ease;
}
.badge-dex-item:hover { transform: translateY(-1px); border-color: rgba(94, 234, 212, .5); }
.badge-dex-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.badge-dex-code { font-family: ui-monospace, Consolas, monospace; font-size: .74rem; color: var(--muted); }

.dual-mode-switch-bar { display: flex; gap: 8px; }
.dual-morph-box {
  position: relative; height: 138px; border-radius: 14px; overflow: hidden;
  background: #0d1322; border: 1px solid rgba(255, 255, 255, .14);
  display: grid; place-items: center;
}
.dual-backdrop-glow {
  position: absolute; inset: 0; opacity: .55;
  background: radial-gradient(circle at 30% 40%, rgba(94, 234, 212, .25), transparent 55%), radial-gradient(circle at 75% 70%, rgba(255, 122, 158, .22), transparent 55%);
  transition: transform .5s ease, filter .5s ease;
}
.dual-screen {
  position: relative; z-index: 1; width: 178px; height: 96px; border-radius: 10px;
  background: linear-gradient(135deg, #1d2b4c, #2d1e42); border: 1px solid rgba(255, 255, 255, .24);
  display: grid; place-items: center; transition: transform .48s cubic-bezier(.34, 1.56, .64, 1), opacity .35s ease;
}
.dual-screen-tag { font-size: .78rem; font-weight: 600; color: #eef4ff; }
.dual-vinyl-disc {
  position: absolute; z-index: 2; width: 92px; height: 92px; border-radius: 50%;
  background: radial-gradient(circle, #ff7a9e 0 12%, #131826 13% 100%);
  border: 2px solid #5eead4; box-shadow: 0 0 24px rgba(94, 234, 212, .45);
  display: grid; place-items: center; opacity: 0; transform: scale(.4);
  transition: opacity .42s ease, transform .48s cubic-bezier(.34, 1.56, .64, 1);
}
.dual-vinyl-label { color: #fff; font-weight: 700; }
.dual-waves {
  position: absolute; right: 16px; bottom: 14px; z-index: 2; display: flex; align-items: flex-end; gap: 4px; height: 28px; opacity: 0; transition: opacity .3s ease;
}
.dual-waves span { width: 4px; height: 10px; border-radius: 999px; background: #5eead4; animation: dual-wave .7s ease-in-out infinite alternate; }
.dual-waves span:nth-child(2) { animation-delay: .12s; background: #ff7a9e; }
.dual-waves span:nth-child(3) { animation-delay: .25s; }
.dual-waves span:nth-child(4) { animation-delay: .38s; background: #ffd479; }
.dual-waves span:nth-child(5) { animation-delay: .18s; }
.dual-waves span:nth-child(6) { animation-delay: .32s; background: #ff7a9e; }
.guide-dual-stage.is-vinyl .dual-screen { transform: scale(.45); opacity: 0; }
.guide-dual-stage.is-vinyl .dual-vinyl-disc { opacity: 1; transform: scale(1); animation: pc-spin 4s linear infinite; }
.guide-dual-stage.is-vinyl .dual-waves { opacity: 1; }
@keyframes dual-wave { from { height: 6px; } to { height: 26px; } }

.guide-hero, .guide-reward-panel { max-width: none; width: 100%; margin-bottom: 0; }
.guide-reward-inner { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.guide-reward-kohi { width: 64px; height: 64px; object-fit: contain; flex: none; }
.guide-reward-copy { flex: 1 1 280px; min-width: 0; }
.guide-reward-copy p { margin: 0; }
.guide-reward-inner h3 { margin: 0 0 4px; font-size: 1rem; color: #8ef7eb; }

/* ---------------------------------------------------------------- Global Motion Layer */
main.page.is-soft-leaving {
  opacity: 0;
  transform: translateY(-4px) scale(0.992);
  transition: opacity .11s ease-out, transform .11s ease-out;
  pointer-events: none;
  will-change: opacity, transform;
}
main.page.is-soft-entering {
  animation: motion-page-in .26s cubic-bezier(.22, 1, .36, 1) backwards;
}
@keyframes motion-page-in {
  from { opacity: 0; transform: translateY(10px) scale(0.994); }
  to { opacity: 1; transform: none; }
}

/* Tactile Spring Press across buttons, nav pills, chips & icon controls */
.btn:not(:disabled), .icon-btn:not(:disabled), .mainnav a, .tabs a, .chip,
.glass-chip-btn, .day-pill, .tab-btn, .recent-icon-btn {
  transition: transform .22s cubic-bezier(.34, 1.56, .64, 1), background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}
@media (hover: hover) {
  .btn:not(:disabled):hover, .icon-btn:not(:disabled):hover, .mainnav a:hover,
  .tabs a:hover, .chip:hover, .glass-chip-btn:hover, .day-pill:hover, .tab-btn:hover, .recent-icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 22%, rgba(0, 0, 0, .24));
  }
}
.btn:not(:disabled):active, .icon-btn:not(:disabled):active, .mainnav a:active,
.tabs a:active, .chip:active, .glass-chip-btn:active, .day-pill:active, .tab-btn:active, .recent-icon-btn:active {
  transform: scale(0.94) !important;
  transition-duration: .08s;
}

/* Smooth Grid-Height Accordion ([data-smooth-details]) */
[data-smooth-details] summary { list-style: none; cursor: pointer; display: flex; align-items: center; }
[data-smooth-details] summary::-webkit-details-marker { display: none; }
.details-caret {
  display: inline-block; font-size: .72em; margin-right: 6px;
  transition: transform .24s cubic-bezier(.34, 1.56, .64, 1);
  transform-origin: center;
}
[data-smooth-details].is-open > summary .details-caret { transform: rotate(90deg); }
.details-grid {
  display: grid; grid-template-rows: 0fr;
  transition: grid-template-rows .26s cubic-bezier(.22, 1, .36, 1);
}
[data-smooth-details].is-open > .details-grid { grid-template-rows: 1fr; }
.details-grid-inner {
  min-height: 0; overflow: hidden; opacity: 0; transform: translateY(-4px);
  transition: opacity .2s ease, transform .24s cubic-bezier(.22, 1, .36, 1);
}
[data-smooth-details].is-open > .details-grid > .details-grid-inner { opacity: 1; transform: none; }

/* Frame-0 Pure CSS Stagger Wave Reveal (zero post-paint flash) */
@keyframes motion-stagger-slide {
  from { opacity: 0; transform: translateX(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes motion-stagger-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
[data-stagger="slide"] > * { animation: motion-stagger-slide .24s cubic-bezier(.22, 1, .36, 1) both; }
[data-stagger="up"] > * { animation: motion-stagger-up .22s cubic-bezier(.22, 1, .36, 1) both; }
[data-stagger="slide"] > *:nth-child(2) { animation-delay: 35ms; }
[data-stagger="slide"] > *:nth-child(3) { animation-delay: 70ms; }
[data-stagger="slide"] > *:nth-child(4) { animation-delay: 105ms; }
[data-stagger="slide"] > *:nth-child(5) { animation-delay: 140ms; }
[data-stagger="slide"] > *:nth-child(6) { animation-delay: 175ms; }
[data-stagger="slide"] > *:nth-child(7) { animation-delay: 210ms; }
[data-stagger="slide"] > *:nth-child(8) { animation-delay: 245ms; }
[data-stagger="slide"] > *:nth-child(n+9) { animation-delay: 280ms; }
[data-stagger="up"] > *:nth-child(2) { animation-delay: 30ms; }
[data-stagger="up"] > *:nth-child(3) { animation-delay: 60ms; }
[data-stagger="up"] > *:nth-child(4) { animation-delay: 90ms; }
[data-stagger="up"] > *:nth-child(5) { animation-delay: 120ms; }
[data-stagger="up"] > *:nth-child(6) { animation-delay: 150ms; }
[data-stagger="up"] > *:nth-child(7) { animation-delay: 180ms; }
[data-stagger="up"] > *:nth-child(8) { animation-delay: 210ms; }
[data-stagger="up"] > *:nth-child(n+9) { animation-delay: 240ms; }

.btn, .icon-btn, .chip, .tab-btn, .day-pill, .glass-chip-btn, .mainnav a, .tabs a, .card, .poster-card, .vinyl-card, .spotlight-card {
  -webkit-tap-highlight-color: transparent;
}

/* ---------------------------------------------------------------- Full Profile Space & Mini Popover */
.uploader-trigger, .user-card-link {
  border: 0; background: none; padding: 0; margin: 0; color: inherit; font: inherit; cursor: pointer;
  display: inline-flex; align-items: center; text-align: left;
}
.user-card-link:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

.profile-mini-popover {
  position: fixed; z-index: 160; width: min(320px, calc(100vw - 20px)); padding: 14px 16px; border-radius: 16px;
  background: linear-gradient(155deg, rgba(14, 19, 34, .96), rgba(9, 13, 24, .96)), url("/static/img/noise.svg");
  backdrop-filter: blur(18px); border: 1px solid rgba(94, 234, 212, .38); color: #eef4ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 18px 48px rgba(0, 0, 0, .62);
  display: flex; flex-direction: column; gap: 10px;
  animation: vt-popover-in .2s cubic-bezier(.22, 1, .36, 1);
}
@keyframes vt-popover-in { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
.profile-mini-popover.role-owner { border-color: rgba(253, 224, 71, .52); }
.profile-mini-popover.role-admin { border-color: rgba(252, 211, 77, .48); }
.pmp-head { display: flex; align-items: center; gap: 11px; }
.pmp-avatar { padding: 2px; border-radius: 50%; flex: none; background: rgba(255, 255, 255, .18); }
.pmp-avatar.role-owner { background: linear-gradient(135deg, #fde047, #fb7185, #c084fc); }
.pmp-avatar.role-admin { background: linear-gradient(135deg, #fcd34d, #f59e0b); }
.pmp-avatar.role-dev { background: linear-gradient(135deg, #38bdf8, #a855f7); }
.pmp-meta { min-width: 0; flex: 1; }
.pmp-name-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pmp-bio { margin: 0; font-size: .84rem; color: rgba(220, 232, 255, .86); line-height: 1.45; }
.pmp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px 0; border-block: 1px solid rgba(255, 255, 255, .09); text-align: center; font-variant-numeric: tabular-nums; }
.pmp-stats strong { display: block; font-size: .98rem; }
.pmp-stats span { font-size: .74rem; color: rgba(200, 214, 240, .68); }
.pmp-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }

.profile-space { display: flex; flex-direction: column; gap: 20px; }
.profile-hero {
  position: relative; height: clamp(220px, 32vh, 296px); border-radius: 24px 24px 0 0; overflow: hidden;
  background: #090e1c;
  -webkit-mask-image: linear-gradient(180deg, #000 58%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 58%, transparent 100%);
}
.profile-banner-img { width: 100%; height: 100%; object-fit: cover; }
.profile-banner-sky {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 76% 24%, rgba(254, 240, 138, .22), transparent 34%),
              radial-gradient(circle at 22% 40%, rgba(94, 234, 212, .22), transparent 52%),
              linear-gradient(135deg, #070b18, #121c38 55%, #1e1538);
}
.banner-moon {
  position: absolute; right: 12%; top: 18%; width: 84px; height: 84px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff9d6, #fde68a 60%, rgba(251, 113, 133, .3));
  box-shadow: 0 0 42px rgba(253, 224, 71, .42), 0 0 88px rgba(94, 234, 212, .22);
}
.banner-stars {
  position: absolute; inset: 0; opacity: .55;
  background: radial-gradient(circle at 18% 28%, #fff 1.2px, transparent 2px) 0 0 / 90px 80px,
              radial-gradient(circle at 64% 62%, #6ee7f5 1px, transparent 2px) 0 0 / 120px 100px;
}
.banner-silhouette {
  position: absolute; left: 0; right: 0; bottom: 0; height: 42%;
  background: linear-gradient(180deg, transparent, rgba(8, 12, 24, .78));
}
.profile-hero-aura { position: absolute; inset: 0; pointer-events: none; }
.profile-hero.role-owner .profile-hero-aura { box-shadow: inset 0 0 70px rgba(251, 113, 133, .28); }
.profile-hero.role-admin .profile-hero-aura { box-shadow: inset 0 0 64px rgba(252, 211, 77, .24); }
.profile-hero.role-dev .profile-hero-aura { box-shadow: inset 0 0 64px rgba(56, 189, 248, .26); }
.profile-hero.role-member .profile-hero-aura { box-shadow: inset 0 0 54px rgba(148, 163, 184, .18); }

.profile-identity-card {
  position: relative; z-index: 2; margin-top: -78px; padding: 22px 24px; border-radius: 20px;
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
  background: linear-gradient(155deg, color-mix(in srgb, var(--surface) 88%, rgb(var(--glass-tint) / .75)), color-mix(in srgb, var(--surface-2) 86%, rgb(var(--glass-tint) / .82))), url("/static/img/noise.svg");
  backdrop-filter: blur(18px);
  border: 1px solid color-mix(in srgb, var(--border) 78%, rgba(255, 255, 255, .14));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 18px 48px rgba(0, 0, 0, .36);
}
.profile-identity-card.role-owner { border-color: rgba(251, 113, 133, .45); }
.profile-identity-card.role-admin { border-color: rgba(252, 211, 77, .42); }
.profile-identity-card.role-dev { border-color: rgba(56, 189, 248, .42); }

.profile-avatar-col { position: relative; flex: none; display: inline-flex; flex-direction: column; align-items: center; margin-bottom: 10px; }
.profile-avatar-halo {
  position: relative; padding: 4px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(148, 163, 184, .65), rgba(94, 234, 212, .5));
  box-shadow: 0 0 22px rgba(94, 234, 212, .25);
}
.profile-avatar-halo::before {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  border: 1.5px dashed rgba(94, 234, 212, .42); pointer-events: none;
  animation: vinyl-spin 22s linear infinite;
}
.profile-avatar-halo.role-owner { background: linear-gradient(135deg, #fde047, #fb7185, #c084fc); box-shadow: 0 0 28px rgba(251, 113, 133, .42); }
.profile-avatar-halo.role-owner::before { border-color: rgba(253, 224, 71, .55); }
.profile-avatar-halo.role-admin { background: linear-gradient(135deg, #fcd34d, #f59e0b); box-shadow: 0 0 24px rgba(252, 211, 77, .35); }
.profile-avatar-halo.role-admin::before { border-color: rgba(252, 211, 77, .52); }
.profile-avatar-halo.role-dev { background: linear-gradient(135deg, #38bdf8, #a855f7); box-shadow: 0 0 24px rgba(56, 189, 248, .38); }
.profile-avatar-halo.role-dev::before { border-color: rgba(56, 189, 248, .55); }
.profile-status-pill {
  position: absolute; left: 50%; bottom: -10px; transform: translateX(-50%); z-index: 3; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  background: rgba(12, 16, 28, .92); border: 1px solid rgba(255, 255, 255, .18); font-size: .72rem; font-weight: 600;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .42);
}
.profile-status-pill.is-online { color: #4fd39a; border-color: rgba(79, 211, 154, .45); }
.profile-status-pill.is-online .status-breath-dot { width: 7px; height: 7px; border-radius: 50%; background: #4fd39a; box-shadow: 0 0 8px #4fd39a; animation: ws-breath 2s ease-in-out infinite; }
.profile-status-pill.is-offline .status-breath-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.profile-status-pill.is-activity { color: #d8b4fe; border-color: rgba(192, 132, 252, .55); box-shadow: 0 0 12px rgba(192, 132, 252, .3); }
.status-note-bounce { display: inline-block; animation: runner-hop .6s ease-in-out infinite; }

.profile-info-col { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.profile-name-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-name {
  margin: 0; font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  background: var(--name-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.profile-bio { margin: 0; color: color-mix(in srgb, var(--text) 84%, transparent); font-size: .94rem; line-height: 1.5; max-width: 62ch; }
.profile-stats-row { display: flex; flex-wrap: wrap; gap: 14px 24px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.profile-stat { display: inline-flex; align-items: baseline; gap: 6px; }
.profile-stat strong { font-size: 1.05rem; }
.profile-stat span { font-size: .82rem; color: var(--muted); }
.profile-activity-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 9px 16px; border-radius: 999px; font-size: .86rem;
  background: linear-gradient(90deg, rgba(168, 85, 247, .16), rgba(94, 234, 212, .12));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(192, 132, 252, .38); color: #e9d5ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 8px 24px rgba(0, 0, 0, .2);
  transition: transform .18s ease, border-color .18s ease;
}
.profile-activity-banner:hover { transform: translateY(-1px); border-color: rgba(94, 234, 212, .55); }
.profile-live-left { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.activity-go { font-weight: 700; color: #5eead4; white-space: nowrap; }
.profile-actions-col { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }

.profile-edit-wrap.is-open > .details-grid { grid-template-rows: 1fr; }
.profile-edit-wrap.is-open > .details-grid > .details-grid-inner { opacity: 1; transform: none; }
.profile-edit-panel {
  padding: 20px 22px; border-radius: var(--radius);
  background: linear-gradient(155deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--surface-2) 86%, transparent)), url("/static/img/noise.svg");
  border: 1px solid rgba(94, 234, 212, .35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 16px 38px rgba(0, 0, 0, .28);
}
.profile-edit-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.profile-edit-head h2 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.profile-edit-close-pill {
  border-radius: 999px; gap: 5px; padding: 6px 13px;
  background: rgba(255, 255, 255, .08); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .18); color: var(--text);
}
.profile-edit-close-pill:hover { border-color: rgba(94, 234, 212, .55); color: #5eead4; }
.profile-fav-mascot-card {
  border-style: dashed; border-color: rgba(148, 163, 184, .3);
  background: var(--ghost-bg);
  box-shadow: none;
}
.profile-fav-mascot-card:hover { border-color: rgba(255, 122, 158, .52); }
.profile-fav-mascot-thumb {
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, rgba(255, 122, 158, .12), rgba(94, 234, 212, .08) 70%, transparent);
}
.profile-fav-mascot-thumb::after { display: none; }
.profile-fav-mascot-thumb .mascot-art-slot { width: 78px; height: 78px; }
.profile-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; align-items: start; }
@media (max-width: 820px) { .profile-edit-grid { grid-template-columns: 1fr; } }
.profile-media-pickers { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.profile-privacy-rows { margin: 12px 0; }
.profile-sub-label { display: inline-flex; align-items: center; gap: 6px; font-size: .88rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.profile-runner-stage { position: relative; height: 86px; border-radius: 12px; background: rgba(8, 12, 24, .68); border: 1px solid rgba(255, 255, 255, .12); display: flex; align-items: flex-end; padding: 0 26px 18px; overflow: hidden; margin-bottom: 10px; }
.profile-runner-track { position: relative; width: 100%; }
.profile-runner-rail { width: 100%; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.profile-runner-trail {
  width: 0%; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #5eead4, #ff7a9e);
  box-shadow: 0 0 10px rgba(94, 234, 212, .45);
  animation: profile-trail-loop 8.5s linear infinite;
}
.profile-runner-stage[data-accent="sakura"] .profile-runner-trail { background: linear-gradient(90deg, #fda4af, #ff7a9e); box-shadow: 0 0 10px rgba(255, 122, 158, .55); }
.profile-runner-stage[data-accent="aurora"] .profile-runner-trail { background: linear-gradient(90deg, #38bdf8, #5eead4); box-shadow: 0 0 10px rgba(94, 234, 212, .55); }
.profile-runner-stage[data-accent="gold"] .profile-runner-trail { background: linear-gradient(90deg, #fde68a, #f59e0b); box-shadow: 0 0 10px rgba(251, 191, 36, .55); }
.profile-runner-stage[data-accent="violet"] .profile-runner-trail { background: linear-gradient(90deg, #c084fc, #5eead4); box-shadow: 0 0 10px rgba(192, 132, 252, .55); }
.profile-runner-demo { left: 0%; bottom: 10px; animation: profile-runner-loop 8.5s linear infinite; }
.profile-runner-demo .runner-body-wrap { animation: runner-stride .42s ease-in-out infinite; }
@keyframes profile-trail-loop { 0% { width: 0%; } 100% { width: 100%; } }
@keyframes profile-runner-loop { 0% { left: 0%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .profile-runner-trail { animation: none; width: 58%; }
  .profile-runner-demo { animation: none; left: 58%; }
}
.profile-accent-pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.profile-runner-grid { max-height: 220px; overflow-y: auto; padding-right: 4px; }

.profile-tabs-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.profile-liquid-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(540px, 100%); margin-bottom: 0; background: var(--surface-2); border-color: var(--border); }
.profile-liquid-tabs .liquid-pill { width: calc(33.333% - 3px); }
.profile-liquid-tabs .liquid-tab { color: var(--muted); padding: 8px 12px; }
.profile-liquid-tabs .liquid-tab.is-active { color: var(--text); }
.tab-count { font-size: .78rem; opacity: .75; margin-left: 3px; font-variant-numeric: tabular-nums; }
.profile-panel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.profile-radio-actions { display: flex; gap: 8px; }

.profile-works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px 16px; align-items: stretch; }
.profile-work-card:hover { transform: perspective(700px) rotateX(2deg) rotateY(-2deg) translateY(-4px); }
.profile-work-card.is-filter-enter { animation: profile-filter-in .26s cubic-bezier(.22, 1, .36, 1) both; }
@keyframes profile-filter-in {
  from { opacity: 0; transform: scale(0.95) translateY(8px); }
  to { opacity: 1; transform: none; }
}
.profile-work-meta { display: flex; gap: 6px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }

.profile-locked-favs .locked-pill {
  display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 8px; padding: 4px 12px; border-radius: 999px;
  background: rgba(255, 122, 158, .14); border: 1px solid rgba(255, 122, 158, .4); color: #ffb4ca; font-size: .82rem; font-weight: 600;
}

.milestones-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.milestone-card {
  position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 14px; padding: 16px;
  border-radius: 16px; border: 1px solid var(--border);
  background: linear-gradient(155deg, color-mix(in srgb, var(--surface) 88%, transparent), color-mix(in srgb, var(--surface-2) 84%, transparent)), url("/static/img/noise.svg");
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.milestone-card::after {
  content: ""; position: absolute; inset: 0; width: 45%; transform: translateX(-160%) skewX(-24deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .22), transparent); pointer-events: none;
  transition: transform .55s ease;
}
.milestone-card:hover::after { transform: translateX(300%) skewX(-24deg); }
.milestone-card:hover { transform: translateY(-2px); }
.milestone-card.is-locked { opacity: .52; filter: grayscale(.6); }
.milestone-card.is-unlocked.tone-owner { border-color: rgba(251, 113, 133, .48); }
.milestone-card.is-unlocked.tone-admin { border-color: rgba(252, 211, 77, .48); }
.milestone-card.is-unlocked.tone-dev { border-color: rgba(56, 189, 248, .48); }
.milestone-card.is-unlocked.tone-pink { border-color: rgba(255, 122, 158, .48); }
.milestone-card.is-unlocked.tone-cyber { border-color: rgba(94, 234, 212, .48); }
.milestone-icon {
  width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: rgba(94, 234, 212, .12); color: #5eead4; border: 1px solid rgba(94, 234, 212, .3);
}
.milestone-card.tone-owner .milestone-icon { background: rgba(251, 113, 133, .14); color: #fda4af; border-color: rgba(251, 113, 133, .36); }
.milestone-card.tone-admin .milestone-icon { background: rgba(252, 211, 77, .14); color: #fcd34d; border-color: rgba(252, 211, 77, .36); }
.milestone-copy { min-width: 0; flex: 1; }
.milestone-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.milestone-copy p { margin: 0 0 4px; }

@media (max-width: 720px) {
  .profile-identity-card { margin-top: -54px; padding: 16px; gap: 14px; }
  .profile-actions-col { width: 100%; margin-left: 0; }
  .profile-works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 10px; }
}

/* ---------------------------------------------------------------- Global Image Cropper Modal */
.cropper-modal {
  position: fixed; inset: 0; z-index: 260; display: grid; place-items: center; padding: 16px;
  background: rgba(5, 8, 18, .78); backdrop-filter: blur(10px);
  animation: vt-popover-in .2s ease;
}
.cropper-card {
  width: min(530px, 100%); padding: 18px 20px; border-radius: 20px;
  background: linear-gradient(155deg, rgba(16, 22, 40, .96), rgba(10, 14, 26, .98)), url("/static/img/noise.svg");
  border: 1px solid rgba(94, 234, 212, .45); color: #eef4ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 24px 64px rgba(0, 0, 0, .66);
  display: flex; flex-direction: column; gap: 12px;
}
.cropper-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cropper-x { border: 0; background: none; color: rgba(215, 228, 250, .75); font-size: 1.35rem; line-height: 1; cursor: pointer; padding: 2px 6px; }
.cropper-stage { display: grid; place-items: center; border-radius: 14px; overflow: hidden; border: 1px solid rgba(255, 255, 255, .12); background: #080c18; }
.cropper-canvas { display: block; cursor: grab; touch-action: none; }
.cropper-canvas:active { cursor: grabbing; }
.cropper-ratios { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.cropper-controls { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cropper-zoom-row { flex: 1 1 180px; display: flex; align-items: center; gap: 10px; margin: 0; font-size: .84rem; color: rgba(215, 228, 250, .82); }
.cropper-zoom-row input { flex: 1; padding: 0; border: 0; background: none; accent-color: #5eead4; }
.cropper-tool-btns { display: flex; gap: 8px; }
.cropper-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, .1); }

/* ---------------------------------------------------------------- battery & reduced-motion downgrade */
@media (prefers-reduced-motion: reduce) {
  main.page.is-soft-entering, [data-stagger] > * { animation: none !important; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .12s !important;
    scroll-behavior: auto !important;
  }
  .ambient-glow-canvas, .auth-border-glow, .vinyl-disc, .mini-vinyl-wrap, .role-badge::after, .role-badge-label, .role-owner, .role-owner .ic-crown-star { animation: none !important; }
  .role-badge::after { display: none; }
  .role-badge-label { color: inherit; background: none; -webkit-background-clip: border-box; background-clip: border-box; }
  .ambient-glow-canvas { opacity: .28; }
}
