/* Font & base */
:root {
  --bg-start: #7a0f1f; /* deep christmas red */
  --bg-end: #0c3b2e;   /* deep pine green */
  --accent: #ffd54f;   /* warm gold */
  --text: #f8fafb;
  --muted: #cfe3db;
  --card: rgba(255, 255, 255, 0.10);
  --card-border: rgba(255, 255, 255, 0.25);
  /* Setează aici logo-ul ca background (poți schimba calea imaginei) */
  --bg-image: url('assets/image.png');
}

* { box-sizing: border-box; }
html, body { height: 100%; overscroll-behavior: none; }
html {
  /* background handled by backgr/animation.css */
}
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--text);
  /* background handled by backgr/animation.css */
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main { flex: 1; }

/* Dynamic viewport height for mobile browsers (fix white gaps top/bottom) */
@supports (height: 100dvh) { body { min-height: 100dvh; } }
@supports (height: 100svh) { body { min-height: 100svh; } }

/* Mobile Safari/Chrome: avoid fixed background rendering issues */
@media (max-width: 680px) {
  html { background-attachment: scroll; }
}

/* Snow overlay (canvas-based) */
.snow-overlay { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.snow-canvas { width: 100%; height: 100%; display: block; }

/* Header */
.site-header {
  padding: 24px 24px 8px;
  text-align: center;
  position: relative;
  z-index: 1;
}
.garland { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 8px 16px; pointer-events: none; }
.garland::before { content:""; position:absolute; left:0; right:0; top:6px; height:2px; background: rgba(255,255,255,0.35); filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25)); border-radius: 2px; }
.garland span { width: 10px; height: 14px; border-radius: 6px 6px 10px 10px; display: inline-block; will-change: transform, opacity; }
.garland span.gold { background:#ffd54f; box-shadow:0 2px 6px rgba(255,213,79,0.8); }
.garland span.red { background:#ff6b6b; box-shadow:0 2px 6px rgba(255,107,107,0.8); }
.garland span.green { background:#7cf37c; box-shadow:0 2px 6px rgba(124,243,124,0.8); }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.garland span { animation: twinkle 2.6s ease-in-out infinite; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand h1 {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.santa { font-size: 44px; filter: drop-shadow(0 3px 6px rgba(0,0,0,0.35)); }
.tagline { margin: 6px 0 0; color: var(--muted); }

/* Container */
.container { max-width: 980px; margin: 12px auto; padding: 0 16px; position: relative; z-index: 1; }
.player-wrap { position: relative; }
.card-snow { position: absolute; left: 50%; transform: translateX(-50%); bottom: -26px; width: 76%; height: 56px; background: radial-gradient(120% 120% at 50% 0%, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.75) 60%, rgba(255,255,255,0.0) 100%); filter: drop-shadow(0 6px 16px rgba(255,255,255,0.45)); border-radius: 40px; }
.card-tree { position: absolute; right: 6%; bottom: -6px; width: 90px; height: 120px; }
.card-tree .t1, .card-tree .t2, .card-tree .t3 { position: absolute; left: 50%; transform: translateX(-50%); border-left: 40px solid transparent; border-right: 40px solid transparent; border-bottom: 40px solid #144833; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4)); }
.card-tree .t1 { top: 0; border-bottom-color: #1a5a41; }
.card-tree .t2 { top: 28px; }
.card-tree .t3 { top: 56px; }
.card-tree .trunk { position: absolute; left: 50%; transform: translateX(-50%); top: 92px; width: 16px; height: 26px; background: #7a4b2a; border-radius: 4px; }

/* Player Card */
.player-card {
  backdrop-filter: blur(8px);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.35);
}
.embed-player { margin-top: 14px; }

/* Android fallback (native play) */
.controls { display: flex; align-items: center; gap: 16px; margin-top: 12px; }

.card-header { display: flex; align-items: center; justify-content: space-between; }
.card-header h2 { margin: 0; font-weight: 700; }
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.30);
}
.live-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #aaa; }
.live-pill.live::before { background: #32cd32; }

.controls { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.btn {
  appearance: none; border: none; cursor: pointer;
  padding: 12px 16px; border-radius: 12px; font-weight: 600;
}
.btn.primary { background: var(--accent); color: #3b2c00; }
.btn.primary { background: linear-gradient(180deg, #ffe27a, #ffcc3f); box-shadow: 0 6px 18px rgba(255,204,63,0.35), inset 0 -2px 0 rgba(150,110,0,0.35); position: relative; overflow: hidden; }
.btn.primary::after { content:''; position:absolute; top:0; left:-60%; width:40%; height:100%; background: linear-gradient(90deg, rgba(255,255,255,0.0), rgba(255,255,255,0.55), rgba(255,255,255,0.0)); transform: skewX(-20deg); }
.btn.primary:hover::after { animation: shine 0.8s ease; }
@keyframes shine { 0% { left:-60%; } 100% { left:120%; } }
.btn.primary:hover { box-shadow: 0 8px 22px rgba(255,204,63,0.45), inset 0 -2px 0 rgba(150,110,0,0.35); }
.btn.primary:hover { filter: brightness(1.08); }

.volume { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); }

.status-row { margin-top: 10px; color: var(--muted); }
.now-playing { margin-top: 6px; display: flex; gap: 6px; align-items: baseline; color: var(--text); }
.now-playing .np-label { opacity: 0.9; font-weight: 600; }
.now-playing .np-title { font-weight: 800; }

.debug { margin-top: 12px; }
.debug select {
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.15);
  color: var(--text);
}

/* Countdown */
.countdown { margin-top: 26px; text-align: center; }
.count-box { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: end; }
.count-box .unit { background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; padding: 12px; }
.count-box .unit span { display: block; font-size: 36px; font-weight: 800; color: var(--accent); text-shadow: 0 2px 10px rgba(255,213,79,0.25); }
.count-box .unit label { display: block; margin-top: 6px; color: var(--muted); font-weight: 600; }
.count-sub { margin-top: 10px; color: var(--muted); }

@media (max-width: 860px) {
  .count-box { grid-template-columns: repeat(2, 1fr); }
}

/* Countdown Hero (glass card, large digits) */
.countdown-hero { margin: 28px auto 10px; max-width: 1100px; padding: 0 16px; display: flex; justify-content: center; }
.countdown-card {
  position: relative; width: 100%;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(14px);
  border-radius: 22px; padding: 26px 30px;
  box-shadow: 0 24px 50px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.18);
}
.countdown-card::after { content:""; position:absolute; inset:0; border-radius:inherit; pointer-events:none; box-shadow: 0 0 60px 10px rgba(255, 215, 90, 0.12); }
.count-title { display:flex; align-items:center; gap:10px; margin-bottom: 10px; }
.count-title .tree { font-size: 20px; }
.count-title h2 { margin:0; font-size: 18px; font-weight: 600; opacity: 0.95; }
.count-grid { display: grid; grid-auto-flow: column; grid-auto-columns: max-content; align-items: end; gap: 18px; }
.count-grid .unit { min-width: 160px; display:grid; grid-template-rows:auto auto; justify-items:center; }
.count-grid .num { font-size: 88px; line-height: 0.9; font-weight: 800; letter-spacing: 2px; text-shadow: 0 8px 18px rgba(0,0,0,0.35); color: var(--text); }
.count-grid .label { margin-top: 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; opacity: 0.85; color: var(--muted); }
.count-grid .sep { align-self: center; font-size: 54px; font-weight: 700; opacity: 0.6; color: var(--text); }

/* Animated separators (live feeling) */
.count-grid .sep {
  text-shadow: 0 0 10px rgba(255, 215, 90, 0.35);
  animation: sepGlow 1.2s ease-in-out infinite;
}
@keyframes sepGlow {
  0%, 100% { opacity: 0.5; text-shadow: 0 0 8px rgba(255,215,90,0.25); }
  50% { opacity: 0.95; text-shadow: 0 0 16px rgba(255,215,90,0.55); }
}

/* Mini tree inside countdown card */
.mini-tree { position: relative; width: 48px; height: 64px; }
.mini-tree .t1, .mini-tree .t2, .mini-tree .t3 {
  position: absolute; left: 50%; transform: translateX(-50%);
  border-left: 22px solid transparent; border-right: 22px solid transparent; border-bottom: 26px solid #184d38;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
}
.mini-tree .t1 { top: 2px; border-bottom-color: #1d5c43; }
.mini-tree .t2 { top: 22px; }
.mini-tree .t3 { top: 42px; }
.mini-tree .trunk { position: absolute; left: 50%; transform: translateX(-50%); top: 62px; width: 12px; height: 12px; background: #7a4b2a; border-radius: 3px; }
.mini-tree { animation: treeSway 3.2s ease-in-out infinite; }
@keyframes treeSway { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(1.1deg); } }

/* Midnight message */
.midnight-message { margin-top: 6px; text-align: center; font-weight: 800; font-size: 28px; letter-spacing: 1px; color: var(--accent); text-shadow: 0 4px 16px rgba(255,213,79,0.35); }

@media (max-width: 860px) {
  .count-grid .unit { min-width: 120px; }
  .count-grid .num { font-size: 64px; }
  .count-grid .sep { font-size: 40px; }
}

/* Tablet tweak */
@media (max-width: 680px) {
  .count-title { gap: 8px; }
  .count-title h2 { font-size: 17px; }
  .count-grid { gap: 14px; }
  .count-grid .unit { min-width: 100px; }
  .count-grid .num { font-size: 56px; }
  .count-grid .sep { font-size: 34px; }
}

/* Small phones */
@media (max-width: 480px) {
  .countdown-card { padding: 20px 18px; border-radius: 20px; }
  /* 2 rânduri pe mobil: (Zile : Ore) / (Minute : Secunde) */
  .count-grid { 
    grid-auto-flow: initial; 
    grid-template-columns: 1fr min-content 1fr; 
    grid-template-rows: auto auto; 
    justify-items: center; 
    align-items: end;
    gap: 10px 12px;
  }
  .count-grid .unit { min-width: 0; }
  .count-grid .num { font-size: 48px; }
  .count-grid .label { font-size: 12px; }
  .count-grid .sep { font-size: 30px; }
  /* Plasare elemente pe grid */
  .count-grid > .unit:nth-child(1) { grid-column: 1; grid-row: 1; }
  .count-grid > .sep:nth-child(2) { grid-column: 2; grid-row: 1; }
  .count-grid > .unit:nth-child(3) { grid-column: 3; grid-row: 1; }
  .count-grid > .unit:nth-child(5) { grid-column: 1; grid-row: 2; }
  .count-grid > .sep:nth-child(4) { grid-column: 2; grid-row: 2; }
  .count-grid > .sep:nth-child(6) { display: none; }
  .count-grid > .unit:nth-child(7) { grid-column: 3; grid-row: 2; }
  .midnight-message { font-size: 24px; }
  .santa-under { margin-top: 10px; }
}

/* Very small phones */
@media (max-width: 360px) {
  .count-grid { gap: 8px 10px; }
  .count-grid .unit { min-width: 0; }
  .count-grid .num { font-size: 44px; }
  .count-grid .sep { font-size: 28px; }
  .santa-under svg { width: 92px; }
  .santa-under { margin-top: 8px; }
}

/* Footer */
.site-footer { text-align: center; color: var(--muted); padding: 14px 0 44px; position: relative; z-index: 1; }
.site-footer .footer-inner { position: relative; max-width: 960px; margin: 0 auto; padding: 0 16px 14px; }
/* Footer garland mirroring header */
.garland-footer { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-evenly; align-items: flex-end; gap: 12px; padding: 4px 16px; pointer-events: none; }
.garland-footer::before { content:""; position:absolute; left:0; right:0; bottom:0; height:2px; background: rgba(255,255,255,0.32); filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25)); border-radius: 2px; }

/* Santa wave in footer */
.santa-wave { position: absolute; right: 16px; bottom: 0; display: inline-flex; align-items: center; gap: 8px; filter: drop-shadow(0 3px 6px rgba(0,0,0,0.35)); }
.santa-wave svg { width: 84px; height: auto; display: block; }
.santa-wave .hand { transform-origin: 0% 50%; transform-box: fill-box; animation: waveBurst 7s ease-in-out infinite; }
.santa-wave svg { will-change: transform; animation: idleSway 6s ease-in-out infinite; }
.santa-svg .hat { transform-origin: 50% 0%; transform-box: fill-box; animation: hatBob 2.6s ease-in-out infinite; }
.santa-svg .eyes { transform-origin: 50% 50%; transform-box: fill-box; animation: blinkEyes 4.8s ease-in-out infinite; }
.santa-svg .sack { transform-origin: 50% 80%; transform-box: fill-box; animation: sackSway 5.8s ease-in-out infinite; }
.santa-svg .beard { stroke: rgba(0,0,0,0.12); stroke-width: 0.6; }
.santa-svg .hat path, .santa-svg .hat-brim { stroke: rgba(0,0,0,0.12); stroke-width: 0.6; }

@keyframes idleSway { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-1.5px); } }
@keyframes hatBob { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-3deg); } }
@keyframes blinkEyes { 0%, 92%, 100% { transform: scaleY(1); } 93% { transform: scaleY(0.12); } 96% { transform: scaleY(1); } }
@keyframes waveBurst {
  0% { transform: rotate(0deg); }
  5% { transform: rotate(16deg); }
  10% { transform: rotate(0deg); }
  15% { transform: rotate(16deg); }
  20% { transform: rotate(0deg); }
  25% { transform: rotate(16deg); }
  30% { transform: rotate(0deg); }
  70% { transform: rotate(0deg); } /* pauză lungă */
  100% { transform: rotate(0deg); }
}
@keyframes sackSway { 0%, 100% { transform: rotate(0deg) translateY(0); } 50% { transform: rotate(-2deg) translateY(-1px); } }
@keyframes waveHand { 0%, 100% { transform: rotate(0deg) translateY(0); } 50% { transform: rotate(18deg) translateY(-1px); } }

/* Sleigh */
.sleigh { position: fixed; top: 90px; left: -140px; font-size: 28px; opacity: 0; pointer-events: none; z-index: 2; filter: drop-shadow(0 3px 6px rgba(0,0,0,0.35));
  --y0: 0px; --yMid: -30px; --yEnd: -60px; --scaleMid: 1.05; --scaleEnd: 1.08; }
@keyframes fly {
  0% { transform: translate(-140px, var(--y0)) scale(1); opacity: 0; }
  10% { opacity: 1; }
  50% { transform: translate(calc(100vw - 120px), var(--yMid)) scale(var(--scaleMid)); opacity: 1; }
  100% { transform: translate(calc(100vw + 160px), var(--yEnd)) scale(var(--scaleEnd)); opacity: 0; }
}
.sleigh.fly { animation: fly var(--dur, 7.5s) ease-in-out forwards; }
.sleigh::after { content: '✨'; position: absolute; left: -24px; top: -6px; opacity: 0; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25)); animation: trail var(--dur, 7.5s) linear forwards; }
@keyframes trail {
  0% { opacity: 0; transform: translate(0, 0); }
  15% { opacity: 0.9; }
  50% { opacity: 0.7; transform: translate(-12px, 6px); }
  100% { opacity: 0; transform: translate(-20px, 10px); }
}

@media (prefers-reduced-motion: reduce) {
  .garland span { animation: none; }
  .sleigh { display: none; }
  .btn.primary:hover::after { animation: none; }
  .count-grid .sep { animation: none; }
  .mini-tree { animation: none; }
  .mini-tree .light { animation: none; opacity: 0.35; }
  .santa-wave .hand { animation: none; }
  .santa-wave svg { animation: none; }
  .santa-svg .hat { animation: none; }
  .santa-svg .eyes { animation: none; }
  .santa-svg .sack { animation: none; }
  .santa-under .hand { animation: none; }
  .santa-under svg { animation: none; }
}

@media (max-width: 480px) {
  .santa-under svg { width: 100px; }
}

/* Vizibil și pe mobile, dar micșorat ușor pentru densitate */
@media (max-width: 420px) {
  .santa-wave svg { width: 74px; }
}

/* Night theme between 22:00–06:00 */
/* disable night override so backgr animation remains visible */
body.night { background: none; }
.mini-tree .light { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #ffd54f; box-shadow: 0 0 8px rgba(255,213,79,0.6); opacity: 0.25; animation: blinkLight 7.2s ease-in-out infinite; }
.mini-tree .light.red { background: #ff6b6b; box-shadow: 0 0 8px rgba(255,107,107,0.6); }
.mini-tree .light.green { background: #7cf37c; box-shadow: 0 0 8px rgba(124,243,124,0.6); }
.mini-tree .light.l1 { top: 14px; left: 18px; animation-delay: 0s; }
.mini-tree .light.l2 { top: 26px; left: 8px; animation-delay: 2.2s; }
.mini-tree .light.l3 { top: 30px; left: 30px; animation-delay: 3.6s; }
.mini-tree .light.l4 { top: 46px; left: 20px; animation-delay: 5.1s; }
.mini-tree .light.l5 { top: 52px; left: 12px; animation-delay: 6.5s; }
@keyframes blinkLight { 0%, 18%, 100% { opacity: 0.18; } 5% { opacity: 1; } 10% { opacity: 0.3; } }
.santa-under { display: flex; justify-content: center; margin-top: 12px; }
.santa-under svg { width: 112px; height: auto; display: block; }
.santa-under .hand { transform-origin: 0% 50%; transform-box: fill-box; animation: waveBurst 7s ease-in-out infinite; }
.santa-under svg { will-change: transform; animation: idleSway 6s ease-in-out infinite; }
