:root {
  --bg: #0a0806;
  --bg-deep: #050403;
  --gold: #c9a227;
  --gold-bright: #f0cf6b;
  --blood: #7a1a12;
  --bone: #d8cfb8;
  --green: #7fdc9a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  min-height: 100%;
}

body {
  background:
    radial-gradient(ellipse 120% 80% at 50% -10%, #1c130a 0%, transparent 60%),
    radial-gradient(ellipse 100% 60% at 50% 110%, #14080a 0%, transparent 55%),
    var(--bg);
  color: var(--bone);
  font-family: "IM Fell English", serif;
  overflow-x: hidden;
}

/* grimdark battle backdrop, heavily darkened */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("assets/battle.jpg") center 60% / cover no-repeat;
  filter: brightness(0.5) contrast(1.08) saturate(0.8);
  opacity: 0.4;
  pointer-events: none;
}

.hidden { display: none !important; }

/* ---------- entry gate ---------- */

#gate {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 255, 140, 0.02) 3px 4px),
    linear-gradient(rgba(5, 4, 3, 0.82), rgba(5, 4, 3, 0.92)),
    url("assets/nebula.jpg") center / cover no-repeat var(--bg-deep);
  transition: opacity 1.2s ease;
}

#gate.fading { opacity: 0; pointer-events: none; }

.gate-inner { padding: 2rem; max-width: 44rem; }

.gate-static {
  color: var(--green);
  opacity: 0.5;
  letter-spacing: 0.6em;
  animation: flicker 1.3s steps(2) infinite;
}

.gate-title {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: clamp(1.1rem, 3.5vw, 1.9rem);
  color: var(--green);
  text-shadow: 0 0 12px rgba(127, 220, 154, 0.6);
  margin: 1.2rem 0;
  animation: flicker 4s steps(3) infinite;
}

.gate-sub {
  color: var(--green);
  opacity: 0.75;
  letter-spacing: 0.15em;
  font-size: 0.95rem;
  margin: 0.3rem 0;
}

.gate-btn { margin-top: 2.2rem; font-size: 1.05rem; }

.gate-hint {
  margin-top: 1.6rem;
  font-style: italic;
  font-size: 0.8rem;
  opacity: 0.45;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.4; }
  94% { opacity: 1; }
  97% { opacity: 0.6; }
}

/* ---------- main card ---------- */

#card {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 1.2rem 4rem;
  min-height: 100vh;
  animation: cardIn 1.4s ease both;
}

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

#aquila {
  width: min(280px, 65vw);
  filter: drop-shadow(0 0 18px rgba(201, 162, 39, 0.35));
  animation: aquilaGlow 5s ease-in-out infinite;
}

@keyframes aquilaGlow {
  0%, 100% { filter: drop-shadow(0 0 12px rgba(201, 162, 39, 0.25)); }
  50% { filter: drop-shadow(0 0 26px rgba(201, 162, 39, 0.55)); }
}

.eyebrow {
  margin-top: 1.6rem;
  font-family: "Cinzel", serif;
  font-size: clamp(0.7rem, 2vw, 0.95rem);
  letter-spacing: 0.35em;
  color: var(--blood);
  text-shadow: 0 0 8px rgba(122, 26, 18, 0.8);
}

.title {
  font-family: "Cinzel", serif;
  font-weight: 900;
  font-size: clamp(2rem, 7vw, 4.2rem);
  line-height: 1.1;
  margin-top: 0.6rem;
  color: var(--gold-bright);
  text-shadow:
    0 0 6px rgba(240, 207, 107, 0.5),
    0 0 30px rgba(201, 162, 39, 0.35),
    0 4px 2px rgba(0, 0, 0, 0.8);
}

.title-name {
  display: block;
  font-size: clamp(1.4rem, 5vw, 3rem);
  letter-spacing: 0.12em;
  color: var(--bone);
  text-shadow: 0 0 20px rgba(216, 207, 184, 0.35);
}

/* ---------- decree scroll ---------- */

.decree {
  max-width: 42rem;
  margin-top: 2.2rem;
  padding: 1.8rem 2rem;
  border: 1px solid rgba(201, 162, 39, 0.45);
  outline: 1px solid rgba(201, 162, 39, 0.15);
  outline-offset: 6px;
  background:
    linear-gradient(180deg, rgba(201, 162, 39, 0.06), rgba(0, 0, 0, 0.25)),
    rgba(10, 8, 6, 0.75);
  font-size: clamp(1rem, 2.6vw, 1.2rem);
  line-height: 1.75;
  text-align: left;
  white-space: pre-wrap;
  min-height: 12rem;
}

.cursor {
  color: var(--gold);
  animation: blink 0.8s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ---------- buttons ---------- */

.war-btn {
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  color: var(--gold);
  background: linear-gradient(180deg, rgba(201, 162, 39, 0.12), rgba(0, 0, 0, 0.4));
  border: 1px solid var(--gold);
  padding: 0.85rem 1.4rem;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.18s ease;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
}

.war-btn:hover, .war-btn:focus-visible {
  color: var(--bg-deep);
  background: var(--gold);
  box-shadow: 0 0 24px rgba(201, 162, 39, 0.6);
  text-shadow: none;
}

.war-btn:active { transform: scale(0.96); }

.mute-btn {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 26;
  font-family: "Cinzel", serif;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: var(--gold);
  background: rgba(10, 8, 6, 0.75);
  border: 1px solid var(--gold);
  padding: 0.5rem 0.8rem;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: all 0.18s ease;
}

.mute-btn:hover {
  background: var(--gold);
  color: var(--bg-deep);
}

.mute-btn.muted {
  color: var(--blood);
  border-color: var(--blood);
}

.mute-btn.muted:hover {
  background: var(--blood);
  color: var(--bone);
}

.gate-btn {
  color: var(--green);
  border-color: var(--green);
  background: linear-gradient(180deg, rgba(127, 220, 154, 0.1), rgba(0, 0, 0, 0.4));
}

.gate-btn:hover, .gate-btn:focus-visible {
  background: var(--green);
  box-shadow: 0 0 24px rgba(127, 220, 154, 0.6);
}

footer {
  margin-top: 3rem;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  opacity: 0.45;
  font-family: "Cinzel", serif;
}

.credits {
  margin-top: 0.6rem;
  font-family: "IM Fell English", serif;
  font-style: italic;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

/* ---------- overlays & fx ---------- */

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, 0.18) 3px 4px);
  mix-blend-mode: multiply;
}

.vignette {
  position: fixed;
  inset: 0;
  z-index: 21;
  pointer-events: none;
  box-shadow: inset 0 0 22vmin 6vmin rgba(0, 0, 0, 0.85);
}

#sparks {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
