:root {
  --ink: #07080c;
  --ink-2: #0e1118;
  --panel: rgba(10, 12, 18, 0.82);
  --gold: #d4b15a;
  --gold-2: #f0d78a;
  --gold-dim: #8a6d2f;
  --crimson: #8d1d24;
  --crimson-2: #c43a3a;
  --mist: #d8cbb4;
  --muted: #9a8d78;
  --line: rgba(212, 177, 90, 0.38);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  color: var(--mist);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 19px;
  line-height: 1.65;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(212, 177, 90, 0.12), transparent 55%),
    linear-gradient(180deg, #08090e 0%, #0b0d13 40%, #07080c 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: url("../img/night.jpg");
  background-size: cover;
  background-position: center;
  opacity: 0.18;
  filter: saturate(0.7) contrast(1.1);
}

.realm-veil {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  box-shadow: inset 0 0 180px rgba(0, 0, 0, 0.72);
}

img { max-width: 100%; display: block; }
a { color: var(--gold-2); text-decoration: none; }
a:hover { color: #fff3c4; }

.realm-wrap {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.realm-header,
.realm-main,
.realm-footer,
.to-top,
.realm-modal { position: relative; z-index: 2; }

.realm-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: linear-gradient(180deg, rgba(7, 8, 12, 0.92), rgba(7, 8, 12, 0.72));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.realm-header.is-scrolled {
  background: rgba(7, 8, 12, 0.96);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.realm-header-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.realm-brand {
  display: flex;
  align-items: center;
  color: var(--gold-2);
}

.realm-brand .brand-lockup {
  height: 58px;
  width: auto;
  max-width: 280px;
  object-fit: contain;
  filter: drop-shadow(0 0 14px rgba(212, 177, 90, 0.45));
}

.realm-nav ul {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.realm-nav a {
  display: block;
  padding: 10px 12px;
  color: var(--mist);
  font-family: Cinzel, serif;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid transparent;
  white-space: nowrap;
}

.realm-nav li.is-active a,
.realm-nav a:hover {
  color: var(--gold-2);
  border-color: var(--line);
  background: rgba(212, 177, 90, 0.08);
}

.realm-nav .nav-cta a {
  background: linear-gradient(180deg, #c9a24a, #7d5a1c);
  color: #1a1206;
  border-color: #f0d78a;
  box-shadow: 0 0 18px rgba(212, 177, 90, 0.28);
}

.realm-burger {
  display: none;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
}

.realm-burger span {
  display: block;
  height: 2px;
  margin: 6px 8px;
  background: var(--gold);
}

.realm-hero {
  position: relative;
  min-height: 92vh;
  display: grid;
  place-items: end center;
  overflow: hidden;
  isolation: isolate;
}

.realm-hero-art {
  position: absolute;
  inset: -8% 0 0;
  background: url("../img/hero-mmorpg.png") center 30% / cover no-repeat;
  transform: scale(1.08);
  z-index: -2;
}

.realm-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(7,8,12,0.15) 0%, rgba(7,8,12,0.35) 45%, rgba(7,8,12,0.94) 100%),
    radial-gradient(circle at 50% 40%, transparent 20%, rgba(7,8,12,0.55) 100%);
}

.realm-hero-copy {
  text-align: center;
  padding: 0 24px 88px;
  max-width: 920px;
}

.kicker {
  display: inline-block;
  color: var(--gold);
  font-family: Cinzel, serif;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  font-size: 12px;
  margin-bottom: 14px;
}

.realm-hero h1,
.page-hero h1,
.sheet h1,
.sheet h2 {
  font-family: "Cinzel Decorative", Cinzel, serif;
  color: #f6e7b8;
  text-shadow: 0 8px 28px rgba(0, 0, 0, 0.75);
}

.realm-hero h1 {
  font-size: clamp(42px, 7vw, 84px);
  line-height: 1.05;
  margin: 0 0 16px;
}

.realm-hero h1.hero-logo {
  margin: 0 auto 8px;
}

.realm-hero h1.hero-logo img {
  width: min(420px, 78vw);
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.65)) drop-shadow(0 0 22px rgba(212, 177, 90, 0.35));
}

.realm-hero p.lead {
  font-size: 24px;
  color: #efe4cc;
  margin: 0 auto 28px;
  max-width: 680px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  min-height: 52px;
  padding: 12px 28px;
  border: 1px solid var(--gold-2);
  font-family: Cinzel, serif;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-gold {
  background: linear-gradient(180deg, #e6c76a 0%, #b28932 48%, #6f4e16 100%);
  color: #1b1306;
  box-shadow: 0 0 24px rgba(212, 177, 90, 0.35), inset 0 1px 0 rgba(255, 240, 190, 0.45);
}

.btn-ghost {
  background: rgba(8, 9, 14, 0.45);
  color: var(--gold-2);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 32px rgba(212, 177, 90, 0.5);
  color: #1b1306;
}

.btn-ghost:hover { color: var(--gold-2); }

.ticker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(8, 9, 14, 0.78);
}

.ticker div {
  padding: 22px 12px;
  text-align: center;
  border-right: 1px solid rgba(212, 177, 90, 0.16);
}

.ticker div:last-child { border-right: 0; }
.ticker b {
  display: block;
  font-family: Cinzel, serif;
  color: var(--gold-2);
  font-size: 22px;
}
.ticker span {
  color: var(--muted);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
}

.section { padding: 84px 0; }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head h2 {
  font-family: "Cinzel Decorative", Cinzel, serif;
  font-size: clamp(30px, 4vw, 46px);
  color: var(--gold-2);
  margin: 8px 0 0;
}

.news-grid,
.mosaic,
.stat-grid,
.account-grid,
.mirror-grid,
.req-grid {
  display: grid;
  gap: 22px;
}

.news-grid { grid-template-columns: repeat(3, 1fr); }
.mosaic { grid-template-columns: 1.3fr 0.7fr; }
.stat-grid { grid-template-columns: repeat(2, 1fr); }
.account-grid, .req-grid, .mirror-grid { grid-template-columns: repeat(2, 1fr); }

.card, .sheet, .stat, .form-card {
  background:
    linear-gradient(180deg, rgba(18, 16, 12, 0.2), transparent 40%),
    var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(212, 177, 90, 0.08);
  position: relative;
}

.card::after,
.sheet::after,
.form-card::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(212, 177, 90, 0.14);
  pointer-events: none;
}

.card {
  overflow: hidden;
  min-height: 100%;
}

.card img.cover {
  height: 190px;
  width: 100%;
  object-fit: cover;
  filter: saturate(0.9);
}

.card-body, .sheet, .stat, .form-card { padding: 22px 24px 26px; }

.card h3, .stat h3, .sheet h3 {
  font-family: Cinzel, serif;
  color: var(--gold-2);
  margin: 0 0 10px;
  font-size: 22px;
}

.meta {
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.04em;
}

.mosaic-hero, .mosaic-side {
  min-height: 340px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-end;
  padding: 28px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.mosaic-hero { background-image: linear-gradient(180deg, transparent, rgba(7,8,12,0.88)), url("../img/card-dungeon.png"); }
.mosaic-side { background-image: linear-gradient(180deg, transparent, rgba(7,8,12,0.88)), url("../img/card-guild.png"); }
.mosaic h3 {
  font-family: Cinzel, serif;
  color: var(--gold-2);
  font-size: 28px;
  margin: 0 0 8px;
}

.band-mark {
  width: 92px;
  height: 92px;
  margin: 0 auto 10px;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(212, 177, 90, 0.4));
}

.download-band {
  position: relative;
  overflow: hidden;
  padding: 72px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.download-band::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../img/page-hero-mmorpg.png") center / cover no-repeat;
  filter: saturate(0.75) brightness(0.45);
  z-index: -1;
}

.page-hero {
  position: relative;
  min-height: 320px;
  display: grid;
  place-items: end center;
  overflow: hidden;
  isolation: isolate;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url("../img/page-hero-mmorpg.png") center 35% / cover no-repeat;
}

.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(7,8,12,0.25), rgba(7,8,12,0.92));
}

.page-hero-copy {
  text-align: center;
  padding: 0 20px 46px;
}

.page-hero-copy::before {
  content: "";
  display: block;
  width: 86px;
  height: 86px;
  margin: 0 auto 10px;
  background: url("../img/logo-mark.png") center / contain no-repeat;
  filter: drop-shadow(0 0 16px rgba(212, 177, 90, 0.4));
}

.page-hero h1 {
  font-size: clamp(34px, 5vw, 60px);
  margin: 0;
}

.sheet {
  margin: -48px auto 72px;
  padding: 36px 40px 44px;
}

.sheet h2 { margin-top: 0; }
.sheet h3 { margin-top: 34px; }
.sheet ul { padding-left: 18px; }
.sheet li { margin: 8px 0; }
.ban { color: #ff8d8d; }

.form-card { width: min(560px, 100%); margin: -48px auto 80px; }

.form-card::before {
  content: "";
  display: block;
  width: 78px;
  height: 78px;
  margin: 0 auto 14px;
  background: url("../img/logo-mark.png") center / contain no-repeat;
}
.form-group { margin: 0 0 18px; }
.form-group label {
  display: block;
  font-family: Cinzel, serif;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group input[type="number"] {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  color: #f4ead4;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(212, 177, 90, 0.28);
  font-family: inherit;
  font-size: 18px;
}

.checkbox-group label,
.form-group label:has(input[type="checkbox"]) {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  text-transform: none;
  letter-spacing: 0;
  font-family: inherit;
  color: var(--mist);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 22px;
}

.warn_login, .warn_form, .warn_page {
  padding: 12px 14px;
  margin: 0 0 16px;
  border-left: 3px solid var(--crimson-2);
  background: rgba(141, 29, 36, 0.18);
  color: #ffd0d0;
}

.succ_login, .succ_form {
  padding: 12px 14px;
  margin: 0 0 16px;
  border-left: 3px solid #7dba6a;
  background: rgba(81, 160, 90, 0.16);
  color: #d9f5cf;
}

.realm-footer {
  padding: 28px 0 24px;
  background: rgba(5, 6, 10, 0.88);
  border-top: 1px solid var(--line);
}

.realm-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 28px;
  padding: 20px 0 10px;
}

.realm-footer h2, .realm-footer h3 {
  font-family: Cinzel, serif;
  color: var(--gold-2);
  margin: 0 0 12px;
}

.realm-footer-brand .footer-lockup {
  width: min(280px, 100%);
  height: auto;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 16px rgba(212, 177, 90, 0.3));
}
.realm-footer ul { list-style: none; margin: 0; padding: 0; }
.realm-footer li { margin: 8px 0; }
.realm-footer a { color: var(--mist); }
.realm-social {
  display: flex;
  gap: 12px;
  align-items: center;
}
.realm-social img { width: 42px; height: 42px; object-fit: contain; opacity: 0.85; }
.realm-social a:hover img { opacity: 1; transform: scale(1.08); }
.realm-copy {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin: 18px 20px 0;
}

.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 52px;
  height: 52px;
  display: none;
  border: 1px solid var(--gold);
  background: rgba(8, 9, 14, 0.8) url("../img/logo-mark.png") center / 78% no-repeat;
  color: transparent;
  cursor: pointer;
  z-index: 50;
  mix-blend-mode: normal;
}
.to-top.is-visible { display: block; }

.realm-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: none;
  place-items: center;
  z-index: 80;
  padding: 24px;
}
.realm-modal.is-open { display: grid; }
.realm-modal iframe { max-width: 100%; }
.realm-modal-close {
  position: absolute;
  top: 18px;
  right: 24px;
  background: none;
  border: 0;
  color: var(--gold-2);
  font-size: 42px;
  cursor: pointer;
}

.realm-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--gold-dim);
  border-top-color: var(--gold-2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.online-dot { color: #7dba6a; }

.donate-legacy h2,
.donate-legacy h3,
.donate-legacy h4 { color: var(--gold-2) !important; }
.donate-legacy .button-a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  min-height: 46px;
  padding: 10px 20px;
  background: linear-gradient(180deg, #e6c76a, #7d5a1c);
  color: #1b1306 !important;
  border: 1px solid #f0d78a;
  font-family: Cinzel, serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.g-recaptcha { transform-origin: left top; }

@media (max-width: 980px) {
  .ticker, .news-grid, .mosaic, .stat-grid, .account-grid, .req-grid, .mirror-grid, .realm-footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .realm-burger { display: block; }
  .realm-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(7, 8, 12, 0.96);
    border-bottom: 1px solid var(--line);
  }
  .realm-nav.is-open { display: block; }
  .realm-nav ul { flex-direction: column; padding: 12px 16px 20px; }
  .realm-hero { min-height: 80vh; }
}

@media (max-width: 700px) {
  .ticker, .news-grid, .mosaic, .stat-grid, .account-grid, .req-grid, .mirror-grid, .realm-footer-grid {
    grid-template-columns: 1fr;
  }
  .sheet, .form-card { padding: 24px 18px 28px; }
  .realm-brand .brand-lockup { height: 48px; max-width: 200px; }
}
