/* Arcade Express — New Year's Eve theme (public/js/themes/nouvel-an.js; theme.js sets <html data-theme="nouvel-an">).
   Gold and champagne, with magenta and cyan sparks, on a midnight sky. Recolours the site (home, lobby, HUD, panels,
   results) and styles the decorations; the games keep the neon palette (.game-host, style.css). */

:root[data-theme="nouvel-an"] {
  --bg: #05060f;
  --bg-2: #0b0c1e;
  --surface: rgba(24, 22, 48, 0.76);
  --surface-solid: #1a1834;
  --surface-2: rgba(255, 245, 220, 0.05);
  --input-bg: #0a0a1a;
  --border: rgba(255, 220, 140, 0.16);
  --border-strong: rgba(255, 210, 63, 0.38);
  --grid: rgba(255, 210, 120, 0.06);

  --text: #fbf6ea;
  --muted: #bdb3a0;
  --faint: #a09684;   /* ≥ 4.5:1 (WCAG AA) on --bg, cards and overlays */

  --accent: #ffd23f;      /* gold */
  --accent-2: #ff3bd4;    /* magenta */
  --accent-3: #00e5ff;    /* cyan */
  --success: #3dff9a;
  --danger: #ff4d6d;
  --warning: #ffb84d;

  --accent-soft: rgba(255, 210, 63, 0.12);
  --magenta-soft: rgba(255, 59, 212, 0.14);
  --accent-end: #ff9d2e;
  --on-accent: #241600;
  --glow-mid: #b44dff;

  --party-font: 'Monoton', var(--font-display);
}

:root[data-theme="nouvel-an"] body {
  background:
    radial-gradient(1100px 620px at 8% -12%, rgba(120, 60, 255, 0.24), transparent 60%),
    radial-gradient(900px 560px at 108% 8%, rgba(255, 59, 212, 0.12), transparent 60%),
    radial-gradient(900px 600px at 50% 120%, rgba(255, 210, 63, 0.10), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* ---------- Site components (never used inside the games) ---------- */

:root[data-theme="nouvel-an"] .title-display {
  font-family: var(--party-font);
  font-weight: 400;
  font-size: clamp(36px, 8.4vw, 76px);
  letter-spacing: .04em;
  background: linear-gradient(180deg, #fff8dc 10%, var(--accent) 50%, #ff9d2e 85%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 18px rgba(255, 210, 63, .5));
}
:root[data-theme="nouvel-an"] .logo-badge {
  background: linear-gradient(135deg, #2a1a5e, #5b2aa8 55%, var(--accent-2));
  box-shadow: 0 14px 40px -12px var(--accent), 0 0 0 1px rgba(255, 210, 63, .35) inset;
  font-size: 48px;
}

:root[data-theme="nouvel-an"] .room-code { text-shadow: 0 0 22px rgba(255, 59, 212, .45); }

:root[data-theme="nouvel-an"] .player-row.me,
:root[data-theme="nouvel-an"] .score-row.me,
:root[data-theme="nouvel-an"] .final-ranking li.me { box-shadow: inset 0 0 0 1px rgba(255, 210, 63, .45); }
:root[data-theme="nouvel-an"] .game-card.selected {
  background: linear-gradient(160deg, rgba(255, 210, 63, .16), rgba(255, 59, 212, .12));
}
:root[data-theme="nouvel-an"] .toggle.on .toggle-track { box-shadow: 0 0 14px rgba(255, 210, 63, .55); }
:root[data-theme="nouvel-an"] .preset-btn.on { box-shadow: 0 0 14px rgba(255, 210, 63, .5); }
:root[data-theme="nouvel-an"] .chat-msg.mine .chat-text { color: #fff0c2; }

:root[data-theme="nouvel-an"] .hud { background: rgba(12, 10, 28, .88); }
:root[data-theme="nouvel-an"] .hud-timer { text-shadow: 0 0 18px rgba(255, 210, 63, .55); }
/* The game board itself: the neon look of style.css, made opaque so the decorations stay out of it. */
:root[data-theme="nouvel-an"] .stage {
  background: radial-gradient(ellipse at 50% 30%, rgba(60, 80, 200, .18), transparent 70%), #050818;
}

:root[data-theme="nouvel-an"] .overlay-card,
:root[data-theme="nouvel-an"] .countdown-card { background: rgba(22, 18, 44, .93); }
:root[data-theme="nouvel-an"] .overlay-card,
:root[data-theme="nouvel-an"] .confirm-card { box-shadow: var(--shadow), 0 0 60px -18px rgba(255, 210, 63, .5); }
:root[data-theme="nouvel-an"] .overlay-roundEnd { background: rgba(5, 6, 15, .86); }
:root[data-theme="nouvel-an"] .overlay-matchEnd { background: rgba(5, 6, 15, .95); }
:root[data-theme="nouvel-an"] .confirm-dialog::backdrop { background: rgba(5, 6, 15, .8); }
:root[data-theme="nouvel-an"] .countdown-number {
  text-shadow: 0 0 30px rgba(255, 210, 63, .6), 0 0 80px rgba(255, 59, 212, .4);
}
:root[data-theme="nouvel-an"] .overlay-matchEnd .overlay-title {
  font-family: var(--party-font);
  font-weight: 400;
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: .05em;
  color: var(--accent);
  text-shadow: 0 0 20px rgba(255, 210, 63, .5);
}

/* A party hat on each podium step. */
:root[data-theme="nouvel-an"] .podium-deco { top: -22px; }

/* ---------- Decorations (theme.js layers) ---------- */

.ny-stars i {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, .8);
  animation: ny-twinkle 4s ease-in-out var(--delay) infinite;
}

/* The city along the bottom edge: dark buildings with lit windows, rows starting from the roof (content box under
   the padding) and only whole windows across. */
.ny-city i {
  position: absolute;
  bottom: 0;
  left: var(--left);
  width: var(--w);
  height: var(--h);
  padding: 3px 3px 0;
  border-radius: 3px 3px 0 0;
  background:
    radial-gradient(circle, rgba(255, 210, 120, .55) 1.2px, transparent 1.8px) 0 0 / 11px 13px space repeat content-box,
    #0d0e22;
  box-shadow: 0 -1px 0 rgba(255, 210, 63, .14);
  opacity: .75;
}
.ny-city i:nth-child(3n) { background-size: 9px 15px, auto; }
.ny-city i:nth-child(4n + 1) { background-image: radial-gradient(circle, rgba(140, 220, 255, .45) 1.2px, transparent 1.8px); }

.ny-streamer { position: absolute; top: 0; font-size: clamp(70px, 8.5vw, 116px); line-height: 0; opacity: .6; }
.ny-streamer-left { left: 0; }
.ny-streamer-right { right: 0; transform: scaleX(-1); }

/* A disco ball swinging on its cord, right of the middle: clear of the title and of the room code. */
.ny-disco {
  position: absolute;
  top: 0;
  left: 63vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 46px;
  transform-origin: 50% 0;
  animation: ny-sway 6s ease-in-out infinite;
}
.ny-cord { width: 1px; height: min(8vh, 64px); margin-bottom: -.25em; background: rgba(220, 225, 255, .6); }
.ny-disco .icon { animation: ny-glint 2.2s steps(1) infinite; }

/* A rocket rises from the city to (--x, --y), then bursts into sparks of the colour --c. */
.ny-firework {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 0;
  height: 0;
  animation: ny-life 3s linear both;
}
.ny-rocket {
  position: absolute;
  left: -1.5px;
  top: 0;
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(var(--c), transparent);
  box-shadow: 0 0 8px var(--c);
  animation: ny-rise .9s cubic-bezier(.2, .7, .4, 1) both;
}
.ny-sparks i {
  position: absolute;
  left: -2px;
  top: -2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 8px 1px var(--c);
  opacity: 0;
  animation: ny-spark 1.7s cubic-bezier(.15, .7, .35, 1) .85s both;
}

/* The new year crossing the sky in neon, sparkles trailing behind. */
.ny-year { white-space: nowrap; opacity: .8; }
.ny-year-text {
  display: block;
  font-family: var(--party-font);
  letter-spacing: .06em;
  line-height: 1;
  background: linear-gradient(180deg, #fff8dc 10%, #ffd23f 50%, #ff9d2e 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 10px rgba(255, 210, 63, .8)) drop-shadow(0 0 28px rgba(255, 59, 212, .5));
  animation: ny-bob 1.8s ease-in-out infinite;
}
.ny-year-text::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 100%;
  width: 1.6em;
  height: .5em;
  margin-top: -.25em;
  background: radial-gradient(circle, #ffd23f 1.5px, transparent 2px) 0 0 / 14px 9px,
    radial-gradient(circle, #ff3bd4 1.2px, transparent 1.8px) 6px 4px / 16px 11px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000);
  mask-image: linear-gradient(90deg, transparent, #000);
  animation: ny-twinkle .6s steps(2) infinite;
}
.ny-year.rtl .ny-year-text::after { right: auto; left: 100%; transform: scaleX(-1); }

/* Game view: streamers only over the HUD corners, no disco ball coming down over the game. */
body:has(.game-view) .ny-streamer { font-size: clamp(60px, 6vw, 92px); opacity: .5; }
body:has(.game-view) .ny-disco { display: none; }
@media (max-width: 760px) {
  .ny-streamer { font-size: 84px; }
  .ny-disco { display: none; }
}

/* Fireworks, sparkles and champagne popping through the final results (theme.js, resultsBurst). */
:root[data-theme="nouvel-an"] .theme-burst-item {
  top: var(--y);
  animation: ny-pop 2.6s ease-out var(--delay) forwards;
}

@keyframes ny-twinkle { 50% { opacity: .25; } }
@keyframes ny-bob { 50% { transform: translateY(-8px) rotate(-2deg); } }
@keyframes ny-sway {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}
@keyframes ny-glint {
  0%, 100% { filter: brightness(1); }
  30% { filter: brightness(1.5) drop-shadow(0 0 6px #fff); }
  60% { filter: brightness(1.15); }
}
@keyframes ny-life { to { opacity: 1; } }
@keyframes ny-rise {
  0% { transform: translateY(calc(100vh - var(--y))); opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(0); opacity: 0; }
}
@keyframes ny-spark {
  0% { transform: rotate(var(--a)) translateY(0) scale(1.2); opacity: 0; }
  4% { opacity: 1; }
  70% { opacity: .9; }
  100% { transform: rotate(var(--a)) translateY(calc(-1 * var(--r) * var(--k))) translateY(14px) scale(.4); opacity: 0; }
}
@keyframes ny-pop {
  0% { transform: scale(.1) rotate(-30deg); opacity: 0; }
  20% { transform: scale(1.15) rotate(0deg); opacity: 1; }
  70% { opacity: .9; }
  100% { transform: translate(var(--sway), 40px) scale(1) rotate(10deg); opacity: 0; }
}
