:root {
  color-scheme: dark;
  --bg: #111210;
  --panel: #1a1c18;
  --raised: #22251f;
  --ink: #f0f0e8;
  --muted: #a1a69b;
  --line: #30352b;
  --accent: #e9bd59;
  --danger: #eea095;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body { margin: 0; background: radial-gradient(ellipse at 90% 0, #23251b 0, transparent 45%), var(--bg); color: var(--ink); font-family: "IBM Plex Sans", sans-serif; font-size: 15px; line-height: 1.5; min-height: 100vh; }
button, input { font: inherit; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; }
button, summary { cursor: pointer; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, .brand { font-family: "Space Grotesk", sans-serif; }
h1 { font-size: clamp(2rem, 4vw, 2.75rem); line-height: 1.15; letter-spacing: -.045em; font-weight: 500; margin: 5px 0 10px; overflow-wrap: anywhere; }
h2 { font-size: 1.05rem; font-weight: 500; letter-spacing: -.02em; margin: 0; }
h3 { font-size: .92rem; font-weight: 500; margin: 0 0 4px; }
p { margin: 0; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }
.mono { font-family: ui-monospace, monospace; overflow-wrap: anywhere; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 20; background: var(--accent); color: var(--bg); padding: 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.site-header { height: 82px; padding: 0 max(24px, calc((100vw - 1160px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #111210e8; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; backdrop-filter: blur(12px); }
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; font-size: 1.2rem; letter-spacing: -.035em; }
.brand-mark { background: var(--accent); width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; gap: 3px; border-radius: 11px; }
.brand-mark i { display: block; width: 3px; border-radius: 3px; background: #171914; height: 12px; }
.brand-mark i:nth-child(2) { height: 23px; }
.brand-mark i:nth-child(3) { height: 17px; }
.brand-mark i:nth-child(4) { height: 8px; }
.header-actions, .heading-actions, .heading-label { display: flex; align-items: center; gap: 10px; }
.connection { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: #8fbb7d; }
.connection.offline .status-dot { background: var(--danger); }
.container { max-width: 1208px; padding: 36px 24px 16px; margin: auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.eyebrow { color: var(--muted); font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; }
.panel { background: linear-gradient(150deg, #1c1f19, var(--panel) 65%); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; min-width: 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.count { font-size: .72rem; color: var(--muted); min-width: 23px; height: 23px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px; display: inline-grid; place-items: center; }
.button, .icon-button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: #262920; border: 1px solid #3d4235; border-radius: 9px; padding: 9px 15px; color: var(--ink); font-size: .84rem; font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s; }
.button:hover, .icon-button:hover { background: #33392b; border-color: #636e55; }
.button.primary { background: var(--accent); border-color: var(--accent); color: #262113; }
.button.primary:hover { background: #f5cd76; }
.button.danger { color: var(--danger); background: #eea0950d; border-color: #eea09538; }
.text-button { background: transparent; border-color: transparent; color: var(--muted); }
.icon-button { width: 40px; min-width: 40px; padding: 8px; background: transparent; border-color: transparent; font-size: 1.4rem; }
.small-button { min-height: 38px; padding: 7px 12px; font-size: .78rem; }
button:disabled { opacity: .45; cursor: default; }
.full-width { width: 100%; }
.lobby-panel { max-width: 760px; }
.party-list { display: grid; gap: 12px; }
.party-card { display: flex; align-items: center; gap: 16px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: #11140f55; }
.party-card .party-info { flex: 1; min-width: 0; }
.party-name { font-size: 1.05rem; font-weight: 500; overflow-wrap: anywhere; }
.party-meta { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.party-symbol { width: 44px; height: 44px; border: 1px solid #e9bd5940; border-radius: 12px; display: grid; place-items: center; color: var(--accent); background: #e9bd590b; flex: none; }
.lobby-note { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 16px; }
.lobby-footnote { margin-top: 16px; max-width: 760px; }
.empty { padding: 28px 12px; text-align: center; color: var(--muted); font-size: .85rem; }
.empty strong { display: block; font-size: .95rem; color: var(--ink); font-weight: 500; margin-bottom: 5px; }
.party-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 22px; align-items: start; }
.queue-column, .sidebar { display: grid; gap: 22px; min-width: 0; }
.playing-panel { border-top: 2px solid #e9bd5980; }
.playback-label { color: var(--accent); font-size: .74rem; text-align: right; }
.now-track { display: flex; align-items: center; gap: 18px; min-width: 0; }
.art { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 8px; overflow: hidden; background: #32382a; color: #a4b391; flex: none; }
.art img { width: 100%; height: 100%; object-fit: cover; }
.now-track .art { width: 88px; height: 88px; border-radius: 12px; }
.now-track .art svg { width: 30px; height: 30px; }
.now-track .track-title { font-family: "Space Grotesk", sans-serif; font-size: 1.35rem; line-height: 1.2; font-weight: 500; margin-bottom: 5px; white-space: normal; }
.track-body { min-width: 0; flex: 1; }
.track-title, .track-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.track-title { font-size: .88rem; font-weight: 500; }
.track-meta { color: var(--muted); font-size: .77rem; margin-top: 3px; }
.track-sub { display: flex; align-items: center; gap: 6px; color: #7f8974; font-size: .68rem; margin-top: 6px; min-width: 0; }
.track-sub > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-pill { display: inline-flex; align-items: center; padding: 1px 5px; border: 1px solid #ffffff17; border-radius: 4px; color: #b1b9a7; font-size: .59rem; line-height: 1.4; flex: none; }
.recommended-track .source-pill { color: #d3bc87; border-color: #e9bd592a; }
.progress { height: 3px; background: #343a2e; border-radius: 3px; overflow: hidden; margin-top: 16px; }
.progress-bar { height: 100%; background: var(--accent); transition: width .5s linear; }
.progress-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .68rem; margin-top: 6px; font-variant-numeric: tabular-nums; }
.playing-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 18px; margin-top: 20px; border-top: 1px solid var(--line); }
.playing-footer .small { font-size: .72rem; }
.track-list { display: grid; gap: 0; }
.track-card { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid #30352b; }
.track-card:first-child { padding-top: 0; }
.track-card:last-child { border-bottom: 0; padding-bottom: 0; }
.track-actions { display: grid; justify-items: end; gap: 4px; flex: none; }
.vote-buttons { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 8px; }
.vote-buttons button { background: transparent; color: var(--muted); border: 0; min-width: 32px; min-height: 38px; padding: 5px; display: grid; place-items: center; border-radius: 6px; }
.vote-buttons button:hover, .vote-buttons button.selected { color: var(--accent); background: #e9bd5915; }
.vote-buttons button svg { width: 15px; height: 15px; }
.score { font-size: .78rem; min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; }
.queue-delete { min-height: 26px; padding: 2px 4px; font-size: .64rem; border: 0; background: transparent; color: #89947d; }
.queue-delete:hover { color: var(--danger); }
.scroll-list { max-height: 480px; overflow-y: auto; padding-right: 6px; scrollbar-gutter: stable; }
.search-row { display: flex; align-items: center; gap: 8px; }
.search-row input { min-width: 0; flex: 1; }
.search-row .button { padding: 9px 12px; }
input { display: block; width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #3b4134; border-radius: 8px; background: #11150e; color: var(--ink); font-size: .87rem; }
input::placeholder { color: #7f8975; }
input:focus { outline: 2px solid #e9bd5960; outline-offset: 1px; border-color: var(--accent); }
label { display: block; font-size: .8rem; margin-bottom: 7px; }
.search-results { max-height: 330px; overflow-y: auto; margin-top: 18px; padding-right: 4px; }
.search-results:empty { margin: 0; }
.search-results .track-card { gap: 10px; }
.search-results .art { width: 38px; height: 38px; }
.search-results .button { min-height: 34px; padding: 5px 10px; font-size: .72rem; }
.duration { font-size: .68rem; color: var(--muted); }
.member-list { display: grid; gap: 16px; max-height: 280px; overflow-y: auto; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: #768563 #1a1c18; }
.people-hint { margin-top: 14px; font-size: .73rem; }
.full-member-list { max-height: 60dvh; }
.member-card { display: flex; align-items: center; gap: 10px; min-width: 0; }
.member-card .member-name { font-size: .83rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.member-role { font-size: .66rem; color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: #37422f; color: #d4dfc9; display: grid; place-items: center; font-size: .68rem; flex: none; }
.avatar.tone-1 { background: #4c402b; color: #e6ceaa; }
.avatar.tone-2 { background: #343f48; color: #becfdc; }
.avatar.tone-3 { background: #463831; color: #dfc4b4; }
.history-panel summary { display: flex; align-items: center; justify-content: space-between; font-family: "Space Grotesk", sans-serif; font-size: .9rem; }
.history-panel summary::after { content: "+"; color: var(--muted); }
.history-panel[open] summary::after { content: "-"; }
.history-panel summary #historyCount { margin-left: auto; margin-right: 12px; }
.history-list { margin-top: 20px; max-height: 270px; overflow-y: auto; }
.history-list .art { width: 36px; height: 36px; }
.history-list .track-sub { display: none; }
.site-footer { padding: 38px 0 12px; display: flex; gap: 12px; color: #737d68; font-size: .7rem; }
.site-footer a:hover { color: var(--ink); }
dialog { background: #1c1f19; color: var(--ink); border: 1px solid #404737; border-radius: 18px; padding: 26px; width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); overflow-y: auto; box-shadow: 0 24px 100px #0009; }
dialog::backdrop { background: #000a; backdrop-filter: blur(5px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.dialog-heading h2 { font-size: 1.3rem; }
.dialog-description { font-size: .85rem; }
.form-stack { display: grid; gap: 18px; margin-top: 24px; }
.field .small { margin-top: 7px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.form-error { color: var(--danger); font-size: .8rem; }
.advanced { font-size: .78rem; color: var(--muted); }
.advanced > .field, .advanced > p { margin-top: 12px; }
.qr-wrap { text-align: center; margin: 28px 0; }
.qr-wrap img { background: white; padding: 12px; border-radius: 12px; max-width: 100%; height: auto; }
.invite-link { margin-bottom: 12px; font-size: .75rem; }
.management-section { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 22px; }
.input-row { display: flex; gap: 8px; }
.input-row input { min-width: 0; flex: 1; }
.management-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.management-row p { max-width: 230px; }
#manageMembers { margin-top: 16px; }
.end-section { display: flex; align-items: center; gap: 16px; justify-content: space-between; }
.toast { position: fixed; z-index: 20; bottom: 26px; left: 50%; transform: translateX(-50%); background: #eef0e6; color: #1b2116; border-radius: 10px; padding: 12px 20px; max-width: calc(100vw - 32px); box-shadow: 0 10px 40px #0005; font-size: .85rem; width: max-content; }
.toast.error { background: #e7b6ab; color: #3b1c13; }
.panel, .page-heading { animation: appear .3s ease both; }
.sidebar .panel:nth-child(2) { animation-delay: .06s; }
.sidebar .panel:nth-child(3) { animation-delay: .12s; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 741px) { .mobile-nav { display: none !important; } }
@media (max-width: 900px) { .party-layout { grid-template-columns: minmax(0, 1.25fr) minmax(290px, 1fr); gap: 16px; } .panel { padding: 18px; } .queue-column, .sidebar { gap: 16px; } }
@media (max-width: 740px) {
  .site-header { height: auto; min-height: 66px; padding: 10px 18px; gap: 4px; display: grid; }
  .brand { gap: 9px; font-size: 1.08rem; }
  .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
  .brand-mark i:nth-child(2) { height: 19px; }
  .header-actions { gap: 2px; justify-content: space-between; }
  .connection { font-size: .7rem; margin-right: 8px; }
  .header-actions .text-button { max-width: 100px; overflow: hidden; text-overflow: ellipsis; display: block; padding-inline: 8px; }
  .container { padding: 26px 16px 22px; }
  .page-heading { gap: 16px; margin-bottom: 24px; }
  .page-heading > .button { padding-inline: 12px; }
  .party-heading { flex-direction: column; align-items: stretch; }
  .heading-actions { gap: 8px; }
  .heading-actions .button { flex: 1; }
  .party-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .panel { padding: 18px; }
  .section-heading { margin-bottom: 18px; }
  .now-track .art { width: 66px; height: 66px; }
  .now-track .track-title { font-size: 1.18rem; }
  .now-track { gap: 14px; }
  .playing-footer { gap: 10px; margin-top: 18px; padding-top: 14px; }
  .playing-footer .small { max-width: 160px; }
  .scroll-list { max-height: 350px; }
  .search-results { max-height: 310px; }
  .track-card { gap: 10px; }
  .track-title { font-size: .84rem; }
  .vote-buttons button { min-width: 30px; min-height: 40px; }
  .score { min-width: 18px; }
  .art { width: 42px; height: 42px; }
  .party-card { padding: 14px; gap: 12px; }
  .party-symbol { width: 36px; height: 36px; }
  .party-open .container { padding-bottom: 90px; }
  .mobile-nav { position: fixed; z-index: 6; left: 0; bottom: 0; right: 0; display: flex; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #171b13f5; backdrop-filter: blur(12px); gap: 12px; }
  .mobile-nav a { min-height: 42px; flex: 1; display: grid; place-items: center; font-size: .84rem; border-radius: 8px; }
  .mobile-nav a:last-child { background: var(--accent); color: #262113; }
  .party-open .toast { bottom: 82px; }
  dialog { padding: 22px; }
  .management-row, .end-section { align-items: flex-start; }
}
@media (max-width: 360px) { .connection #statusText { display: none; } .brand { font-size: 1rem; } .panel { padding: 14px; } .vote-buttons button { min-width: 26px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
