:root {
  --bg: #0a0814;
  --surface: #14112a;
  --surface-2: #1f1a3d;
  --text: #f2efff;
  --muted: #9b95c4;
  --star-off: #3b355f;
  --accent: #8b5cf6;
  --accent-2: #c4b5fd;
  --accent-3: #e879f9;
  --accent-grad: linear-gradient(135deg, #8b5cf6, #d946ef);
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: radial-gradient(900px 480px at 50% -180px, rgba(139, 92, 246, .28), transparent 70%) no-repeat, var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Segoe UI Arabic", sans-serif;
  padding-bottom: 120px;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }

.top, .tabs, main, .notice { max-width: 760px; margin-inline: auto; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; }
/* logo.png is the supplied 4222x6400 file, unmodified; this shows only its band with the letters
   (rows 2565-3166). Its text stays for screen readers. */
.logo { display: block; aspect-ratio: 4222 / 602; background: url(logo.png?v=8ed46cde) 50% 44.24% / 100% auto no-repeat; font-size: 0; color: transparent; }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* inside pages: just the name (rows 2605-2887, x 362-3942 of the file), tagline cropped */
.brand-logo { width: clamp(168px, 48vw, 228px); flex: 0 1 auto; min-width: 0; aspect-ratio: 3581 / 283; background-position: 56.47% 42.59%; background-size: 117.9% auto; }
.brand-sub { color: var(--muted); letter-spacing: .04em; font-weight: 500; white-space: nowrap; }
.account { display: flex; align-items: center; gap: 10px; flex: none; white-space: nowrap; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.avatar-initial { display: inline-grid; place-items: center; background: var(--accent-grad); color: #fff; font-weight: 700; }
.btn-google { background: var(--text); color: #1f1f1f; padding: 8px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.link { color: var(--muted); text-decoration: underline; font-size: 14px; }

.tabs { display: flex; gap: 4px; padding: 0 16px; }
.tabs button { flex: 1; padding: 10px; border-radius: 999px; color: var(--muted); transition: background .2s, color .2s; }
.tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--accent-2); box-shadow: inset 0 0 0 1px rgba(139, 92, 246, .45); }
.tabs .tab-board {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  color: #fff; font-weight: 700;
  background: linear-gradient(90deg, rgba(139, 92, 246, .38), rgba(217, 70, 239, .38));
  animation: tabglow 2.2s ease-in-out infinite alternate;
}
.tabs .tab-board[aria-selected="true"] { background: var(--accent-grad); color: #fff; }
.tab-board svg { width: 18px; height: 18px; fill: #fde68a; filter: drop-shadow(0 0 6px rgba(253, 230, 138, .9)); }
@keyframes tabglow {
  from { box-shadow: 0 0 0 1px rgba(196, 181, 253, .35), 0 0 10px rgba(168, 85, 247, .35); }
  to   { box-shadow: 0 0 0 1px rgba(240, 171, 252, .9), 0 0 26px rgba(217, 70, 239, .75); }
}
.notice { margin-top: 12px; padding: 10px 16px; background: var(--surface-2); border-left: 3px solid var(--accent); }
main { padding: 12px 16px; }
ol { list-style: none; margin: 0; padding: 0; }
.sub { font-size: 13px; color: var(--muted); font-weight: 600; margin: 24px 4px 8px; text-transform: uppercase; letter-spacing: .12em; }

.track, .brow {
  display: grid;
  align-items: center;
  gap: 2px 12px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: var(--radius);
  background: var(--surface);
}
.track { grid-template-columns: 22px 44px minmax(0, 1fr) auto; }
.track .num { grid-row: 1 / span 2; color: var(--muted); font-size: 13px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.track.playing .num { color: var(--accent-2); }
.track .play { grid-row: 1 / span 2; }
.track .title { grid-column: 3; }
.track .stars { grid-column: 3; }
.track .meta { grid-column: 4; grid-row: 1; }
.row-actions { grid-column: 4; grid-row: 2; justify-self: end; display: flex; gap: 6px; }
.share-btn { width: 30px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent-2); transition: background .15s, color .15s; }
.share-btn svg { width: 15px; height: 15px; fill: currentColor; }
.share-btn:hover { background: var(--accent); color: #fff; }
.brow { grid-template-columns: 28px 44px minmax(0, 1fr) auto; }
.brow .rank, .brow .play, .brow .meta { grid-row: 1 / span 2; }
.brow .title { grid-column: 3; grid-row: 1; }
.brow .meta { grid-column: 4; }
.brow .bar { grid-column: 3; grid-row: 2; height: 4px; border-radius: 2px; background: var(--surface-2); overflow: hidden; }
.brow .bar i { display: block; height: 100%; width: var(--w); background: var(--accent-grad); border-radius: 2px; transition: width .4s; }
#podium:not([hidden]) ~ #board-rated .brow.top { display: none; }
.brow.top { background: linear-gradient(90deg, rgba(139, 92, 246, .28), var(--surface) 70%); }
.brow.top .rank { color: var(--accent-2); }
.rank { color: var(--muted); font-weight: 700; text-align: center; }
.title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.meta { color: var(--muted); font-size: 13px; white-space: nowrap; text-align: end; }

/* a track's photo (--img, from wow/covers) sits over its generated gradient */
.play, .np-cover, .pod-cover {
  background:
    var(--img, none) center / cover no-repeat,
    radial-gradient(circle at var(--cx, 30%) var(--cy, 30%), hsl(var(--h2, 300) 90% 72% / .85), transparent 58%),
    linear-gradient(var(--ca, 135deg), hsl(var(--h1, 270) 72% 46%), hsl(var(--h2, 300) 70% 20%));
}
.play { width: 44px; height: 44px; border-radius: 12px; position: relative; box-shadow: 0 4px 14px hsl(var(--h1, 270) 80% 40% / .35); transition: transform .15s; }
.play:hover { transform: scale(1.06); }
.play::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0;
  height: 0;
  border-left: 12px solid #fff;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  transform: translateX(2px);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .75));
}
.playing .play::before {
  width: 16px;
  height: 14px;
  border: 0;
  transform: none;
  background-image: linear-gradient(#fff, #fff), linear-gradient(#fff, #fff), linear-gradient(#fff, #fff);
  background-position: 0 100%, 6px 100%, 12px 100%;
  background-repeat: no-repeat;
  background-size: 4px 30%, 4px 100%, 4px 60%;
  animation: eq .8s ease-in-out infinite alternate;
}
@keyframes eq {
  0%   { background-size: 4px 30%, 4px 100%, 4px 60%; }
  50%  { background-size: 4px 90%, 4px 40%, 4px 100%; }
  100% { background-size: 4px 60%, 4px 80%, 4px 30%; }
}

.stars { display: flex; gap: 2px; }
.star { font-size: 22px; line-height: 1; padding: 2px; color: var(--star-off); transition: color .15s; }
.star.on { color: var(--accent-2); }
@media (hover: hover) {
  .stars:hover .star { color: var(--accent-2); }
  .stars .star:hover ~ .star { color: var(--star-off); }
}
.unrate { margin-left: 6px; width: 24px; height: 24px; border-radius: 50%; font-size: 12px; line-height: 24px; color: var(--muted); background: var(--surface-2); transition: color .15s, background .15s; }
.unrate:hover { color: #fff; background: var(--accent); }
.track[data-mine=""] .unrate { visibility: hidden; }
.star.pop { animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 50% { transform: scale(1.45); } }

.player {
  position: fixed;
  inset: auto 0 0 0;
  background: rgba(20, 17, 42, .92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--surface-2);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.player-inner { max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; }
.no-viz .player-inner { grid-template-columns: minmax(0, 1fr) auto; }
.no-viz #viz { display: none; }
#viz { width: 48px; height: 32px; color: var(--accent); }
.now { display: grid; gap: 2px; min-width: 0; text-align: start; cursor: pointer; }
.now .title::after { content: " \2303"; color: var(--accent-2); font-weight: 400; }
#player-time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.ctrl { display: flex; gap: 6px; }
.ctrl button { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; }
#btn-play { background: var(--accent-grad); color: #fff; box-shadow: 0 4px 18px rgba(168, 85, 247, .45); }
.i-pause, .is-playing .i-play { display: none; }
.is-playing .i-pause { display: inline; }
.progress { grid-column: 1 / -1; height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; cursor: pointer; }
#progress-fill { height: 100%; background: var(--accent-grad); transform-origin: 0 50%; transform: scaleX(0); }

.foot { max-width: 760px; margin: 24px auto 0; padding: 0 16px; text-align: center; font-size: 13px; }
.foot a { color: var(--muted); }
.toast {
  position: fixed;
  left: 50%;
  bottom: 130px;
  max-width: calc(100% - 32px);
  transform: translate(-50%, 20px);
  background: var(--surface-2);
  padding: 10px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .6); }
#gsi-button { color-scheme: normal; }
.modal-card { background: var(--surface); border-radius: var(--radius); padding: 24px; display: grid; gap: 16px; justify-items: center; text-align: center; min-width: min(320px, 100%); }

@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
}

/* ---- landing (signed-out) ---- */
body.landing { min-height: 100vh; min-height: 100svh; display: grid; grid-template-rows: 1fr auto; padding-bottom: 24px; }
.hero { width: 100%; overflow-x: clip; display: grid; justify-items: center; align-content: center; gap: 14px; padding: 32px 16px; text-align: center; }
/* neon triangle: its outline traces itself in, then the tip pulses */
.hero-mark { width: 76px; height: 76px; overflow: visible; filter: drop-shadow(0 0 6px rgba(139, 92, 246, .9)) drop-shadow(0 0 16px rgba(103, 232, 249, .35)); }
.hero-mark path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pm-edge { stroke: url(#hm); stroke-width: 1.4; stroke-dasharray: 1; stroke-dashoffset: 1; animation: pm-draw 1.6s cubic-bezier(.6, 0, .2, 1) forwards; }
.pm-apex { fill: #fff; filter: drop-shadow(0 0 3px #fff) drop-shadow(0 0 6px #67e8f9); animation: pm-pulse 2.6s ease-in-out 1.6s infinite; }
@keyframes pm-draw { to { stroke-dashoffset: 0; } }
@keyframes pm-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) {
  .pm-edge { animation: none; stroke-dashoffset: 0; }
  .pm-apex { animation: none; }
}
.hero-title { justify-self: stretch; margin: 4px calc(50% - min(51.5vw, 432px)) 0; }
.hero-sub { margin: 0; color: var(--accent-2); font-size: 13px; font-weight: 600; letter-spacing: .3em; text-transform: uppercase; }
.hero-copy { margin: 10px 0 6px; color: var(--muted); max-width: 32ch; }
.gsi-landing { min-height: 44px; color-scheme: normal; }

/* ---- progress card, search/sort ---- */
.progress-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px 12px; padding: 14px; margin-bottom: 12px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(139, 92, 246, .22), rgba(217, 70, 239, .10)), var(--surface); box-shadow: inset 0 0 0 1px rgba(139, 92, 246, .3); }
.pc-text { display: grid; gap: 2px; }
.pc-done { color: var(--accent-2); font-size: 13px; }
.pc-bar { grid-column: 1 / -1; grid-row: 2; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.pc-bar i { display: block; height: 100%; background: var(--accent-grad); transform-origin: 0 50%; transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.btn-next { padding: 8px 14px; border-radius: 999px; background: var(--accent-grad); color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap; box-shadow: 0 4px 16px rgba(168, 85, 247, .4); }
.toolbar { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-bottom: 12px; }
.toolbar input, .toolbar select { min-width: 0; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--surface-2); background: var(--surface); color: var(--text); font: inherit; font-size: 15px; }
.toolbar input:focus, .toolbar select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.empty { text-align: center; color: var(--muted); padding: 24px 0; }
.track.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0% { box-shadow: 0 0 0 2px var(--accent-3), 0 0 24px rgba(217, 70, 239, .6); } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---- leaderboard podium ---- */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 8px; margin: 4px 0 18px; }
.pod { display: grid; justify-items: center; gap: 6px; min-width: 0; padding: 0; text-align: center; }
.pod-medal { font-size: 26px; line-height: 1; filter: drop-shadow(0 0 8px rgba(253, 230, 138, .5)); }
.pod-cover { position: relative; width: 100%; max-width: 120px; aspect-ratio: 1; border-radius: 16px; box-shadow: 0 8px 28px hsl(var(--h1, 270) 80% 45% / .45); }
.pod-cover::after, .np-cover::after { content: ""; position: absolute; inset: 24%; clip-path: polygon(50% 6%, 96% 92%, 4% 92%); background: linear-gradient(rgba(255, 255, 255, .9), rgba(255, 255, 255, .12)); opacity: var(--tri, 1); }
.pod-1 .pod-cover { max-width: 140px; box-shadow: 0 0 0 2px #fde68a, 0 10px 36px rgba(217, 70, 239, .6); }
.pod-title { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: 14px; }
.pod-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.pod-step { width: 100%; display: grid; place-items: center; border-radius: 12px 12px 4px 4px; font-weight: 800; font-size: 20px; color: rgba(255, 255, 255, .85); background: linear-gradient(rgba(139, 92, 246, .45), rgba(139, 92, 246, .08)); }
.pod-1 .pod-step { height: 64px; background: linear-gradient(rgba(217, 70, 239, .6), rgba(139, 92, 246, .1)); }
.pod-2 .pod-step { height: 46px; }
.pod-3 .pod-step { height: 34px; }

/* ---- Now Playing (full screen) ---- */
.np {
  position: fixed; inset: 0; z-index: 20; overflow-y: auto;
  background:
    radial-gradient(70% 50% at 50% 18%, hsl(var(--h1, 270) 80% 45% / .55), transparent 70%),
    radial-gradient(60% 40% at 80% 90%, hsl(var(--h2, 300) 80% 40% / .35), transparent 70%),
    var(--bg);
  animation: np-in .32s cubic-bezier(.2, .8, .2, 1);
}
@keyframes np-in { from { transform: translateY(40px); opacity: 0; } }
body.np-open { overflow: hidden; }
#np-viz { position: absolute; inset: auto 0 0 0; width: 100%; height: 34vh; opacity: .55; pointer-events: none; }
.no-viz #np-viz { display: none; }
.np-inner { position: relative; max-width: 440px; margin: 0 auto; padding: 16px 20px calc(28px + env(safe-area-inset-bottom)); display: grid; justify-items: center; gap: 10px; text-align: center; }
.np-close { justify-self: start; width: 40px; height: 40px; border-radius: 50%; font-size: 24px; background: rgba(255, 255, 255, .08); }
.np-cover { position: relative; width: min(72vw, 300px); aspect-ratio: 1; border-radius: 28px; margin: 8px 0 10px; box-shadow: 0 20px 60px hsl(var(--h1, 270) 85% 45% / .55); transition: transform .6s cubic-bezier(.2, .8, .2, 1); transform: scale(.94); }
.np.is-playing .np-cover { transform: scale(1); animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 24px 80px hsl(var(--h2, 300) 85% 50% / .7); } }
.np-num { color: var(--accent-2); font-size: 12px; font-weight: 700; letter-spacing: .25em; text-transform: uppercase; }
.np-title { margin: 0; max-width: 100%; font-size: 26px; line-height: 1.2; overflow-wrap: anywhere; }
.np-meta { color: var(--muted); font-size: 14px; }
.np-stars { display: flex; align-items: center; gap: 4px; margin: 4px 0; }
.np-star { font-size: 34px; line-height: 1; padding: 2px; color: var(--star-off); transition: color .15s, transform .15s; }
.np-star.on { color: #fde68a; text-shadow: 0 0 12px rgba(253, 230, 138, .6); }
.np-star:hover { transform: scale(1.12); }
.np-unrate { width: 28px; height: 28px; margin-left: 6px; border-radius: 50%; font-size: 13px; color: var(--muted); background: rgba(255, 255, 255, .08); }
.np-seek, .np-vol input { width: 100%; accent-color: var(--accent-3); }
.np-times { width: 100%; display: flex; justify-content: space-between; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; margin-top: -6px; }
.np-ctrl { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 6px 0; }
.np-ctrl button { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; }
.np-ctrl .np-play { width: 72px; height: 72px; font-size: 26px; color: #fff; background: var(--accent-grad); box-shadow: 0 8px 30px rgba(168, 85, 247, .6); }
.np-mode { color: var(--muted); font-size: 20px; }
.np-mode[aria-pressed="true"], .np-mode[data-mode="all"], .np-mode[data-mode="one"] { color: var(--accent-3); text-shadow: 0 0 10px rgba(232, 121, 249, .7); }
.np-vol { display: flex; align-items: center; gap: 10px; width: 60%; color: var(--muted); }
.np-keys { color: var(--muted); font-size: 12px; margin: 4px 0 0; }
@media (hover: none) { .np-vol, .np-keys { display: none; } }

/* ---- admin: hide songs ---- */
.hide-btn { width: 30px; height: 26px; border-radius: 8px; font-size: 15px; background: var(--surface-2); opacity: .55; transition: opacity .15s, background .15s; }
.hide-btn:hover { opacity: 1; background: rgba(229, 104, 109, .25); }
.hidden-songs { margin-top: 28px; padding-top: 4px; border-top: 1px dashed var(--surface-2); }
.admin-tag { margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 11px; letter-spacing: .08em; color: #fde68a; background: rgba(253, 230, 138, .12); }
.hrow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 12px; margin-bottom: 8px; border-radius: var(--radius); background: var(--surface); opacity: .75; }
.hrow .play { filter: grayscale(.6); }
.unhide-btn { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #fff; background: var(--accent-grad); }

.vote-hint { margin: 0 4px 10px; color: var(--accent-2); font-size: 14px; font-weight: 600; text-align: center; }

/* ---- sharing ---- */
.np-top { justify-self: stretch; display: flex; justify-content: space-between; }
.np-share { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); color: #fff; }
.np-share svg { width: 18px; height: 18px; fill: currentColor; }
.share-card { width: min(380px, 100%); gap: 14px; }
.share-heading { margin: 0; color: var(--muted); }
.share-heading strong { display: block; margin-top: 4px; color: var(--text); font-size: 18px; }
.share-grid { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.share-opt { display: grid; justify-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.share-opt span { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 22px; font-weight: 800; color: #fff; transition: transform .15s; }
.share-opt:hover span { transform: scale(1.08); }
.sh-wa span { background: #25d366; }
.sh-fb span { background: #1877f2; font-family: Georgia, serif; font-size: 28px; }
.sh-ig span { background: radial-gradient(circle at 30% 110%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.sh-copy span { background: var(--surface-2); }
.share-more { width: 100%; padding: 10px; border-radius: 999px; background: var(--accent-grad); color: #fff; font-weight: 600; }
.share-url { width: 100%; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--surface-2); background: var(--bg); color: var(--muted); font: inherit; font-size: 13px; text-align: center; }
.hero-shared { margin: 10px 0 6px; color: var(--muted); display: grid; gap: 4px; }
.hero-shared strong { color: #fff; font-size: 20px; }

/* ---- voters (admin, Now Playing) ---- */
.track .title, .brow .title { cursor: pointer; }
.track .title:hover, .brow .title:hover { color: var(--accent-2); }
.np-voters { position: relative; width: 100%; margin-top: 14px; padding: 14px; border-radius: var(--radius); background: rgba(20, 17, 42, .92); box-shadow: inset 0 0 0 1px rgba(139, 92, 246, .25); text-align: start; }
.np-voters h3 { margin: 0 0 10px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.np-voters-count { color: var(--text); }
.np-voters-empty { margin: 0; color: var(--muted); font-size: 14px; }
.np-voters-list { display: grid; gap: 8px; max-height: 40vh; overflow-y: auto; }
.np-voters-list li { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.voter-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.voter-stars { color: #fde68a; letter-spacing: 1px; white-space: nowrap; }

/* ---- confirm vote change / removal ---- */
.confirm-card { width: min(360px, 100%); gap: 18px; }
.confirm-text { margin: 0; line-height: 1.6; color: var(--muted); }
.confirm-text strong { color: var(--text); }
.confirm-text .confirm-stars { color: #fde68a; letter-spacing: 1px; white-space: nowrap; }
.confirm-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.confirm-actions button { padding: 11px; border-radius: 999px; font-weight: 700; }
.confirm-cancel { background: var(--surface-2); color: var(--text); }
.confirm-ok { background: var(--accent-grad); color: #fff; box-shadow: 0 4px 16px rgba(168, 85, 247, .4); }
.np-voters-chip { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #fde68a; background: rgba(253, 230, 138, .12); box-shadow: inset 0 0 0 1px rgba(253, 230, 138, .3); }

/* ---- voters tab (admin) ---- */
.tabs .tab-people { font-size: 15px; }
.people-list { display: grid; gap: 8px; }
.person { display: grid; grid-template-columns: 22px 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface); }
.person .avatar { width: 40px; height: 40px; }
.person-rank { color: var(--muted); font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.person-seen { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
#members-list .person { cursor: default; }
#members-list .person:hover { background: var(--surface); }
.person-votes { padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--accent-2); background: rgba(139, 92, 246, .16); white-space: nowrap; }
/* Three tabs (admins): keep labels on one line, and make the open tab unmistakable. */
.tabs:has(.tab-people) button { padding: 10px 6px; font-size: 14px; white-space: nowrap; }
/* Four tabs (the Members viewer): squeeze so they still fit a 360px phone. */
.tabs:has(.tab-members) { gap: 2px; padding-inline: 8px; }
.tabs:has(.tab-members) button { padding: 10px 2px; font-size: 12px; }
.tabs:has(.tab-members) .tab-board { gap: 4px; }
.tabs:has(.tab-members) .tab-board svg { width: 14px; height: 14px; }
.tabs button[aria-selected="true"] { color: #fff; box-shadow: inset 0 0 0 2px var(--accent-2); }
.tabs .tab-board[aria-selected="false"] { background: linear-gradient(90deg, rgba(139, 92, 246, .2), rgba(217, 70, 239, .2)); }
.tabs .tab-board[aria-selected="true"] { box-shadow: inset 0 0 0 2px #fff, 0 0 24px rgba(217, 70, 239, .7); animation: none; }

/* ---- one voter (admin) ---- */
.person, .np-voters-list li { cursor: pointer; }
.person:hover { background: var(--surface-2); }
.person-view { position: fixed; inset: 0; z-index: 25; overflow-y: auto; background: radial-gradient(70% 40% at 50% 0%, rgba(139, 92, 246, .45), transparent 70%), var(--bg); animation: np-in .28s cubic-bezier(.2, .8, .2, 1); }
.pv-inner { max-width: 560px; margin: 0 auto; padding: 14px 16px calc(28px + env(safe-area-inset-bottom)); }
.pv-back { padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--text); font-weight: 600; }
.pv-head { display: grid; justify-items: center; gap: 6px; margin: 10px 0 20px; text-align: center; }
.pv-avatar .avatar { width: 96px; height: 96px; font-size: 40px; box-shadow: 0 0 0 3px rgba(196, 181, 253, .6), 0 10px 40px rgba(139, 92, 246, .5); }
.pv-name { margin: 8px 0 0; font-size: 24px; }
.pv-count { margin: 0; color: var(--accent-2); font-weight: 600; }
.pv-list { display: grid; gap: 8px; }
.pv-song { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: center; gap: 2px 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.pv-song .play { grid-row: 1 / span 2; }
.pv-song .title { grid-column: 2; }
.pv-song .pv-stars { grid-column: 2; color: #fde68a; letter-spacing: 1px; }
.pv-song .pv-rank { grid-column: 3; grid-row: 1 / span 2; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--accent-2); background: rgba(139, 92, 246, .16); white-space: nowrap; }
.pv-song.playing .title { color: var(--accent-2); }

/* pager under the tabs: which page you're on, and what's either side */
.pager { max-width: 760px; margin: 8px auto 0; padding: 0 16px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; font-size: 13px; }
.pager button { color: var(--muted); padding: 4px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pager button:hover { color: var(--accent-2); }
.pg-prev { justify-self: start; }
.pg-next { justify-self: end; }
.pager .off { visibility: hidden; }
.pg-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pg-dots { display: flex; gap: 6px; }
.pg-dots i { width: 7px; height: 7px; border-radius: 999px; background: rgba(255, 255, 255, .25); transition: width .25s, background .25s; }
.pg-dots i.on { width: 22px; background: var(--accent-2); box-shadow: 0 0 8px rgba(167, 139, 250, .8); }
.pg-swipe { display: none; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
@media (pointer: coarse) {
  .pg-swipe { display: block; }
  .pg-next:not(.off) { animation: pg-nudge-r 2.4s ease-in-out infinite; }
  .pg-prev:not(.off) { animation: pg-nudge-l 2.4s ease-in-out infinite; }
}
@keyframes pg-nudge-r { 0%, 70%, 100% { transform: none; } 80% { transform: translateX(5px); } 90% { transform: translateX(-1px); } }
@keyframes pg-nudge-l { 0%, 70%, 100% { transform: none; } 80% { transform: translateX(-5px); } 90% { transform: translateX(1px); } }
@media (prefers-reduced-motion: reduce) { .pager button { animation: none !important; } }

/* sign-in warp: the landing lunges forward while stars streak past and light flares;
   the app then arrives out of that light, approaching from the distance */
.warp { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 50; pointer-events: none; }
body.warping { overflow: hidden; }
body.warping .hero { animation: warp-out 1.1s cubic-bezier(.7, 0, .9, .4) forwards; transform-origin: 50% 30%; }
body.warping .foot { opacity: 0; transition: opacity .3s; }
body.warping::after, html.arrive body::after {
  content: ''; position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: radial-gradient(circle at 50% 40%, #fff 0%, #ede9fe 25%, #a78bfa 60%, #0b0a14 100%);
}
body.warping::after { opacity: 0; animation: flare-in .4s .72s ease-in forwards; }
html.arrive body::after { animation: flare-out .9s ease-out forwards; }
html.arrive .top, html.arrive .tabs, html.arrive .pager, html.arrive main { animation: arrive 1.1s cubic-bezier(.16, .84, .3, 1) both; }
@keyframes warp-out { to { transform: scale(7); opacity: 0; filter: blur(6px); } }
@keyframes flare-in { to { opacity: 1; } }
@keyframes flare-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes arrive { from { transform: scale(.6); opacity: 0; filter: blur(12px); } to { transform: none; opacity: 1; filter: none; } }
@media (prefers-reduced-motion: reduce) {
  html.arrive body::after { animation-duration: .3s; }
  html.arrive .top, html.arrive .tabs, html.arrive .pager, html.arrive main { animation: none; }
}
