:root {
  --bg-deep: #050806;
  --forest: #1b261b;
  --gold: #d4af37;
  --gold-bright: #f0d78c;
  --gold-dark: #8a6a1a;
  --bronze: #cd7f32;
  --crimson: #8b0000;
  --fire: #ff4500;
  --ember: #ff8c00;
  --gem: #9370db;
  --gem-deep: #4b0082;
  --mist: rgba(27, 38, 27, 0.55);
  --glass: rgba(8, 10, 8, 0.62);
  --text: #f3e6c4;
  --text-dim: rgba(243, 230, 196, 0.72);
  --font-display: "Cinzel Decorative", "Cinzel", Georgia, serif;
  --font-body: "Cinzel", Georgia, serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-gold: 0 0 24px rgba(212, 175, 55, 0.35);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: var(--text);
  font-family: var(--font-body);
  background: var(--bg-deep);
  overflow-x: hidden;
  min-height: 100vh;
  min-height: 100dvh;
}

/* —— Scene / wallpaper —— */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.scene__wallpaper {
  position: absolute;
  inset: -4%;
  background:
    url("../assets/wallpaper.png") center / cover no-repeat,
    linear-gradient(160deg, #0a120a 0%, #1a1008 50%, #0a0f14 100%);
  transform: translate3d(var(--px, 0), var(--py, 0), 0) scale(1.06);
  transition: transform 0.45s var(--ease-out);
  will-change: transform;
  animation: wallpaper-breathe 14s ease-in-out infinite alternate;
}

@keyframes wallpaper-breathe {
  from { filter: brightness(0.92) saturate(1.05); }
  to { filter: brightness(1.05) saturate(1.15); }
}

.scene__mist {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 35%, transparent 20%, rgba(5, 8, 6, 0.45) 70%),
    linear-gradient(180deg, rgba(5, 8, 6, 0.35) 0%, transparent 28%, transparent 55%, rgba(5, 8, 6, 0.75) 100%);
}

.scene__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, 0.72) 100%);
}

.scene__embers {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cursor-glow {
  position: fixed;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle, rgba(255, 69, 0, 0.14) 0%, rgba(147, 112, 219, 0.08) 40%, transparent 70%);
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.35s ease;
  mix-blend-mode: screen;
}

body.is-pointer .cursor-glow {
  opacity: 1;
}

/* —— Stage content —— */
.stage {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  min-height: 100dvh;
  padding: clamp(1.25rem, 3vw, 2.5rem) clamp(1rem, 4vw, 2rem) 2rem;
  text-align: center;
}

.brand {
  margin-top: clamp(0.5rem, 2vh, 1.5rem);
  animation: rise-in 1s var(--ease-out) both;
}

.brand__logo {
  display: block;
  width: min(420px, 78vw);
  height: auto;
  margin: 0 auto;
  background: transparent;
  mix-blend-mode: normal;
  filter:
    drop-shadow(0 0 18px rgba(255, 69, 0, 0.35))
    drop-shadow(0 0 40px rgba(147, 112, 219, 0.25));
  animation: logo-pulse 4.5s ease-in-out infinite;
  transition: transform 0.5s var(--ease-out), filter 0.5s ease;
}

.brand__logo:hover {
  transform: scale(1.03);
  filter:
    drop-shadow(0 0 28px rgba(255, 140, 0, 0.55))
    drop-shadow(0 0 55px rgba(147, 112, 219, 0.4));
}

@keyframes logo-pulse {
  0%, 100% {
    filter:
      drop-shadow(0 0 14px rgba(255, 69, 0, 0.28))
      drop-shadow(0 0 32px rgba(147, 112, 219, 0.2));
  }
  50% {
    filter:
      drop-shadow(0 0 28px rgba(255, 140, 0, 0.5))
      drop-shadow(0 0 52px rgba(147, 112, 219, 0.38));
  }
}

.brand__tagline {
  margin: 0.35rem 0 0;
  font-size: clamp(0.7rem, 1.4vw, 0.85rem);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.45);
}

.lead {
  max-width: 34rem;
  margin: 0.85rem auto 0;
  font-size: clamp(0.85rem, 1.8vw, 1.05rem);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.55;
  color: var(--text-dim);
  animation: rise-in 1s var(--ease-out) 0.15s both;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* —— Countdown tablets —— */
.countdowns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
  width: min(960px, 100%);
  margin-top: clamp(1.5rem, 4vh, 2.75rem);
  animation: rise-in 1s var(--ease-out) 0.3s both;
}

.timer {
  position: relative;
  outline: none;
  cursor: default;
}

.timer__frame {
  position: relative;
  padding: clamp(1.1rem, 2.5vw, 1.65rem) clamp(0.85rem, 2vw, 1.35rem) 1.25rem;
  background:
    linear-gradient(165deg, rgba(28, 18, 10, 0.78) 0%, rgba(8, 10, 8, 0.82) 100%);
  border: 1px solid rgba(212, 175, 55, 0.45);
  box-shadow:
    inset 0 0 0 1px rgba(139, 0, 0, 0.25),
    inset 0 1px 0 rgba(240, 215, 140, 0.18),
    0 12px 40px rgba(0, 0, 0, 0.45),
    var(--shadow-gold);
  clip-path: polygon(
    12px 0,
    calc(100% - 12px) 0,
    100% 12px,
    100% calc(100% - 12px),
    calc(100% - 12px) 100%,
    12px 100%,
    0 calc(100% - 12px),
    0 12px
  );
  overflow: hidden;
  transition:
    transform 0.45s var(--ease-out),
    border-color 0.35s ease,
    box-shadow 0.45s ease;
}

.timer::before,
.timer::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  z-index: 2;
  pointer-events: none;
  border-color: var(--gold);
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

.timer::before {
  top: 6px;
  left: 6px;
  border-top: 2px solid;
  border-left: 2px solid;
}

.timer::after {
  bottom: 6px;
  right: 6px;
  border-bottom: 2px solid;
  border-right: 2px solid;
}

.timer:hover .timer__frame,
.timer:focus-visible .timer__frame {
  transform: translateY(-6px) scale(1.015);
  border-color: var(--gold-bright);
  box-shadow:
    inset 0 0 0 1px rgba(255, 69, 0, 0.35),
    inset 0 1px 0 rgba(240, 215, 140, 0.28),
    0 18px 50px rgba(0, 0, 0, 0.55),
    0 0 36px rgba(255, 69, 0, 0.28);
}

.timer--grand:hover .timer__frame,
.timer--grand:focus-visible .timer__frame {
  box-shadow:
    inset 0 0 0 1px rgba(147, 112, 219, 0.4),
    inset 0 1px 0 rgba(240, 215, 140, 0.28),
    0 18px 50px rgba(0, 0, 0, 0.55),
    0 0 40px rgba(147, 112, 219, 0.35);
}

.timer__glow {
  position: absolute;
  inset: -40%;
  opacity: 0.35;
  pointer-events: none;
  animation: glow-spin 12s linear infinite;
}

.timer__glow--beta {
  background: conic-gradient(from 0deg, transparent, rgba(255, 69, 0, 0.45), transparent 40%, rgba(212, 175, 55, 0.35), transparent 70%);
}

.timer__glow--grand {
  background: conic-gradient(from 90deg, transparent, rgba(147, 112, 219, 0.5), transparent 40%, rgba(255, 69, 0, 0.3), transparent 70%);
}

@keyframes glow-spin {
  to { transform: rotate(360deg); }
}

.timer__head {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.timer__badge {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: linear-gradient(180deg, var(--gold-bright) 0%, var(--gold) 45%, var(--bronze) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6));
}

.timer__badge--grand {
  background: linear-gradient(180deg, #e8d5ff 0%, var(--gem) 40%, var(--ember) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.timer__date {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.timer__digits {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(0.15rem, 1vw, 0.4rem);
}

.unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: clamp(2.6rem, 7vw, 3.6rem);
}

.unit__value {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 4.5vw, 2.65rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  background: linear-gradient(180deg, #fff6d6 0%, var(--gold-bright) 35%, var(--gold) 70%, var(--bronze) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(255, 69, 0, 0.35));
  transition: transform 0.25s var(--ease-out), filter 0.25s ease;
  font-variant-numeric: tabular-nums;
}

.unit__value.is-tick {
  transform: scale(1.08);
  filter: drop-shadow(0 0 16px rgba(255, 140, 0, 0.65));
}

.timer--grand .unit__value {
  background: linear-gradient(180deg, #f5e9ff 0%, #c9a0ff 30%, var(--gold-bright) 65%, var(--ember) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  filter: drop-shadow(0 0 10px rgba(147, 112, 219, 0.45));
}

.unit__label {
  margin-top: 0.3rem;
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(243, 230, 196, 0.55);
}

.unit__sep {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3.5vw, 2rem);
  line-height: 1.2;
  color: var(--gold-dark);
  opacity: 0.85;
  animation: sep-blink 1s steps(1) infinite;
  padding-top: 0.15rem;
}

@keyframes sep-blink {
  0%, 49% { opacity: 0.9; }
  50%, 100% { opacity: 0.25; }
}

.timer.is-live .timer__frame {
  border-color: rgba(125, 255, 179, 0.35);
}

/* —— Actions —— */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  margin-top: clamp(1.5rem, 4vh, 2.5rem);
  animation: rise-in 1s var(--ease-out) 0.45s both;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 11rem;
  padding: 0.85rem 1.6rem;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--gold-bright);
  border: 1px solid rgba(212, 175, 55, 0.55);
  background: linear-gradient(180deg, rgba(139, 0, 0, 0.55) 0%, rgba(20, 10, 6, 0.85) 100%);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
  transition:
    transform 0.35s var(--ease-out),
    color 0.25s ease,
    background 0.35s ease,
    box-shadow 0.35s ease,
    border-color 0.25s ease;
}

.btn:hover,
.btn:focus-visible {
  color: #fff8e7;
  border-color: var(--gold-bright);
  background: linear-gradient(180deg, rgba(255, 69, 0, 0.55) 0%, rgba(80, 20, 0, 0.9) 100%);
  box-shadow: 0 0 28px rgba(255, 69, 0, 0.4);
  transform: translateY(-3px) scale(1.03);
  outline: none;
}

.btn--ghost {
  background: rgba(8, 10, 8, 0.55);
  border-color: rgba(212, 175, 55, 0.35);
  color: var(--text-dim);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  color: var(--gold-bright);
  background: rgba(20, 14, 8, 0.85);
  box-shadow: 0 0 24px rgba(212, 175, 55, 0.3);
}

.foot {
  margin-top: auto;
  padding-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  align-items: center;
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(243, 230, 196, 0.4);
  animation: rise-in 1s var(--ease-out) 0.55s both;
}

.foot__sep {
  opacity: 0.5;
}

/* —— Responsive —— */
@media (max-width: 720px) {
  .countdowns {
    grid-template-columns: 1fr;
    max-width: 420px;
  }

  .brand__logo {
    width: min(300px, 82vw);
  }

  .unit__sep {
    display: none;
  }

  .timer__digits {
    gap: 0.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .scene__wallpaper {
    transform: none !important;
  }
}
