/* ═══════════════════════════════════════════════════════════════════════════
   Palio 2026 — Stile principale
   Verde Calandrel · Glassmorphism · Mobile-first
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Variabili ───────────────────────────────────────────────────────────── */
:root {
  --green-deepest : #050d08;
  --green-dark    : #14532d;
  --green-mid     : #166534;
  --green-bright  : #22c55e;
  --green-light   : #4ade80;
  --green-pale    : #bbf7d0;

  --glass-bg      : rgba(20, 83, 45, 0.18);
  --glass-bg-hover: rgba(20, 83, 45, 0.28);
  --glass-border  : rgba(74, 222, 128, 0.18);
  --glass-border-h: rgba(74, 222, 128, 0.40);
  --glass-shadow  : 0 8px 32px rgba(0, 0, 0, 0.40);

  --text-base     : #f0fdf4;
  --text-muted    : rgba(240, 253, 244, 0.55);
  --text-faint    : rgba(240, 253, 244, 0.30);

  --radius-card   : 20px;
  --radius-btn    : 12px;
  --radius-pill   : 100px;

  --transition    : 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s ease;

  --font          : 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-size   : 15px;
  line-height : 1.6;
  color       : var(--text-base);
  background  : var(--green-deepest);
  min-height  : 100vh;
  overflow-x  : hidden;
}
img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
a { color: inherit; }

/* ── Background — orb animati ────────────────────────────────────────────── */
.bg-layer {
  position : fixed;
  inset     : 0;
  z-index   : -1;
  background:
    radial-gradient(ellipse at 15% 25%, rgba(20,83,45,0.85) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 75%, rgba(22,101,52,0.65) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 50%, rgba(34,197,94,0.08) 0%, transparent 65%),
    linear-gradient(160deg, #05100a 0%, #071306 60%, #030807 100%);
  overflow  : hidden;
}

.orb {
  position      : absolute;
  border-radius : 50%;
  filter        : blur(100px);
  opacity       : 0.25;
  will-change   : transform;
}
.orb-1 {
  width: 520px; height: 520px;
  background: radial-gradient(circle, #22c55e 0%, transparent 70%);
  top: -160px; left: -160px;
  animation: floatOrb 22s ease-in-out infinite;
}
.orb-2 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, #14532d 0%, transparent 70%);
  bottom: -80px; right: -100px;
  animation: floatOrb 28s ease-in-out infinite reverse;
  animation-delay: -8s;
}
.orb-3 {
  width: 260px; height: 260px;
  background: radial-gradient(circle, #4ade80 0%, transparent 70%);
  top: 40%; left: 60%;
  animation: floatOrb 18s ease-in-out infinite;
  animation-delay: -14s;
}

@keyframes floatOrb {
  0%,100% { transform: translate(0,0) scale(1); }
  33%     { transform: translate(40px,-35px) scale(1.08); }
  66%     { transform: translate(-30px, 25px) scale(0.93); }
}

/* ── Loading overlay ─────────────────────────────────────────────────────── */
.loading-overlay {
  position   : fixed;
  inset      : 0;
  z-index    : 9999;
  display    : flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap        : 20px;
  background : rgba(5, 13, 8, 0.92);
  backdrop-filter: blur(8px);
  transition : opacity 0.4s ease, visibility 0.4s ease;
}
.loading-overlay.hidden {
  opacity   : 0;
  visibility: hidden;
  pointer-events: none;
}
.loading-ring {
  width : 52px;
  height: 52px;
  border: 3px solid rgba(34, 197, 94, 0.15);
  border-top-color: var(--green-bright);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
  font-size  : 0.9rem;
  color      : var(--text-muted);
  letter-spacing: 0.04em;
}

/* ── Header fisso ─────────────────────────────────────────────────────────── */
.site-header {
  position  : sticky;
  top       : 0;
  z-index   : 100;
  background: rgba(5, 13, 8, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(74, 222, 128, 0.12);
}
.header-inner {
  max-width     : 900px;
  margin        : 0 auto;
  padding       : 14px 20px;
  display       : flex;
  align-items   : center;
  justify-content: space-between;
  gap           : 16px;
}
.logo {
  display    : flex;
  align-items: center;
  gap        : 10px;
}
.logo-note {
  font-size        : 1.5rem;
  color            : var(--green-bright);
  filter           : drop-shadow(0 0 8px rgba(34,197,94,0.6));
  line-height      : 1;
}
.logo-name {
  font-size  : 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.logo-name strong { color: var(--green-bright); }

.header-counters {
  display: flex;
  gap    : 8px;
}
.counter-pill {
  display    : flex;
  align-items: center;
  gap        : 6px;
  padding    : 5px 12px;
  border-radius: var(--radius-pill);
  background : rgba(34, 197, 94, 0.08);
  border     : 1px solid rgba(34, 197, 94, 0.15);
  font-size  : 0.76rem;
  font-weight: 500;
  color      : var(--text-muted);
  white-space: nowrap;
}
.pill-dot {
  width : 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-song  { background: var(--green-bright); box-shadow: 0 0 6px rgba(34,197,94,0.7); }
.dot-choir { background: var(--green-light);  box-shadow: 0 0 6px rgba(74,222,128,0.7); }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
  text-align : center;
  padding    : 80px 24px 64px;
}
.hero-inner { max-width: 600px; margin: 0 auto; }

.hero-eyebrow {
  display      : inline-block;
  font-size    : 0.8rem;
  font-weight  : 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color        : var(--green-bright);
  background   : rgba(34,197,94,0.08);
  border       : 1px solid rgba(34,197,94,0.25);
  border-radius: var(--radius-pill);
  padding      : 5px 16px;
  margin-bottom: 24px;
}

.hero-title {
  font-size  : clamp(3.2rem, 12vw, 7rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
}
.hero-accent {
  background       : linear-gradient(135deg, var(--green-bright) 0%, var(--green-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip  : text;
  filter           : drop-shadow(0 0 30px rgba(34,197,94,0.4));
}

.hero-sub {
  font-size  : 1.05rem;
  color      : var(--text-muted);
  max-width  : 420px;
  margin     : 0 auto;
}
.hero-sub strong { color: var(--text-base); }

/* ── Layout principale ────────────────────────────────────────────────────── */
.main {
  max-width: 900px;
  margin   : 0 auto;
  padding  : 0 16px 80px;
}

/* ── Sezione di voto ─────────────────────────────────────────────────────── */
.vote-section { margin-bottom: 12px; }

.section-head {
  display    : flex;
  align-items: center;
  gap        : 14px;
  margin-bottom: 20px;
  padding    : 0 4px;
}
.section-icon-wrap {
  width        : 48px;
  height       : 48px;
  border-radius: 14px;
  background   : rgba(34, 197, 94, 0.10);
  border       : 1px solid rgba(34, 197, 94, 0.20);
  display      : flex;
  align-items  : center;
  justify-content: center;
  flex-shrink  : 0;
  font-size    : 1.4rem;
}
.section-meta { flex: 1; min-width: 0; }
.section-title {
  font-size  : 1.3rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.section-hint {
  font-size : 0.82rem;
  color     : var(--text-muted);
}
.section-hint strong { color: var(--green-bright); }

.song-vote-counter {
  text-align    : center;
  font-size     : 0.85rem;
  font-weight   : 600;
  color         : var(--green-bright);
  background    : rgba(34, 197, 94, 0.12);
  border        : 1px solid rgba(34, 197, 94, 0.3);
  border-radius : 20px;
  padding       : 6px 16px;
  margin        : 0 auto 16px;
  width         : fit-content;
}

.section-tally {
  text-align : center;
  flex-shrink: 0;
}
.tally-num {
  display    : block;
  font-size  : 1.6rem;
  font-weight: 800;
  color      : var(--green-bright);
  line-height: 1;
}
.tally-lbl {
  font-size: 0.7rem;
  color    : var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Separatore sezioni ───────────────────────────────────────────────────── */
.sep-line {
  margin : 40px 4px;
  height : 1px;
  background: linear-gradient(90deg,
    transparent 0%, rgba(34,197,94,0.25) 30%, rgba(34,197,94,0.25) 70%, transparent 100%);
}

/* ── Lista items ─────────────────────────────────────────────────────────── */
.items-list {
  display      : flex;
  flex-direction: column;
  gap          : 10px;
}

/* ── Card item ───────────────────────────────────────────────────────────── */
.item-card {
  background  : var(--glass-bg);
  border      : 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  box-shadow  : var(--glass-shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding     : 16px 18px;
  transition  : border-color var(--transition), transform var(--transition), box-shadow var(--transition);
  role        : listitem;
  position    : relative;
  overflow    : hidden;
}
.item-card::before {
  content : '';
  position: absolute;
  inset   : 0;
  border-radius: inherit;
  background: linear-gradient(135deg,
    rgba(34,197,94,0.05) 0%, transparent 60%);
  pointer-events: none;
}
.item-card:hover {
  border-color: var(--glass-border-h);
  transform   : translateY(-2px);
  box-shadow  : 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(34,197,94,0.1);
}
.item-card.is-winner {
  border-color: rgba(250, 204, 21, 0.40);
  background  : rgba(20, 83, 45, 0.28);
  box-shadow  : 0 8px 32px rgba(0,0,0,0.40), 0 0 0 1px rgba(250,204,21,0.15);
}
.item-card.is-voted {
  border-color: rgba(34, 197, 94, 0.35);
}

/* ── Riga player audio ───────────────────────────────────────────────────── */
.audio-row {
  display    : flex;
  align-items: center;
  gap        : 12px;
  margin-bottom: 12px;
}
.play-btn {
  width        : 40px;
  height       : 40px;
  border-radius: 50%;
  border       : 2px solid rgba(34,197,94,0.40);
  background   : rgba(34,197,94,0.10);
  display      : flex;
  align-items  : center;
  justify-content: center;
  transition   : background var(--transition-fast), border-color var(--transition-fast),
                 transform var(--transition-fast), box-shadow var(--transition-fast);
  flex-shrink  : 0;
  color        : var(--green-bright);
}
.play-btn:hover, .play-btn:focus-visible {
  background  : rgba(34,197,94,0.22);
  border-color: var(--green-bright);
  box-shadow  : 0 0 0 4px rgba(34,197,94,0.15), 0 0 16px rgba(34,197,94,0.3);
  transform   : scale(1.06);
}
.play-btn:active { transform: scale(0.94); }
.play-btn.is-playing {
  background   : rgba(34,197,94,0.20);
  border-color : var(--green-bright);
  box-shadow   : 0 0 16px rgba(34,197,94,0.4);
}
.play-btn svg {
  width : 16px;
  height: 16px;
  fill  : currentColor;
  flex-shrink: 0;
}

.audio-track {
  flex   : 1;
  min-width: 0;
}
.audio-bar-bg {
  height       : 4px;
  border-radius: 4px;
  background   : rgba(255,255,255,0.10);
  cursor       : pointer;
  position     : relative;
  overflow     : hidden;
  margin-bottom: 5px;
}
.audio-bar-fill {
  height       : 100%;
  border-radius: 4px;
  background   : linear-gradient(90deg, var(--green-dark), var(--green-bright));
  width        : 0%;
  transition   : width 0.2s linear;
  pointer-events: none;
}
.audio-times {
  display        : flex;
  justify-content: space-between;
  font-size      : 0.7rem;
  color          : var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.audio-error-note {
  font-size: 0.72rem;
  color    : rgba(248,113,113,0.7);
  margin-top: 4px;
}

/* ── Riga info card ──────────────────────────────────────────────────────── */
.info-row {
  display    : flex;
  align-items: center;
  gap        : 10px;
  flex-wrap  : wrap;
}
.item-num {
  font-size  : 0.72rem;
  font-weight: 700;
  color      : var(--green-bright);
  background : rgba(34,197,94,0.12);
  border     : 1px solid rgba(34,197,94,0.20);
  border-radius: 6px;
  padding    : 2px 7px;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.item-title {
  font-size  : 1rem;
  font-weight: 600;
  flex       : 1;
  min-width  : 0;
  overflow   : hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.winner-badge {
  display    : inline-flex;
  align-items: center;
  gap        : 4px;
  font-size  : 0.72rem;
  font-weight: 700;
  color      : #fbbf24;
  background : rgba(251,191,36,0.12);
  border     : 1px solid rgba(251,191,36,0.30);
  border-radius: var(--radius-pill);
  padding    : 3px 10px;
  flex-shrink: 0;
  animation  : pulseWinner 2.4s ease-in-out infinite;
}
@keyframes pulseWinner {
  0%,100% { box-shadow: 0 0 0 0 rgba(251,191,36,0.3); }
  50%     { box-shadow: 0 0 0 6px rgba(251,191,36,0); }
}

/* ── Pulsante vota ───────────────────────────────────────────────────────── */
.vote-btn {
  display      : inline-flex;
  align-items  : center;
  gap          : 6px;
  margin-top   : 12px;
  padding      : 10px 22px;
  border-radius: var(--radius-btn);
  border       : 1.5px solid var(--green-bright);
  background   : linear-gradient(135deg, rgba(34,197,94,0.15), rgba(34,197,94,0.05));
  color        : var(--green-bright);
  font-size    : 0.88rem;
  font-weight  : 600;
  letter-spacing: 0.02em;
  transition   : background var(--transition-fast), transform var(--transition-fast),
                 box-shadow var(--transition-fast), opacity var(--transition-fast);
}
.vote-btn:hover, .vote-btn:focus-visible {
  background : linear-gradient(135deg, rgba(34,197,94,0.30), rgba(34,197,94,0.15));
  box-shadow : 0 0 0 3px rgba(34,197,94,0.2), 0 4px 16px rgba(34,197,94,0.25);
  transform  : translateY(-1px);
}
.vote-btn:active { transform: scale(0.97); }
.vote-btn:disabled {
  opacity       : 0.45;
  cursor        : not-allowed;
  pointer-events: none;
}

.vote-btn-loading {
  display      : none;
  width        : 14px;
  height       : 14px;
  border       : 2px solid rgba(34,197,94,0.2);
  border-top-color: var(--green-bright);
  border-radius: 50%;
  animation    : spin 0.8s linear infinite;
  flex-shrink  : 0;
}
.vote-btn.loading .vote-btn-loading  { display: block; }
.vote-btn.loading .vote-btn-label    { opacity: 0.6; }

/* ── Statistiche di voto ─────────────────────────────────────────────────── */
.vote-stats {
  margin-top: 12px;
}
.progress-track {
  height        : 8px;
  border-radius : 8px;
  background    : rgba(255,255,255,0.08);
  overflow      : hidden;
  margin-bottom : 7px;
}
.progress-fill {
  height       : 100%;
  border-radius: 8px;
  background   : linear-gradient(90deg, var(--green-dark) 0%, var(--green-bright) 100%);
  width        : 0%;
  transition   : width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-fill.fill-winner {
  background: linear-gradient(90deg, #b45309 0%, #fbbf24 80%, #fde68a 100%);
}

.stats-row {
  display    : flex;
  align-items: center;
  gap        : 10px;
  flex-wrap  : wrap;
}
.stat-pct {
  font-size  : 1.1rem;
  font-weight: 700;
  color      : var(--green-bright);
}
.stat-votes {
  font-size: 0.78rem;
  color    : var(--text-muted);
}
.your-vote-tag {
  display    : inline-flex;
  align-items: center;
  gap        : 4px;
  font-size  : 0.72rem;
  font-weight: 600;
  color      : var(--green-bright);
  background : rgba(34,197,94,0.10);
  border     : 1px solid rgba(34,197,94,0.25);
  border-radius: var(--radius-pill);
  padding    : 2px 9px;
  margin-left: auto;
}

/* ── Toast ────────────────────────────────────────────────────────────────── */
.toast-wrap {
  position  : fixed;
  bottom    : 28px;
  left      : 50%;
  transform : translateX(-50%);
  z-index   : 9000;
  pointer-events: none;
}
.toast {
  background   : rgba(15, 30, 20, 0.92);
  border       : 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 14px;
  padding      : 13px 22px;
  font-size    : 0.88rem;
  font-weight  : 500;
  color        : var(--text-base);
  backdrop-filter: blur(12px);
  box-shadow   : 0 8px 28px rgba(0,0,0,0.5);
  white-space  : nowrap;
  opacity      : 0;
  transform    : translateY(16px) scale(0.95);
  transition   : opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  max-width    : 90vw;
  overflow     : hidden;
  text-overflow: ellipsis;
}
.toast.visible {
  opacity  : 1;
  transform: translateY(0) scale(1);
}
.toast.toast-success { border-color: rgba(34,197,94,0.45); }
.toast.toast-error   { border-color: rgba(239,68,68,0.45); color: #fca5a5; }
.toast.toast-warn    { border-color: rgba(234,179,8,0.45);  color: #fde68a; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
  text-align : center;
  padding    : 32px 20px;
  border-top : 1px solid rgba(34,197,94,0.08);
}
.footer-copy {
  font-size: 0.82rem;
  color    : var(--text-muted);
  margin-bottom: 4px;
}
.footer-note {
  font-size: 0.72rem;
  color    : var(--text-faint);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (min-width: 600px) {
  body { font-size: 16px; }
  .hero { padding: 100px 32px 72px; }
  .main { padding: 0 32px 80px; }
  .item-card { padding: 18px 22px; }
  .audio-bar-bg { height: 5px; }
}

@media (min-width: 900px) {
  .items-list {
    display              : grid;
    grid-template-columns: repeat(2, 1fr);
    gap                  : 12px;
  }
}

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

/* ── Modal nome votante ───────────────────────────────────────────────────── */
.name-overlay {
  position        : fixed;
  inset           : 0;
  z-index         : 8500;
  background      : rgba(3, 8, 5, 0.85);
  backdrop-filter : blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display         : flex;
  align-items     : center;
  justify-content : center;
  padding         : 20px;
  opacity         : 0;
  visibility      : hidden;
  transition      : opacity 0.30s ease, visibility 0.30s ease;
}
.name-overlay.open {
  opacity   : 1;
  visibility: visible;
}
.name-panel {
  width        : 100%;
  max-width    : 420px;
  background   : linear-gradient(155deg, rgba(10,25,15,0.98) 0%, rgba(5,13,8,0.98) 100%);
  border       : 1px solid rgba(74, 222, 128, 0.22);
  border-radius: 28px;
  box-shadow   : 0 24px 64px rgba(0,0,0,0.7), 0 0 0 1px rgba(34,197,94,0.06);
  padding      : 36px 32px 32px;
  text-align   : center;
  transform    : scale(0.92) translateY(20px);
  transition   : transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
}
.name-overlay.open .name-panel {
  transform: scale(1) translateY(0);
}
.name-panel-icon {
  font-size    : 2.8rem;
  margin-bottom: 14px;
  line-height  : 1;
  filter       : drop-shadow(0 0 12px rgba(34,197,94,0.3));
}
.name-panel-title {
  font-size    : 1.5rem;
  font-weight  : 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}
.name-panel-hint {
  font-size    : 0.85rem;
  color        : var(--text-muted);
  line-height  : 1.6;
  margin-bottom: 24px;
}
.name-input {
  width         : 100%;
  padding       : 14px 18px;
  border-radius : 14px;
  border        : 1.5px solid rgba(74, 222, 128, 0.25);
  background    : rgba(34, 197, 94, 0.06);
  color         : var(--text-base);
  font-family   : var(--font);
  font-size     : 1rem;
  font-weight   : 500;
  outline       : none;
  transition    : border-color var(--transition-fast), box-shadow var(--transition-fast);
  margin-bottom : 20px;
  text-align    : center;
}
.name-input::placeholder { color: var(--text-faint); }
.name-input:focus {
  border-color: var(--green-bright);
  box-shadow  : 0 0 0 4px rgba(34, 197, 94, 0.15);
}
.name-panel-actions {
  display: flex;
  gap    : 10px;
}
.name-btn-skip {
  flex         : 0 0 auto;
  padding      : 12px 18px;
  border-radius: var(--radius-btn);
  border       : 1.5px solid rgba(240, 253, 244, 0.12);
  background   : transparent;
  color        : var(--text-muted);
  font-size    : 0.85rem;
  font-weight  : 500;
  transition   : background var(--transition-fast), color var(--transition-fast);
}
.name-btn-skip:hover { background: rgba(255,255,255,0.05); color: var(--text-base); }
.name-btn-confirm {
  flex         : 1;
  padding      : 12px 20px;
  border-radius: var(--radius-btn);
  border       : 1.5px solid var(--green-bright);
  background   : linear-gradient(135deg, rgba(34,197,94,0.20), rgba(34,197,94,0.08));
  color        : var(--green-bright);
  font-size    : 0.92rem;
  font-weight  : 700;
  transition   : background var(--transition-fast), box-shadow var(--transition-fast),
                 transform var(--transition-fast);
}
.name-btn-confirm:hover {
  background : linear-gradient(135deg, rgba(34,197,94,0.32), rgba(34,197,94,0.18));
  box-shadow : 0 0 0 3px rgba(34,197,94,0.2), 0 4px 16px rgba(34,197,94,0.25);
  transform  : translateY(-1px);
}
.name-btn-confirm:active { transform: scale(0.97); }

/* Tag nome votante nella card */
.voter-name-tag {
  display    : inline-flex;
  align-items: center;
  gap        : 4px;
  font-size  : 0.72rem;
  font-weight: 600;
  color      : var(--green-bright);
  background : rgba(34, 197, 94, 0.10);
  border     : 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius-pill);
  padding    : 2px 9px;
  max-width  : 140px;
  overflow   : hidden;
  text-overflow: ellipsis;
  white-space  : nowrap;
}

/* ── Pulsante testo / karaoke su ogni card ────────────────────────────────── */
.lyrics-btn {
  display      : inline-flex;
  align-items  : center;
  gap          : 5px;
  margin-top   : 8px;
  margin-left  : 4px;
  padding      : 7px 16px;
  border-radius: var(--radius-btn);
  border       : 1.5px solid rgba(74, 222, 128, 0.30);
  background   : rgba(74, 222, 128, 0.07);
  color        : var(--green-light);
  font-size    : 0.82rem;
  font-weight  : 600;
  letter-spacing: 0.02em;
  transition   : background var(--transition-fast), border-color var(--transition-fast),
                 box-shadow var(--transition-fast);
}
.lyrics-btn:hover, .lyrics-btn:focus-visible {
  background  : rgba(74, 222, 128, 0.16);
  border-color: var(--green-light);
  box-shadow  : 0 0 0 3px rgba(74, 222, 128, 0.12);
}
.lyrics-btn.has-lyrics {
  border-color: rgba(74, 222, 128, 0.45);
  color       : var(--green-light);
}
.lyrics-btn.no-lyrics {
  opacity: 0.45;
}

/* ── Overlay karaoke ─────────────────────────────────────────────────────── */
.karaoke-overlay {
  position   : fixed;
  inset      : 0;
  z-index    : 8000;
  background : rgba(3, 8, 5, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display    : flex;
  align-items: flex-end;
  justify-content: center;
  padding    : 0;
  opacity    : 0;
  visibility : hidden;
  transition : opacity 0.35s ease, visibility 0.35s ease;
}
.karaoke-overlay.open {
  opacity   : 1;
  visibility: visible;
}

/* ── Pannello karaoke (slide-up) ─────────────────────────────────────────── */
.karaoke-panel {
  width         : 100%;
  max-width     : 680px;
  max-height    : 88vh;
  display       : flex;
  flex-direction: column;
  background    : linear-gradient(160deg, rgba(10,25,15,0.98) 0%, rgba(5,13,8,0.98) 100%);
  border        : 1px solid rgba(74, 222, 128, 0.20);
  border-bottom : none;
  border-radius : 28px 28px 0 0;
  box-shadow    : 0 -16px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(34,197,94,0.08);
  transform     : translateY(100%);
  transition    : transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  overflow      : hidden;  /* clip border-radius */
  contain       : layout;  /* isola lo scroll interno */
}
.karaoke-overlay.open .karaoke-panel {
  transform: translateY(0);
}

/* Handle visivo per mobile */
.karaoke-panel::before {
  content      : '';
  display      : block;
  width        : 40px;
  height       : 4px;
  border-radius: 4px;
  background   : rgba(74, 222, 128, 0.25);
  margin       : 12px auto 0;
  flex-shrink  : 0;
}

/* ── Header modal ────────────────────────────────────────────────────────── */
.karaoke-header {
  display        : flex;
  align-items    : center;
  justify-content: space-between;
  padding        : 16px 24px 14px;
  border-bottom  : 1px solid rgba(74, 222, 128, 0.10);
  flex-shrink    : 0;
}
.karaoke-title-wrap {
  display    : flex;
  align-items: center;
  gap        : 10px;
}
.karaoke-note {
  font-size : 1.3rem;
  color     : var(--green-bright);
  filter    : drop-shadow(0 0 8px rgba(34,197,94,0.5));
}
.karaoke-title {
  font-size  : 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  max-width  : 55vw;
  overflow   : hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.karaoke-close {
  width        : 34px;
  height       : 34px;
  border-radius: 50%;
  border       : 1px solid rgba(74, 222, 128, 0.20);
  background   : rgba(74, 222, 128, 0.06);
  color        : var(--text-muted);
  font-size    : 1rem;
  display      : flex;
  align-items  : center;
  justify-content: center;
  transition   : background var(--transition-fast), color var(--transition-fast);
  flex-shrink  : 0;
}
.karaoke-close:hover { background: rgba(239,68,68,0.15); color: #fca5a5; }

/* ── Barra mini-player nel modal ─────────────────────────────────────────── */
.karaoke-player-bar {
  display    : flex;
  align-items: center;
  gap        : 10px;
  padding    : 10px 24px;
  background : rgba(34, 197, 94, 0.05);
  border-bottom: 1px solid rgba(74, 222, 128, 0.08);
  flex-shrink: 0;
}
.karaoke-now-playing {
  flex      : 1;
  font-size : 0.78rem;
  color     : var(--text-muted);
  overflow  : hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.karaoke-time {
  font-size   : 0.78rem;
  font-weight : 600;
  color       : var(--green-bright);
  font-variant-numeric: tabular-nums;
  flex-shrink : 0;
}

/* Waveform animata — attiva solo quando suona */
.karaoke-waveform {
  display    : flex;
  align-items: center;
  gap        : 2px;
  flex-shrink: 0;
}
.karaoke-waveform span {
  display      : block;
  width        : 3px;
  border-radius: 3px;
  background   : var(--green-bright);
  height       : 4px;
  transition   : height 0.1s ease;
}
.karaoke-waveform.playing span:nth-child(1) { animation: wave 0.8s ease infinite; }
.karaoke-waveform.playing span:nth-child(2) { animation: wave 0.8s ease infinite 0.15s; }
.karaoke-waveform.playing span:nth-child(3) { animation: wave 0.8s ease infinite 0.05s; }
.karaoke-waveform.playing span:nth-child(4) { animation: wave 0.8s ease infinite 0.25s; }
.karaoke-waveform.playing span:nth-child(5) { animation: wave 0.8s ease infinite 0.10s; }

@keyframes wave {
  0%, 100% { height: 4px;  }
  50%       { height: 18px; }
}

/* ── Corpo testo karaoke ─────────────────────────────────────────────────── */
.karaoke-body {
  flex        : 1;
  overflow-y  : auto;
  padding     : 28px 28px 40px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.karaoke-body::-webkit-scrollbar { width: 4px; }
.karaoke-body::-webkit-scrollbar-track { background: transparent; }
.karaoke-body::-webkit-scrollbar-thumb {
  background   : rgba(34, 197, 94, 0.25);
  border-radius: 4px;
}

/* Stanza di testo */
.lyric-stanza {
  margin-bottom: 28px;
}
.lyric-stanza:last-child { margin-bottom: 0; }

/* Riga singola */
.lyric-line {
  display      : block;
  font-size    : 1.18rem;
  font-weight  : 500;
  line-height  : 1.7;
  color        : rgba(240, 253, 244, 0.45);
  letter-spacing: 0.01em;
  padding      : 2px 0;
  transition   : color 0.3s ease, transform 0.3s ease, text-shadow 0.3s ease;
  cursor       : default;
  border-radius: 6px;
}

/* Riga evidenziata (karaoke attivo) */
.lyric-line.active {
  color      : #ffffff;
  transform  : scale(1.05) translateX(10px);
  text-shadow: 0 0 28px rgba(255,255,255,0.75), 0 0 8px rgba(34,197,94,0.5);
  font-weight: 700;
}
/* Riga passata */
.lyric-line.past {
  color: rgba(240, 253, 244, 0.25);
}

/* Messaggio nessun testo */
.karaoke-empty {
  padding   : 48px 28px;
  text-align: center;
  color     : var(--text-muted);
  font-size : 0.95rem;
  line-height: 1.8;
}
.karaoke-empty small {
  font-size: 0.78rem;
  color    : var(--text-faint);
}

/* ── Responsive modal ────────────────────────────────────────────────────── */
@media (min-width: 600px) {
  .karaoke-overlay {
    align-items: center;
    padding    : 24px;
  }
  .karaoke-panel {
    border-radius: 24px;
    border-bottom: 1px solid rgba(74, 222, 128, 0.20);
    max-height   : 80vh;
    transform    : translateY(40px) scale(0.96);
  }
  .karaoke-overlay.open .karaoke-panel {
    transform: translateY(0) scale(1);
  }
  .karaoke-panel::before { display: none; }
  .lyric-line { font-size: 1.3rem; }
}

