/* Easy Voting — static, dependency-free stylesheet. */

:root {
  --bg: #080814;
  --panel: rgba(20, 20, 42, 0.9);
  --panel-solid: #14142a;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.2);
  --text: #f4f1ff;
  --muted: #aaa4c9;
  --muted-2: #837ca8;
  --pink: #f472b6;
  --purple: #a78bfa;
  --cyan: #22d3ee;
  --gold: #fbbf24;
  --danger: #fb7185;
  --focus: #fbbf24;
  --radius: 18px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  background:
    radial-gradient(1100px 620px at 8% -12%, rgba(124, 58, 237, 0.32), transparent 62%),
    radial-gradient(950px 520px at 102% -2%, rgba(236, 72, 153, 0.2), transparent 58%),
    radial-gradient(900px 540px at 50% 112%, rgba(34, 211, 238, 0.1), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  color: #f9a8d4;
}

a {
  color: var(--cyan);
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.wrap {
  width: min(1240px, calc(100% - 40px));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  top: -80px;
  left: 12px;
  z-index: 300;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--gold);
  color: #1a1200;
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

/* ---------------------------------------------------------------- Header */

.site-header {
  padding: 42px 0 24px;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

/* The brand doubles as the home link: it keeps the plain header look (no link
   colour, no underline) and takes the app's usual focus ring. */
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  color: inherit;
  text-decoration: none;
  border-radius: 18px;
}

.brand:hover h1,
.brand:focus-visible h1 {
  color: var(--cyan);
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--pink), var(--purple) 55%, var(--cyan));
  box-shadow: 0 12px 34px rgba(167, 139, 250, 0.38);
  color: #120b24;
  font-size: 27px;
}

h1 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.tagline {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* --------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease;
}

.btn:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.09);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  border-color: transparent;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  color: #fff;
  box-shadow: 0 8px 24px rgba(236, 72, 153, 0.3);
}

.btn-primary:hover {
  border-color: transparent;
  background: linear-gradient(135deg, #f472b6, #a78bfa);
}

.btn-ghost {
  background: transparent;
}

.btn-danger {
  border-color: rgba(251, 113, 133, 0.35);
  color: #fecdd3;
}

.btn-danger:hover {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.6);
}

.btn-small {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 0.84rem;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

/* --------------------------------------------------------------- Banners */

.banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 20px;
  padding: 13px 16px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.banner p {
  margin: 0;
}

.banner-warning {
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.1);
  color: #fde68a;
}

.banner-close {
  flex: 0 0 auto;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.75;
}

.banner-close:hover {
  opacity: 1;
}

/* ---------------------------------------------------------------- Panels */

.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(23, 23, 48, 0.92), rgba(14, 14, 32, 0.94));
  box-shadow: var(--shadow);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 14px;
}

h2 {
  margin: 0;
  font-size: 1.16rem;
  letter-spacing: -0.01em;
}

.panel-sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.muted {
  color: var(--muted);
}

.points-note {
  flex: 0 0 auto;
  margin: 2px 0 0;
  color: var(--muted-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ----------------------------------------------------------- Empty state */

.empty-state {
  margin-bottom: 24px;
  padding: 52px 24px;
  text-align: center;
}

.empty-illustration {
  font-size: 3rem;
  line-height: 1;
  background: linear-gradient(135deg, var(--pink), var(--purple) 55%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* The main page's account panel: log in with username + PIN so the voting
   dialog can reuse that account. */
.account-panel {
  margin-bottom: 24px;
  padding: 20px 22px 22px;
}

.account-panel h2 {
  margin: 0;
}

.account-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-top: 14px;
}

.account-form label {
  display: block;
  font-size: 0.85rem;
}

.account-form label span {
  display: block;
  margin-bottom: 6px;
}

.account-form input {
  display: block;
  min-width: 12rem;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #0a0a18;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}

.account-status {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: #fecdd3;
}

.account-status.ok {
  color: #bbf7d0;
}

.account-session {
  margin-top: 14px;
}

.account-greeting {
  margin: 0 0 10px;
  font-weight: 600;
}

.account-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.account-links a {
  color: var(--text);
}

/* The home page's public voting lists: open ones and closed ones, which share
   the panel and row styles. */
.voting-list-panel {
  margin-bottom: 24px;
  padding: 20px 22px 22px;
}

.voting-list-panel h2 {
  margin: 0;
}

.voting-list {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.voting-list-item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(10, 10, 24, 0.55);
}

.voting-list-link {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.voting-list-link:hover,
.voting-list-link:focus-visible {
  text-decoration: underline;
}

.voting-list-deadline {
  color: var(--muted);
  font-size: 0.82rem;
  margin-left: auto;
}

/* "Wyniki" of a closed voting: its stats panel, public after the deadline. */
.voting-list-results {
  color: var(--accent, #a78bfa);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
}

.voting-list-results:hover,
.voting-list-results:focus-visible {
  text-decoration: underline;
}

.voting-list-empty {
  margin: 14px 0 0;
  color: var(--muted);
  font-style: italic;
}

.empty-state h2 {
  margin: 14px 0 6px;
  font-size: 1.55rem;
}

.empty-state p {
  max-width: 540px;
  margin: 0 auto 20px;
  color: var(--muted);
}

.empty-state .btn + .btn {
  margin-left: 8px;
}

/* --------------------------------------------------------------- Voting */

.voting-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.9fr);
  gap: 24px;
  align-items: start;
  padding-bottom: 24px;
}

.voting-layout > * {
  min-width: 0;
}

.ranking-panel {
  min-width: 0;
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0 22px 22px;
  list-style: none;
}

.rank-row {
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr) 4.5rem;
  gap: 14px;
  align-items: center;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    opacity 0.15s ease;
}

.rank-row:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.055);
}

.rank-row.is-dragging {
  opacity: 0.4;
}

.rank-row.is-drop-target {
  border-color: var(--gold);
  background: rgba(251, 191, 36, 0.07);
  box-shadow: inset 0 0 0 2px rgba(251, 191, 36, 0.3);
}

.rank-pos {
  color: var(--purple);
  font-size: 1.7rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-align: center;
}

@supports (background-clip: text) or (-webkit-background-clip: text) {
  .rank-pos {
    background: linear-gradient(135deg, var(--pink), var(--purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
}

.rank-body {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.rank-points {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.1);
  color: var(--gold);
}

.rank-points strong {
  font-size: 1.28rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.rank-points span {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  opacity: 0.8;
}

.rank-points.is-zero {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

/* Songs ------------------------------------------------------------- */

.drag-handle {
  flex: 0 0 auto;
  padding: 8px 3px;
  color: var(--muted-2);
  font-size: 1.15rem;
  letter-spacing: -0.18em;
  line-height: 1;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.drag-handle:hover {
  color: var(--text);
}

.drag-handle:active {
  cursor: grabbing;
}

.thumb {
  flex: 0 0 auto;
  width: 96px;
  height: 54px;
  border-radius: 8px;
  background: #1b1b38;
  object-fit: cover;
}

.song-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.song-text {
  min-width: 0;
}

.song-artist,
.song-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-artist {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.song-title {
  font-size: 1rem;
  font-weight: 650;
}

.song-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.rank-row .song-actions {
  gap: 4px;
}

.rank-row .song-actions .btn {
  padding-inline: 9px;
}

.rank-row .song-actions .yt-link {
  padding-inline: 8px;
}

.yt-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  border: 1px solid rgba(34, 211, 238, 0.25);
  border-radius: 999px;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
}

.yt-link:hover {
  background: rgba(34, 211, 238, 0.1);
}

/* Empty / drop targets ---------------------------------------------- */

.ranking-empty {
  padding: 34px 20px;
  border: 2px dashed rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.ranking-empty.is-drop-target {
  border-color: var(--gold);
  background: rgba(251, 191, 36, 0.06);
}

.empty-drop-icon {
  display: block;
  margin-bottom: 6px;
  color: var(--purple);
  font-size: 1.6rem;
  line-height: 1;
}

.ranking-empty p {
  margin: 0;
  font-size: 0.9rem;
}

.rank-drop-end {
  padding: 12px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: var(--muted-2);
  font-size: 0.82rem;
  text-align: center;
}

.rank-drop-end.is-drop-target {
  border-color: var(--gold);
  background: rgba(251, 191, 36, 0.06);
  color: #fde68a;
}

/* Sandbox ----------------------------------------------------------- */

.sandbox-panel {
  position: sticky;
  top: 20px;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.sandbox-panel.is-drop-target {
  border-color: var(--gold);
  box-shadow:
    0 0 0 3px rgba(251, 191, 36, 0.22),
    var(--shadow);
}

.sandbox-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 250px);
  padding: 0 18px 20px;
  overflow-y: auto;
}

.song-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease,
    opacity 0.15s ease;
}

.song-card:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.055);
}

.song-card.is-dragging {
  opacity: 0.4;
}

.song-card .thumb {
  width: 80px;
  height: 45px;
}

.song-card .song-copy {
  gap: 6px;
}

.song-card.is-featured {
  flex-wrap: wrap;
}

.embed-wrap {
  flex: 1 1 100%;
  min-width: 0;
  margin-top: 2px;
}

.embed-toggle {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
  cursor: pointer;
}

.embed-poster {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  opacity: 0.78;
  transition: opacity 0.15s ease;
}

.embed-toggle:hover .embed-poster,
.embed-toggle:focus-visible .embed-poster {
  opacity: 1;
}

.embed-play {
  position: absolute;
  top: 50%;
  left: 50%;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  width: 56px;
  height: 40px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 1.05rem;
  pointer-events: none;
}

.embed-hint {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.72rem;
  pointer-events: none;
}

.embed-frame {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 10px;
}

.sandbox-empty {
  margin: 0;
  padding: 18px 4px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

/* --------------------------------------------------------------- Footer */

.site-footer {
  padding: 22px 0 38px;
  border-top: 1px solid var(--border);
  color: var(--muted-2);
  font-size: 0.8rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
}

.footer-inner p {
  margin: 0;
}

/* --------------------------------------------------------------- Dialog */

.send-dialog {
  width: min(720px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: #121226;
  color: var(--text);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.7);
}

.send-dialog::backdrop {
  background: rgba(4, 4, 12, 0.74);
  backdrop-filter: blur(4px);
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

#send-note {
  margin: 14px 20px 0;
  font-size: 0.85rem;
}

#send-text {
  display: block;
  width: calc(100% - 40px);
  min-height: 280px;
  margin: 12px 20px 0;
  padding: 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: #0a0a18;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
  line-height: 1.55;
  resize: vertical;
}

/* The review of what will be sent: the slim per-song list, never a wall of
   text (the plain-text form lives in the .send-raw fold below it). */
.send-review {
  margin: 12px 20px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0f0f20;
  font-size: 0.86rem;
  line-height: 1.5;
}

.send-review-title {
  margin: 0 0 6px;
  font-weight: 700;
}

.send-review-points {
  color: #ffd76e;
  font-weight: 600;
}

.send-review-unranked {
  margin-top: 6px;
  color: var(--muted-2);
}

.send-raw {
  margin: 12px 20px 0;
  font-size: 0.82rem;
  color: var(--muted-2);
}

.send-raw summary {
  cursor: pointer;
}

.send-field {
  display: block;
  margin: 14px 20px 0;
  font-size: 0.85rem;
}

.send-field span {
  display: block;
  margin-bottom: 6px;
}

.account-fields input[readonly] {
  border-style: dashed;
  color: var(--muted);
}

.send-field input,
.account-fields input {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #0a0a18;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
}

.send-validation,
.account-validation {
  margin: 10px 20px 0;
  font-size: 0.82rem;
  color: #fecdd3;
}

.send-account {
  margin: 14px 20px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.85rem;
}

.send-account-title {
  margin: 0 0 4px;
  font-weight: 700;
}

.send-account-hint {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--muted-2);
}

/* The account section is off by default: the box switches it on, so the only
   mandatory answer stays the voter's name. */
.account-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  font-weight: 600;
  cursor: pointer;
}

.account-toggle input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: #ffd76e;
  cursor: pointer;
}

.account-toggle input:disabled {
  cursor: default;
}

.account-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* display: grid above would otherwise win over the UA's [hidden] rule. */
.account-fields[hidden] {
  display: none;
}

.account-fields label span {
  display: block;
  margin-bottom: 4px;
}

.me-hint {
  margin: 12px 20px 0;
  font-size: 0.8rem;
  color: var(--muted-2);
}

.me-hint a {
  color: inherit;
}

.send-history {
  margin: 14px 20px 20px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.send-history-title {
  margin: 0 0 8px;
  font-weight: 700;
}

.send-history-item {
  margin: 0 0 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.send-history-item:last-of-type {
  margin-bottom: 0;
}

.send-history-date {
  margin: 0 0 4px;
  color: var(--muted-2);
}

.send-history-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.send-history-list li {
  margin: 0 0 2px;
}

/* The live standings the dialog shows once a vote was saved. */
.send-totals {
  margin: 14px 20px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0f0f20;
  font-size: 0.86rem;
  line-height: 1.5;
}

.send-totals .send-history-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.totals-refresh {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 400;
  text-decoration: underline;
  cursor: pointer;
}

.totals-refresh:disabled {
  cursor: default;
  opacity: 0.6;
}

.totals-votes {
  color: var(--muted-2);
}

.totals-empty,
.totals-error {
  margin: 0;
  color: var(--muted-2);
}

/* The standings chart: a scroll box around a frame whose pixel height fits one
   bar per song, so a long voting scrolls instead of squeezing its labels. */
.totals-chart {
  max-height: 420px;
  margin-top: 8px;
  overflow-y: auto;
  overflow-x: hidden;
}

.totals-chart-frame {
  position: relative;
  min-height: 120px;
}

.send-totals .hint {
  margin: 6px 0 0;
  color: var(--muted-2);
  font-size: 0.78rem;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 16px 20px 20px;
}

.copy-status {
  color: var(--muted);
  font-size: 0.82rem;
}

/* ---------------------------------------------------------------- Toast */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 200;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #1b1b38;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  color: var(--text);
  font-size: 0.9rem;
  transform: translateX(-50%);
}

/* ----------------------------------------------------------- Touch drag */

.touch-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 250;
  padding: 10px;
  border: 1px solid var(--gold);
  border-radius: 14px;
  background: #1b1b38;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  opacity: 0.92;
  pointer-events: none;
}

body.touch-dragging {
  cursor: grabbing;
  user-select: none;
}

body.touch-dragging * {
  cursor: grabbing !important;
}

/* ------------------------------------------------------------- Utilities */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ----------------------------------------------------------- Responsive */

@media (max-width: 980px) {
  .voting-layout {
    grid-template-columns: 1fr;
  }

  .sandbox-panel {
    position: static;
  }

  .sandbox-list {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 720px) {
  .wrap {
    width: calc(100% - 24px);
  }

  .site-header {
    padding: 26px 0 18px;
  }

  .brand {
    gap: 12px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    font-size: 22px;
  }

  .tagline {
    font-size: 0.88rem;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .btn {
    flex: 1 1 auto;
  }

  .panel-head {
    padding: 16px 16px 12px;
  }

  .ranking-list {
    padding: 0 14px 16px;
  }

  .rank-row {
    grid-template-columns: 2.4rem minmax(0, 1fr) 4rem;
    gap: 9px;
    padding: 10px 10px 10px 6px;
  }

  .rank-pos {
    font-size: 1.35rem;
  }

  .rank-body {
    display: grid;
    grid-template-columns: auto 72px minmax(0, 1fr);
    grid-template-areas:
      "handle thumb text"
      "actions actions actions";
    align-items: center;
    gap: 8px;
  }

  .rank-body .drag-handle {
    grid-area: handle;
  }

  .rank-body .thumb {
    grid-area: thumb;
  }

  .rank-body .song-copy {
    display: contents;
  }

  .rank-body .song-text {
    grid-area: text;
    min-width: 0;
  }

  .rank-body .song-actions {
    grid-area: actions;
  }

  .rank-row .btn-label {
    display: none;
  }

  .rank-row .song-actions .btn {
    padding-inline: 9px;
  }

  .thumb {
    width: 72px;
    height: 41px;
  }

  .song-card .thumb {
    width: 64px;
    height: 36px;
  }

  .song-title {
    font-size: 0.94rem;
  }

  .rank-points strong {
    font-size: 1.05rem;
  }

  .rank-points span {
    font-size: 0.56rem;
  }

  .sandbox-list {
    padding: 0 14px 16px;
  }

  .points-note {
    display: none;
  }

  .dialog-actions .btn {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
