/* =============================================================================
   EchoX Design System
   ダーク基調（わずかに青み）+ 水色のアクセント。全ページ共通。
   ============================================================================= */
/* 見出し用の英字フォント（22KB・同一オリジン配信）。日本語は OS 標準フォントを使う */
@font-face {
    font-family: "Space Grotesk"; font-style: normal; font-weight: 300 700; font-display: swap;
    src: url("vendor/space-grotesk.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212;
}
:root {
    --bg: #070b10;
    --bg-elev: #0b1118;
    --surface: #101820;
    --surface-2: #16202a;
    --surface-3: #1e2a36;
    --border: #22303d;
    --border-strong: #324454;
    --text: #eef6fb;
    --muted: #9aaab8;
    --subtle: #63727f;
    --accent: #4cc9f0;
    --accent-hover: #74d7f5;
    --accent-2: #8ff0ff;
    --accent-ink: #03131b;
    --accent-soft: rgba(76, 201, 240, 0.14);
    --accent-line: rgba(76, 201, 240, 0.38);
    --ok: #3ddc97;
    --ok-soft: rgba(61, 220, 151, 0.12);
    --danger: #ff6b6b;
    --danger-soft: rgba(255, 107, 107, 0.12);
    --heart: #ff4d7d;

    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.7);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN",
            "Yu Gothic UI", "BIZ UDPGothic", Meiryo, "Noto Sans JP", system-ui, sans-serif;
    --font-display: "Space Grotesk", var(--font);
    --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}
body::before {
    /* 画面上部のほのかな光 */
    content: "";
    position: fixed;
    inset: -20% -10% auto -10%;
    height: 70vh;
    background:
        radial-gradient(60% 60% at 15% 0%, rgba(76, 201, 240, 0.11), transparent 70%),
        radial-gradient(40% 50% at 90% 10%, rgba(143, 240, 255, 0.06), transparent 70%);
    pointer-events: none;
    z-index: -1;
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
code {
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: 0.92em;
    background: var(--accent-soft);
    color: var(--accent);
    padding: 2px 7px;
    border-radius: 6px;
}
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- Topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(7, 11, 16, 0.94);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.topbar-inner {
    max-width: 1240px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 19px;
    letter-spacing: -0.02em;
}
.brand-mark { width: 30px; height: 30px; flex-shrink: 0; }
.brand-tag {
    font-family: var(--font);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--accent-line);
    padding: 1px 7px;
    border-radius: 999px;
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; flex-shrink: 1; }
.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px 4px 4px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 13px;
    color: var(--muted);
    text-decoration: none;
    max-width: 200px;
    transition: border-color .2s, color .2s;
}
.user-chip:hover { border-color: var(--border-strong); color: var(--text); }
.user-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar {
    width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
    object-fit: cover; background: var(--surface-3);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: var(--text);
}

/* ---------------------------------------------------------------- Layout */
.page { width: 100%; max-width: 1240px; margin: 0 auto; padding: 36px 20px 48px; flex: 1; }
.page-narrow { max-width: 880px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
/* 見出しが 360px 未満に押し縮められる場合は、右側の操作部を下の段に回す */
.page-head .grow { flex: 1 1 360px; min-width: 0; }
.page-head-actions { display: flex; align-items: center; gap: 10px; }
.ctrl-break { display: none; }
.eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.page-title {
    font-family: var(--font-display);
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
}
.page-sub { color: var(--muted); margin-top: 6px; }
.section-head {
    display: flex; align-items: center; gap: 10px;
    margin: 32px 0 14px;
    font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--muted);
}
.section-head::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.section-head .count { color: var(--subtle); font-weight: 500; letter-spacing: 0; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; min-height: 32px; flex-wrap: wrap; }
.card-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-title i { color: var(--accent); }
.card-head .spacer { flex: 1; }

/* ---------------------------------------------------------------- Footer */
.site-footer {
    max-width: 1240px; width: 100%; margin: 0 auto;
    padding: 24px 20px 32px;
    display: flex; gap: 16px; align-items: center; justify-content: space-between;
    font-size: 12px; color: var(--subtle);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--text); }

/* ---------------------------------------------------------------- Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 13px; font-weight: 700;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    transition: transform .15s var(--ease), background .2s, border-color .2s, color .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--border); }
.btn-ghost:hover:not(:disabled) { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.btn-soft { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-soft:hover:not(:disabled) { background: var(--surface-3); }
.btn-danger { background: transparent; color: var(--danger); border-color: rgba(255, 107, 107, .3); }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 9px; }
.btn-sm.accent { color: var(--accent); border-color: var(--accent-line); background: transparent; }
.btn-sm.accent:hover { background: var(--accent-soft); }
.btn-sm.danger { color: var(--danger); border-color: rgba(255, 107, 107, .3); background: transparent; }
.btn-sm.danger:hover { background: var(--danger-soft); }
.btn-sm:not(.btn) {
    display: inline-flex; align-items: center; gap: 5px;
    border: 1px solid var(--border); background: transparent; color: var(--muted);
    cursor: pointer; white-space: nowrap; transition: all .15s;
}
.btn-sm:not(.btn):hover { color: var(--text); border-color: var(--border-strong); }

.icon-btn {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: 15px;
    cursor: pointer; text-decoration: none;
    transition: all .15s;
    flex-shrink: 0;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }

/* 小さなアイコンボタン（キュー/お気に入りパネル等。JSからも使用） */
.btn-icon {
    display: inline-flex; align-items: center; gap: 5px;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
    border-radius: 9px; padding: 5px 9px; font-size: 13px; line-height: 1;
    cursor: pointer; transition: all .15s;
}
.btn-icon:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-3); }
.btn-icon.active { color: var(--heart); border-color: rgba(255, 77, 125, .35); background: rgba(255, 77, 125, .1); }
.btn-icon.on { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.btn-icon-only { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 16px; padding: 4px 6px; border-radius: 8px; }
.btn-icon-only:hover { color: var(--text); background: var(--surface-2); }
.btn-icon-only.heart-active { color: var(--heart); }

/* ---------------------------------------------------------------- Forms */
.input, .inline-input, .field input, .field select {
    width: 100%;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 12px;
    padding: 11px 14px;
    font-size: 14px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.inline-input { padding: 8px 12px; font-size: 13px; border-radius: 10px; }
.input:focus, .inline-input:focus, .field input:focus, .field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder, .inline-input::placeholder, .field input::placeholder { color: var(--subtle); }
.input-row { display: flex; gap: 8px; }
.input-row .input { flex: 1; min-width: 0; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.field .hint { font-size: 11px; color: var(--subtle); margin-top: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.switch-row {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px;
    margin-bottom: 10px; cursor: pointer; background: var(--bg-elev);
}
.switch-row .txt { flex: 1; font-size: 13px; }
.switch-row .txt small { display: block; color: var(--subtle); font-size: 11px; margin-top: 2px; }
.switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; margin-top: 1px; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .track {
    position: absolute; inset: 0; border-radius: 999px;
    background: var(--surface-3); border: 1px solid var(--border-strong);
    transition: background .2s, border-color .2s;
}
.switch .track::after {
    content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%;
    background: var(--muted); transition: transform .2s var(--ease), background .2s;
}
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); background: var(--accent-ink); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .5; }

/* ---------------------------------------------------------------- Tabs */
.tabs {
    display: inline-flex; gap: 4px; padding: 4px;
    background: var(--bg-elev); border: 1px solid var(--border); border-radius: 13px;
}
.tab {
    border: none; background: transparent; color: var(--muted);
    padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 700;
    cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: all .15s;
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 0 rgba(255,255,255,.04) inset; }

/* ---------------------------------------------------------------- Pills / badges */
.pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 999px;
    font-size: 11px; font-weight: 700; letter-spacing: .02em;
    border: 1px solid var(--border); color: var(--muted); background: var(--surface);
    white-space: nowrap;
}
.pill-live { color: var(--ok); border-color: rgba(61, 220, 151, .3); background: var(--ok-soft); }
.pill-accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.count-badge {
    min-width: 22px; padding: 1px 7px; border-radius: 999px;
    background: var(--accent); color: var(--accent-ink);
    font-size: 11px; font-weight: 800; text-align: center;
}
.conn-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.conn-badge.on { color: var(--ok); background: var(--ok-soft); border: 1px solid rgba(61, 220, 151, .25); }
.conn-badge.off { color: var(--danger); background: var(--danger-soft); border: 1px solid rgba(255, 107, 107, .25); }

/* ---------------------------------------------------------------- EQ animation */
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 3px; height: 100%; background: currentColor; border-radius: 2px; transform-origin: bottom; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.4s; }
.eq i:nth-child(3) { animation-delay: -.7s; }
.eq i:nth-child(4) { animation-delay: -.2s; }
@keyframes eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }
.eq.paused i { animation-play-state: paused; transform: scaleY(.3); }

/* ---------------------------------------------------------------- Empty / misc */
.empty, .queue-empty {
    color: var(--subtle); font-size: 13px; text-align: center; padding: 28px 12px;
}
.empty-state { text-align: center; padding: 72px 20px; border: 1px dashed var(--border); border-radius: var(--radius-lg); }
.empty-state .ico {
    width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 20px;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-2); color: var(--muted); font-size: 28px;
}
.empty-state h3 { font-size: 16px; margin-bottom: 6px; }
.empty-state p { color: var(--muted); font-size: 13px; max-width: 420px; margin: 0 auto; }

.spinner {
    display: inline-block; width: 15px; height: 15px;
    border: 2px solid rgba(255, 255, 255, .25); border-top-color: currentColor;
    border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
    position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
    padding: 12px 18px; border-radius: 14px;
    font-size: 13px; font-weight: 700; z-index: 999;
    max-width: calc(100vw - 32px);
    box-shadow: var(--shadow);
    animation: toastIn .3s var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }
.toast-ok { background: rgba(14, 36, 30, .97); border: 1px solid rgba(61, 220, 151, .35); color: var(--ok); }
.toast-err { background: rgba(44, 16, 20, .97); border: 1px solid rgba(255, 107, 107, .35); color: var(--danger); }

/* ---------------------------------------------------------------- Modal */
.modal-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(2, 5, 8, .76);
    display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.show { display: flex; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.modal-box {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    padding: 26px; width: min(560px, 100%); max-height: 86vh; overflow-y: auto;
    box-shadow: var(--shadow);
    animation: pop .25s var(--ease);
}
.modal-box.sm { width: min(420px, 100%); }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.modal-title i { color: var(--accent); }
.modal-foot { display: flex; align-items: center; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.modal-foot .spacer { flex: 1; }

/* ---------------------------------------------------------------- Login */
.login-wrap {
    flex: 1; display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh;
}
.login-hero {
    position: relative; overflow: hidden;
    padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
    border-right: 1px solid var(--border);
    background: var(--bg-elev);
}
.login-hero .rings {
    position: absolute; left: 50%; top: 52%; width: 900px; height: 900px; transform: translate(-50%, -50%);
    background: repeating-radial-gradient(circle at center, transparent 0 46px, rgba(76, 201, 240, .11) 46px 47px);
    -webkit-mask-image: radial-gradient(circle at center, #000 0 30%, transparent 62%);
    mask-image: radial-gradient(circle at center, #000 0 30%, transparent 62%);
    animation: ripple 9s linear infinite;
    will-change: transform;
}
@keyframes ripple { from { transform: translate(-50%, -50%) scale(1); } to { transform: translate(-50%, -50%) scale(1.104); } }
.login-hero .glow {
    position: absolute; left: 50%; top: 52%; width: 360px; height: 360px; transform: translate(-50%, -50%);
    background: radial-gradient(circle, rgba(76, 201, 240, .30), rgba(76, 201, 240, .08) 45%, transparent 70%);
}
.login-hero > * { position: relative; }
.login-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(36px, 5vw, 64px);
    line-height: 1.02; letter-spacing: -0.04em; font-weight: 700;
}
.login-hero h1 em { font-style: normal; color: var(--accent); }
.login-hero p { color: var(--muted); max-width: 420px; margin-top: 16px; font-size: 15px; }
.login-feats { display: flex; gap: 10px; flex-wrap: wrap; }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-family: var(--font-display); font-size: 28px; letter-spacing: -0.03em; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 28px; }
.btn-discord {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    width: 100%; padding: 15px 22px;
    background: #5865f2; color: #fff; border: none; border-radius: 14px;
    font-size: 15px; font-weight: 700; text-decoration: none;
    transition: transform .15s var(--ease), background .2s, box-shadow .2s;
}
.btn-discord:hover { background: #4752c4; box-shadow: 0 12px 30px -10px rgba(88, 101, 242, .7); }
.btn-discord:active { transform: scale(.98); }
.btn-discord.loading { pointer-events: none; opacity: .8; }
.btn-discord i { font-size: 20px; }
.alert {
    background: var(--danger-soft); border: 1px solid rgba(255, 107, 107, .3); color: #ffb3b3;
    border-radius: 12px; padding: 12px 14px; font-size: 13px; margin-bottom: 20px;
    display: flex; gap: 10px; align-items: flex-start;
}
.login-note { margin-top: 20px; font-size: 12px; color: var(--subtle); }
.login-note a { color: var(--muted); }
@media (max-width: 860px) {
    .login-wrap { grid-template-columns: 1fr; }
    .login-hero { min-height: 46vh; padding: 28px 24px; border-right: none; border-bottom: 1px solid var(--border); }
    .login-hero .rings { width: 640px; height: 640px; }
}

/* ---------------------------------------------------------------- Dashboard */
.guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.guild-card {
    position: relative; overflow: hidden;
    display: flex; align-items: center; gap: 14px;
    padding: 18px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--border);
    text-decoration: none; cursor: pointer;
    transition: transform .2s var(--ease), border-color .2s, background .2s;
}
.guild-card:hover { transform: translateY(-2px); border-color: var(--border-strong); background: var(--surface-2); }
.guild-card.live { border-color: rgba(61, 220, 151, .28); }
.guild-card.live::before {
    content: ""; position: absolute; inset: 0;
    background: radial-gradient(80% 120% at 0% 50%, rgba(61, 220, 151, .08), transparent 60%);
    pointer-events: none;
}
.guild-avatar, .guild-avatar-placeholder {
    width: 54px; height: 54px; border-radius: 16px; flex-shrink: 0; object-fit: cover; position: relative;
}
.guild-avatar-placeholder {
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--accent-ink);
    font-family: var(--font-display); font-size: 22px; font-weight: 700;
}
.guild-body { flex: 1; min-width: 0; position: relative; }
.guild-name { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guild-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 10px; margin-top: 3px; }
.guild-meta .live-txt { color: var(--ok); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guild-go {
    width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; position: relative;
    display: flex; align-items: center; justify-content: center;
    background: var(--surface-3); color: var(--muted); transition: all .2s;
}
.guild-card:hover .guild-go { background: var(--accent); color: var(--accent-ink); }
.quick-links { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Player */
.player-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.player-main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.player-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 80px; min-width: 0; }

.hero {
    position: relative; overflow: hidden;
    border-radius: 28px; border: 1px solid var(--border);
    background: var(--surface);
    padding: 28px;
    isolation: isolate;
}
.hero-bg {
    position: absolute; inset: -40px; z-index: -2;
    background-size: cover; background-position: center;
    filter: blur(48px) saturate(1.4);
    opacity: .55;
    transform: translateZ(0);
    will-change: transform;
    transition: opacity .6s ease;
}
.hero::after {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(180deg, rgba(7, 11, 16, .25), rgba(7, 11, 16, .8));
}
.hero-top { display: flex; gap: 26px; align-items: center; }
.artwork {
    width: 196px; height: 196px; flex-shrink: 0;
    border-radius: 20px; overflow: hidden;
    background: var(--surface-2);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 24px 48px -18px rgba(0, 0, 0, .8);
}
.artwork a { display: block; width: 100%; height: 100%; }
.artwork img { width: 100%; height: 100%; object-fit: cover; }
/* YouTube の hqdefault は上下に黒帯がある 4:3 画像のため拡大して帯を切り落とす */
img.yt { transform: scale(1.34); }
.queue-thumb, .s-thumb { overflow: hidden; display: block; }
.artwork i { font-size: 56px; color: var(--accent); }
.track-meta { flex: 1; min-width: 0; }
.now-label { font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.now-label .eq { display: none; }
body.is-playing .now-label .eq { display: inline-flex; }
.track-title {
    font-family: var(--font-display);
    font-size: clamp(22px, 3vw, 34px);
    font-weight: 700; letter-spacing: -0.025em; line-height: 1.15;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    word-break: break-word;
}
.track-artist { color: var(--muted); margin-top: 6px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-tools { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.vote-info { font-size: 12px; color: var(--accent); font-weight: 700; }

.progress-wrap { margin-top: 26px; }
.progress {
    position: relative; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .12); cursor: pointer;
    contain: layout style;  /* 位置の更新が周囲のレイアウトに波及しないように */
}
.progress::before { content: ""; position: absolute; inset: -8px 0; } /* クリック領域拡大 */
.progress-fill {
    height: 100%; border-radius: 6px; position: relative;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width .3s linear;
}
.progress-fill::after {
    content: ""; position: absolute; right: -6px; top: 50%; width: 12px; height: 12px; border-radius: 50%;
    background: #fff; transform: translateY(-50%) scale(0); transition: transform .15s;
}
.progress:hover .progress-fill::after { transform: translateY(-50%) scale(1); }
.time-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 8px; font-variant-numeric: tabular-nums; }

/* ライブ配信: シーク・ループは無し。バーは常に満タンで赤 */
.live-badge {
    display: none; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px;
    background: var(--danger); color: #fff; font-size: 10px; letter-spacing: .12em;
}
.live-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: livePulse 1.6s ease-in-out infinite; }
body.is-live .live-badge { display: inline-flex; }
body.is-live .progress { cursor: default; }
body.is-live .progress-fill { width: 100% !important; background: linear-gradient(90deg, rgba(255, 107, 107, .3), var(--danger)); }
body.is-live .progress:hover .progress-fill::after { transform: translateY(-50%) scale(0); }
body.is-live #total-time { color: var(--danger); font-weight: 800; letter-spacing: .08em; }
body.is-live .loop-toggle { opacity: .45; pointer-events: none; }
@keyframes livePulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .live-badge::before { animation: none; } }

.controls { display: flex; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.ctrl-btn {
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .06);
    color: var(--text); font-size: 18px;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; transition: transform .15s var(--ease), background .2s, border-color .2s;
}
.ctrl-btn:hover { background: rgba(255, 255, 255, .12); }
.ctrl-btn:active { transform: scale(.92); }
.ctrl-btn:disabled { opacity: .45; pointer-events: none; }
.ctrl-btn.primary {
    width: 60px; height: 60px; font-size: 26px;
    background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
    box-shadow: 0 12px 30px -10px rgba(76, 201, 240, .7);
}
.ctrl-btn.primary:hover { background: var(--accent-hover); }
.ctrl-btn.danger:hover { color: var(--danger); border-color: rgba(255, 107, 107, .4); }
.loop-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 12px; border-radius: 999px;
    background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12);
    font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; user-select: none;
}
.loop-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.loop-toggle:has(input:checked) { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.loop-toggle:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.vol-wrap { display: flex; align-items: center; gap: 10px; margin-left: auto; color: var(--muted); }
.vol-wrap span { font-size: 12px; min-width: 36px; text-align: right; font-variant-numeric: tabular-nums; }
input[type=range] {
    -webkit-appearance: none; appearance: none; width: 120px; height: 5px; border-radius: 5px;
    background: rgba(255, 255, 255, .15); outline: none; cursor: pointer;
}
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%; background: var(--text); border: none; }
input[type=range]::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; background: var(--text); border: none; }

.vc-notice {
    text-align: center; padding: 48px 24px;
    border: 1px dashed rgba(255, 107, 107, .35); border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 107, 107, .06), transparent);
}
.vc-notice .ico { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 20px; display: flex; align-items: center; justify-content: center; background: var(--danger-soft); color: var(--danger); font-size: 28px; }
.vc-notice h2 { font-size: 18px; margin-bottom: 8px; }
.vc-notice p { color: var(--muted); }

/* キュー / リスト */
.queue-list { max-height: 520px; overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
.queue-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px; margin: 0 -8px; border-radius: 12px;
    font-size: 13px; transition: background .15s;
    border-top: 2px solid transparent;
}
.queue-item:hover { background: var(--surface-2); }
.queue-item[draggable=true] { cursor: grab; }
.queue-item.dragging { opacity: .4; }
.queue-item.drag-over { border-top-color: var(--accent); }
.queue-idx { color: var(--subtle); font-size: 11px; min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.queue-thumb { width: 40px; height: 40px; border-radius: 9px; object-fit: cover; flex-shrink: 0; background: var(--surface-3); }
.queue-body { flex: 1; min-width: 0; }
.queue-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.queue-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.queue-del {
    color: var(--subtle); cursor: pointer; font-size: 13px;
    width: 28px; height: 28px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center;
    opacity: 0; transition: all .15s; flex-shrink: 0;
}
.queue-item:hover .queue-del { opacity: 1; }
.queue-del:hover { color: var(--danger); background: var(--danger-soft); }
@media (hover: none) { .queue-del { opacity: 1; } }
.sub-panel { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.sub-panel-title { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--subtle); margin-bottom: 8px; }

.participant { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 13px; }
.participant .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); flex-shrink: 0; }
.me-badge { margin-left: auto; font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }

/* 追加パネル */
.add-tabs { margin-bottom: 16px; }
.add-pane[hidden] { display: none; }
.search-results { max-height: 380px; overflow-y: auto; margin-top: 12px; }
.search-item {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 10px; border-radius: 12px; cursor: pointer; transition: background .15s;
}
.search-item:hover { background: var(--surface-2); }
.search-item .s-thumb { width: 64px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--surface-3); }
.search-item .s-info { flex: 1; min-width: 0; }
.search-item .s-title { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item .s-meta { font-size: 11px; color: var(--muted); }
.search-item .s-add { color: var(--accent); font-size: 20px; flex-shrink: 0; }
.search-item.loading { opacity: .6; pointer-events: none; }
.search-item.added { opacity: .55; }
.upload-zone {
    border: 1.5px dashed var(--border-strong); border-radius: var(--radius);
    padding: 32px 20px; text-align: center; cursor: pointer;
    transition: border-color .2s, background .2s;
}
.upload-zone:hover, .upload-zone.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.upload-inner { pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.upload-progress { margin-top: 12px; font-size: 12px; color: var(--muted); }
.upload-progress .progress { margin-top: 6px; height: 4px; cursor: default; }
.upload-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.upload-actions .btn { flex: 1; }

/* ---------------------------------------------------------------- 追加中・準備中の演出 */
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
.shimmer, .queue-item.pending .queue-thumb {
    background: linear-gradient(90deg, var(--surface-3) 0%, #34343d 50%, var(--surface-3) 100%);
    background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
.queue-item.pending {
    background: linear-gradient(90deg, transparent, var(--accent-soft), transparent);
    background-size: 200% 100%; animation: shimmer 2.2s linear infinite, pendingIn .35s var(--ease);
}
.queue-item.pending .queue-idx { color: var(--accent); }
.queue-item.pending .queue-idx .spinner { width: 13px; height: 13px; border-color: var(--accent-soft); border-top-color: var(--accent); }
.queue-item.pending .queue-sub { color: var(--accent); }
.queue-item.pending.failed { animation: none; background: var(--danger-soft); }
.queue-item.pending.failed .queue-idx, .queue-item.pending.failed .queue-sub { color: var(--danger); }
@keyframes pendingIn { from { opacity: 0; transform: translateY(-6px); } }

/* 何も再生していない時に曲を追加 → ジャケット部分に準備中の演出 */
.artwork { position: relative; }
body.is-preparing .artwork::before {
    content: ""; position: absolute; inset: 0; z-index: 2;
    background: rgba(9, 9, 11, .55);
}
body.is-preparing .artwork::after {
    content: ""; position: absolute; z-index: 3; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px;
    border-radius: 50%; border: 4px solid rgba(255, 255, 255, .15); border-top-color: var(--accent);
    animation: spin .9s linear infinite;
}
body.is-preparing .artwork i { animation: pulse 1.2s ease-in-out infinite; }
body.is-preparing .track-artist { color: var(--accent); }
body.is-preparing .now-label .eq { display: inline-flex; }
body.is-preparing .hero-bg { opacity: .3; }
@keyframes pulse { 0%, 100% { opacity: .4; transform: scale(.94); } 50% { opacity: 1; transform: scale(1); } }

/* 曲リストの行: 追加リクエスト中は下線が流れる */
.song-row.busy { position: relative; overflow: hidden; }
.song-row.busy::before {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    background-size: 50% 100%; background-repeat: no-repeat;
    animation: busyBar 1s linear infinite;
}
@keyframes busyBar { from { background-position: -50% 0; } to { background-position: 150% 0; } }
.song-row.added { animation: addedFlash .6s var(--ease); }
@keyframes addedFlash { 0% { background: var(--ok-soft); } 100% { background: transparent; } }

/* プレイリスト一括追加の進捗 */
.toast-progress { display: flex; align-items: center; gap: 10px; min-width: 240px; }
.toast-progress .bar { flex: 1; height: 4px; border-radius: 4px; background: rgba(61, 220, 151, .2); overflow: hidden; min-width: 60px; }
.toast-progress .bar i { display: block; height: 100%; background: var(--ok); transition: width .3s var(--ease); }

/* ---------------------------------------------------------------- Picker（曲を追加） */
.show-sm { display: none !important; }
.muted { color: var(--muted); }
.picker-tabs .tab span { display: inline; }
.tabs-sm .tab { padding: 5px 11px; font-size: 12px; }
.search-box { position: relative; display: flex; gap: 8px; }
.search-box .input { padding-left: 40px; flex: 1; min-width: 0; height: 46px; }
.search-box .btn { height: 46px; min-width: 64px; }
.search-ico { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--subtle); pointer-events: none; z-index: 1; }
.suggest-list {
    position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30;
    list-style: none; padding: 6px; margin: 0;
    background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 14px;
    box-shadow: var(--shadow); max-height: 320px; overflow-y: auto;
}
.suggest-list li {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: 9px; cursor: pointer; font-size: 14px;
}
.suggest-list li i { color: var(--subtle); font-size: 12px; }
.suggest-list li:hover, .suggest-list li.active { background: var(--surface-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 12px; }
.chips:empty { display: none; }
.chips-label { font-size: 11px; color: var(--subtle); font-weight: 700; margin-right: 2px; }
.chip {
    border: 1px solid var(--border); background: var(--bg-elev); color: var(--muted);
    border-radius: 999px; padding: 4px 11px; font-size: 12px; cursor: pointer; transition: all .15s;
    max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.pane-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pane-head > :first-child { flex: 1; min-width: 0; }
.pane-note { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pane-hint {
    display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
    color: var(--subtle); font-size: 13px; text-align: center; padding: 28px 12px; line-height: 1.7;
}
.song-list { margin-top: 12px; max-height: 460px; overflow-y: auto; margin-left: -8px; margin-right: -8px; padding: 0 8px; }
.pane-head + .song-list { margin-top: 0; }
.song-row {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 8px; margin: 0 -8px; border-radius: 12px; cursor: pointer;
    transition: background .15s, opacity .2s;
}
.song-row:hover { background: var(--surface-2); }
.song-row .s-thumb { width: 64px; height: 40px; border-radius: 8px; flex-shrink: 0; background: var(--surface-3); }
.song-row .s-thumb img { width: 100%; height: 100%; object-fit: cover; }
.s-thumb-ph { display: flex !important; align-items: center; justify-content: center; color: var(--subtle); font-size: 16px; }
.song-row .s-info { flex: 1; min-width: 0; }
.song-row .s-title { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-row .s-meta { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-tag {
    display: none; margin-right: 6px; padding: 0 6px; border-radius: 999px;
    font-size: 10px; font-weight: 800; color: var(--ok); background: var(--ok-soft);
}
.song-row.in-queue .q-tag { display: inline-block; }
.row-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex-shrink: 0;
    height: 32px; min-width: 32px; padding: 0 10px; border-radius: 9px;
    border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
    font-size: 12px; font-weight: 700; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.row-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-3); }
.row-btn.primary { padding: 0; width: 32px; background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.row-btn.primary:hover { background: var(--accent); color: var(--accent-ink); }
.song-row .row-btn[data-act=next] { opacity: 0; }
.song-row:hover .row-btn[data-act=next], .song-row:focus-within .row-btn[data-act=next] { opacity: 1; }
@media (hover: none) { .song-row .row-btn[data-act=next] { opacity: 1; } }
.song-row.busy { opacity: .55; pointer-events: none; }
.song-row.added .row-btn { display: none; }
.song-row.added::after {
    content: attr(data-state); flex-shrink: 0;
    font-size: 11px; font-weight: 800; color: var(--ok);
    padding: 4px 10px; border-radius: 999px; background: var(--ok-soft);
}
.pl-group { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; background: var(--bg-elev); }
.pl-group summary {
    display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; list-style: none;
    font-size: 13px; font-weight: 700;
}
.pl-group summary::-webkit-details-marker { display: none; }
.pl-group summary > i { color: var(--accent); }
.pl-group summary::after { content: "\F282"; font-family: "bootstrap-icons"; color: var(--subtle); transition: transform .2s; font-size: 12px; }
.pl-group[open] summary::after { transform: rotate(180deg); }
.pl-group .pl-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-group summary .row-btn.primary { width: auto; padding: 0 10px; }
.pl-group .song-list { margin: 0; padding: 0 12px 8px; }
.pl-group .song-row { margin: 0 -4px; }

@media (max-width: 1020px) {
    .player-layout { grid-template-columns: minmax(0, 1fr); }
    .player-side { position: static; }
}
@media (max-width: 640px) {
    .page { padding: 24px 16px 40px; }
    .hero { padding: 20px; border-radius: 22px; }
    .hero-top { flex-direction: column; align-items: stretch; text-align: center; gap: 18px; }
    .artwork { width: min(240px, 70vw); height: min(240px, 70vw); margin: 0 auto; }
    .track-tools { justify-content: center; }
    .controls { justify-content: center; }
    .card { padding: 18px; border-radius: 20px; }
    .field-row { gap: 10px; }
    .modal-box { padding: 20px; }
    .hide-sm { display: none !important; }
    /* 見出し右側の操作部は全幅にして左右の偏りをなくす */
    .page-head > :not(.grow) { width: 100%; }
    .page-head .quick-links .btn { flex: 1; }
    .page-head .tabs { display: flex; }
    .page-head .tabs .tab { flex: 1; justify-content: center; }
    .page-head-actions { justify-content: space-between; }
    /* 再生ボタンを中央に: 1段目「停止・再生・スキップ」、2段目「ループ・音量」 */
    .ctrl-break { display: block; flex-basis: 100%; height: 0; }
    .now-label { justify-content: center; }
    .controls { row-gap: 14px; }
    .loop-toggle { margin-left: 0; }
    .vol-wrap { margin-left: 0; flex: 1 1 0; min-width: 0; max-width: 300px; }
    .vol-wrap input[type=range] { flex: 1; width: auto; min-width: 60px; }
    .show-sm { display: inline-block !important; }
    .picker-tabs .tab span { display: none; }
    .picker-tabs .tab { padding: 7px 11px; }
    .row-btn[data-act=next] span { display: none; }
    .song-row .s-thumb { width: 52px; height: 36px; }
    .topbar-inner { padding: 10px 16px; gap: 10px; }
    .site-footer { flex-direction: column; gap: 6px; }
}

/* ---------------------------------------------------------------- Stats */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { padding: 22px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.stat-card .lbl { font-size: 12px; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.stat-card .lbl i { color: var(--accent); }
.stat-card .val { font-family: var(--font-display); font-size: 36px; font-weight: 700; letter-spacing: -0.03em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.rank-item { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; }
.rank-item + .rank-item { border-top: 1px solid rgba(255, 255, 255, .04); }
.rank-no { font-family: var(--font-display); font-weight: 700; color: var(--subtle); font-size: 15px; text-align: center; }
.rank-item:nth-child(-n+3) .rank-no { color: var(--accent); }
.rank-title { min-width: 0; }
.rank-title div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; font-weight: 500; }
.rank-bar { height: 4px; border-radius: 4px; background: var(--surface-3); margin-top: 6px; overflow: hidden; }
.rank-bar span { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.rank-cnt { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- My page */
.item-row {
    display: flex; align-items: center; gap: 10px;
    padding: 10px; margin: 0 -10px; border-radius: 12px; font-size: 13px;
    border-top: 2px solid transparent; transition: background .15s;
}
.item-row:hover { background: var(--surface-2); }
.item-row.dragging { opacity: .4; }
.item-row.drag-over { border-top-color: var(--accent); }
.item-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.search-bar { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.search-bar .inline-input { flex: 1; min-width: 140px; width: auto; }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 13px; }
.sr-item:hover { background: var(--surface-2); color: var(--accent); }
.pl-check-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; font-size: 13px; cursor: pointer; }
.pl-check-item:hover { background: var(--surface-2); }
.pl-check-item input { display: none; }
.pl-check-item .custom-check {
    width: 20px; height: 20px; border: 2px solid var(--border-strong); border-radius: 6px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.pl-check-item input:checked + .custom-check { background: var(--accent); border-color: var(--accent); }
.pl-check-item input:checked + .custom-check::after {
    content: ""; width: 5px; height: 10px; border: solid var(--accent-ink); border-width: 0 2px 2px 0; transform: rotate(45deg); margin-top: -2px;
}

/* ---------------------------------------------------------------- Terms */
.prose h2 {
    font-size: 16px; font-weight: 700; margin: 36px 0 12px;
    display: flex; align-items: baseline; gap: 10px;
}
.prose h2 .no { font-family: var(--font-display); color: var(--accent); font-size: 14px; }
.prose p { color: var(--muted); margin-bottom: 12px; line-height: 1.95; }
.prose ol { color: var(--muted); padding-left: 0; list-style: none; margin-bottom: 12px; }
.prose ol li { padding-left: 2.2em; text-indent: -2.2em; margin-bottom: 4px; line-height: 1.9; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------------------------------------------------------------- 描画パフォーマンス */
.card, .hero, .guild-card, .stat-card { contain: layout style; }
.queue-list, .song-list, .search-results { contain: content; }
.queue-item, .song-row { contain: layout style; }
.queue-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------------------------------------------------------- プレイリスト追加の確認 */
.modal-box.pl-confirm { width: min(720px, 100%); display: flex; flex-direction: column; max-height: 88vh; overflow: hidden; padding: 0; }
.plc-head { display: flex; gap: 16px; align-items: center; padding: 22px 24px 14px; }
.plc-icon {
    width: 56px; height: 56px; border-radius: 16px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 24px;
    background: var(--accent-soft); color: var(--accent);
}
.plc-meta { min-width: 0; flex: 1; }
.plc-meta .eyebrow { margin-bottom: 2px; }
.plc-title { font-family: var(--font-display); font-size: 20px; font-weight: 700; letter-spacing: -0.02em;
             white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plc-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.plc-toolbar { display: flex; align-items: center; gap: 8px; padding: 0 24px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.plc-toolbar .spacer { flex: 1; }
.plc-count { font-size: 12px; font-weight: 700; color: var(--accent); }
.plc-list { overflow-y: auto; padding: 8px 16px; flex: 1; min-height: 120px; contain: content; }
.plc-row {
    display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 12px; cursor: pointer;
    transition: background .15s;
}
.plc-row:hover { background: var(--surface-2); }
.plc-row.disabled { opacity: .45; cursor: not-allowed; }
.plc-row .s-thumb { width: 64px; height: 36px; border-radius: 8px; flex-shrink: 0; background: var(--surface-3); }
.plc-row .s-thumb img { width: 100%; height: 100%; object-fit: cover; }
.plc-idx { width: 26px; text-align: right; font-size: 11px; color: var(--subtle); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.plc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.plc-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plc-ch { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plc-dur { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
/* 丸いチェック（複数選択） */
.plc-check {
    -webkit-appearance: none; appearance: none; flex-shrink: 0; margin: 0;
    width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong);
    display: inline-grid; place-content: center; cursor: pointer; transition: all .15s; background: transparent;
}
.plc-check::before {
    content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-ink);
    transform: scale(0); transition: transform .12s var(--ease);
}
.plc-check:checked { background: var(--accent); border-color: var(--accent); }
.plc-check:checked::before { transform: scale(1); }
.plc-check:disabled { cursor: not-allowed; }
.plc-row:not(.disabled):has(.plc-check:not(:checked)) .plc-name { color: var(--muted); }
.pl-confirm .modal-foot { margin: 0; padding: 14px 24px 18px; border-top: 1px solid var(--border); }
.plc-note { font-size: 11px; color: var(--subtle); }
@media (max-width: 640px) {
    .plc-head { padding: 18px 16px 12px; }
    .plc-toolbar { padding: 0 16px 10px; }
    .plc-list { padding: 6px 8px; }
    .pl-confirm .modal-foot { padding: 12px 16px 16px; }
    .plc-row .s-thumb { display: none; }
    .plc-note { width: 100%; }
}

/* YouTube の制限中の案内 */
.yt-block {
    display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px;
    padding: 14px 16px; border-radius: var(--radius); font-size: 13px; line-height: 1.7;
    background: rgba(255, 184, 77, .08); border: 1px solid rgba(255, 184, 77, .35); color: #ffd79a;
}
.yt-block[hidden] { display: none; }
.yt-block i { font-size: 18px; margin-top: 1px; }
.yt-block b { color: #ffe2b3; }

/* マイページの行内ボタン: 同じ大きさ・同じ間隔にそろえる（ハートだけ枠が無く右に寄って見えていた） */
.item-row .btn-sm:not(.btn), .item-row .btn-icon-only {
    width: 34px; height: 34px; padding: 0; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 9px;
}
.item-row .btn-icon-only.heart-active { border-color: rgba(255, 77, 125, .35); background: rgba(255, 77, 125, .08); }

/* リスナー一覧: Web のログイン状態 */
.participant .p-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.participant .p-tags { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; }
.participant .me-badge { margin-left: 0; }
.web-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
    color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap;
}
.web-badge .ws-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--subtle); }
.web-badge.online { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.web-badge.online .ws-dot { background: var(--accent); animation: wsPulse 1.8s ease-in-out infinite; }
@keyframes wsPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(76, 201, 240, .6); } 50% { box-shadow: 0 0 0 4px rgba(76, 201, 240, 0); } }

/* =============================================================================
   統計・共有プレイリスト・音質設定
   ============================================================================= */
.filter-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.stat-delta { font-size: 12px; color: var(--muted); margin-top: 6px; min-height: 16px; }
.stat-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-grid-4 .stat-card { padding: 18px; }
.stat-grid-4 .stat-card .val { font-size: 28px; }
.stats-card { margin-bottom: 14px; }
.stats-two { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 14px; }
.stats-side { min-width: 0; }
.history-search { width: min(240px, 100%); }
.rank-item.has-action { grid-template-columns: 30px 1fr auto auto; }

/* 棒グラフ（1系列）: 棒は最大 24px・上端のみ角丸・隣との間に 2px の隙間 */
.chart-plot { display: flex; gap: 10px; height: 180px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--subtle); text-align: right; min-width: 22px; font-variant-numeric: tabular-nums; }
.chart-area { position: relative; flex: 1; min-width: 0; padding-top: 20px; border-bottom: 1px solid var(--border);
    background: linear-gradient(var(--border), var(--border)) 0 calc(50% + 10px) / 100% 1px no-repeat; }
.chart-bars { display: flex; align-items: stretch; gap: 2px; height: 100%; }
.chart-col { position: relative; flex: 1 1 0; min-width: 0; display: flex; align-items: flex-end; justify-content: center; }
.chart-col i { display: block; width: 100%; max-width: 24px; background: var(--accent); border-radius: 4px 4px 0 0; transition: filter .12s; }
.chart-col:hover i { filter: brightness(1.25); }
.chart-col em { position: absolute; left: 50%; transform: translateX(-50%); font-size: 11px; font-style: normal; font-weight: 700; color: var(--text); pointer-events: none; }
.chart-x { display: flex; justify-content: space-between; margin: 6px 0 0 32px; font-size: 11px; color: var(--subtle); }
.chart-tip { position: fixed; left: 0; top: 0; z-index: 90; padding: 6px 10px; border-radius: 8px; font-size: 12px; pointer-events: none;
    background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text); white-space: nowrap; }
.chart-table { margin-top: 12px; font-size: 12px; color: var(--muted); }
.chart-table summary { cursor: pointer; }
.chart-table table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.chart-table th, .chart-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); font-variant-numeric: tabular-nums; }
.chart-table th { color: var(--subtle); font-weight: 700; }

/* 履歴・共有プレイリストの曲の行 */
.track-row { display: flex; align-items: center; gap: 12px; padding: 8px 4px; }
.track-row + .track-row { border-top: 1px solid rgba(255, 255, 255, .04); }
.track-row .s-thumb { width: 56px; height: 32px; border-radius: 6px; flex: none; }
.track-row .s-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.track-no { width: 22px; text-align: right; flex: none; font-size: 12px; color: var(--subtle); font-variant-numeric: tabular-nums; }
.track-body { flex: 1; min-width: 0; }
.track-name { display: block; font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
a.track-name:hover { color: var(--accent); }
.track-artist-sm { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-dur { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.pager:empty { display: none; }
.pager .btn[hidden] { display: none; }

/* プレイリストの公開・共有 */
.pl-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin-top: 10px; }
.pl-meta i { margin-right: 5px; }
.pl-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.share-panel { padding: 14px; margin-bottom: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elev); }
.share-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.share-note { flex: 1; min-width: 200px; font-size: 11px; color: var(--subtle); }
.share-link { display: flex; gap: 6px; margin-top: 10px; align-items: center; }
.share-link .inline-input { flex: 1; min-width: 0; }
.vis-badge { font-size: 11px; font-weight: 700; color: var(--accent); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--accent-line); background: var(--accent-soft); white-space: nowrap; }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.pl-card { display: block; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); color: inherit; text-decoration: none; transition: border-color .15s; min-width: 0; }
.pl-card:hover { border-color: var(--accent-line); }
.pl-card-name { font-family: var(--font-display); font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-card-desc { font-size: 12px; color: var(--muted); margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pl-card-meta { font-size: 12px; color: var(--muted); margin-top: 10px; }
.pl-card-owner { font-size: 12px; color: var(--subtle); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-card-owner i { margin-right: 5px; }

/* ダッシュボード */
.guild-now { font-size: 12px; color: var(--muted); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guild-now i { color: var(--accent); margin-right: 5px; }
.guild-now span { color: var(--subtle); }

/* プレーヤー: 音質の表示・キューの合計時間 */
.audio-tags { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.audio-tags:empty { display: none; }
.audio-tag { font-size: 11px; color: var(--muted); padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border); background: rgba(0, 0, 0, .18); white-space: nowrap; }
.audio-tag.on { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.queue-total { font-size: 11px; color: var(--subtle); }

/* サーバー設定 */
.set-section { font-size: 11px; font-weight: 800; letter-spacing: .12em; color: var(--subtle); margin: 18px 0 8px; }
.set-section:first-of-type { margin-top: 0; }
.field label b { color: var(--text); margin-left: 4px; }
.field input[type="range"] { width: 100%; padding: 0; accent-color: var(--accent); }
.set-advanced { margin: 10px 0 4px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--bg-elev); }
.set-advanced summary { cursor: pointer; font-size: 13px; font-weight: 600; }
.set-advanced[open] summary { margin-bottom: 12px; }
.eq-band { display: grid; grid-template-columns: 52px 1fr 48px; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); padding: 3px 0; }
.eq-band input { accent-color: var(--accent); width: 100%; }
.eq-band b { text-align: right; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
    .stat-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats-two { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .chart-plot { height: 150px; }
    .history-search { width: 100%; }
}
