* { box-sizing: border-box; }

:root {
  --ash-black: #090a0a;
  --ash-charcoal: #151412;
  --ash-panel: rgba(18, 16, 13, .9);
  --ash-panel-soft: rgba(31, 27, 21, .82);
  --ash-gold: #f4c76c;
  --ash-gold-deep: #b66f1d;
  --ash-rust: #a84124;
  --ash-rust-bright: #d34e2e;
  --ash-cream: #f7efd9;
  --ash-muted: #cdbf9f;
  --ash-border: rgba(244,199,108,.34);
}

body {
  isolation: isolate;
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at 25% 30%, rgba(255, 194, 92, .28), transparent 34%),
    linear-gradient(90deg, rgba(7, 8, 8, .55), rgba(7, 8, 8, .08) 48%, rgba(7, 8, 8, .78)),
    linear-gradient(to bottom, rgba(0,0,0,.08), rgba(0,0,0,.78)),
    url("/images/ashfall-bg.png") center/cover no-repeat fixed;
  color: #fff;
  overflow-x: hidden;
}
@supports (background-image: url('/images/ashfall-bg.webp')) {
  body {
    background:
      radial-gradient(circle at 25% 30%, rgba(255, 194, 92, .28), transparent 34%),
      linear-gradient(90deg, rgba(7, 8, 8, .55), rgba(7, 8, 8, .08) 48%, rgba(7, 8, 8, .78)),
      linear-gradient(to bottom, rgba(0,0,0,.08), rgba(0,0,0,.78)),
      url("/images/ashfall-bg-placeholder.webp") center/cover no-repeat fixed;
  }
  body::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
      radial-gradient(circle at 25% 30%, rgba(255, 194, 92, .28), transparent 34%),
      linear-gradient(90deg, rgba(7, 8, 8, .55), rgba(7, 8, 8, .08) 48%, rgba(7, 8, 8, .78)),
      linear-gradient(to bottom, rgba(0,0,0,.08), rgba(0,0,0,.78)),
      url('/images/ashfall-bg.webp') center/cover no-repeat fixed;
    opacity: 0;
    transition: opacity 0.5s ease;
  }
  body.bg-hq::after {
    opacity: 1;
  }
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mix-blend-mode: overlay;
  opacity: .35;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 34px;
  background: linear-gradient(to bottom, rgba(0,0,0,.82), rgba(0,0,0,.24));
  border-bottom: 1px solid var(--ash-border);
}

.topbar img {
  width: 225px;
  filter: drop-shadow(0 5px 8px rgba(0,0,0,.85));
}

.main-nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.main-nav a {
  color: var(--ash-cream);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: .7px;
  padding: 9px 13px;
  border: 1px solid var(--ash-border);
  background: linear-gradient(rgba(45, 30, 20, .74), rgba(11, 10, 9, .72));
  border-radius: 5px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 3px 9px rgba(0,0,0,.24);
}

.main-nav a:hover {
  color: #fff;
  border-color: rgba(244,199,108,.72);
  background: linear-gradient(rgba(121, 55, 28, .76), rgba(23, 15, 10, .8));
}

.page {
  min-height: calc(100vh - 84px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 315px;
  gap: 36px;
  padding: 44px 42px 32px;
  align-items: start;
  max-width: 1280px;
  margin: 0 auto;
}

.hero {
  max-width: 760px;
  text-shadow: 0 3px 14px rgba(0,0,0,.95);
  padding-top: 32px;
}

.kicker {
  display: inline-block;
  color: #17120a;
  background: linear-gradient(#ffd983, var(--ash-gold-deep));
  border: 1px solid #5b3711;
  box-shadow: 0 3px 10px rgba(0,0,0,.45);
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: 1.6px;
  padding: 7px 12px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.tagline {
  font-size: clamp(44px, 6vw, 88px);
  line-height: .88;
  margin: 0 0 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ash-gold);
}

.subtext {
  font-size: clamp(18px, 2vw, 22px);
  max-width: 650px;
  line-height: 1.45;
  color: var(--ash-cream);
  margin: 0 0 22px;
}

.cta-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 24px 0;
}

.cta {
  display: inline-block;
  text-decoration: none;
  text-transform: uppercase;
  font-weight: 900;
  letter-spacing: .8px;
  padding: 13px 20px;
  border-radius: 5px;
  box-shadow: 0 5px 15px rgba(0,0,0,.45);
}

.cta.primary {
  color: #211407;
  background: linear-gradient(#ffd983, var(--ash-gold-deep));
  border: 1px solid #5b3711;
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}

.cta.secondary {
  color: var(--ash-cream);
  background: linear-gradient(rgba(92, 34, 22, .72), rgba(18, 15, 12, .72));
  border: 1px solid rgba(211,78,46,.68);
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
  max-width: 760px;
}

.feature {
  background: var(--ash-panel-soft);
  border: 1px solid var(--ash-border);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 5px 18px rgba(0,0,0,.4);
}

.feature b {
  display: block;
  color: var(--ash-gold);
  text-transform: uppercase;
  font-size: 14px;
  margin-bottom: 5px;
}

.feature span {
  color: #dfd4bb;
  font-size: 13px;
  line-height: 1.35;
}

.right-column {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 20px;
}

/* Login Panel */
.login-panel {
  width: 100%;
  color: var(--ash-cream);
  border: 1px solid var(--ash-border);
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(0,0,0,.78), inset 0 0 0 1px rgba(255,255,255,.06);
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(244,199,108,.16), transparent 38%),
    linear-gradient(145deg, rgba(39, 31, 23, .96), rgba(9, 10, 10, .98));
  position: relative;
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent, rgba(255,255,255,.05), transparent),
    repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 4px);
  opacity: .32;
}

.login-title {
  position: relative;
  color: #17120a;
  background: linear-gradient(#ffd983, var(--ash-gold-deep));
  border-bottom: 1px solid #5b3711;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35);
  font-size: 21px;
  text-align: center;
  padding: 14px 10px 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255,255,255,.25);
}

.login-title small {
  display: block;
  color: rgba(23,18,10,.72);
  font-size: 10px;
  letter-spacing: 2px;
  margin-top: 3px;
}

.login-body {
  position: relative;
  padding: 16px;
  font-size: 14px;
}

.login-body label {
  display: block;
  font-weight: bold;
  margin: 8px 0 5px;
  color: var(--ash-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .8px;
}

.field-wrap { position: relative; }

.field-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  pointer-events: none;
  opacity: .82;
}

.login-body input[type="text"],
.login-body input[type="password"],
.login-body input[type="email"] {
  width: 100%;
  height: 39px;
  border: 1px solid rgba(244,199,108,.36);
  border-radius: 8px;
  padding: 5px 10px 5px 35px;
  font-size: 15px;
  background: rgba(5, 6, 6, .76);
  color: #fff4d6;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.68), 0 1px 0 rgba(255,255,255,.08);
  outline: none;
}

.login-body input[type="text"]:focus,
.login-body input[type="password"]:focus,
.login-body input[type="email"]:focus {
  border-color: var(--ash-gold);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.65), 0 0 0 3px rgba(244,199,108,.16);
}

.password-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-top: 5px;
}

.password-row label { margin: 0; }

.forgot {
  font-size: 11px;
  font-weight: bold;
  color: var(--ash-gold);
  text-decoration: none;
  white-space: nowrap;
  opacity: .92;
}

.forgot:hover { text-decoration: underline; }

.login-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 14px;
}

.remember {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  margin: 0;
  color: #d8ccb3;
  text-transform: none;
  letter-spacing: 0;
  font-weight: normal;
}

.remember input {
  width: 14px;
  height: 14px;
  accent-color: var(--ash-gold-deep);
}

.login-btn {
  width: 100%;
  background: linear-gradient(#ffd983, var(--ash-gold-deep));
  border: 1px solid #5b3711;
  border-radius: 8px;
  padding: 10px 17px;
  font-size: 15px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: #211407;
  box-shadow: 0 4px 10px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.55);
  cursor: pointer;
  text-decoration: none;
  display: block;
  text-align: center;
  box-sizing: border-box;
}

.login-btn:hover { filter: brightness(1.08); }

.login-error {
  position: relative;
  background: rgba(168, 65, 36, .22);
  border: 1px solid rgba(211,78,46,.5);
  border-radius: 6px;
  color: #f4a07a;
  font-size: 13px;
  text-align: center;
  padding: 8px 12px;
  margin: 0 16px 4px;
}

/* Loggedin state */
.login-profile {
  text-align: center;
  padding: 18px 16px;
  position: relative;
}

.login-profile img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--ash-border);
  box-shadow: 0 4px 12px rgba(0,0,0,.6);
  object-fit: cover;
  margin-bottom: 10px;
}

.login-profile .survivor-name {
  color: var(--ash-gold);
  font-size: 16px;
  font-weight: bold;
  text-shadow: 0 2px 6px rgba(0,0,0,.8);
  margin-bottom: 14px;
}

.login-profile .not-you {
  display: block;
  font-size: 11px;
  color: rgba(247,239,217,.5);
  margin-top: 10px;
  text-decoration: none;
}

.login-profile .not-you:hover { color: var(--ash-gold); }

/* Status card */
.status-card {
  background: var(--ash-panel);
  border: 1px solid var(--ash-border);
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 6px 20px rgba(0,0,0,.5);
}

.status-card h2 {
  margin: 0 0 8px;
  color: var(--ash-gold);
  text-transform: uppercase;
  font-size: 18px;
}

.status-card p {
  margin: 0;
  color: #e7dec9;
  line-height: 1.42;
  font-size: 14px;
}

.server-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: #d7ccb3;
  font-size: 13px;
  border-top: 1px solid rgba(255,255,255,.12);
  padding-top: 10px;
}

.online { color: var(--ash-gold); font-weight: bold; }

.player-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.player-stat {
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(244,199,108,.16);
  border-radius: 8px;
  padding: 10px;
  text-align: center;
  box-shadow: inset 0 1px 4px rgba(0,0,0,.45);
}

.player-stat .label {
  display: block;
  color: var(--ash-muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.player-stat .value {
  display: block;
  color: var(--ash-gold);
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,.6);
}

.player-stat .sub {
  display: block;
  color: rgba(247,239,217,.6);
  font-size: 11px;
  margin-top: 4px;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 18px 20px 24px;
  color: rgba(247,239,217,.62);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .8px;
}

.footer-links a {
  color: rgba(247,239,217,.72);
  text-decoration: none;
}

.footer-links a:hover { color: var(--ash-gold); }

@media (max-width: 850px) {
  .topbar {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 18px 20px;
    text-align: center;
  }

  .topbar img { margin: 0 auto; }

  .main-nav {
    justify-content: center;
    width: 100%;
    gap: 8px;
  }

  .main-nav a {
    text-align: center;
    min-width: 100px;
  }

  .page {
    grid-template-columns: 1fr;
    padding: 24px 18px 32px;
  }

  .hero {
    text-align: center;
    margin: 0 auto;
    padding-top: 10px;
  }

  .cta-row { justify-content: center; }

  .feature-strip { grid-template-columns: 1fr; }

  .right-column {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    position: static;
  }
}
