:root {
  --bg: #12110f;
  --surface: #151413;
  --surface-2: #1b1917;
  --line: #3c3225;
  --gold: #d6a94c;
  --gold-light: #f0cf83;
  --text: #e8e2d7;
  --muted: #aaa299;
  --green: #70d28c;
  --page-gutter: clamp(170px, 16vw, 340px);
  --sidebar-width: 260px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 Arial, sans-serif;
}
a { color: inherit; }
.site-shell {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(#0005, #0005), url("legacy-castle-stone.png") center top / 640px auto repeat;
}
.banner {
  position: relative;
  min-height: clamp(150px, 16.667vw, 260px);
  overflow: hidden;
  background: #15110f;
}
.banner-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.banner-title {
  position: absolute;
  top: 25%;
  left: 54.2%;
  transform: translate(-50%, -50%);
  color: #efd9aa;
  font: 500 clamp(.85rem, 1.75vw, 1.65rem)/1 Georgia, serif;
  letter-spacing: .34em;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 2px 3px #35200f, 0 0 14px #ffd78d77;
  pointer-events: none;
}
.banner::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .7;
}
.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;
}
.nav {
  min-height: 58px;
  display: flex;
  align-items: stretch;
  padding: 0 var(--page-gutter);
  gap: 16px;
  background: linear-gradient(#17151255, #17151288), url("legacy-castle-stone.png") center 40% / 640px auto repeat;
  border: 0;
  box-shadow: inset 0 2px #0006, inset 0 -2px #0007, 0 5px 14px #0005;
}
.nav-links { display: flex; align-items: center; gap: 7px; padding-block: 8px; min-width: 0; }
.nav a {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 10px;
  color: #dbc9a9;
  text-decoration: none;
  text-transform: uppercase;
  font: 600 .78rem/1.2 Georgia, "Times New Roman", serif;
  letter-spacing: .075em;
  text-shadow: 0 2px 2px #000;
  border: 0;
  border-radius: 2px;
  background: linear-gradient(#18151233, #18151277), url("legacy-castle-stone.png") center / 380px auto;
  box-shadow: inset 0 1px #ded3c326, inset 0 -2px #0008, 0 3px 5px #0009;
  transition: color .18s ease, background-color .18s ease;
  white-space: nowrap;
}
.nav a:hover,
.nav a:focus-visible,
.nav a.active {
  color: #fff2d8;
  background: linear-gradient(#ded0b91a, #18151222), url("legacy-castle-stone.png") center / 380px auto;
  box-shadow: inset 0 1px #eee2cb40, inset 0 -2px #0008, 0 3px 5px #0009;
}
.nav a.active { color: #fff0c4; }
.nav a:focus-visible { outline: 2px solid #dfd5c5; outline-offset: -4px; }
.mini-status {
  margin: auto 0 auto auto;
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: 38px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 10px;
  padding: 4px 10px;
  background: linear-gradient(#18151277, #181512aa), url("legacy-castle-stone.png") center / 380px auto;
  border: 0;
  box-shadow: inset 0 1px #ded3c326, inset 0 -2px #0008, 0 3px 5px #0008;
  font-size: .68rem;
  line-height: 1.1;
}
.mini-status strong { color: var(--gold-light); }
.mini-status .players { color: #aaa; }
.mini-status .online {
  grid-row: 1 / 3;
  grid-column: 2;
  color: var(--green);
  font-weight: 700;
}
.mini-status .online.offline { color: #bd625c; }
.page-main {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: clamp(620px, 48vw, 960px);
  flex: 1;
  margin: 0 auto;
  padding: 24px var(--page-gutter) 36px;
}
.page-main::before,
.page-main::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0;
  bottom: 0;
  width: clamp(150px, 15vw, 320px);
  background: url("legacy-heraldic-banner.png") center top / auto 100% no-repeat;
  pointer-events: none;
  mask-image: linear-gradient(to right, transparent, #000 10%, #000 90%, transparent);
}
.page-main::before { left: 0; }
.page-main::after { right: 0; }
@media (min-width: 2000px) {
  :root { --page-gutter: max(340px, calc((100% - 1320px) / 2)); }
  .page-main::before { left: max(0px, calc((100% - 2000px) / 2)); }
  .page-main::after { right: max(0px, calc((100% - 2000px) / 2)); }
}
@media (max-width: 1150px) {
  :root { --page-gutter: 120px; --sidebar-width: 220px; }
  .page-main { min-height: 560px; }
  .page-main::before, .page-main::after { width: 110px; }
  .page-grid { grid-template-columns: minmax(0, 1fr) 220px; }
}
.page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
  gap: 16px;
  align-items: start;
}
.stack { display: grid; gap: 14px; }
.panel {
  padding: 15px;
  background: linear-gradient(145deg, var(--surface-2), var(--surface));
  border: 1px solid #34302b;
  box-shadow: inset 0 1px rgba(255,255,255,.025), 0 8px 25px rgba(0,0,0,.2);
}
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin: 0 0 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid #493a28;
  color: var(--gold-light);
  font: 1.15rem Georgia, serif;
}
.panel-title small {
  color: #7f786f;
  font: .72rem Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: .09em;
}
.panel p { margin: 7px 0 0; color: var(--muted); }
.news-item { padding: 10px 0; border-bottom: 1px solid #302d29; }
.news-item:last-child { border-bottom: 0; padding-bottom: 2px; }
.news-meta { display: flex; justify-content: space-between; gap: 15px; }
.news-meta strong { color: #eee7dc; }
.news-meta time { color: #777169; font-size: .78rem; white-space: nowrap; }
.best-list { margin: 0; padding: 0; list-style: none; counter-reset: hero; }
.best-list li {
  counter-increment: hero;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #302d29;
  color: #c8c1b7;
  font-size: .88rem;
}
.best-list li::before { content: counter(hero, decimal-leading-zero); color: var(--gold); font: .8rem Georgia, serif; }
.best-list em { color: #6f6962; font-size: .72rem; font-style: normal; }
.top-three li span {
  color: var(--gold-light);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(214, 169, 76, .2);
}
.top-three li::before { color: #f2c96f; font-weight: 700; }
.rate-list { margin: 0; display: grid; gap: 6px; }
.rate-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 5px;
  border-bottom: 1px dotted #37322c;
}
.rate-list dt { color: #928a80; }
.rate-list dd { margin: 0; color: #e3c179; font-weight: 700; }
.rates-content { display: grid; gap: 14px; }
.rate-section {
  padding: 15px;
  background: linear-gradient(145deg, var(--surface-2), var(--surface));
  border: 1px solid #34302b;
  box-shadow: inset 0 1px rgba(255,255,255,.025), 0 8px 25px rgba(0,0,0,.16);
}
.rate-section h2 {
  margin: 0 0 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid #493a28;
  color: var(--gold-light);
  font: 1.05rem Georgia, serif;
}
.detailed-rates { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.detailed-rates div { min-height: 30px; align-items: center; }
.rate-note { margin-top: 10px !important; padding: 9px 11px; background: #11100f; border-left: 2px solid #765725; font-size: .82rem; }
.premium-list { margin: 0; padding-left: 19px; color: var(--muted); }
.premium-list li { margin: 7px 0; }
.premium-list strong { color: var(--gold-light); }
.simple-rates { padding: 18px; }
.rate-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.rate-card {
  padding: 16px;
  background: linear-gradient(145deg, #171513, #100f0e);
  border: 1px solid #3b342b;
}
.rate-card h3 {
  margin: 0 0 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid #59462c;
  color: var(--gold-light);
  font: 1.2rem Georgia, serif;
  text-align: center;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.premium-rate-card {
  border-color: #765725;
  box-shadow: inset 0 1px rgba(242, 201, 111, .08), 0 8px 24px rgba(0,0,0,.2);
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.feature h3 { margin: 0 0 5px; color: #e3c179; font: 1rem Georgia, serif; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  margin-top: 11px;
  padding: 7px 13px;
  color: #17120b;
  background: linear-gradient(#edc875, #bd8a33);
  border: 1px solid #f0d18a;
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  font-size: .76rem;
  letter-spacing: .06em;
}
.button:hover, .button:focus-visible { filter: brightness(1.1); outline: 2px solid #fff5d6; outline-offset: 2px; }
.button.disabled { color: #746b5d; background: #28241f; border-color: #453c31; cursor: not-allowed; }
.download-card {
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(145deg, #171513, #100f0e);
  border: 1px solid #3b342b;
}
.download-card h3 { margin: 0 0 13px; color: var(--gold-light); font: 1.05rem Georgia, serif; }
.download-meta dd { max-width: 58%; text-align: right; overflow-wrap: anywhere; }
.registration-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px 16px;
  margin-top: 16px;
}
.field { display: grid; gap: 6px; color: #c9bfae; font-size: .8rem; }
.field.full-width { grid-column: 1 / -1; }
.field input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  color: #8e867c;
  background: #100f0e;
  border: 1px solid #3b342b;
  font: inherit;
}
.field input:disabled { opacity: 1; cursor: not-allowed; }
.turnstile-placeholder {
  grid-column: 1 / -1;
  min-height: 66px;
  display: grid;
  place-items: center;
  padding: 12px;
  color: #8f887f;
  background: #11100f;
  border: 1px dashed #5a4934;
  text-align: center;
}
.notice {
  padding: 12px 14px;
  color: #aaa299;
  background: #11100f;
  border-left: 3px solid var(--gold);
}
.empty-state { min-height: 200px; display: grid; place-items: center; text-align: center; }
.empty-state strong { display: block; color: var(--gold-light); font: 1.25rem Georgia, serif; }
.table-wrap { overflow-x: auto; }
.ranking-table { width: 100%; border-collapse: collapse; min-width: 520px; }
.ranking-table th, .ranking-table td { padding: 9px 10px; border-bottom: 1px solid #302d29; text-align: left; }
.ranking-table th { color: #d6b36e; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.ranking-table td { color: #aaa299; }
.ranking-table td:first-child { color: var(--gold); width: 55px; }
footer {
  padding: 18px 24px;
  color: #736d65;
  text-align: center;
  border-top: 1px solid #302a22;
  background: #0b0b0bd9;
  font-size: .8rem;
}

@media (max-width: 980px) {
  .banner { min-height: clamp(135px, 16.667vw, 165px); }
  .nav { flex-wrap: wrap; padding: 0 var(--page-gutter) 8px; }
  .nav-links { width: 100%; overflow-x: auto; min-height: 46px; }
  .mini-status { margin-left: auto; }
}
@media (max-width: 740px) {
  :root { --page-gutter: 10px; }
  .banner { min-height: 125px; }
  .banner-title { left: 54.2%; letter-spacing: .2em; font-size: .72rem; }
  .nav { justify-content: center; }
  .nav-links { justify-content: center; flex-wrap: wrap; overflow-x: visible; gap: 6px; }
  .nav a { min-height: 40px; padding: 0 10px; font-size: .72rem; }
  .mini-status { width: min(100%, 360px); margin: 7px auto 0; }
  .page-main { padding: 14px 10px 20px; }
  .page-main::before, .page-main::after { display: none; }
  .page-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .detailed-rates { grid-template-columns: 1fr; }
  .rate-comparison { grid-template-columns: 1fr; }
  .registration-grid { grid-template-columns: 1fr; }
  .field.full-width { grid-column: auto; }
}
@media (max-width: 420px) {
  .banner { min-height: 95px; }
  .banner-title { left: 54.2%; font-size: .58rem; letter-spacing: .12em; }
  .panel { padding: 13px; }
  .news-meta { display: grid; gap: 2px; }
}
