:root {
  color-scheme: dark;
  font-family: Georgia, "Times New Roman", serif;
  color: #f5deb4;
  background: #07111d;
  --gold: #d9a350;
  --gold-bright: #ffe0a2;
  --stage-ratio: 1.776833;
  --mobile-ratio: .562799;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-width: 320px; min-height: 100%; margin: 0; overflow: hidden; }
body { background: #07111d; }
button, a { font: inherit; }
button { color: inherit; }

.scene { position: relative; width: 100vw; height: 100svh; min-height: 560px; overflow: hidden; isolation: isolate; background: #07111d; }
.desktop-stage {
  position: absolute;
  z-index: 0;
  top: 50%;
  left: 50%;
  width: max(100vw, calc(100svh * var(--stage-ratio)));
  height: max(100svh, calc(100vw / var(--stage-ratio)));
  overflow: hidden;
  transform: translate(-50%, -50%);
}

.depth-layer, .depth-layer img, .scene-vignette, .desktop-art-ui { position: absolute; inset: 0; }
.depth-layer { pointer-events: none; will-change: transform; }
.depth-layer img { width: 100%; height: 100%; object-fit: fill; user-select: none; -webkit-user-drag: none; }
.depth-layer--far { transform: translate3d(var(--far-x, 0), var(--far-y, 0), 0) scale(1.025); }
.depth-layer--companions { transform: translate3d(var(--mid-x, 0), var(--mid-y, 0), 0); }
.depth-layer--companions img { top: 27.5%; left: 21%; width: 70%; height: auto; }
.depth-layer--hero { transform: translate3d(var(--near-x, 0), var(--near-y, 0), 0); }
.depth-layer--hero img { top: 5%; left: 33%; width: 100%; height: auto; }

.lantern-glow { position: absolute; z-index: 3; top: 32%; right: 4%; width: 23%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255,167,53,.28), rgba(255,113,18,.08) 38%, transparent 68%); mix-blend-mode: screen; filter: blur(16px); pointer-events: none; animation: breathe 4.8s ease-in-out infinite; }
.scene-vignette { z-index: 4; background: linear-gradient(90deg, rgba(2,6,12,.26), transparent 32%, transparent 82%, rgba(2,6,12,.18)), linear-gradient(0deg, rgba(2,5,10,.55), transparent 30%); pointer-events: none; }
.desktop-art-ui { z-index: 5; pointer-events: none; }

.banner-motto { position: absolute; top: 25.5%; left: 19.1%; margin: 0; color: #e0c49a; font-size: clamp(.68rem, 1.08vw, 1.12rem); font-weight: 700; line-height: 1.28; text-transform: uppercase; text-shadow: 0 2px 4px #32160d; }
.identity { position: absolute; top: 7.5%; left: 24%; display: grid; width: 32%; justify-items: center; }
.identity__logo { display: block; width: 100%; height: auto; filter: drop-shadow(0 7px 8px rgba(31,10,0,.78)); }
.identity__tagline { margin: -1.8% 0 0; color: #f4dfbb; font-size: clamp(.72rem, 1.17vw, 1.2rem); font-weight: 700; line-height: 1.33; text-align: center; text-transform: uppercase; text-shadow: 0 2px 4px #000; }

.hero-actions { position: absolute; top: 57%; left: 18.8%; display: flex; gap: clamp(10px, 1.1vw, 18px); pointer-events: auto; }
.fantasy-button { position: relative; display: flex; height: clamp(54px, 7.4vh, 72px); align-items: center; justify-content: center; gap: 18px; padding: 0 clamp(18px, 2.1vw, 36px); border: 1px solid #67513a; border-radius: 3px; background: linear-gradient(180deg, rgba(31,33,34,.98), rgba(12,16,20,.99)); color: #d2c09e; box-shadow: 0 8px 18px rgba(0,0,0,.6), inset 0 0 0 3px rgba(0,0,0,.3); font-size: clamp(.88rem, 1.25vw, 1.2rem); font-weight: 700; text-transform: uppercase; cursor: pointer; transition: transform 160ms ease, filter 160ms ease; }
.fantasy-button::before { position: absolute; inset: -5px; border: 1px solid rgba(131,95,51,.6); content: ""; clip-path: polygon(3% 0,97% 0,100% 16%,100% 84%,97% 100%,3% 100%,0 84%,0 16%); }
.fantasy-button:hover, .fantasy-button:focus-visible { outline: 0; transform: translateY(-2px); filter: brightness(1.14); }
.fantasy-button--primary { min-width: clamp(182px, 14.4vw, 242px); border-color: #ffc458; background: linear-gradient(180deg, rgba(91,55,12,.98), rgba(33,20,7,.99)); color: #ffe2a1; box-shadow: 0 0 18px rgba(255,154,28,.72), inset 0 0 12px rgba(255,179,52,.18), 0 8px 18px rgba(0,0,0,.6); }
.fantasy-button__arrow { font-size: 1.7em; line-height: 1; }
.fantasy-button--discord svg { width: 29px; fill: #aebded; }

.alliance-stats { position: absolute; right: 4.5%; bottom: 3%; display: grid; width: 51%; min-height: 90px; grid-template-columns: repeat(4, 1fr); margin: 0; border: 1px solid rgba(111,91,67,.72); background: linear-gradient(180deg, rgba(23,29,35,.95), rgba(8,13,18,.97)); box-shadow: 0 8px 24px rgba(0,0,0,.7), inset 0 0 0 3px rgba(0,0,0,.28); clip-path: polygon(1% 0,99% 0,100% 13%,100% 87%,99% 100%,1% 100%,0 87%,0 13%); pointer-events: auto; }
.stat { display: grid; place-content: center; padding: 10px; border-right: 1px solid rgba(114,94,70,.43); }
.stat:last-child { border-right: 0; }
.stat dt { display: flex; align-items: center; gap: 9px; color: #ead0a4; }
.stat dt span { font-size: clamp(1.2rem, 1.8vw, 1.8rem); }
.stat strong { font-size: clamp(1rem, 1.5vw, 1.5rem); }
.stat dd { margin: -2px 0 0 36px; color: #c8b38e; font-size: clamp(.5rem, .68vw, .68rem); font-weight: 700; text-transform: uppercase; }
.stat--words strong { font-size: clamp(.72rem, 1vw, 1rem); text-transform: uppercase; }

.site-header { position: fixed; z-index: 20; inset: 0 0 auto; height: 78px; pointer-events: none; }
.compact-brand, .menu-toggle { display: none; }
.main-nav { position: absolute; top: 9px; left: 17%; display: grid; width: min(51.5%, 860px); height: 62px; grid-template-columns: repeat(6, minmax(0,1fr)); padding: 0 14px; border: 1px solid rgba(156,111,60,.65); background: linear-gradient(180deg, rgba(27,28,29,.98), rgba(10,14,19,.97)); box-shadow: 0 7px 14px rgba(0,0,0,.6), inset 0 0 0 3px rgba(0,0,0,.35); clip-path: polygon(1% 0,99% 0,100% 14%,100% 86%,99% 100%,1% 100%,0 86%,0 14%); pointer-events: auto; }
.main-nav__item { display: grid; min-width: 0; place-items: center; padding: .25rem; border: 0; border-right: 1px solid rgba(118,84,48,.2); background: transparent; color: #c7ac80; font-size: clamp(.7rem, 1.02vw, 1.02rem); font-weight: 700; text-decoration: none; text-transform: uppercase; text-shadow: 0 2px 3px #000; cursor: pointer; }
.main-nav__item:last-child { border-right: 0; }
.main-nav__item:hover, .main-nav__item:focus-visible, .main-nav__item.is-active { color: #ffe3a8; outline: 0; background: rgba(255,190,85,.05); box-shadow: inset 0 -2px 0 #d9932c; }
.header-tools { position: absolute; top: 18px; right: 4%; display: flex; gap: 10px; pointer-events: auto; }
.server-badge, .language { display: flex; height: 43px; align-items: center; border: 1px solid rgba(87,117,144,.25); border-radius: 7px; background: rgba(8,19,31,.84); color: #c1b49e; box-shadow: 0 5px 18px rgba(0,0,0,.35); backdrop-filter: blur(8px); }
.server-badge { padding: 0 17px; font-size: clamp(.72rem, 1vw, 1rem); }
.language { gap: 7px; padding: 0 12px; cursor: pointer; }
.language svg { width: 20px; fill: none; stroke: #d2b881; stroke-width: 1.5; }

.mobile-stage, .mobile-ui { display: none; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; max-width: min(90vw,440px); padding: 12px 18px; border: 1px solid rgba(227,179,102,.6); border-radius: 4px; background: rgba(7,12,18,.95); color: #f6dfb5; box-shadow: 0 10px 30px rgba(0,0,0,.55); opacity: 0; pointer-events: none; text-align: center; transform: translate(-50%,12px); transition: opacity 180ms ease, transform 180ms ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%,0); }
.visually-hidden { position: absolute!important; width: 1px!important; height: 1px!important; padding: 0!important; margin: -1px!important; overflow: hidden!important; clip: rect(0,0,0,0)!important; white-space: nowrap!important; border: 0!important; }

@media (max-aspect-ratio: 4/3) and (min-width: 701px) {
  .main-nav { left: 11%; width: 62%; }
  .header-tools { right: 2%; }
  .identity { left: 29%; width: 30%; }
  .banner-motto { left: 23%; }
  .hero-actions { left: 24%; }
  .alliance-stats { right: auto; left: 24%; width: 58%; }
}

@media (max-width: 700px) {
  .desktop-stage { display: none; }
  .scene { min-height: 620px; }
  .mobile-stage { position: absolute; z-index: 0; top: 50%; left: 50%; display: block; width: max(100vw, calc(100svh * var(--mobile-ratio))); height: max(100svh, calc(100vw / var(--mobile-ratio))); transform: translate(-50%,-50%); }
  .mobile-stage::after { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(2,7,13,.12), transparent 44%, rgba(2,5,10,.5) 76%, rgba(2,5,9,.92)); content: ""; }
  .mobile-stage img { width: 100%; height: 100%; object-fit: fill; }
  .mobile-ui { position: absolute; z-index: 4; inset: 0; display: block; pointer-events: none; }
  .mobile-logo { position: absolute; top: max(70px, calc(env(safe-area-inset-top) + 66px)); left: 50%; width: min(68vw, 300px); height: auto; filter: drop-shadow(0 5px 7px rgba(20,7,0,.82)); transform: translateX(-50%); }
  .mobile-tagline { position: absolute; top: min(31vh, 248px); left: 50%; width: 90%; margin: 0; color: #f2ddba; font-size: clamp(.68rem, 3vw, .86rem); font-weight: 700; line-height: 1.34; text-align: center; text-transform: uppercase; text-shadow: 0 2px 4px #000; transform: translateX(-50%); }
  .mobile-actions { position: absolute; right: 15px; bottom: calc(104px + env(safe-area-inset-bottom)); left: 15px; display: flex; gap: 10px; justify-content: center; pointer-events: auto; }
  .fantasy-button { height: 50px; flex: 1 1 0; max-width: 190px; gap: 9px; padding: 0 13px; font-size: .78rem; }
  .fantasy-button--primary { min-width: 0; }
  .mobile-stats { position: absolute; right: 8px; bottom: max(8px,env(safe-area-inset-bottom)); left: 8px; display: grid; min-height: 80px; grid-template-columns: repeat(3,1fr); margin: 0; border: 1px solid rgba(111,91,67,.72); background: rgba(9,15,21,.94); box-shadow: 0 8px 24px rgba(0,0,0,.65); pointer-events: auto; }
  .mobile-stats div { display: grid; place-content: center; border-right: 1px solid rgba(114,94,70,.43); text-align: center; }
  .mobile-stats div:last-child { border: 0; }
  .mobile-stats dt { color: #ecd2a6; font-size: 1.05rem; font-weight: 700; }
  .mobile-stats dd { margin: 2px 0 0; color: #c9b38f; font-size: .5rem; font-weight: 700; text-transform: uppercase; }
  .site-header { top: max(8px,env(safe-area-inset-top)); right: 12px; left: 12px; display: flex; height: 52px; align-items: center; justify-content: space-between; padding: 0 8px 0 12px; border: 1px solid rgba(155,115,67,.52); border-radius: 4px; background: rgba(7,14,22,.84); box-shadow: 0 6px 18px rgba(0,0,0,.42); backdrop-filter: blur(10px); pointer-events: auto; }
  .compact-brand { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid #b6843d; border-radius: 50%; color: #f3d79f; font-size: .72rem; font-weight: 700; text-decoration: none; }
  .header-tools { display: none; }
  .menu-toggle { display: grid; width: 40px; height: 40px; place-content: center; gap: 5px; padding: 0; border: 0; background: transparent; cursor: pointer; }
  .menu-toggle span { display: block; width: 23px; height: 2px; background: #dfc18d; }
  .main-nav { top: 58px; right: 0; left: 0; display: grid; width: auto; height: auto; grid-template-columns: 1fr 1fr; gap: 1px; padding: 6px; visibility: hidden; opacity: 0; transform: translateY(-8px); transition: opacity 160ms ease, transform 160ms ease, visibility 160ms; }
  .main-nav.is-open { visibility: visible; opacity: 1; transform: translateY(0); }
  .main-nav__item { min-height: 44px; border: 0; font-size: .72rem; }
  .toast { bottom: calc(100px + env(safe-area-inset-bottom)); font-size: .84rem; }
}

@media (max-height: 650px) and (min-width: 701px) {
  .identity { top: 7%; width: 29%; }
  .hero-actions { top: 55%; }
  .alliance-stats { min-height: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto!important; animation-duration: .01ms!important; animation-iteration-count: 1!important; transition-duration: .01ms!important; }
  .depth-layer { transform: none!important; }
}

@keyframes breathe { 0%,100% { opacity: .72; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.06); } }

