/* Eurovision 2026 voting app — mobile-first */
:root {
  --bg: #0a0b1e;
  --bg-2: #14163a;
  --card: #1a1e44;
  --card-2: #232856;
  --text: #f4f4ff;
  --muted: #9095c8;
  --accent: #ff2d87;
  --accent-2: #c624ff;
  --good: #34d399;
  --nah:  #fbbf24;
  --bad:  #f87171;
  --border: rgba(255,255,255,.08);
  --shadow: 0 6px 24px rgba(0,0,0,.45);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 600px at 80% -100px, rgba(198,36,255,.35), transparent 60%),
    radial-gradient(900px 500px at -20% 10%, rgba(255,45,135,.25), transparent 60%),
    linear-gradient(180deg, #060617 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "Plus Jakarta Sans","Manrope","Inter",-apple-system,BlinkMacSystemFont,
               "Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  padding-bottom: 80px;
}

/* ===== Header ===== */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(180deg, rgba(10,11,30,.96) 0%, rgba(10,11,30,.92) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  padding: 14px 14px 10px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: end;
}
.brand { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.brand .logo {
  font-size: 32px;
  filter: drop-shadow(0 4px 10px rgba(255,45,135,.5));
}
.brand-text h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.05;
}
.brand-text h1 .year {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-text p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }

.tab-btn {
  background: rgba(255,255,255,.06);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
}
.tab-btn.active {
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(198,36,255,.35);
}

/* ===== Views ===== */
main { max-width: 720px; margin: 0 auto; padding: 16px; }
.view { display: none; }
.view.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.intro {
  color: var(--muted);
  font-size: 14px;
  margin: 0 4px 16px;
  text-align: center;
}

/* ===== Song cards ===== */
.songs { display: grid; gap: 12px; }
.song-card {
  background: linear-gradient(180deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.song-card.voted-good { border-color: rgba(52,211,153,.45); }
.song-card.voted-nah  { border-color: rgba(251,191,36,.45); }
.song-card.voted-bad  { border-color: rgba(248,113,113,.45); }

.song-pos {
  display: flex; align-items: flex-start; justify-content: center;
  font-weight: 800; font-size: 22px;
  color: var(--muted);
  padding-top: 2px;
}
.song-body { min-width: 0; }
.song-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.flag { font-size: 22px; line-height: 1; }
.country { font-weight: 700; font-size: 14px; letter-spacing: 0.02em; }
.song-title { font-weight: 700; font-size: 17px; line-height: 1.2; margin: 2px 0 1px; word-break: break-word; }
.song-artist { color: var(--muted); font-size: 13px; margin-bottom: 12px; word-break: break-word; }

.vote-btns {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.vote-btn {
  position: relative;
  background: rgba(255,255,255,.05);
  border: 1.5px solid rgba(255,255,255,.08);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 4px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all .15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.vote-btn .emoji { font-size: 22px; line-height: 1; }
.vote-btn:active { transform: scale(0.96); }
.vote-btn:hover { background: rgba(255,255,255,.09); }

.vote-btn.good.selected {
  background: linear-gradient(180deg, #34d399 0%, #10b981 100%);
  border-color: transparent;
  color: #06231a;
  box-shadow: 0 6px 18px rgba(52,211,153,.35);
}
.vote-btn.nah.selected {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 100%);
  border-color: transparent;
  color: #2a1c00;
  box-shadow: 0 6px 18px rgba(251,191,36,.3);
}
.vote-btn.bad.selected {
  background: linear-gradient(180deg, #f87171 0%, #ef4444 100%);
  border-color: transparent;
  color: #2c0606;
  box-shadow: 0 6px 18px rgba(248,113,113,.35);
}

/* ===== Leaderboard ===== */
.leaderboard-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 0 4px 14px;
}
.leaderboard-head h2 { margin: 0; font-size: 20px; font-weight: 800; }
.stats { color: var(--muted); font-size: 13px; }
.stats strong { color: var(--text); font-weight: 700; }
.stats .dot { margin: 0 6px; opacity: 0.5; }

.leaderboard { display: grid; gap: 10px; }
.lb-row {
  background: linear-gradient(180deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 12px;
  align-items: center;
  transition: transform .35s cubic-bezier(.2,.7,.3,1), border-color .2s ease;
}
.lb-row.rank-1 { border-color: rgba(255,215,0,.55); box-shadow: 0 6px 18px rgba(255,215,0,.18); }
.lb-row.rank-2 { border-color: rgba(192,192,192,.45); }
.lb-row.rank-3 { border-color: rgba(205,127,50,.45); }

.lb-rank {
  display: flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: 12px;
  background: rgba(255,255,255,.04);
  font-weight: 800; font-size: 16px;
}
.lb-row.rank-1 .lb-rank { background: linear-gradient(180deg, #ffd700, #f59e0b); color: #2a1c00; }
.lb-row.rank-2 .lb-rank { background: linear-gradient(180deg, #e5e7eb, #9ca3af); color: #111; }
.lb-row.rank-3 .lb-rank { background: linear-gradient(180deg, #f59e0b, #92400e); color: #fff; }

.lb-info { min-width: 0; }
.lb-title { font-weight: 700; font-size: 14px; line-height: 1.25; }
.lb-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.lb-meta .flag { font-size: 14px; vertical-align: -1px; }

.lb-score {
  text-align: right;
  font-weight: 800; font-size: 22px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lb-score.neg { background: none; -webkit-text-fill-color: #f87171; color: #f87171; }
.lb-score.zero { background: none; -webkit-text-fill-color: var(--muted); color: var(--muted); }
.lb-breakdown { font-size: 11px; color: var(--muted); margin-top: 2px; font-weight: 600; }
.lb-breakdown .g { color: var(--good); }
.lb-breakdown .n { color: var(--nah); }
.lb-breakdown .b { color: var(--bad); }

/* ===== Footer ===== */
.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 24px 16px;
  opacity: .8;
}

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 24px;
  transform: translateX(-50%) translateY(8px);
  background: rgba(20,22,58,.95);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Larger screens ===== */
@media (min-width: 640px) {
  .brand-text h1 { font-size: 26px; }
  .song-card { grid-template-columns: 56px 1fr; padding: 16px; }
  .song-pos { font-size: 26px; }
  .song-title { font-size: 19px; }
  .vote-btn { padding: 12px 6px; font-size: 14px; }
  .vote-btn .emoji { font-size: 26px; }
  .topbar { padding: 16px 18px 12px; }
}
@media (min-width: 900px) {
  main { max-width: 980px; }
  .songs, .leaderboard { grid-template-columns: 1fr 1fr; gap: 14px; }
}
