/* Ashenfall — OSRS-inspired dark fantasy theme */

:root {
  --bg: #0a090c;
  --bg-elevated: #121016;
  --panel: #1a151c;
  --panel-hover: #241e26;
  --border: #4a3428;
  --border-light: #6b4f38;
  --crimson: #9b2c2c;
  --crimson-bright: #c23a3a;
  --gold: #c9a227;
  --gold-light: #e8c45c;
  --text: #ebe4d6;
  --muted: #9a8f82;
  --success: #5d8a4a;
  --max-width: 1100px;
  --header-height: 72px;
  --font-display: 'Cinzel', Georgia, serif;
  --font-body: 'Segoe UI', system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background:
    radial-gradient(ellipse 100% 60% at 50% -20%, rgba(155, 44, 44, 0.18), transparent 55%),
    radial-gradient(ellipse 80% 40% at 80% 100%, rgba(201, 162, 39, 0.06), transparent),
    var(--bg);
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--gold-light);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  width: min(100% - 2rem, var(--max-width));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 9, 12, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header-height);
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand:hover {
  text-decoration: none;
}

.brand__logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.brand__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.12em;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--gold);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.site-nav a {
  padding: 0.5rem 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--gold-light);
  background: var(--panel);
  text-decoration: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.btn:hover {
  background: var(--panel-hover);
  border-color: var(--border-light);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: linear-gradient(180deg, var(--crimson-bright), var(--crimson));
  border-color: #7a2020;
  color: #fff;
}

.btn--primary:hover {
  background: linear-gradient(180deg, #d44a4a, var(--crimson-bright));
  border-color: var(--gold);
}

.btn--gold {
  background: linear-gradient(180deg, #a88620, #7a6318);
  border-color: var(--gold);
  color: #1a1510;
}

.btn--gold:hover {
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
}

.btn--discord {
  background: #5865f2;
  border-color: #4752c4;
  color: #fff;
}

.btn--discord:hover {
  background: #6b77f5;
}

.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Hero */
.hero {
  text-align: center;
  padding: 3rem 0 4rem;
}

.hero__logo {
  width: min(280px, 70vw);
  margin: 0 auto 1.5rem;
  filter: drop-shadow(0 12px 32px rgba(155, 44, 44, 0.35));
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 6vw, 3rem);
  color: var(--gold-light);
  letter-spacing: 0.15em;
  margin: 0 0 0.5rem;
  text-transform: uppercase;
}

.hero__tagline {
  font-size: clamp(1rem, 3vw, 1.25rem);
  color: var(--muted);
  margin: 0 0 2rem;
  font-style: italic;
}

/* Sections */
.section {
  padding: 3rem 0;
}

.section--panel {
  background: var(--bg-elevated);
  border-block: 1px solid var(--border);
}

.section__title {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--gold-light);
  margin: 0 0 1.5rem;
  text-align: center;
  letter-spacing: 0.08em;
}

.section__lead {
  text-align: center;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto 2rem;
}

/* Home content showcase (ToA, Nex, world boss) */
.content-showcase {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 0.5rem;
}

.content-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.content-card__media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.content-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.content-card__body {
  padding: 1.25rem 1.5rem 1.5rem;
}

.content-card__label {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--crimson-bright);
  font-weight: 600;
}

.content-card__title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--gold-light);
}

.content-card__text {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.55;
}

@media (min-width: 900px) {
  .content-showcase {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .content-card {
    flex-direction: row;
    align-items: stretch;
  }

  .content-card__media {
    flex: 1.1;
    min-width: 0;
    aspect-ratio: auto;
    min-height: 220px;
    border-bottom: none;
    border-right: 1px solid var(--border);
  }

  .content-card__body {
    flex: 0.9;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

/* Feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.feature-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--crimson), var(--gold));
}

.feature-card h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold-light);
}

.feature-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Content panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.5rem;
}

.panel h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--gold-light);
  margin: 0 0 1rem;
}

.panel h3 {
  font-size: 1rem;
  color: var(--text);
  margin: 1.25rem 0 0.5rem;
}

.panel ol,
.panel ul {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--muted);
}

/* Web store */
.store-checkout-panel {
  margin-bottom: 1.5rem;
}

.store-username-label {
  display: block;
  font-family: var(--font-display);
  color: var(--gold-light);
  margin-bottom: 0.5rem;
}

.store-username-input {
  width: 100%;
  max-width: 320px;
  padding: 0.65rem 0.85rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

.store-hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
}

.store-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.store-product {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.store-product__visual {
  width: 88px;
  height: 88px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(201, 162, 39, 0.15), transparent 70%);
  border-radius: 8px;
}

.store-product__img {
  image-rendering: pixelated;
  object-fit: contain;
  max-width: 72px;
  max-height: 72px;
}

.store-product__actions {
  width: 100%;
  justify-content: center;
}

.store-paypal-panel ol.store-paypal-steps {
  color: var(--muted);
  line-height: 1.6;
  padding-left: 1.25rem;
}

.store-paypal-code-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 1.25rem 0 0.35rem;
  text-align: center;
}

.store-paypal-code {
  font-family: ui-monospace, monospace;
  font-size: 1.1rem;
  color: var(--gold-light);
  text-align: center;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px dashed var(--gold);
  border-radius: 6px;
  word-break: break-all;
}

.store-product h3 {
  font-family: var(--font-display);
  color: var(--gold-light);
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.store-product p {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.store-product__price {
  font-size: 0.95rem !important;
  color: var(--muted) !important;
  font-weight: 500;
  margin-bottom: 0.5rem !important;
}

.store-qty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.store-qty__label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-right: 0.25rem;
}

.store-qty__btn {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-elevated);
  color: var(--gold-light);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}

.store-qty__btn:hover {
  border-color: var(--gold);
  background: var(--panel-hover);
}

.store-qty__input {
  width: 3.25rem;
  text-align: center;
  padding: 0.35rem 0.25rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  -moz-appearance: textfield;
}

.store-qty__input::-webkit-outer-spin-button,
.store-qty__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.store-product__line-total {
  font-size: 1.15rem !important;
  color: var(--gold-light) !important;
  font-weight: 600;
  margin-bottom: 0.75rem !important;
}

.store-empty {
  color: var(--muted);
  grid-column: 1 / -1;
}

.store-status {
  text-align: center;
  color: var(--gold-light);
  margin-bottom: 1rem;
}

.store-status--error {
  color: #e88;
}

.donor-rank-list {
  columns: 2;
  column-gap: 2rem;
  margin: 0;
  padding-left: 1.25rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.donor-rank-list li {
  margin-bottom: 0.35rem;
  break-inside: avoid;
}

@media (max-width: 600px) {
  .donor-rank-list {
    columns: 1;
  }
}

.panel li {
  margin-bottom: 0.5rem;
}

.panel li strong {
  color: var(--text);
}

/* Page header */
.page-header {
  text-align: center;
  padding: 2.5rem 0 1.5rem;
}

.page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  color: var(--gold-light);
  letter-spacing: 0.1em;
  margin: 0 0 0.5rem;
}

.page-header p {
  color: var(--muted);
  margin: 0;
  max-width: 560px;
  margin-inline: auto;
}

/* Vote / update lists */
.card-list {
  display: grid;
  gap: 1rem;
}

.vote-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.vote-card__info h3 {
  margin: 0 0 0.25rem;
  color: var(--gold-light);
  font-family: var(--font-display);
}

.vote-card__info p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.update-item {
  padding: 1.25rem 1.5rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 4px solid var(--crimson);
  border-radius: 8px;
}

.update-item time {
  font-size: 0.8rem;
  color: var(--gold);
}

.update-item h3 {
  margin: 0.35rem 0 0.5rem;
  font-family: var(--font-display);
  color: var(--text);
}

.update-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Rules */
.rules-list {
  counter-reset: rule;
  list-style: none;
  padding: 0;
  margin: 0;
}

.rules-list li {
  counter-increment: rule;
  padding: 1rem 1rem 1rem 3rem;
  margin-bottom: 0.75rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  position: relative;
  color: var(--muted);
}

.rules-list li::before {
  content: counter(rule);
  position: absolute;
  left: 1rem;
  top: 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--crimson-bright);
}

/* Hiscores placeholder */
.placeholder-box {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--panel);
  border: 2px dashed var(--border);
  border-radius: 8px;
  color: var(--muted);
}

.placeholder-box strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--gold-light);
  margin-bottom: 0.5rem;
}

/* Store embed placeholder */
.store-frame {
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  padding: 2rem;
  color: var(--muted);
}

/* Footer */
.site-footer {
  margin-top: auto;
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}

.site-footer .btn-group {
  justify-content: center;
  margin-bottom: 1rem;
}

.site-footer p {
  margin: 0.25rem 0;
}

/* Donor ranks page */
.section-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-bottom: 3rem;
}

.donor-rules-list {
  margin: 0;
  padding-left: 1.25rem;
  color: var(--muted);
}

.donor-rules-list li {
  margin-bottom: 0.5rem;
}

.donor-rules-list code {
  color: var(--gold-light);
  font-size: 0.9em;
}

.donor-section-title {
  font-family: var(--font-display);
  color: var(--gold-light);
  margin: 0.5rem 0 0;
  font-size: 1.35rem;
}

.donor-table-wrap {
  overflow-x: auto;
}

.donor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.donor-table th,
.donor-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.donor-table th {
  color: var(--gold-light);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.donor-table__apex td {
  color: var(--gold-light);
  background: rgba(201, 162, 39, 0.08);
}

.donor-rank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.donor-rank-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
}

.donor-rank-card--apex {
  border-color: var(--gold);
  box-shadow: 0 0 24px rgba(201, 162, 39, 0.12);
}

.donor-rank-card__head {
  margin-bottom: 0.75rem;
}

.donor-rank-card__name {
  font-family: var(--font-display);
  margin: 0;
  font-size: 1.2rem;
  color: var(--gold-light);
}

.donor-rank-card--apex .donor-rank-card__name {
  color: var(--gold);
}

.donor-rank-card__amount {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.donor-rank-card__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.donor-rank-card__stats strong {
  color: var(--text);
}

.donor-rank-card__unlocks {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.donor-rank-card__unlocks li {
  margin-bottom: 0.35rem;
}

/* Layout wrapper */
.page-wrap {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

/* Mobile nav */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    background: rgba(10, 9, 12, 0.98);
    border-bottom: 1px solid var(--border);
  }

  .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    padding: 0.75rem 1rem;
  }

  .hero {
    padding-top: 2rem;
  }

  .btn-group {
    flex-direction: column;
  }

  .btn-group .btn {
    width: 100%;
  }
}
