:root {
  --bg: #101114; --panel: #181A1F; --line: #2A2D35; --line2: #4A4F5C; --off: #343842;
  --text: #F2F3F5; --soft: #DADDE3; --muted: #A3A8B3; --accent: #C8F250; --danger: #FF8A80;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 var(--body); }
a { color: var(--text); }
h1 { margin: 0; font: 700 40px/1.1 var(--display); letter-spacing: -0.02em; }
h2 { margin: 0 0 16px; font: 700 22px/1.2 var(--display); }
p { margin: 0; }
svg { width: 16px; height: 16px; flex: none; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }
.pad { padding: 32px; }
.err { color: var(--danger); min-height: 0; }
.err:empty { display: none; }
.empty { padding: 48px 0; color: var(--muted); text-align: center; }

input, select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; font: inherit;
}
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--accent); }
textarea { resize: vertical; }
select:disabled { opacity: .5; }
label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 8px; border: 0; font: 600 15px var(--body); cursor: pointer; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); color: #101114; }
.btn.outline { background: transparent; color: var(--text); border: 1px solid var(--line2); }
.btn.ghost { background: transparent; color: var(--text); }
.btn.text { background: transparent; color: var(--muted); padding: 0 10px; font-weight: 500; }
.btn.text.small { min-height: 32px; font-size: 13px; }
.btn.danger { background: var(--danger); color: #101114; }
.danger-text { color: var(--danger) !important; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 28px; }
.badge { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line2); color: #C9CDD6; }
.chip { font-family: var(--mono); font-size: 13px; padding: 3px 8px; border-radius: 6px; background: var(--line); color: var(--text); border: 0; }
button.chip { cursor: pointer; border: 1px solid var(--line2); background: transparent; }

/* login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.brand { display: flex; align-items: baseline; gap: 12px; text-decoration: none; }
.brand-name { font: 700 22px var(--display); letter-spacing: -0.01em; }

/* shell */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 32px; border-bottom: 1px solid var(--line); }
.top-right { display: flex; align-items: center; gap: 12px; }
.navlink { color: var(--muted); text-decoration: none; padding: 12px 8px; }
.who { font-weight: 500; }
.page { max-width: 1240px; margin: 0 auto; padding: 32px 32px 64px; display: flex; flex-direction: column; gap: 20px; }
.page.narrow { max-width: 720px; }
.back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; align-self: flex-start; color: var(--muted); text-decoration: none; font-size: 14px; }

/* dashboard */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.head-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; }
label.inline { flex-direction: row; align-items: center; gap: 10px; font-size: 14px; font-weight: 400; white-space: nowrap; }
label.inline select { width: auto; background: var(--panel); }
.hint { flex-basis: 100%; display: flex; align-items: center; justify-content: flex-end; gap: 6px; color: var(--muted); font-size: 13px; }
.hint svg, .hidden-note svg, .rate-link svg { width: 14px; height: 14px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line2); background: transparent; color: var(--text); font: 600 15px var(--body); cursor: pointer; display: flex; align-items: center; gap: 8px; }
.pill .mono { font-weight: 400; }
.pill.on { background: var(--accent); border-color: var(--accent); color: #101114; }
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.table { min-width: 980px; }
.tr { display: grid; grid-template-columns: minmax(220px, 2.2fr) 150px 190px 150px 110px 150px; align-items: center; gap: 16px; padding: 14px 20px; border-bottom: 1px solid #23262D; }
.tr:last-child { border-bottom: 0; }
.tr.th { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.cell-title, .cell-stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cell-title a { font-weight: 600; font-size: 16px; text-decoration: none; padding: 4px 0; }
.cell-title a:hover { text-decoration: underline; }
.cell-status { display: flex; flex-direction: column; gap: 6px; }
.stage { display: flex; gap: 3px; }
.stage i { width: 22px; height: 4px; border-radius: 2px; background: var(--off); }
.stage i.on { background: var(--accent); }
.score { display: flex; align-items: baseline; gap: 8px; }
.score b { font: 700 24px var(--display); }
.ccount { display: flex; align-items: center; gap: 8px; color: #C9CDD6; }
.rate-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }
.hidden-note { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }

/* song page */
.info-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; }
.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 10px; }
.status-line .stage i { width: 28px; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.details { margin: 24px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px 24px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
dt, .label { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
dd { margin: 4px 0 0; font-weight: 500; }
.player { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; }
.pp { width: 72px; height: 72px; flex: none; border-radius: 50%; border: 0; background: var(--accent); color: #101114; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pp svg { width: 28px; height: 28px; }
.wave-wrap { flex: 999 1 420px; min-width: 0; max-width: 100%; display: flex; flex-direction: column; gap: 8px; }
.markers { position: relative; height: 24px; }
.marker { position: absolute; top: 0; transform: translateX(-50%); width: 24px; height: 24px; padding: 0; border-radius: 50%; border: 0; background: var(--text); color: #101114; font: 600 10px var(--body); cursor: pointer; }
.wave { display: flex; align-items: center; gap: 2px; height: 88px; cursor: pointer; }
.wave i { flex: 1 1 0; min-width: 1px; border-radius: 2px; background: var(--line2); }
.wave i.on { background: var(--accent); }
.wave.flat { height: 12px; margin: 38px 0; background: var(--off); border-radius: 6px; overflow: hidden; }
.wave.flat span { display: block; height: 100%; width: 0; background: var(--accent); }
.times { display: flex; justify-content: space-between; color: var(--muted); }
.times #cur { color: var(--text); }
.versel { flex: 1 1 220px; }
.cols { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; }
.grow { flex: 999 1 560px; min-width: 0; }
.side { flex: 1 1 360px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.locked { display: flex; align-items: flex-start; gap: 14px; padding: 20px; border: 1px dashed var(--line2); border-radius: 12px; }
.locked svg { width: 22px; height: 22px; margin-top: 2px; }
.composer { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.composer > label { color: var(--text); font-size: 15px; font-weight: 500; }
.composer-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.check { flex-direction: row; align-items: center; gap: 10px; min-height: 44px; color: var(--text); font-size: 15px; font-weight: 400; cursor: pointer; }
.comment { display: flex; gap: 14px; padding: 18px 0; border-top: 1px solid var(--line); }
.avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--line); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; }
.cbody { display: flex; flex-direction: column; gap: 6px; min-width: 0; flex: 1; }
.cbody p { color: var(--soft); white-space: pre-wrap; overflow-wrap: anywhere; }
.cmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cmeta .btn { margin-left: auto; }
.stars { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); }
.star { height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.star svg { width: 26px; height: 26px; fill: none; stroke: #7A8090; }
.star.on svg { fill: var(--accent); stroke: var(--accent); }
.mynote { display: flex; align-items: baseline; gap: 8px; margin-top: 12px; }
.mynote b { font: 700 40px/1 var(--display); }
.mynote b.mid { font-size: 28px; }
.team { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.team .mynote { margin-top: 6px; }
.votes, .vlist, .ulist { list-style: none; margin: 12px 0 0; padding: 0; }
.votes li, .vlist li, .ulist li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.vlist li > div, .ulist li > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.ulist { margin: 0; } .ulist li:first-child { border-top: 0; }
.uactions { display: flex; flex-wrap: wrap; gap: 4px; }
.upform, .uform { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }

/* dialog */
.dlg { width: min(480px, calc(100vw - 32px)); background: var(--panel); color: var(--text); border: 1px solid var(--line2); border-radius: 16px; padding: 28px; }
.dlg::backdrop { background: rgba(0, 0, 0, .6); }
.dlg form { display: flex; flex-direction: column; gap: 14px; }
.dlg h2 { margin: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }

@media (max-width: 600px) {
  h1 { font-size: 30px; }
  .top, .page { padding-left: 16px; padding-right: 16px; }
  .card { padding: 20px; }
  .hint { justify-content: flex-start; }
  .wave { gap: 1px; }
  .wave i:nth-child(2n) { display: none; }
}
