/* ============================================================
   Aurora — Modded Valheim Server  (Episode III)
   Full-bleed emblem background. Palette from the EP3 emblem:
   dark iron, lava ember, blood-red gem, rune bronze.
   ============================================================ */

:root {
  --stone-0:   #0a0807;
  --parchment: #f1e4d4;
  --muted:     #c2ab97;

  --ember:     #ff6a1f;
  --ember-2:   #ff9b3d;
  --ember-deep:#c2390c;
  --blood:     #e21f15;
  --bronze:    #d6a35e;

  --discord:   #5865f2;

  --maxw: 720px;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  min-height: 100vh;
  background: var(--stone-0);
  color: var(--parchment);
  font-family: "Spectral", Georgia, "Times New Roman", serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ----------------------------------------------------------------
   Full-screen emblem background
   ---------------------------------------------------------------- */
.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    url("assets/emblem.png") center center / cover no-repeat,
    var(--stone-0);
  /* gentle live glow on the whole scene */
  animation: sceneBreath 9s ease-in-out infinite alternate;
}

@keyframes sceneBreath {
  from { filter: brightness(0.96) saturate(1.0); }
  to   { filter: brightness(1.06) saturate(1.12); }
}

/* Scrim: darkens edges + bottom so overlaid text stays readable
   without hiding the emblem in the centre. */
.bg__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom,
      rgba(10,8,7,0.55) 0%,
      rgba(10,8,7,0.05) 22%,
      rgba(10,8,7,0.05) 48%,
      rgba(10,8,7,0.72) 82%,
      rgba(10,8,7,0.94) 100%),
    radial-gradient(120% 85% at 50% 42%, transparent 46%, rgba(8,6,5,0.6) 100%);
}

/* ----------------------------------------------------------------
   Ember particles canvas
   ---------------------------------------------------------------- */
#embers {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* ----------------------------------------------------------------
   Hero layout — eyebrow pinned top, content pinned bottom,
   emblem shows through the middle.
   ---------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 24px 22px;
}

.hero__eyebrow {
  font-family: "Cinzel", serif;
  font-weight: 600;
  letter-spacing: 0.44em;
  text-transform: uppercase;
  font-size: clamp(0.6rem, 1.5vw, 0.82rem);
  color: var(--bronze);
  margin: 0;
  text-shadow: 0 0 18px rgba(214,163,94,0.45), 0 2px 10px rgba(0,0,0,0.8);
  animation: fade 1.2s ease both;
}

.hero__spacer { flex: 1; }

/* ----------------------------------------------------------------
   Launch countdown (centered over the emblem)
   ---------------------------------------------------------------- */
.hero__mid {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.countdown {
  position: relative;
  text-align: center;
  padding: 22px clamp(26px, 4vw, 48px) 24px;
  z-index: 2;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(18,13,11,0.86) 0%, rgba(9,7,6,0.9) 100%);
  border: 1px solid rgba(214,163,94,0.42);
  box-shadow:
    0 20px 55px rgba(0,0,0,0.6),
    inset 0 0 0 1px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,210,160,0.08),
    0 0 34px rgba(255,106,31,0.14);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  animation: rise 1s cubic-bezier(.2,.8,.2,1) .1s both;
}
.countdown[hidden] { display: none; }

.countdown__label {
  font-family: "Cinzel", serif;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--bronze);
  font-size: clamp(0.7rem, 1.9vw, 1.05rem);
  margin: 0 0 1rem;
  text-shadow: 0 0 18px rgba(214,163,94,0.45), 0 2px 10px rgba(0,0,0,0.85);
}

/* highlighted game title inside the countdown label */
.countdown__title {
  font-weight: 700;
  background: linear-gradient(180deg, #ffe6c4 0%, var(--ember-2) 55%, var(--ember) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(255,106,31,0.55));
}

.countdown__time {
  display: flex;
  gap: clamp(6px, 1.6vw, 18px);
  justify-content: center;
  align-items: flex-start;
}

.cd__unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: clamp(52px, 9vw, 92px);
}

.cd__num {
  font-family: "Cinzel", serif;
  font-weight: 900;
  line-height: 1;
  font-size: clamp(2.1rem, 7.5vw, 4.6rem);
  background: linear-gradient(180deg, #ffe2bd 0%, var(--ember-2) 40%, var(--ember) 70%, var(--ember-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(255,106,31,0.4)) drop-shadow(0 3px 10px rgba(0,0,0,0.7));
}

.cd__lbl {
  font-family: "Cinzel", serif;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: clamp(0.5rem, 1.25vw, 0.74rem);
  color: var(--muted);
  margin-top: 0.55rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.85);
}

.cd__sep {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 5.5vw, 3.4rem);
  line-height: 1;
  color: rgba(214,163,94,0.6);
  margin-top: 0.1em;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

/* ----------------------------------------------------------------
   Live screenshot viewport (framed rune window over the emblem)
   ---------------------------------------------------------------- */
.shots {
  position: absolute;
  right: 18vw;
  bottom: 8vh;
  width: clamp(230px, 22vw, 330px);
  z-index: 2;
  pointer-events: none;
  animation: fade 1.6s ease both;
}
.shots[hidden] { display: none; }

/* Frameless: soft rounded image with a gentle shadow + ember glow */
.shots__frame {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: transparent;
  box-shadow:
    0 16px 44px rgba(0,0,0,0.6),
    0 0 22px rgba(255,106,31,0.14);
}

.shots__imgs { position: absolute; inset: 0; }
.shots__imgs img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 2.2s ease;
}
.shots__imgs img.is-active { opacity: 1; }

.shots__label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 7px 8px 6px;
  text-align: center;
  font-family: "Cinzel", serif;
  font-size: 0.6rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--parchment);
  background: linear-gradient(to top, rgba(8,6,5,0.9), rgba(8,6,5,0));
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
}

/* Hide the overlay on portrait/mobile to keep the emblem clean */
@media (max-aspect-ratio: 1/1) {
  .shots { display: none; }
}

.hero__bottom {
  width: 100%;
  max-width: var(--maxw);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: rise 1s cubic-bezier(.2,.8,.2,1) .15s both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.hero__tagline {
  font-size: clamp(1.05rem, 2.6vw, 1.5rem);
  color: var(--parchment);
  font-style: italic;
  max-width: 28ch;
  margin: 0 0 1.8rem;
  text-shadow: 0 2px 24px rgba(0,0,0,0.85);
}

/* ----------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------- */
.hero__actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
}

.btn {
  --btn-bg: rgba(255,255,255,0.05);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 36px;
  min-width: 260px;
  border-radius: 12px;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: clamp(1rem, 2.1vw, 1.2rem);
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--parchment);
  background: var(--btn-bg);
  border: 1px solid rgba(214,163,94,0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .25s ease, border-color .25s ease, filter .25s ease;
}

.btn__icon { width: 1.3em; height: 1.3em; flex: none; }

.btn:hover  { transform: translateY(-3px); }
.btn:active { transform: translateY(-1px); }

/* Discord — seated in stone, keeps recognizable blurple */
.btn--discord {
  --btn-bg: linear-gradient(180deg, rgba(46,38,66,0.92), rgba(26,21,34,0.94));
  border-color: rgba(120,131,255,0.55);
  color: #eef0ff;
  box-shadow: 0 8px 26px rgba(0,0,0,0.5), inset 0 0 0 1px rgba(120,131,255,0.14);
}
.btn--discord .btn__icon { color: #9aa4ff; }
.btn--discord:hover {
  border-color: rgba(150,160,255,0.95);
  box-shadow: 0 14px 40px rgba(88,101,242,0.45), inset 0 0 0 1px rgba(120,131,255,0.28);
}

/* Play — molten iron */
.btn--play {
  --btn-bg: linear-gradient(180deg, var(--ember-2) 0%, var(--ember) 45%, var(--ember-deep) 100%);
  border-color: rgba(255,180,120,0.85);
  color: #2a1206;
  text-shadow: 0 1px 0 rgba(255,210,170,0.5);
  box-shadow: 0 10px 30px rgba(255,106,31,0.5), inset 0 1px 0 rgba(255,230,200,0.5);
}
.btn--play .btn__icon { color: #2a1206; }
.btn--play:hover {
  border-color: rgba(255,220,180,1);
  filter: brightness(1.08);
  box-shadow: 0 16px 50px rgba(255,106,31,0.65), inset 0 1px 0 rgba(255,230,200,0.6);
}

.hero__hint {
  margin: 1.6rem 0 0;
  color: var(--muted);
  font-size: clamp(0.78rem, 1.7vw, 0.92rem);
  letter-spacing: 0.02em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.8);
}

/* ----------------------------------------------------------------
   Footer
   ---------------------------------------------------------------- */
.footer {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.6rem;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  opacity: 0.85;
  text-shadow: 0 1px 8px rgba(0,0,0,0.8);
}
.footer__sep { opacity: 0.5; }

/* ----------------------------------------------------------------
   Toast (placeholder button feedback)
   ---------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(20,16,16,0.96);
  border: 1px solid rgba(255,106,31,0.5);
  color: var(--parchment);
  padding: 13px 20px;
  border-radius: 12px;
  font-family: "Cinzel", serif;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 24px rgba(255,106,31,0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ----------------------------------------------------------------
   Portrait / mobile — clean vertical "poster":
   emblem banner up top, content stacked below on dark stone.
   ---------------------------------------------------------------- */
@media (max-aspect-ratio: 1/1) {
  /* Emblem pinned to the top as a full-width banner */
  .bg {
    background:
      url("assets/emblem.png") center top / contain no-repeat,
      var(--stone-0);
  }

  /* Transparent over the emblem, dark over the content zone, warm at the base */
  .bg__scrim {
    background:
      radial-gradient(130% 42% at 50% 100%, rgba(255,106,31,0.16) 0%, transparent 62%),
      linear-gradient(to bottom,
        rgba(10,8,7,0.10) 0%,
        rgba(10,8,7,0.05) 22%,
        rgba(10,8,7,0.68) 42%,
        rgba(10,8,7,0.93) 60%,
        rgba(10,8,7,0.97) 100%);
  }

  .hero {
    justify-content: flex-start;
    padding: 16px 18px 24px;
    padding-top: 57vw;          /* reserve room for the emblem banner */
  }

  .hero__eyebrow {
    letter-spacing: 0.16em;
    font-size: 0.6rem;
    margin: 0 0 1.15rem;
  }

  /* sit in the flow under the emblem instead of vertically centering */
  .hero__mid {
    flex: 0 0 auto;
    width: 100%;
    margin-bottom: 1.6rem;
  }

  /* Countdown: shrink to fit narrow screens */
  .countdown {
    width: min(94vw, 360px);
    padding: 15px 12px 17px;
    border-radius: 14px;
  }
  .countdown__label { letter-spacing: 0.1em; font-size: 0.62rem; margin-bottom: 0.8rem; }
  .countdown__time { gap: 3px; }
  .cd__unit { min-width: 0; flex: 1 1 0; }
  .cd__num { font-size: clamp(1.8rem, 11vw, 2.7rem); }
  .cd__lbl { font-size: 0.46rem; letter-spacing: 0.06em; margin-top: 0.4rem; }
  .cd__sep { font-size: 1.5rem; margin-top: 0.06em; }

  .hero__tagline { font-size: 1.06rem; max-width: 26ch; margin-bottom: 1.4rem; }

  /* Buttons: comfortable full-width tap targets */
  .btn {
    width: min(86vw, 340px);
    min-width: 0;
    padding: 15px 24px;
  }

  .hero__hint { margin-top: 1.4rem; }
  .footer { margin-top: 1.5rem; font-size: 0.7rem; }
}

/* ----------------------------------------------------------------
   Reduced motion
   ---------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .bg,
  .hero__bottom,
  .hero__eyebrow { animation: none; }
  #embers { display: none; }
}
