/* ═══════════════════════════════════════════════════════════════════
   Moozico — Stylesheet  (identical palette to original HTML)
═══════════════════════════════════════════════════════════════════ */

* { box-sizing: border-box; margin: 0; padding: 0; touch-action: manipulation; }

html, body {
  height: 100%; height: 100dvh;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

body {
  background: #f5a623;
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Sans', sans-serif;
  overflow: hidden;
}

body.is-fullscreen {
  background: #1a0a2e;
  align-items: stretch; justify-content: stretch;
}

body.is-fullscreen .phone {
  width: 100vw; width: 100dvw;
  min-height: 100vh; min-height: 100dvh;
  border-radius: 0;
  max-width: 480px;
  margin: 0 auto;
}

/* ── Generic Form / Select styling ────────────────────────────────── */
.form-input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 8px;
  padding: 10px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: #f5c842; }

select.form-input option {
  background-color: #2c2c54; /* dark background for readability */
  color: #fff;
}

/* ── Modal styling ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0,0,0,0.8);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.modal-overlay.show { opacity: 1; pointer-events: all; }
.modal-content {
  background: #1a0a2e;
  border-radius: 16px;
  padding: 24px;
  width: 90%; max-width: 400px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.1);
}
.modal-header {
  font-family: 'Lilita One', cursive;
  font-size: 1.5rem; color: #f5c842;
  margin-bottom: 16px;
  display: flex; justify-content: space-between; align-items: center;
}
.modal-close {
  background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer;
}
.modal-body {
  display: flex; flex-direction: column; gap: 12px;
}
.modal-footer {
  margin-top: 20px;
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ── Login body ───────────────────────────────────────────────────── */
body.login-body {
  background: #1a0a2e;
  overflow-y: auto;
  align-items: flex-start;
  justify-content: center;
  padding: 20px 0 40px;
}

/* ── Fullscreen button ────────────────────────────────────────────── */
#fsBtn {
  position: fixed; bottom: 18px; right: 18px; z-index: 9999;
  width: 42px; height: 42px; border-radius: 12px;
  background: rgba(245,200,66,0.18); border: 1.5px solid rgba(245,200,66,0.45);
  color: #f5c842; font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); transition: opacity 0.2s;
  -webkit-tap-highlight-color: transparent;
}
#fsBtn:active { opacity: 0.7; }

/* ── Phone shell ─────────────────────────────────────────────────── */
.phone {
  width: 360px; min-height: 640px; background: #1a0a2e; border-radius: 36px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.1);
  overflow: hidden; display: flex; flex-direction: column; position: relative;
}

.rays {
  position: absolute; inset: 0; z-index: 0;
  background: conic-gradient(from 0deg at 50% 50%,
    #e8401a 0deg,#f5a623 22deg,#e8401a 44deg,#f5a623 66deg,
    #e8401a 88deg,#f5a623 110deg,#e8401a 132deg,#f5a623 154deg,
    #e8401a 176deg,#f5a623 198deg,#e8401a 220deg,#f5a623 242deg,
    #e8401a 264deg,#f5a623 286deg,#e8401a 308deg,#f5a623 330deg,
    #e8401a 352deg,#f5a623 360deg);
  opacity: 0.82; pointer-events: none;
}

/* ── Top / Info bars ─────────────────────────────────────────────── */
.topbar {
  position: relative; z-index: 10; background: rgba(15,8,30,0.93);
  padding: 10px 14px 8px; display: flex; align-items: center; gap: 10px;
}
.logo-top {
  font-family: 'Lilita One', cursive; font-size: 1.5rem;
  color: #f5c842; letter-spacing: 1px; text-shadow: 2px 2px 0 #c07a00;
  flex: 1; text-align: center;
}
.round-badge {
  background: #e8401a; border-radius: 8px; padding: 3px 8px;
  font-size: 0.6rem; font-weight: 700; color: #fff;
  text-transform: uppercase; white-space: nowrap; line-height: 1.35; text-align: center;
}
.pause-btn {
  width: 30px; height: 30px; background: rgba(255,255,255,0.15);
  border-radius: 6px; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; color: #fff; flex-shrink: 0;
}
.infobar {
  position: relative; z-index: 10; background: rgba(15,8,30,0.86);
  padding: 6px 14px; display: flex; align-items: center; gap: 10px;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #e8401a; border: 2px solid #f5c842;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; flex-shrink: 0;
}
.track-info { flex: 1; min-width: 0; }
.track-name { font-size: 0.78rem; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-dots { display: flex; gap: 3px; margin-top: 3px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #444; }
.dot.on { background: #f5c842; }
.timer-display {
  font-family: 'Lilita One', cursive; font-size: 1.4rem;
  color: #f5c842; letter-spacing: 1px; text-shadow: 1px 1px 0 #c07a00; white-space: nowrap;
}
.timer-display.danger { color: #ff4444; text-shadow: 1px 1px 0 #800; }
.song-banner {
  position: relative; z-index: 10; background: #f5c842;
  text-align: center; padding: 7px 12px;
  font-family: 'Lilita One', cursive; font-size: 1rem; color: #1a0a2e; letter-spacing: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.grid-area {
  position: relative; z-index: 10; flex: 1;
  display: flex; align-items: center; justify-content: center; padding: 12px;
}
.circle-grid {
  display: grid;
  grid-template-columns: repeat(3, 80px);
  grid-template-rows: repeat(3, 80px);
  gap: 28px;
  position: relative;
}

/* ── Circles ─────────────────────────────────────────────────────── */
.seg-circle {
  width: 80px; height: 80px; border-radius: 50%;
  position: relative; cursor: pointer; transition: transform 0.12s;
  user-select: none; -webkit-user-select: none;
  z-index: 2;
  /* Bordo bianco (12px = stesso spessore anello rosso) + ombra portante */
  box-shadow: 0 0 0 12px rgba(255,255,255,0.82), 0 10px 28px rgba(0,0,0,0.6);
}
.seg-circle:active { transform: scale(0.9); }
.seg-circle.drag-over { transform: scale(1.1) !important; }
.seg-circle.dragging  { opacity: 0.3; }
.ring { position: absolute; inset: 0; border-radius: 50%; }
.seg-circle.blue .ring {
  background: radial-gradient(circle at 34% 27%, #a8d8ff 0%, #4a90f0 32%, #1a55d8 62%, #0a32a0 100%);
  box-shadow:
    0 10px 30px rgba(0,0,0,0.65),
    inset 0 5px 0 rgba(255,255,255,0.55),
    inset 0 -6px 0 rgba(0,0,60,0.55),
    inset 4px 0 10px rgba(255,255,255,0.1),
    inset -4px 0 10px rgba(0,0,50,0.2);
}
.seg-circle.red .ring {
  background: radial-gradient(circle at 34% 27%, #ffaaaa 0%, #f04040 32%, #cc1818 62%, #8a0808 100%);
  box-shadow:
    0 10px 30px rgba(180,0,0,0.65),
    inset 0 5px 0 rgba(255,255,255,0.55),
    inset 0 -6px 0 rgba(80,0,0,0.55),
    inset 4px 0 10px rgba(255,200,200,0.1),
    inset -4px 0 10px rgba(80,0,0,0.2);
}
.seg-circle.green .ring {
  background: radial-gradient(circle at 34% 27%, #a0ffcc 0%, #30e070 32%, #16b846 62%, #0a7028 100%);
  box-shadow:
    0 10px 30px rgba(0,180,60,0.6),
    inset 0 5px 0 rgba(255,255,255,0.55),
    inset 0 -6px 0 rgba(0,60,10,0.55),
    inset 4px 0 10px rgba(200,255,220,0.1),
    inset -4px 0 10px rgba(0,50,10,0.2);
}
.play-icon {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.play-icon svg { filter: drop-shadow(0 2px 6px rgba(0,0,0,0.55)); }
/* Numeri 3D durante la demo */
.demo-num-wrap {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; pointer-events: none;
}
.demo-seg-num {
  font-family: 'Lilita One', cursive;
  font-size: 2rem; line-height: 1; color: #fff;
  text-shadow:
    0 1px 0 rgba(255,255,255,0.55),
    0 2px 0 rgba(180,210,255,0.3),
    0 3px 0 rgba(0,0,80,0.35),
    0 4px 0 rgba(0,0,80,0.22),
    0 5px 0 rgba(0,0,80,0.12),
    0 9px 18px rgba(0,0,0,0.55);
}
.center-cell {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(15,8,30,0.85);
  border: 2px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  position: relative; z-index: 2; overflow: hidden;
}
.center-cover-img {
  width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%;
}
.center-note {
  font-size: 2.6rem; color: rgba(255,255,255,0.55); pointer-events: none; line-height: 1;
}
.slot-num {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  font-size: 0.72rem; font-weight: 800; color: rgba(255,255,255,0.88);
  font-family: 'DM Sans', sans-serif; z-index: 3; pointer-events: none;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7); line-height: 1;
}

/* ── Demo sequence ───────────────────────────────────────────────── */
.demo-ring-progress {
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 5;
  /* Ring rosso sovrapposto al bianco: parte dal raggio del cerchio (40px) */
  -webkit-mask: radial-gradient(transparent 40px, black 41px);
  mask: radial-gradient(transparent 40px, black 41px);
}
.demo-stop-btn {
  position: absolute; inset: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,4,22,0.72);
  cursor: pointer; z-index: 20;
  animation: demo-pulse 1s ease-in-out infinite;
}
.demo-stop-btn svg { filter: drop-shadow(0 0 5px rgba(255,255,255,0.45)); }
@keyframes demo-pulse {
  0%, 100% { opacity: 0.62; }
  50%       { opacity: 1;    }
}

/* ── Bottom bar ──────────────────────────────────────────────────── */
.bottombar {
  position: relative; z-index: 10; background: rgba(15,8,30,0.93);
  padding: 10px 14px; display: flex; align-items: center; gap: 8px;
}
.credits-pill {
  display: flex; align-items: center; gap: 5px;
  background: rgba(245,200,66,0.12); border: 1px solid rgba(245,200,66,0.28);
  border-radius: 999px; padding: 5px 12px;
  font-weight: 700; font-size: 0.88rem; color: #f5c842; flex-shrink: 0;
}
.msg-bar { flex: 1; text-align: center; font-size: 0.7rem; color: rgba(255,255,255,0.55); font-weight: 600; }

/* ── Generic overlay ─────────────────────────────────────────────── */
.overlay {
  position: absolute; inset: 0; z-index: 50;
  background: rgba(15,8,30,0.97);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  border-radius: 36px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s; overflow: hidden;
}
.overlay.show { opacity: 1; pointer-events: all; }

/* ── Catalogue header ────────────────────────────────────────────── */
.cat-header {
  width: 100%; background: rgba(15,8,30,0.98);
  padding: 16px 16px 12px;
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.cat-back {
  width: 32px; height: 32px; border-radius: 8px;
  background: rgba(255,255,255,0.1); border: none; cursor: pointer;
  color: #fff; font-size: 1rem; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.cat-back:hover { background: rgba(255,255,255,0.2); }
.cat-title {
  font-family: 'Lilita One', cursive; font-size: 1.3rem;
  color: #f5c842; text-shadow: 1px 1px 0 #c07a00; flex: 1;
}
.cat-credits { display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 0.85rem; color: #f5c842; }

.cat-scroll { flex: 1; overflow-y: auto; width: 100%; padding: 12px 14px 20px; }
.cat-scroll::-webkit-scrollbar { width: 4px; }
.cat-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }

/* ── Genre grid ──────────────────────────────────────────────────── */
.genre-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.genre-card {
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px; padding: 16px 14px;
  cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.1s;
  display: flex; flex-direction: column; gap: 6px;
  -webkit-tap-highlight-color: rgba(245,200,66,0.15);
}
.genre-card:hover { background: rgba(255,255,255,0.1); border-color: rgba(245,200,66,0.4); }
.genre-card:active { transform: scale(0.96); }
.genre-icon { font-size: 1.8rem; line-height: 1; }
.genre-name { font-family: 'Lilita One', cursive; font-size: 1rem; color: #fff; }
.genre-count { font-size: 0.72rem; color: rgba(255,255,255,0.4); font-weight: 600; }
.genre-bar { height: 3px; border-radius: 999px; margin-top: 4px; }

.gc-novita  .genre-bar { background: #f5c842; }
.gc-casuale .genre-bar { background: #a78bfa; }
.gc-rock    .genre-bar { background: #e8401a; }
.gc-pop     .genre-bar { background: #f472b6; }
.gc-jazz    .genre-bar { background: #4e9eff; }
.gc-electro .genre-bar { background: #34d399; }
.gc-italiana .genre-bar { background: #fb923c; }
.gc-revival  .genre-bar { background: #94a3b8; }
.gc-novita  { border-color: rgba(245,200,66,0.25); }
.gc-casuale { border-color: rgba(167,139,250,0.25); }
.gc-rock    { border-color: rgba(232,64,26,0.25); }
.gc-pop     { border-color: rgba(244,114,182,0.25); }
.gc-jazz    { border-color: rgba(78,158,255,0.25); }
.gc-electro { border-color: rgba(52,211,153,0.25); }
.gc-italiana { border-color: rgba(251,146,60,0.25); }
.gc-revival  { border-color: rgba(148,163,184,0.25); }

/* ── Song list ───────────────────────────────────────────────────── */
.song-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 12px;
  cursor: pointer; transition: background 0.15s; margin-bottom: 6px;
  border: 1px solid rgba(255,255,255,0.07);
  -webkit-tap-highlight-color: rgba(255,255,255,0.1);
}
.song-row:hover { background: rgba(255,255,255,0.07); }
.song-row:active { background: rgba(255,255,255,0.12); }
.song-row.st-new    { border-left: 3px solid rgba(255,255,255,0.5); }
.song-row.st-lv1    { border-left: 3px solid #e8401a; }
.song-row.st-lv2    { border-left: 3px solid #f5a623; }
.song-row.st-lv3    { border-left: 3px solid #4ae27a; }
.song-row.st-locked { border-left: 3px solid #555; opacity: 0.55; }
.song-info { flex: 1; min-width: 0; }
.song-title-row { font-weight: 700; font-size: 0.9rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-meta { font-size: 0.72rem; color: rgba(255,255,255,0.38); margin-top: 2px; }
.ai-badge { display:inline-block; background:#1565c0; color:#90caf9; font-size:0.6rem; font-weight:700; padding:1px 4px; border-radius:3px; border:1px solid rgba(144,202,249,0.35); letter-spacing:0.04em; vertical-align:middle; margin-right:4px; }
.song-status-badge { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.badge-new    { background: rgba(245,200,66,0.15); color: #f5c842; }
.badge-lv1    { background: rgba(232,64,26,0.15);  color: #e8401a; }
.badge-lv2    { background: rgba(245,165,35,0.15); color: #f5a623; }
.badge-lv3    { background: rgba(74,226,122,0.15); color: #4ae27a; }
.badge-locked { background: rgba(80,80,80,0.3);    color: #666; }
.song-play-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(245,200,66,0.22); border: 1.5px solid rgba(245,200,66,0.6);
  display: flex; align-items: center; justify-content: center;
  color: #f5c842; font-size: 1rem; cursor: pointer; flex-shrink: 0;
  text-shadow: 0 0 6px rgba(245,200,66,0.5);
}
.song-play-btn:hover { background: rgba(245,200,66,0.35); border-color: #f5c842; }
.song-row.previewing { background: rgba(74,158,255,0.1) !important; border-color: rgba(74,158,255,0.4); }
.song-row.previewing .song-title-row::before { content: '⏸ '; font-size: 0.75em; opacity: 0.75; }
.lock-cost { font-size: 0.7rem; color: #f5c842; font-weight: 700; display: flex; align-items: center; gap: 3px; flex-shrink: 0; cursor: pointer; }
.diff-chips { display: flex; gap: 6px; padding: 4px 0 8px; }
.diff-chip {
  flex: 1; padding: 8px 0; border-radius: 10px; border: none;
  font-family: 'DM Sans', sans-serif; font-weight: 700; font-size: 0.82rem;
  cursor: pointer; transition: all 0.15s;
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.45);
  border: 1.5px solid rgba(255,255,255,0.12);
}
.diff-chip.active { border-color: #f5c842; color: #f5c842; background: rgba(245,200,66,0.1); }
.sec-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,0.3); margin: 14px 0 8px; }

/* ── Standard overlays ───────────────────────────────────────────── */
.std-overlay {
  position: absolute; inset: 0; z-index: 50;
  background: rgba(15,8,30,0.93);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 26px; border-radius: 36px;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.std-overlay.show { opacity: 1; pointer-events: all; }
.ov-title { font-family: 'Lilita One', cursive; font-size: 2.4rem; color: #f5c842; text-shadow: 3px 3px 0 #c07a00; text-align: center; line-height: 1; }
.ov-sub { color: rgba(255,255,255,0.5); font-size: 0.84rem; text-align: center; }

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn-main {
  width: 100%; padding: 13px;
  background: linear-gradient(135deg,#f5c842,#e8a010);
  border: none; border-radius: 12px;
  font-family: 'Lilita One', cursive; font-size: 1.05rem;
  color: #1a0a2e; cursor: pointer; letter-spacing: 1px;
  box-shadow: 0 4px 14px rgba(200,130,0,0.35); transition: transform 0.1s, opacity 0.15s;
}
.btn-main:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-full { width: 100%; }
.btn-sec {
  flex: 1; padding: 11px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.13);
  border-radius: 11px; font-family: 'DM Sans', sans-serif; font-weight: 700;
  font-size: 0.84rem; color: #fff; cursor: pointer; transition: opacity 0.15s;
  width: 100%;
}
.btn-sec:hover { opacity: 0.8; }
.btn-back {
  background: rgba(255,255,255,0.1); border: none; border-radius: 8px;
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1rem; cursor: pointer; text-decoration: none; flex-shrink: 0;
}

/* ── Stat boxes ──────────────────────────────────────────────────── */
.stat-row { display: flex; gap: 8px; width: 100%; }
.stat-box {
  flex: 1; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px; padding: 12px 6px; text-align: center;
}
.stat-val { font-family: 'Lilita One', cursive; font-size: 1.5rem; color: #f5c842; }
.stat-val.green { color: #4ae27a; }
.stat-val.red   { color: #ff5555; }
.stat-lbl { font-size: 0.6rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.35); margin-top: 2px; }

/* ── Listen overlay ──────────────────────────────────────────────── */
.listen-overlay {
  position: absolute; inset: 0; z-index: 50;
  background: rgba(15,8,30,0.9);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 28px; border-radius: 36px;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.listen-overlay.show { opacity: 1; pointer-events: all; }
.listen-title { font-family: 'Lilita One', cursive; font-size: 1.3rem; color: #f5c842; text-align: center; text-shadow: 2px 2px 0 #c07a00; }
.listen-sub { color: rgba(255,255,255,0.48); font-size: 0.82rem; text-align: center; }
.listen-cover-wrap { width: 100%; display: flex; align-items: center; justify-content: center; }
.listen-cover-img {
  width: 150px; height: 150px; border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 2px rgba(245,200,66,0.18);
}
.waveform { display: flex; align-items: flex-end; gap: 4px; height: 52px; width: 100%; justify-content: center; }
.wv-bar { width: 8px; border-radius: 4px 4px 0 0; background: rgba(245,200,66,0.22); transition: background 0.12s; flex-shrink: 0; }
.wv-bar.active { background: #f5c842; }
.cd-bar-row { width: 100%; display: flex; align-items: center; gap: 10px; }
.btn-training {
  background: rgba(138,99,210,0.15); border: 1px solid rgba(138,99,210,0.4);
  border-radius: 999px; color: #b794f4; font-weight: 700;
  padding: 9px 20px; cursor: pointer; font-size: 0.82rem;
  width: 100%; transition: all 0.15s; font-family: 'DM Sans', sans-serif;
}
.btn-training:hover { background: rgba(138,99,210,0.28); border-color: rgba(138,99,210,0.7); }
.btn-listen-once {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 14px 20px; margin-bottom: 10px;
  background: rgba(245,200,66,0.08);
  border: 2px solid #f5c842; border-radius: 14px;
  color: #f5c842; font-size: 1rem; font-weight: 700;
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
}
.btn-listen-once:hover { background: rgba(245,200,66,0.18); transform: translateY(-1px); }
.btn-listen-once:active { transform: translateY(0); }
.btn-back-listen {
  width: 100%; padding: 11px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.13);
  border-radius: 11px; font-family: 'DM Sans', sans-serif; font-weight: 700;
  font-size: 0.88rem; color: rgba(255,255,255,0.75); cursor: pointer;
  transition: opacity 0.15s; margin-top: 4px;
}
.btn-back-listen:hover { opacity: 0.8; }
.result-cover-wrap { display: flex; justify-content: center; margin-bottom: 16px; }
.result-cover { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; box-shadow: 0 4px 18px rgba(0,0,0,0.5); }
.result-back-btn { width: 100%; margin-top: 18px; font-size: 1rem; padding: 14px; }
.cd-val { font-family: 'Lilita One', cursive; font-size: 1.5rem; color: #f5c842; min-width: 36px; text-align: right; }
.cd-bar-bg { flex: 1; height: 8px; background: rgba(255,255,255,0.1); border-radius: 999px; overflow: hidden; }
.cd-bar-fill { height: 100%; background: #f5c842; border-radius: 999px; transition: width 1s linear; }

/* ── Countdown ───────────────────────────────────────────────────── */
.countdown-overlay {
  position: absolute; inset: 0; z-index: 60;
  background: rgba(15,8,30,0.52);
  display: flex; align-items: center; justify-content: center;
  border-radius: 36px; opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.countdown-overlay.show { opacity: 1; pointer-events: all; }
.cd-num {
  font-family: 'Lilita One', cursive; font-size: 7rem; color: #f5c842; line-height: 1;
  text-shadow: 0 0 24px rgba(245,200,66,0.7), 4px 4px 0 #c07a00, 0 2px 12px rgba(0,0,0,0.9);
}

@keyframes cdpop {
  0%  { transform: scale(2.2); opacity: 0; }
  30% { transform: scale(1);   opacity: 1; }
  80% { transform: scale(1);   opacity: 1; }
  100%{ transform: scale(0.7); opacity: 0; }
}

/* ── Flashes ─────────────────────────────────────────────────────── */
.penalty-flash, .correct-flash {
  position: absolute; inset: 0; z-index: 70;
  border-radius: 36px; pointer-events: none; opacity: 0; transition: opacity 0.08s;
}
.penalty-flash { background: rgba(220,30,30,0.22); }
.correct-flash { background: rgba(30,200,80,0.15); }
.penalty-flash.show, .correct-flash.show { opacity: 1; }

/* ── Drag ghost ──────────────────────────────────────────────────── */
.drag-ghost {
  position: fixed; z-index: 9999; width: 76px; height: 76px; border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 38% 32%,#6ab0ff 0%,#2060cc 55%,#1040a0 100%);
  box-shadow: 0 8px 24px rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center; opacity: 0.88;
}

@keyframes shake { 0%,100%{transform:translateX(0);} 25%{transform:translateX(-8px);} 75%{transform:translateX(8px);} }
.seg-circle.shake { animation: shake 0.35s ease-out; }
@keyframes cpop { 0%{transform:scale(1);} 45%{transform:scale(1.18);} 100%{transform:scale(1);} }
.seg-circle.cpop { animation: cpop 0.32s ease-out; }

/* ── Menu top bar (profile + lang inside menu) ───────────────────── */
.menu-top-bar {
  width: 100%; padding: 12px 20px 0;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}

/* ── Main menu ───────────────────────────────────────────────────── */
.main-menu {
  position: absolute; inset: 0; z-index: 50;
  background: rgba(15,8,30,0.97);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  border-radius: 36px; opacity: 0; pointer-events: none; transition: opacity 0.2s; overflow: hidden;
}
.main-menu.show { opacity: 1; pointer-events: all; }
.menu-logo { font-family: 'Lilita One', cursive; font-size: 3rem; color: #f5c842; text-shadow: 4px 4px 0 #c07a00; margin: 32px 0 4px; letter-spacing: 2px; }
.menu-tagline { color: rgba(255,255,255,0.4); font-size: 0.82rem; margin-bottom: 28px; }
.menu-credits-row { display: flex; align-items: center; gap: 6px; font-family: 'Lilita One', cursive; font-size: 1.3rem; color: #f5c842; margin-bottom: 28px; }
.menu-btns { width: 100%; padding: 0 24px; display: flex; flex-direction: column; gap: 10px; }
.menu-btn {
  width: 100%; padding: 15px 20px;
  background: rgba(255,255,255,0.06); border: 1.5px solid rgba(255,255,255,0.12);
  border-radius: 14px; cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; gap: 14px; text-align: left; font-family: inherit;
  -webkit-tap-highlight-color: rgba(245,200,66,0.2); user-select: none;
}
.menu-btn:hover { background: rgba(255,255,255,0.11); border-color: rgba(245,200,66,0.35); }
.menu-btn:active { transform: scale(0.97); }
.menu-btn-icon { font-size: 1.6rem; flex-shrink: 0; }
.menu-btn-text { flex: 1; }
.menu-btn-title { font-family: 'Lilita One', cursive; font-size: 1.1rem; color: #fff; letter-spacing: 0.5px; }
.menu-btn-sub { font-size: 0.72rem; color: rgba(255,255,255,0.38); margin-top: 2px; }
.menu-btn-arrow { color: rgba(255,255,255,0.25); font-size: 1rem; }
.menu-btn.mb-sp    { border-color: rgba(74,226,122,0.3); }
.menu-btn.mb-duel  { border-color: rgba(232,64,26,0.3); }
.menu-btn.mb-chal  { border-color: rgba(78,158,255,0.3); }
.menu-btn.mb-admin { border-color: rgba(245,200,66,0.4); }
.menu-btn.mb-radio { border-color: rgba(78,200,180,0.35); }
.menu-btn.mb-radio:hover { background: rgba(78,200,180,0.08); }
.menu-btn.mb-radio .menu-btn-icon { color: #4ec8b4; }
.menu-challenges-badge { background: #e8401a; color: #fff; font-size: 0.65rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; margin-left: 6px; }

/* ── Duel ────────────────────────────────────────────────────────── */
.duel-vs-bar {
  width: 100%; background: rgba(232,64,26,0.15); border-bottom: 1px solid rgba(232,64,26,0.25);
  padding: 8px 14px; display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.duel-player { display: flex; align-items: center; gap: 7px; flex: 1; }
.duel-player.right { flex-direction: row-reverse; }
.duel-avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.85rem; flex-shrink: 0; }
.duel-avatar.me  { background: #2060cc; border: 2px solid #4e9eff; }
.duel-avatar.bot { background: #c82020; border: 2px solid #ff7070; }
.duel-pname  { font-size: 0.75rem; font-weight: 700; color: #fff; }
.duel-pscore { font-family: 'Lilita One', cursive; font-size: 1rem; color: #f5c842; }
.vs-badge { font-family: 'Lilita One', cursive; font-size: 0.9rem; color: #e8401a; background: rgba(232,64,26,0.2); padding: 2px 8px; border-radius: 6px; flex-shrink: 0; }
.round-indicator { display: flex; gap: 4px; justify-content: center; padding: 6px 0; flex-shrink: 0; }
.round-dot { width: 28px; height: 6px; border-radius: 3px; background: rgba(255,255,255,0.15); transition: background 0.3s; }
.round-dot.done-me  { background: #4e9eff; }
.round-dot.done-bot { background: #ff7070; }
.round-dot.active   { background: #f5c842; }

.duel-result-table { width: 100%; border-collapse: collapse; }
.duel-result-table th { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.35); font-weight: 700; padding: 6px 8px; text-align: center; }
.duel-result-table td { padding: 8px; text-align: center; font-size: 0.88rem; }
.duel-result-table tr { border-bottom: 1px solid rgba(255,255,255,0.06); }
.duel-result-table td:first-child { text-align: left; color: rgba(255,255,255,0.6); font-size: 0.78rem; }
.cell-win  { color: #4ae27a; font-weight: 700; }
.cell-lose { color: #ff5555; }
.cell-draw { color: #f5c842; }
.duel-winner-banner { font-family: 'Lilita One', cursive; font-size: 2rem; text-align: center; padding: 8px 0; letter-spacing: 1px; }
.duel-winner-banner.win  { color: #4ae27a; text-shadow: 0 0 20px rgba(74,226,122,0.4); }
.duel-winner-banner.lose { color: #ff5555; }
.duel-winner-banner.draw { color: #f5c842; }

.friend-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; margin-bottom: 7px; cursor: pointer; transition: all 0.15s; }
.friend-item:hover { background: rgba(255,255,255,0.1); border-color: rgba(232,64,26,0.4); }
.friend-av { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex-shrink: 0; border: 2px solid rgba(255,255,255,0.15); }
.friend-info { flex: 1; }
.friend-name { font-weight: 700; font-size: 0.9rem; color: #fff; }
.friend-stat { font-size: 0.72rem; color: rgba(255,255,255,0.38); }
.friend-challenge-btn { background: rgba(232,64,26,0.2); border: 1px solid rgba(232,64,26,0.4); border-radius: 8px; padding: 5px 10px; color: #ff7070; font-size: 0.75rem; font-weight: 700; cursor: pointer; }
.random-opponent-card { display: flex; align-items: center; gap: 12px; padding: 14px; background: linear-gradient(135deg, rgba(232,64,26,0.15), rgba(200,32,32,0.1)); border: 1.5px solid rgba(232,64,26,0.35); border-radius: 14px; margin-bottom: 14px; cursor: pointer; transition: all 0.15s; }
.random-opponent-card:active { transform: scale(0.97); }
.roc-icon { font-size: 2rem; }
.roc-info { flex: 1; }
.roc-title { font-family: 'Lilita One', cursive; font-size: 1rem; color: #ff7070; }
.roc-sub   { font-size: 0.75rem; color: rgba(255,255,255,0.4); margin-top: 2px; }
.roc-arr   { color: #ff7070; font-size: 1.1rem; }
.waiting-spinner { width: 56px; height: 56px; border-radius: 50%; border: 4px solid rgba(232,64,26,0.2); border-top-color: #e8401a; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Duel tabs ───────────────────────────────────────────────────── */
.duel-tabs {
  display: flex; gap: 0; margin: 0 14px 0;
  background: rgba(0,0,0,0.3); border-radius: 12px; padding: 3px;
  border: 1px solid rgba(255,255,255,0.07);
}
.duel-tab {
  flex: 1; padding: 8px 4px; border: none; background: transparent;
  color: rgba(255,255,255,0.45); font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem; font-weight: 700; border-radius: 9px; cursor: pointer;
  transition: all 0.18s; white-space: nowrap;
}
.duel-tab:hover  { color: rgba(255,255,255,0.75); }
.duel-tab.active { background: rgba(232,64,26,0.25); color: #ff7070; border: 1px solid rgba(232,64,26,0.35); }
.duel-tab-panel  { }
.duel-tab-hint   { font-size: 0.75rem; color: rgba(255,255,255,0.35); margin: 0 0 12px; text-align: center; }

/* ── Duel genre grid ─────────────────────────────────────────────── */
.duel-genre-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duel-genre-card {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  border-radius: 14px; border: 1.5px solid; cursor: pointer;
  transition: all 0.15s; background: rgba(0,0,0,0.2);
}
.duel-genre-card:hover  { filter: brightness(1.15); transform: scale(1.02); }
.duel-genre-card:active { transform: scale(0.97); }
.duel-genre-icon { font-size: 1.6rem; }
.duel-genre-name { font-family: 'Lilita One', cursive; font-size: 0.9rem; }
.duel-genre-sub  { font-size: 0.65rem; color: rgba(255,255,255,0.4); margin-top:1px; }

/* ── Genre chips (community/friends filter) ──────────────────────── */
.duel-genre-chips {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px;
}
.duel-genre-chip {
  display: flex; align-items: center; gap: 5px; padding: 5px 11px;
  border-radius: 999px; border: 1.5px solid; font-size: 0.75rem; font-weight: 700;
  cursor: pointer; transition: all 0.14s; background: transparent;
  font-family: 'DM Sans', sans-serif;
}
.duel-genre-chip:hover  { filter: brightness(1.2); }
.duel-genre-chip.active { color: #0f0a1e !important; }
.duel-pick-hint {
  text-align: center; color: rgba(255,255,255,0.28); font-size: 0.8rem;
  padding: 22px 0; letter-spacing: 0.3px;
}

/* ── Community tiers ─────────────────────────────────────────────── */
.community-tier {
  background: rgba(0,0,0,0.2); border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08); margin-bottom: 10px; overflow: hidden;
}
.tier-hdr {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  cursor: pointer; transition: background 0.15s;
}
.tier-hdr:hover { background: rgba(255,255,255,0.04); }
.tier-badge {
  font-family: 'Lilita One', cursive; font-size: 0.8rem; padding: 4px 10px;
  border-radius: 999px; flex-shrink: 0; border: 1px solid;
}
.tier-elite   { background: rgba(245,200,66,0.15);  color: #f5c842;  border-color: rgba(245,200,66,0.4); }
.tier-grinder { background: rgba(74,158,255,0.15);  color: #4e9eff;  border-color: rgba(74,158,255,0.4); }
.tier-casual  { background: rgba(74,226,122,0.15);  color: #4ae27a;  border-color: rgba(74,226,122,0.4); }
.tier-hdr-info { flex: 1; }
.tier-hdr-name { font-weight: 700; font-size: 0.88rem; color: #fff; }
.tier-hdr-sub  { font-size: 0.7rem; color: rgba(255,255,255,0.38); margin-top: 2px; }
.tier-chevron  { color: rgba(255,255,255,0.35); font-size: 1.1rem; transition: transform 0.2s; }
.tier-chevron.open { transform: rotate(90deg); }
.tier-list { display: none; padding: 0 10px 10px; }
.tier-list.open { display: block; }
.tier-player {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 10px; cursor: pointer; transition: background 0.12s;
  border: 1px solid transparent; margin-bottom: 4px;
}
.tier-player:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.1); }
.tier-player:active { transform: scale(0.98); }
.tier-player-av {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
  background: rgba(255,255,255,0.07); border: 1.5px solid rgba(255,255,255,0.15);
}
.tier-player-info { flex: 1; }
.tier-player-name { font-weight: 700; font-size: 0.88rem; color: #fff; }
.tier-player-stat { font-size: 0.68rem; color: rgba(255,255,255,0.38); margin-top: 1px; }
.tier-player-btn  {
  background: rgba(232,64,26,0.18); border: 1px solid rgba(232,64,26,0.35);
  border-radius: 8px; padding: 5px 11px; color: #ff7070;
  font-size: 0.72rem; font-weight: 700; cursor: pointer; flex-shrink: 0;
  transition: background 0.12s;
}
.tier-player-btn:hover { background: rgba(232,64,26,0.35); }

/* ── Unlock modal ────────────────────────────────────────────────── */
.unlock-modal {
  position: absolute; inset: 0; z-index: 80;
  background: rgba(15,8,30,0.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 32px; border-radius: 36px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.unlock-modal.show { opacity: 1; pointer-events: all; }
.unlock-icon  { font-size: 3rem; }
.unlock-title { font-family: 'Lilita One', cursive; font-size: 1.4rem; color: #f5c842; text-align: center; }
.unlock-sub   { color: rgba(255,255,255,0.5); font-size: 0.85rem; text-align: center; line-height: 1.5; }
.unlock-cost  { font-family: 'Lilita One', cursive; font-size: 2rem; color: #f5c842; }

/* ── Abandon popup ───────────────────────────────────────────────── */
.abandon-popup {
  position: absolute; inset: 0; z-index: 150; background: rgba(15,8,30,0.96);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 32px; border-radius: 36px;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.abandon-popup.show { opacity: 1; pointer-events: all; }
.abandon-song-info { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.abandon-cover { width: 80px; height: 80px; border-radius: 12px; object-fit: cover; box-shadow: 0 4px 14px rgba(0,0,0,0.5); }
.abandon-song-title { font-size: 0.88rem; color: rgba(255,255,255,0.6); text-align: center; max-width: 220px; line-height: 1.3; }

/* ── Toast ───────────────────────────────────────────────────────── */
.toast {
  position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: rgba(30,20,50,0.95); border: 1px solid rgba(255,255,255,0.15);
  color: #fff; font-size: 0.78rem; font-weight: 600;
  padding: 8px 16px; border-radius: 999px; white-space: nowrap;
  z-index: 200; pointer-events: none;
  opacity: 0; transition: opacity 0.2s;
  max-width: 90%;
}
.toast.show { opacity: 1; }

/* ── Lives ───────────────────────────────────────────────────────── */
.life-heart { font-size: 0.85rem; transition: color 0.3s; }
.life-heart.full  { color: #e8401a; }
.life-heart.empty { color: rgba(255,255,255,0.15); }

/* ── Profile icon ────────────────────────────────────────────────── */
.profile-icon-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: #e8401a; border: 2px solid #f5c842;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; flex-shrink: 0;
}
.profile-icon-letter {
  font-family: 'Lilita One', cursive; font-size: 0.8rem;
  color: #fff; line-height: 1;
}

/* ── Language switcher ───────────────────────────────────────────── */
.lang-switcher { display: flex; align-items: center; gap: 4px; }
.lang-btn {
  display: flex; align-items: center; gap: 3px;
  padding: 2px 6px; border-radius: 6px;
  color: rgba(255,255,255,0.5); font-size: 0.7rem; font-weight: 700;
  text-decoration: none; transition: all 0.15s;
  border: 1px solid transparent;
}
.lang-btn img { width: 16px; height: 12px; border-radius: 2px; }
.lang-btn:hover { color: #f5c842; border-color: rgba(245,200,66,0.3); }
.lang-btn.active { color: #f5c842; border-color: rgba(245,200,66,0.4); background: rgba(245,200,66,0.08); }
.topbar-lang .lang-btn { padding: 2px 4px; }
.topbar-lang .lang-btn span { display: none; }

/* ── Login page ──────────────────────────────────────────────────── */
.login-wrapper {
  width: 100%; max-width: 400px; padding: 0 20px;
  display: flex; flex-direction: column; align-items: center;
}
.login-logo { text-align: center; margin-bottom: 24px; margin-top: 20px; }
.login-logo-text {
  font-family: 'Lilita One', cursive; font-size: 2.8rem;
  color: #f5c842; text-shadow: 3px 3px 0 #c07a00; letter-spacing: 2px;
}
.login-logo-sub { color: rgba(255,255,255,0.4); font-size: 0.82rem; margin-top: 4px; }
.login-lang { margin-bottom: 16px; }
.login-card {
  width: 100%; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px; padding: 24px; overflow: hidden;
}
.login-tabs { display: flex; gap: 0; margin-bottom: 20px; border-radius: 10px; overflow: hidden; border: 1px solid rgba(255,255,255,0.1); }
.login-tab {
  flex: 1; padding: 10px; background: rgba(255,255,255,0.04);
  border: none; color: rgba(255,255,255,0.4); font-family: 'DM Sans', sans-serif;
  font-weight: 700; font-size: 0.88rem; cursor: pointer; transition: all 0.15s;
}
.login-tab.active { background: rgba(245,200,66,0.12); color: #f5c842; }
.auth-form { display: none; flex-direction: column; gap: 14px; }
.auth-form.show { display: flex; }
.form-group { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.form-row { display: flex; gap: 10px; }
.form-label { font-size: 0.78rem; font-weight: 600; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 0.5px; }
.form-input {
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px; padding: 10px 14px;
  color: #fff; font-family: 'DM Sans', sans-serif; font-size: 0.9rem;
  transition: border-color 0.15s; width: 100%;
}
.form-input:focus { outline: none; border-color: rgba(245,200,66,0.5); }
.form-input:disabled { opacity: 0.5; cursor: not-allowed; }
.form-hint { font-size: 0.7rem; color: rgba(255,255,255,0.3); margin-top: 2px; }
.form-switch { text-align: center; font-size: 0.78rem; color: rgba(255,255,255,0.4); margin-top: 4px; }
.form-switch a { color: #f5c842; text-decoration: none; }
.form-alert { padding: 10px 14px; border-radius: 10px; font-size: 0.82rem; font-weight: 600; margin-bottom: 4px; }
.form-alert-error   { background: rgba(232,64,26,0.15); border: 1px solid rgba(232,64,26,0.3); color: #ff7070; }
.form-alert-success { background: rgba(74,226,122,0.1);  border: 1px solid rgba(74,226,122,0.3); color: #4ae27a; }

/* ── Profile page ────────────────────────────────────────────────── */
.profile-wrapper { gap: 0; }
.profile-header { width: 100%; display: flex; align-items: center; gap: 12px; padding: 16px 0 8px; }
.profile-title { font-size: 1.4rem; flex: 1; text-align: center; }
.profile-avatar-wrap { text-align: center; padding: 20px 0 16px; }
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(135deg, #e8401a, #c07a00);
  border: 3px solid #f5c842;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Lilita One', cursive; font-size: 2rem; color: #fff;
  margin: 0 auto 8px;
}
.profile-username { color: rgba(255,255,255,0.6); font-size: 0.85rem; font-weight: 600; }
.profile-role {
  display: inline-block; margin-top: 6px;
  padding: 2px 12px; border-radius: 999px; font-size: 0.7rem; font-weight: 700;
}
.role-admin    { background: rgba(232,64,26,0.2); color: #ff7070; border: 1px solid rgba(232,64,26,0.4); }
.role-producer { background: rgba(78,158,255,0.2); color: #4e9eff; border: 1px solid rgba(78,158,255,0.4); }
.role-user     { background: rgba(74,226,122,0.1); color: #4ae27a; border: 1px solid rgba(74,226,122,0.3); }
.card-section-title { font-family: 'Lilita One', cursive; font-size: 1.1rem; color: #f5c842; margin-bottom: 16px; }

/* ── Admin panel ─────────────────────────────────────────────────── */
.admin-wrapper { width: 100%; max-width: 1400px; padding: 20px; min-height: 100vh; margin: 0 auto; }
.admin-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.admin-title { font-family: 'Lilita One', cursive; font-size: 1.3rem; color: #f5c842; flex: 1; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; color: #fff; font-size: 0.85rem; }
.admin-table th { text-align: left; padding: 8px 10px; color: rgba(255,255,255,0.4); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.admin-table td { padding: 10px 10px; border-bottom: 1px solid rgba(255,255,255,0.05); color: rgba(255,255,255,0.8); vertical-align: middle; }
.admin-table tr:hover td { background: rgba(255,255,255,0.03); }
.genre-badge { background: rgba(245,200,66,0.1); border: 1px solid rgba(245,200,66,0.25); color: #f5c842; padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
.toggle-btn { background: none; border: none; cursor: pointer; font-size: 1rem; padding: 2px 6px; border-radius: 6px; color: rgba(255,255,255,0.75); }
.toggle-btn:hover { background: rgba(255,255,255,0.1); color: #fff; }
.toggle-btn.active { color: #4ae27a; }
.preview-btn { color: rgba(255,255,255,0.6); font-size: 0.85rem; }
.preview-btn.active { color: #4ae27a; }
.delete-btn { background: rgba(232,64,26,0.15); border: 1px solid rgba(232,64,26,0.3); border-radius: 8px; padding: 4px 8px; cursor: pointer; font-size: 0.9rem; }
.delete-btn:hover { background: rgba(232,64,26,0.3); }

/* ── Resume overlay (phone call / app switch) ────────────────────── */
.resume-overlay {
  display: none;
  position: absolute; inset: 0; z-index: 9999;
  background: rgba(0,0,0,0.85);
  align-items: center; justify-content: center; flex-direction: column; gap: 12px;
  cursor: pointer;
}
.resume-overlay.show { display: flex; }

/* ── Tutorial ────────────────────────────────────────────────────── */
.tut-overlay {
  background: rgba(0,0,0,0.88);
  display: none;
  align-items: flex-end;
  padding-bottom: 24px;
  z-index: 10000;
}
.tut-overlay.show { display: flex; }
.tut-card {
  background: #12122a;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px;
  margin: 0 14px;
  padding: 22px 18px 18px;
  width: calc(100% - 28px);
  box-sizing: border-box;
}
.tut-illus {
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
.tut-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #fff;
  text-align: center;
  margin-bottom: 8px;
}
.tut-body {
  font-size: 0.84rem;
  color: rgba(255,255,255,0.72);
  line-height: 1.55;
  text-align: center;
  margin-bottom: 14px;
}
.tut-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-bottom: 16px;
}
.tut-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  transition: background 0.25s, transform 0.25s;
}
.tut-dot.active { background: #4ae27a; transform: scale(1.3); }
.tut-btns { display: flex; gap: 10px; }
.tut-skip {
  flex: 1; padding: 11px 0;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 12px;
  color: rgba(255,255,255,0.38);
  font-size: 0.82rem;
  cursor: pointer;
}
.tut-next {
  flex: 2; padding: 11px 0;
  background: linear-gradient(135deg, #4ae27a, #22b455);
  border: none;
  border-radius: 12px;
  color: #000;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.02em;
}
/* Tutorial illustrations */
.tut-circle {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(26,74,255,0.35), #4e9eff);
  border: 2px solid #4e9eff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 800; color: #fff;
}
.tut-circle.green {
  background: linear-gradient(135deg, rgba(26,74,42,0.5), #4ae27a);
  border-color: #4ae27a;
}
.tut-circle.pulse { animation: tutPulse 1.3s ease-in-out infinite; }
@keyframes tutPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(78,158,255,0.5); }
  50%      { box-shadow: 0 0 0 14px rgba(78,158,255,0); }
}
.tut-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 26px);
  grid-template-rows: repeat(3, 26px);
  gap: 4px;
}
.tut-mc {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, rgba(26,74,255,0.35), #4e9eff);
  border: 1.5px solid #4e9eff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 800; color: #fff;
  position: relative;
}
.tut-mc-center {
  background: rgba(15,8,30,0.85);
  border: 1.5px solid rgba(255,255,255,0.12);
}
.tut-mc-drag {
  background: linear-gradient(135deg, rgba(245,200,66,0.45), #f5c842);
  border-color: #f5c842; color: #1a0a2e;
  z-index: 5; position: relative;
  animation: tutGridDrag 2.8s ease-in-out infinite;
}
.tut-mc-target {
  border: 1.5px dashed rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.04);
  animation: tutGridTarget 2.8s ease-in-out infinite;
}
@keyframes tutGridDrag {
  0%   { transform: translate(0,0)          scale(1);    opacity:1; }
  8%   { transform: translate(0,0)          scale(1.18); opacity:1; }
  42%  { transform: translate(-60px, 60px)  scale(1.18); opacity:1; }
  52%  { transform: translate(-60px, 60px)  scale(1);    opacity:1; }
  62%  { transform: translate(-60px, 60px)  scale(1);    opacity:0; }
  63%  { transform: translate(0,0)          scale(1);    opacity:0; }
  78%  { transform: translate(0,0)          scale(1);    opacity:1; }
  100% { transform: translate(0,0)          scale(1);    opacity:1; }
}
@keyframes tutGridTarget {
  0%,100%   { border-color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.04); }
  42%, 52%  { border-color: #f5c842; background: rgba(245,200,66,0.15); }
  62%       { border-color: rgba(255,255,255,0.35); background: rgba(255,255,255,0.04); }
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 400px) {
  .phone { width: 100vw; border-radius: 0; min-height: 100dvh; }
  body { background: #1a0a2e; }
}
@media (max-width: 480px) {
  .login-wrapper, .admin-wrapper { padding: 0 12px; }
  .form-row { flex-direction: column; }
  .login-card { padding: 18px; }
}
