:root {
  --bg: oklch(0.97 0.012 80);
  --text: oklch(0.22 0.015 80);
  --link: oklch(0.5 0.13 30);
  --link-hover: oklch(0.42 0.15 30);

  --forest-dark: oklch(0.24 0.03 130);
  --forest-darker: oklch(0.2 0.025 130);
  --forest-mid: oklch(0.3 0.04 130);
  --forest-border: oklch(0.45 0.05 130);
  --forest-badge-text: oklch(0.85 0.03 130);
  --forest-sub: oklch(0.9 0.02 130);
  --forest-italic: oklch(0.75 0.03 130);
  --online-dot: oklch(0.75 0.18 140);

  --accent: oklch(0.78 0.15 30);
  --accent-dark: oklch(0.3 0.06 30);
  --ink: oklch(0.22 0.02 130);
  --discord-blue: oklch(0.36 0.09 260);

  --section-bg-alt: oklch(0.94 0.015 80);
  --card-border: oklch(0.9 0.01 80);
  --muted: oklch(0.4 0.02 80);
  --muted-2: oklch(0.42 0.02 80);
  --muted-3: oklch(0.45 0.02 80);
  --label: oklch(0.5 0.13 30);

  --war-bg: oklch(0.2 0.02 80);
  --war-accent-circle: oklch(0.3 0.03 80);
  --war-text: oklch(0.9 0.01 80);
  --war-hl-red: oklch(0.68 0.13 25);

  --rules-bg: oklch(0.98 0.02 85);
  --rules-border: oklch(0.85 0.03 85);
  --rules-divider: oklch(0.9 0.02 85);
  --rule-num: oklch(0.55 0.13 30);

  --board-header-bg: oklch(0.2 0.02 80);
  --board-border: oklch(0.88 0.01 80);
  --board-divider: oklch(0.93 0.01 80);

  --map-bg1: oklch(0.88 0.03 130);
  --map-bg2: oklch(0.84 0.03 130);
  --map-border: oklch(0.7 0.03 130);
  --map-text: oklch(0.4 0.03 130);

  --footer-muted: oklch(0.6 0.02 130);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Karla', sans-serif;
}

a { color: var(--link); }
a:hover { color: var(--link-hover); }
::selection { background: oklch(0.8 0.12 30 / 0.4); }

.page { width: 100%; overflow-x: hidden; }

h1, h2, h3 { font-family: 'Pixelify Sans', monospace; margin: 0; }

.accent { color: var(--accent); }

/* HERO */
.hero {
  position: relative;
  padding: 96px 32px 100px;
  text-align: center;
  background: linear-gradient(180deg, var(--forest-dark) 0%, var(--forest-darker) 55%, var(--bg) 100%);
  overflow: hidden;
}
.hero__grid {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 2px, transparent 2px 34px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 2px, transparent 2px 34px);
  pointer-events: none;
}
.hero__inner { position: relative; max-width: 820px; margin: 0 auto; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--forest-mid);
  border: 2px solid var(--forest-border);
  border-radius: 4px;
  padding: 6px 14px;
  font-family: 'Pixelify Sans', monospace;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--forest-badge-text);
  margin-bottom: 28px;
}
.badge__dot { width: 8px; height: 8px; background: var(--online-dot); border-radius: 50%; }

.hero__title {
  font-size: clamp(40px, 7vw, 84px);
  line-height: 1;
  margin: 0 0 18px;
  color: #fff;
  text-shadow: 4px 4px 0 var(--accent-dark);
}
.hero__tagline {
  font-size: 20px;
  line-height: 1.6;
  color: var(--forest-sub);
  max-width: 560px;
  margin: 0 auto 12px;
}
.hero__sub {
  font-size: 14px;
  color: var(--forest-italic);
  margin: 0 0 36px;
  font-style: italic;
}

.hero__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.ip-box {
  display: flex;
  align-items: center;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--ink);
}
.ip-box__text {
  font-family: 'Pixelify Sans', monospace;
  font-size: 16px;
  padding: 14px 18px;
  color: oklch(0.3 0.02 80);
}
.ip-box__copy {
  border: none;
  border-left: 3px solid var(--ink);
  background: var(--accent);
  color: var(--accent-dark);
  font-family: 'Pixelify Sans', monospace;
  font-size: 13px;
  padding: 14px 18px;
  cursor: pointer;
  height: 100%;
  transition: background 0.15s ease;
}
.ip-box__copy:hover { background: oklch(0.72 0.16 30); }

.btn {
  display: flex;
  align-items: center;
  border: 3px solid var(--ink);
  border-radius: 6px;
  color: #fff;
  font-family: 'Pixelify Sans', monospace;
  font-size: 13px;
  padding: 14px 20px;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--ink);
}
.btn--discord { background: var(--discord-blue); }
.btn--discord:hover { color: #fff; }
.btn--large { padding: 16px 28px; border: 3px solid #fff; box-shadow: none; }

/* SECTIONS */
.section { padding: 88px 32px; }
.section--alt { padding: 80px 32px; background: var(--section-bg-alt); }
.section__inner { max-width: 1180px; margin: 0 auto; }
.section__inner--narrow { max-width: 820px; }
.section__inner--wide { max-width: 1560px; }

.section__head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section__head--center { text-align: center; margin-bottom: 52px; }

.eyebrow {
  font-family: 'Pixelify Sans', monospace;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--label);
  margin-bottom: 10px;
}
.eyebrow--on-dark { color: var(--accent); }

.section__title { font-size: 36px; margin: 0 0 14px; }
.section__head--center .section__title { margin: 0; }
.section__desc { font-size: 16px; line-height: 1.7; color: var(--muted); margin: 0; }

/* NATIONS */
.nations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}
.nation-card {
  background: #fff;
  border: 2px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 0 var(--card-border);
}
.nation-card__bar { height: 8px; }
.nation-card__body { padding: 26px; }
.nation-card__icon { width: 52px; height: 52px; border-radius: 6px; margin-bottom: 16px; transform: rotate(45deg); }
.nation-card__name { font-size: 18px; margin: 0 0 4px; }
.nation-card__ideology {
  font-size: 12px;
  color: oklch(0.5 0.02 80);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.nation-card__blurb { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 0; }

.war-callout {
  background: var(--war-bg);
  border-radius: 10px;
  padding: 36px 40px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.war-callout::before {
  content: "";
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: var(--war-accent-circle);
  border-radius: 50%;
  opacity: 0.5;
}
.war-callout__text {
  position: relative;
  font-size: 16px;
  line-height: 1.75;
  max-width: 720px;
  margin: 0;
  color: var(--war-text);
}
.hl-accent { color: var(--accent); }
.hl-blue { color: var(--war-hl-red); }

/* STEPS */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 28px;
}
.step__n { font-size: 28px; color: oklch(0.78 0.13 30); margin-bottom: 12px; font-family: 'Pixelify Sans', monospace; }
.step__title { font-size: 17px; margin: 0 0 8px; font-weight: 700; font-family: 'Karla', sans-serif; }
.step__desc { font-size: 14px; line-height: 1.6; color: var(--muted-2); margin: 0; }

/* RULES */
.rules-list {
  background: var(--rules-bg);
  border: 2px solid var(--rules-border);
  border-radius: 10px;
  padding: 8px;
}
.rule {
  display: flex;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--rules-divider);
  align-items: flex-start;
}
.rule--last { border-bottom: none; }
.rule__n {
  font-family: 'Pixelify Sans', monospace;
  font-size: 14px;
  color: var(--rule-num);
  flex: none;
  width: 24px;
}
.rule__title { font-weight: 700; font-size: 15px; margin-bottom: 3px; }
.rule__desc { font-size: 14px; color: var(--muted-2); line-height: 1.5; }

/* STAFF */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 22px;
}
.staff-card { text-align: center; }
.staff-card__avatar {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px solid oklch(0.85 0.02 80);
  background-color: oklch(0.9 0.01 80);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  color: oklch(0.3 0.02 80);
  text-align: center;
}
.staff-card__skin {
  height: 100%;
  width: auto;
  max-width: 100%;
  image-rendering: pixelated;
}
.staff-card__name { font-weight: 700; font-size: 14px; }
.staff-card__role { font-size: 12px; color: oklch(0.5 0.02 80); }

/* MAP */
.map-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
}
.map-head__link {
  font-family: 'Pixelify Sans', monospace;
  font-size: 12px;
  color: var(--label);
  text-decoration: none;
}
.map-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 480px;
  max-height: 780px;
  background: repeating-linear-gradient(135deg, var(--map-bg1) 0 20px, var(--map-bg2) 20px 40px);
  border-radius: 10px;
  border: 2px solid var(--map-border);
  position: relative;
  overflow: hidden;
}
.map-frame__iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* LEADERBOARD */
.board {
  background: #fff;
  border: 2px solid var(--board-border);
  border-radius: 10px;
  overflow: hidden;
}
.board__head {
  display: grid;
  grid-template-columns: 40px 1fr 100px;
  padding: 12px 20px;
  background: var(--board-header-bg);
  color: #fff;
  font-family: 'Pixelify Sans', monospace;
  font-size: 11px;
  letter-spacing: 0.5px;
}
.board__row {
  display: grid;
  grid-template-columns: 40px 1fr 100px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--board-divider);
  align-items: center;
  font-size: 14px;
}
.board__row--last { border-bottom: none; }
.board__rank { font-family: ui-monospace, monospace; font-weight: 700; color: var(--rule-num); }
.board__name {
  font-weight: 600;
  background: none;
  border: 0;
  padding: 0;
  text-align: left;
  font-size: inherit;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
}
.board__name:hover, .board__name:focus-visible { color: var(--label); text-decoration: underline; }
.board__cell { color: var(--muted-2); }
.board__updated { margin: 14px 4px 0; font-size: 12px; color: var(--muted-2); text-align: right; }

/* PLAYER PROFILE MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: oklch(0.15 0.01 80 / 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  position: relative;
  background: #fff;
  border: 2px solid var(--board-border);
  border-radius: 12px;
  padding: 28px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 22px;
}
.modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--muted-2);
  cursor: pointer;
  padding: 6px;
}
.modal__close:hover, .modal__close:focus-visible { color: var(--text); }
.modal__skin {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  align-self: start;
  justify-self: center;
}
.modal__name { font-size: 22px; margin-bottom: 4px; }
.modal__rank { font-size: 13px; color: var(--muted-2); margin: 0 0 16px; }
.modal__stats { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.modal__stat { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.modal__stat-label { color: var(--muted-2); }
.modal__stat-value { font-weight: 700; font-family: ui-monospace, monospace; }
.modal__no-data { font-size: 13px; color: var(--muted-2); font-style: italic; margin: 0 0 16px; }
.modal__section { margin-bottom: 16px; }
.modal__section:last-child { margin-bottom: 0; }
.modal__lives-count { font-size: 14px; font-weight: 600; margin: 0 0 6px; }
.modal__deaths { margin: 0; padding-left: 18px; font-size: 12px; color: var(--muted-2); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  display: inline-block;
  background: var(--section-bg-alt);
  border: 1px solid var(--board-border);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

@media (max-width: 560px) {
  .modal { grid-template-columns: 1fr; text-align: center; padding: 24px 20px; }
  .modal__skin { max-width: 160px; margin: 0 auto; }
  .modal__stat { justify-content: center; gap: 8px; }
  .badges { justify-content: center; }
}

/* EVENTS */
.events-list { display: flex; flex-direction: column; gap: 14px; }
.event {
  display: flex;
  align-items: center;
  gap: 22px;
  background: #fff;
  border: 2px solid var(--card-border);
  border-radius: 10px;
  padding: 18px 24px;
}
.event__date { text-align: center; flex: none; width: 64px; }
.event__month {
  display: block;
  font-family: 'Pixelify Sans', monospace;
  font-size: 11px;
  color: var(--label);
  letter-spacing: 1px;
}
.event__day { display: block; font-family: ui-monospace, monospace; font-weight: 700; font-size: 24px; }
.event__title { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.event__desc { font-size: 13px; color: var(--muted-3); }

/* CTA / FOOTER */
.cta {
  padding: 80px 32px;
  background: var(--forest-dark);
  text-align: center;
}
.cta__inner { max-width: 520px; margin: 0 auto; }
.cta__title { font-size: 30px; color: #fff; margin: 0 0 14px; }
.cta__desc { font-size: 15px; color: var(--forest-sub); line-height: 1.6; margin: 0 0 28px; }
.footer-note { margin: 56px 0 0; font-size: 12px; color: var(--footer-muted); text-align: center; }

@media (max-width: 480px) {
  .hero { padding: 72px 20px 80px; }
  .section, .section--alt { padding: 64px 20px; }
  .board__head, .board__row { grid-template-columns: 32px 1fr 76px; padding: 12px 14px; font-size: 13px; }
}
