:root {
  color-scheme: dark;
  --dial: 0;
  --horde-strength: 0;
  --alliance-strength: 0;
  --neutral-strength: 1;
  --accent-rgb: 176, 188, 207;
  --accent-bright-rgb: 227, 233, 242;
  --bg-rgb: 12, 16, 24;
  --fog-opacity: 0.48;
  --mist-brightness: 0.88;
  --cursor-x: 50vw;
  --cursor-y: 50vh;
  --knob-x: 50%;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  overflow-x: hidden;
  background: rgb(var(--bg-rgb));
  color: #eef1f7;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background-color 900ms ease, color 600ms ease;
}
button, input { font: inherit; }
button { color: inherit; }

.scene,
.scene > * {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.scene {
  z-index: -3;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 35%, rgba(var(--accent-rgb), calc(.16 + var(--alliance-strength) * .18)), transparent 32%),
    radial-gradient(circle at 16% 72%, rgba(150, 18, 20, calc(var(--horde-strength) * .34)), transparent 42%),
    radial-gradient(circle at 84% 20%, rgba(38, 83, 150, calc(var(--alliance-strength) * .28)), transparent 38%),
    linear-gradient(180deg, rgba(3, 7, 13, .1), rgba(2, 4, 8, .82)),
    rgb(var(--bg-rgb));
  transition: background 1s ease;
}

.backdrop {
  inset: 0;
  background-repeat: no-repeat;
  background-size: cover;
  transition: opacity 180ms linear;
}
.backdrop-neutral {
  background:
    radial-gradient(circle at 50% 20%, rgba(255,255,255,.08), transparent 40%),
    linear-gradient(180deg, rgba(11, 16, 22, .26), rgba(3, 6, 10, .72));
  opacity: 1;
}
.backdrop-alliance {
  background-image:
    linear-gradient(180deg, rgba(9, 14, 20, .20), rgba(5, 8, 13, .44)),
    linear-gradient(120deg, rgba(205, 217, 230, .04), rgba(110, 138, 177, .03)),
    url("assets/alliance-site-final.jpg");
  background-position: center center;
  background-size: cover;
  opacity: calc(var(--alliance-strength) * .97);
  filter: grayscale(1) contrast(1.04) brightness(.92);
  transform: none;
}
.backdrop-horde {
  background-image:
    linear-gradient(180deg, rgba(28, 10, 4, .20), rgba(12, 4, 2, .62)),
    linear-gradient(90deg, rgba(115, 28, 10, .16), rgba(255, 160, 95, .05)),
    url("assets/horde-camelot-bg-generated.jpg");
  background-position: center center;
  opacity: calc(var(--horde-strength) * .94);
  filter: saturate(.95) contrast(1.05) brightness(.78);
  transform: none;
}

.sky-glow {
  background:
    linear-gradient(120deg, transparent 28%, rgba(255, 241, 194, calc(var(--alliance-strength) * .12)) 47%, transparent 61%),
    radial-gradient(ellipse at 50% 110%, rgba(var(--accent-rgb), .12), transparent 50%);
  filter: blur(8px);
  opacity: .92;
}

.storm-cloud {
  width: 80vw;
  height: 40vh;
  top: -10vh;
  left: -8vw;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, calc(.22 + var(--horde-strength) * .26)), transparent 68%);
  filter: blur(35px);
  animation: cloud-drift 22s ease-in-out infinite alternate;
}
.storm-cloud-b {
  left: auto;
  right: -15vw;
  top: 12vh;
  animation-duration: 29s;
  animation-direction: alternate-reverse;
}

#particleCanvas { width: 100%; height: 100%; }

.fog {
  inset: -20%;
  width: 140%;
  height: 140%;
  opacity: calc(var(--fog-opacity) * .72);
  filter: brightness(var(--mist-brightness));
  mix-blend-mode: screen;
  will-change: transform, opacity;
  background-image:
    radial-gradient(ellipse at 10% 30%, rgba(220, 227, 235, .23) 0 8%, transparent 25%),
    radial-gradient(ellipse at 32% 75%, rgba(190, 203, 215, .18) 0 12%, transparent 34%),
    radial-gradient(ellipse at 70% 24%, rgba(225, 230, 240, .16) 0 11%, transparent 31%),
    radial-gradient(ellipse at 92% 68%, rgba(190, 206, 220, .19) 0 8%, transparent 28%);
  background-size: 760px 430px, 980px 560px, 840px 470px, 1100px 600px;
}
.fog-back { opacity: calc(var(--fog-opacity) * .62); filter: blur(26px) brightness(var(--mist-brightness)); animation: fog-left 52s linear infinite; }
.fog-mid { opacity: calc(var(--fog-opacity) * .78); filter: blur(18px) brightness(var(--mist-brightness)); animation: fog-right 38s linear infinite; }
.fog-front { opacity: calc(var(--fog-opacity) * .55); filter: blur(10px) brightness(var(--mist-brightness)); animation: fog-left 24s linear infinite reverse; }

.lightning { display: none; }


.vignette { box-shadow: inset 0 0 220px 80px rgba(0, 0, 0, calc(.62 - var(--alliance-strength) * .18)); }
.grain {
  opacity: .12;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.42'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.cursor-aura {
  position: fixed;
  z-index: 20;
  left: var(--cursor-x);
  top: var(--cursor-y);
  width: 210px;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(var(--accent-bright-rgb), .14), rgba(var(--accent-rgb), .045) 42%, transparent 70%);
  filter: blur(4px);
  mix-blend-mode: screen;
  transition: background 450ms ease;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  position: relative;
  z-index: 2;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 0;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(8, 12, 20, .36);
  backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}
.icon-button:hover { transform: translateY(-2px); border-color: rgba(var(--accent-rgb), .65); background: rgba(var(--accent-rgb), .1); }
.icon-button svg { width: 21px; fill: currentColor; }
.icon-button .sound-on { display: none; }
.icon-button[aria-pressed="true"] .sound-on { display: block; }
.icon-button[aria-pressed="true"] .sound-off { display: none; }

.hero {
  align-self: center;
  text-align: center;
  padding: 38px 0 58px;
}
.eyebrow {
  letter-spacing: .48em;
  margin-right: -.48em;
  font-size: clamp(.65rem, 1.2vw, .78rem);
  font-weight: 600;
  color: rgba(var(--accent-bright-rgb), .72);
  text-shadow: 0 0 22px rgba(var(--accent-rgb), .25);
}
h1 {
  margin: 13px 0 7px;
}

.hero-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  filter: drop-shadow(0 8px 30px rgba(0,0,0,.65)) drop-shadow(0 0 30px rgba(var(--accent-rgb), .18));
  transition: filter 700ms ease;
}
.hero-logo-stack {
  position: relative;
  display: block;
  width: min(88vw, 760px);
  aspect-ratio: 704 / 178;
}
.logo-layer {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 120ms linear, filter 220ms linear;
}
.logo-neutral {
  opacity: var(--neutral-strength);
}
.logo-horde {
  opacity: var(--horde-strength);
  filter: drop-shadow(0 0 22px rgba(230, 35, 24, .58));
}
.logo-alliance {
  opacity: var(--alliance-strength);
  filter: drop-shadow(0 0 22px rgba(75, 145, 255, .58));
}
.faction-whisper {
  min-height: 1.5em;
  margin: 0;
  font-family: Cinzel, Georgia, "Times New Roman", serif;
  color: rgba(239, 242, 248, .58);
  letter-spacing: .08em;
  font-size: clamp(.76rem, 1.4vw, .95rem);
}

.countdown-frame {
  margin: clamp(28px, 5vh, 52px) auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.countdown-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  width: 100%;
}
.countdown-meta {
  grid-column: 1 / -1;
  margin-bottom: -6px;
  text-align: center;
  font-family: Cinzel, Georgia, "Times New Roman", serif;
  font-size: clamp(.85rem, 2vw, 1.05rem);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(240, 236, 225, .78);
  text-shadow: 0 0 16px rgba(var(--accent-rgb), .18);
}
.ornament { width: clamp(36px, 8vw, 110px); height: 1px; background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), .5)); position: relative; }
.ornament::after { content: "◆"; position: absolute; right: -4px; top: 50%; transform: translateY(-52%); font-size: 8px; color: rgba(var(--accent-rgb), .8); }
.ornament-right { transform: scaleX(-1); }
.countdown {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: clamp(8px, 2.4vw, 25px);
  padding: 20px 26px 17px;
  border: 1px solid rgba(var(--accent-rgb), .22);
  background: linear-gradient(180deg, rgba(14, 19, 28, .34), rgba(4, 7, 12, .22));
  backdrop-filter: blur(13px);
  box-shadow: inset 0 1px rgba(255,255,255,.04), 0 18px 50px rgba(0,0,0,.2);
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px);
}
.time-block { min-width: clamp(46px, 8vw, 78px); }
.time-block strong {
  display: block;
  font-family: Cinzel, Georgia, "Times New Roman", serif;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1;
  font-weight: 600;
  color: #f5f7fb;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(var(--accent-rgb), .26);
}
.time-block span {
  display: block;
  margin-top: 8px;
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .22em;
  color: rgba(226, 231, 240, .48);
}
.separator {
  margin-top: 3px;
  color: rgba(var(--accent-rgb), .58);
  font-family: Cinzel, Georgia, "Times New Roman", serif;
  font-size: clamp(1.35rem, 3vw, 2.3rem);
}

.faction-panel {
  width: min(760px, 94vw);
  margin: clamp(34px, 6vh, 64px) auto 0;
  padding: 0 8px;
}

.faction-buttons {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(12px, 2.5vw, 24px);
}

.faction-choice {
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, .16);
  padding: 16px 20px;
  color: rgba(239, 243, 249, .78);
  background: linear-gradient(180deg, rgba(21, 27, 38, .66), rgba(7, 10, 16, .72));
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px rgba(255,255,255,.05), 0 16px 38px rgba(0,0,0,.24);
  clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px);
  cursor: pointer;
  transition: transform 180ms ease, border-color 260ms ease, background 260ms ease, box-shadow 260ms ease, color 260ms ease;
}

.faction-choice:hover { transform: translateY(-2px); }
.faction-choice:focus-visible {
  outline: 2px solid rgba(var(--accent-bright-rgb), .95);
  outline-offset: 5px;
}

.faction-button-sigil {
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.36));
}
.faction-button-sigil img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.faction-button-copy { min-width: 0; text-align: left; }
.faction-button-copy strong {
  display: block;
  font-family: Cinzel, Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 2vw, 1.35rem);
  letter-spacing: .18em;
}
.faction-button-copy small {
  display: block;
  margin-top: 7px;
  color: rgba(229, 234, 242, .45);
  font-size: .63rem;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.faction-or {
  color: rgba(255,255,255,.42);
  font-family: Cinzel, Georgia, "Times New Roman", serif;
  font-size: .7rem;
  letter-spacing: .25em;
}

.faction-choice-horde:hover,
body[data-faction="horde"] .faction-choice-horde {
  color: #ffd2c9;
  border-color: rgba(235, 69, 45, .72);
  background: linear-gradient(180deg, rgba(76, 13, 12, .78), rgba(22, 5, 7, .82));
  box-shadow: inset 0 1px rgba(255,255,255,.06), 0 0 34px rgba(208, 39, 24, .28), 0 18px 45px rgba(0,0,0,.3);
}

.faction-choice-alliance:hover,
body[data-faction="alliance"] .faction-choice-alliance {
  color: #e3efff;
  border-color: rgba(84, 151, 244, .76);
  background: linear-gradient(180deg, rgba(17, 49, 92, .76), rgba(6, 17, 37, .82));
  box-shadow: inset 0 1px rgba(255,255,255,.07), 0 0 34px rgba(63, 130, 229, .3), 0 18px 45px rgba(0,0,0,.3);
}

.choice-status {
  margin-top: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  font-size: .66rem;
  text-transform: uppercase;
  letter-spacing: .22em;
  color: rgba(255,255,255,.4);
}
#choiceStatus { color: rgb(var(--accent-bright-rgb)); min-width: 88px; text-align: right; }
.choice-hint { padding-left: 16px; border-left: 1px solid rgba(255,255,255,.14); }

footer {
  padding: 20px 0 26px;
  display: flex;
  justify-content: center;
  gap: 10px;
  color: rgba(255,255,255,.3);
  font-size: .65rem;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.footer-dot { color: rgba(var(--accent-rgb), .62); }

.entry-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 22px;
  background: radial-gradient(circle at center, rgba(21, 28, 40, .74), rgba(3, 6, 10, .96));
  backdrop-filter: blur(18px);
  transition: opacity 900ms ease, visibility 900ms ease;
}
.entry-overlay.hidden { opacity: 0; visibility: hidden; }
.entry-card {
  width: min(510px, 100%);
  padding: clamp(34px, 7vw, 60px);
  text-align: center;
  border: 1px solid rgba(218, 225, 237, .2);
  background: linear-gradient(180deg, rgba(24, 31, 43, .62), rgba(5, 9, 15, .66));
  box-shadow: 0 40px 120px rgba(0,0,0,.56), inset 0 1px rgba(255,255,255,.05);
  clip-path: polygon(20px 0, calc(100% - 20px) 0, 100% 20px, 100% calc(100% - 20px), calc(100% - 20px) 100%, 20px 100%, 0 calc(100% - 20px), 0 20px);
}
.entry-sigil { width: 92px; margin: 0 auto; color: #cbd3df; filter: drop-shadow(0 0 24px rgba(191,205,224,.4)); }
.entry-sigil img { display: block; width: 100%; height: auto; }
.entry-kicker { margin: 16px 0 6px; font-size: .64rem; letter-spacing: .36em; color: rgba(220,227,238,.55); }
.entry-card h2 { margin: 0; font-family: Cinzel, Georgia, "Times New Roman", serif; font-size: clamp(2rem, 7vw, 3.35rem); }
.entry-card > p:not(.entry-kicker) { max-width: 390px; margin: 16px auto 28px; color: rgba(226,232,241,.62); line-height: 1.65; }
.enter-button {
  width: min(250px, 100%);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(229,235,243,.36);
  padding: 14px 28px;
  background: linear-gradient(180deg, rgba(206,216,229,.17), rgba(84,96,115,.12));
  font-family: Cinzel, Georgia, "Times New Roman", serif;
  letter-spacing: .32em;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(180,196,218,.09), inset 0 1px rgba(255,255,255,.08);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}
.enter-button:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.7); box-shadow: 0 12px 35px rgba(0,0,0,.35), 0 0 30px rgba(180,196,218,.17); }
.button-glint { position: absolute; top: 0; left: -50%; width: 36%; height: 100%; transform: skewX(-20deg); background: linear-gradient(90deg, transparent, rgba(255,255,255,.23), transparent); animation: glint 3.4s ease-in-out infinite; }
.silent-button { display: block; margin: 15px auto 0; border: 0; background: none; color: rgba(223,229,239,.42); font-size: .72rem; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.silent-button:hover { color: rgba(240,244,249,.75); }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

body[data-faction="horde"] .hero-logo {
  filter: drop-shadow(0 8px 30px rgba(0,0,0,.7)) drop-shadow(0 0 36px rgba(196, 29, 19, .26));
}
body[data-faction="alliance"] .hero-logo {
  filter: drop-shadow(0 8px 30px rgba(0,0,0,.55)) drop-shadow(0 0 36px rgba(104, 163, 242, .27));
}

@keyframes fog-left { from { transform: translate3d(-8%, 0, 0) scale(1.02); } to { transform: translate3d(10%, 4%, 0) scale(1.1); } }
@keyframes fog-right { from { transform: translate3d(8%, 2%, 0) scale(1.08); } to { transform: translate3d(-10%, -3%, 0) scale(1.01); } }
@keyframes cloud-drift { from { transform: translate3d(-2%, 0, 0) scale(1); } to { transform: translate3d(10%, 5%, 0) scale(1.12); } }
@keyframes lightning { 0% { opacity: 0; } 6% { opacity: .92; } 10% { opacity: .08; } 16% { opacity: .72; } 24% { opacity: .04; } 31% { opacity: .35; } 48%, 100% { opacity: 0; } }
@keyframes glint { 0%, 55% { left: -50%; opacity: 0; } 65% { opacity: 1; } 85%, 100% { left: 120%; opacity: 0; } }

@media (max-width: 660px) {
  .topbar { padding-top: 16px; align-items: flex-start; }
  .hero { padding-top: 20px; }
  .hero-logo-stack { width: min(92vw, 620px); }
  .backdrop-alliance { background-position: center center, center center, center center; }
  .backdrop-horde { background-position: 58% center; }
  .countdown-frame { gap: 8px; }
  .countdown-row { gap: 8px; }
  .ornament { display: none; }
  .countdown { width: 100%; padding-inline: 14px; gap: 6px; }
  .time-block { min-width: 0; flex: 1; }
  .time-block strong { font-size: clamp(1.45rem, 8vw, 2.25rem); }
  .separator { font-size: 1.3rem; }
  .faction-panel { margin-top: 42px; }
  .faction-buttons { grid-template-columns: 1fr; gap: 10px; }
  .faction-or { display: none; }
  .faction-choice { min-height: 92px; }
  .choice-status { flex-direction: column; gap: 7px; }
  #choiceStatus { text-align: center; }
  .choice-hint { border: 0; padding: 0; }
  footer { flex-wrap: wrap; }
  .cursor-aura { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .fog { transform: none !important; }
  .lightning { display: none; }
}
