/* TimeDrop v3 — delat tema (guld/mörkt) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d0d0f;
  --surface: #16161a;
  --surface2: #1e1e24;
  --border: rgba(255,255,255,0.07);
  --primary: #c9a84c;
  --primary-dim: rgba(201,168,76,0.15);
  --primary-glow: rgba(201,168,76,0.4);
  --text: #f0efe8;
  --muted: #6b6a72;
  --success: #4ade80;
  --danger: #f87171;
  --warning: #fbbf24;
  --font-display: 'Bebas Neue', sans-serif;
  --font-body: 'DM Sans', sans-serif;
}

body { font-family: var(--font-body); background: var(--bg); color: var(--text); }

.hidden { display: none !important; }

/* Knappar */
.btn {
  width: 100%; padding: 12px; border: none; border-radius: 9px;
  font-family: var(--font-body); font-size: 0.9rem; font-weight: 700;
  cursor: pointer; transition: all 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn-gold { background: var(--primary); color: #000; }
.btn-gold:hover { background: #dbb84f; }
.btn-gold:disabled { background: var(--surface2); color: var(--muted); cursor: not-allowed; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--muted); }
.btn-outline:hover { border-color: var(--warning); color: var(--warning); }
.btn-outline:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-danger { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3); color: var(--danger); }
.btn-danger:hover { background: rgba(248,113,113,0.2); }

/* Poängtabell */
.score-table { display: flex; flex-direction: column; gap: 5px; }
.score-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 9px; font-size: 0.88rem;
}
.score-row .rank { font-family: var(--font-display); font-size: 1.1rem; color: var(--muted); width: 22px; }
.score-row:first-child .rank { color: var(--primary); }
.score-row .rname { flex: 1; font-weight: 600; }
.score-row .rpts { font-family: var(--font-display); font-size: 1.2rem; color: var(--primary); }
.score-row.me { border-color: rgba(201,168,76,0.35); background: var(--primary-dim); }

/* Media (master) */
.media-wrap { margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.media-audio { width: 100%; max-width: 420px; border-radius: 8px; }
/* YouTube: stor yta; spelaren är förstorad och centrerad i wrappern så att
   YouTubes titelöverlägg (topp) och kontroller (botten) hamnar utanför synfältet. */
.media-youtube-wrap { width: 100%; max-width: 1000px; aspect-ratio: 16/9; overflow: hidden; border-radius: 10px; position: relative; background: #000; }
.media-youtube-wrap .media-youtube { position: absolute; top: -14%; left: 0; width: 100%; height: 128%; border: 0; }
.media-image { max-height: 220px; max-width: 100%; border-radius: 8px; object-fit: contain; }
.media-artwork { width: 140px; height: 140px; border-radius: 10px; box-shadow: 0 4px 24px rgba(0,0,0,0.5); }
.media-titlecard {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 12px;
  padding: 24px 32px; text-align: center; width: 100%; max-width: 420px;
}
.media-titlecard-title { font-family: var(--font-display); font-size: 1.8rem; letter-spacing: 1px; }
.media-titlecard-sub { color: var(--muted); margin-top: 4px; }
.media-titlecard-note { color: var(--muted); font-size: 0.78rem; margin-top: 10px; font-style: italic; }

/* Overlay (t.ex. "spelledaren tappade anslutningen") */
.overlay {
  position: fixed; inset: 0; background: rgba(13,13,15,0.92); z-index: 1000;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; padding: 30px;
}
.overlay .ov-title { font-family: var(--font-display); font-size: 1.8rem; letter-spacing: 2px; color: var(--warning); }
.overlay .ov-sub { color: var(--muted); font-size: 0.9rem; }

/* Animationer */
@keyframes pop-in { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes slide-up { from { transform: translateY(10px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes glow-pulse {
  0%,100% { text-shadow: 0 0 40px var(--primary-glow); }
  50% { text-shadow: 0 0 90px var(--primary-glow), 0 0 140px rgba(201,168,76,0.2); }
}
@keyframes pulse-ring {
  0%,100% { transform: scale(1); opacity: 0.4; }
  50% { transform: scale(1.15); opacity: 0.8; }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-8px); }
  40%,80% { transform: translateX(8px); }
}
.shake { animation: shake 0.4s ease; }
