:root {
  --bg: #14120f;
  --panel: #1e1b17;
  --panel-2: #26221c;
  --line: #3a342b;
  --text: #e8dcc0;
  --muted: #9a8f7a;
  --rust: #c9873e;
  --rust-2: #e0a25a;
  --radius: 14px;
  --max: 1120px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 "Inter", system-ui, -apple-system, sans-serif;
}
a { color: var(--rust-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, .brand { font-family: "Oswald", "Inter", sans-serif; letter-spacing: 0.04em; text-transform: uppercase; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 16px; }
.wrap.wide { max-width: 1280px; }

header.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(20, 18, 15, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
header.top .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { font-size: 22px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 10px; }
.brand:hover { text-decoration: none; }
.brand svg { width: 26px; height: 26px; }
nav.links { display: flex; gap: 18px; margin-left: auto; font-size: 14px; }
nav.links a { color: var(--muted); }
nav.links a:hover { color: var(--text); text-decoration: none; }
.auth { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.auth .who { color: var(--text); font-weight: 600; }
.auth .link { background: none; border: none; color: var(--muted); cursor: pointer; font: inherit; }
.apple-logo { width: 14px; height: 17px; flex: none; }
.btn.apple.big .apple-logo { width: 17px; height: 21px; }
.two-col > *, .beta-card > * { min-width: 0; }
.btn.apple { background: #f5f5f0; color: #111; border-color: #f5f5f0; padding: 7px 14px; font-size: 13px; cursor: pointer; }
.langs { display: flex; gap: 2px; font-size: 12px; }
.langs button {
  background: none; border: 1px solid transparent; color: var(--muted);
  padding: 4px 7px; border-radius: 6px; cursor: pointer; font: inherit; font-weight: 600;
}
.langs button.active { color: var(--text); border-color: var(--line); background: var(--panel); }

.hero { padding: 72px 0 56px; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(600px 300px at 80% 30%, rgba(201, 135, 62, 0.18), transparent 70%),
    radial-gradient(500px 260px at 15% 80%, rgba(80, 160, 90, 0.12), transparent 70%);
}
.kicker { color: var(--rust); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.18em; }
.hero h1 { font-size: clamp(38px, 7vw, 72px); line-height: 1.02; margin: 12px 0 18px; }
.hero p { max-width: 560px; color: var(--muted); font-size: 18px; margin: 0 0 28px; }
.ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 15px;
  border: 1px solid var(--line); color: var(--text); background: var(--panel);
}
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn.primary { background: var(--rust); border-color: var(--rust); color: #1a140c; }
.btn.primary:hover { background: var(--rust-2); }
.btn.disabled { color: var(--muted); cursor: default; }

section { padding: 48px 0; }
section h2 { font-size: 28px; margin: 0 0 8px; }
.sub { color: var(--muted); margin: 0 0 20px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.step .n { font-family: "Oswald", sans-serif; color: var(--rust); font-size: 30px; line-height: 1; }
.step h3 { font-size: 18px; margin: 10px 0 6px; }
.step p { color: var(--muted); margin: 0; font-size: 15px; }

.map-box { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }

.map-note {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  background: rgba(20, 18, 15, 0.9); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; color: var(--muted); pointer-events: none;
}
.map-note[hidden] { display: none; }

.maplibregl-popup-content {
  background: var(--panel) !important; color: var(--text); border: 1px solid var(--line);
  border-radius: 12px !important; padding: 14px 16px !important; min-width: 220px;
  font: 14px/1.45 "Inter", sans-serif;
}
.maplibregl-popup-tip { border-top-color: var(--panel) !important; border-bottom-color: var(--panel) !important; }
.maplibregl-popup-close-button { color: var(--muted); font-size: 18px; }
.pop-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.medal {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-family: "Oswald", sans-serif; font-weight: 700; color: #fff; border: 3px solid #14120f;
}
.pop-head b { display: block; font-size: 15px; }
.pop-head span { color: var(--muted); font-size: 12px; }
.kv { display: flex; justify-content: space-between; gap: 16px; padding: 3px 0; }
.kv span:first-child { color: var(--muted); }
.kv .warn { color: #e0675a; }

table.board { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.board th, .board td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.board th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); font-weight: 600; background: var(--panel-2); }
.board td.num, .board th.num { text-align: right; font-variant-numeric: tabular-nums; }
.board tr:last-child td { border-bottom: none; }
.board .rank { color: var(--muted); width: 44px; font-variant-numeric: tabular-nums; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 10px; vertical-align: -1px; }
.empty { color: var(--muted); padding: 24px; text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }

.profile-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.profile-head { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.profile-head .medal { width: 72px; height: 72px; font-size: 26px; border-width: 4px; }
.profile-head h1 { margin: 0; font-size: 32px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { background: var(--panel-2); border-radius: 10px; padding: 14px; }
.stat b { display: block; font-size: 24px; font-family: "Oswald", sans-serif; }
.stat span { color: var(--muted); font-size: 13px; }

.beta { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: start; }
.beta-form { display: grid; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.beta-form label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.beta-form input, .beta-form textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%;
}
.beta-form input:focus, .beta-form textarea:focus { outline: 2px solid var(--rust); border-color: transparent; }
.beta-form .btn { justify-self: start; cursor: pointer; }
.form-note { margin: 0; font-size: 14px; min-height: 1.4em; }
.form-note.ok { color: #7fd36b; }
.form-note.err { color: #e0675a; }
.steps-v { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.steps-v h3 { margin: 0 0 10px; font-size: 18px; }
.steps-v ol { margin: 0; padding-left: 20px; color: var(--muted); display: grid; gap: 10px; }

/* Map first: full-bleed under the header, the pitch floats on top. */
.map-hero { position: relative; padding: 0; height: calc(100svh - 61px); min-height: 480px; max-height: 900px; }
.map-hero #map-canvas { position: absolute; inset: 0; background: #2a2722; }
.hero-card {
  position: absolute; left: max(16px, calc((100vw - 1280px) / 2 + 16px)); top: 20px; width: min(400px, calc(100% - 32px));
  background: rgba(20, 18, 15, 0.86); backdrop-filter: blur(6px); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px;
}
.hero-card h1 { font-size: 30px; line-height: 1.05; margin: 8px 0 10px; }
.hero-card p { color: var(--muted); font-size: 15px; margin: 0 0 16px; }
.hero-card .ctas { gap: 8px; }
.hero-card .btn { padding: 10px 16px; font-size: 14px; }
.hero-card .map-tip { margin: 14px 0 0; font-size: 12.5px; }
.map-hero .map-note { top: auto; bottom: 18px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
.two-col .steps { grid-template-columns: 1fr; gap: 12px; }
.two-col .step { display: flex; gap: 16px; align-items: flex-start; padding: 16px 18px; }
.two-col .step h3 { margin: 2px 0 4px; }

.beta-card { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.beta-card h2 { margin-top: 0; }
.beta-steps h3 { margin: 4px 0 10px; font-size: 18px; }
.beta-steps ol { margin: 0; padding-left: 20px; color: var(--muted); display: grid; gap: 10px; }
.apple-logo { width: 14px; height: 17px; flex: none; }
.btn.apple.big .apple-logo { width: 17px; height: 21px; }
.two-col > *, .beta-card > * { min-width: 0; }
.btn.apple { background: #f5f5f0; color: #111; border-color: #f5f5f0; cursor: pointer; font-family: inherit; }
.btn.apple:hover { background: #fff; }
.btn.apple.small { padding: 7px 14px; font-size: 13px; }
.btn.apple .label-short { display: none; }
.btn.apple.big { padding: 14px 26px; font-size: 16px; }
.joined { display: inline-block; background: rgba(127, 211, 107, 0.12); color: #9fe08c; border: 1px solid #3e6b34;
  border-radius: 12px; padding: 12px 16px; font-weight: 600; }
details.manual { margin-top: 18px; color: var(--muted); font-size: 14px; }
details.manual summary { cursor: pointer; }
details.manual .beta-form { margin-top: 12px; background: var(--bg); }

footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; padding: 24px 0 40px; margin-top: 24px; }

@media (max-width: 720px) {
  nav.links { display: none; }
  .langs { margin-left: auto; }
  .steps, .stats, .beta, .two-col, .beta-card { grid-template-columns: 1fr; }
  .map-hero { height: 78svh; min-height: 440px; }
  .hero-card { top: auto; bottom: 12px; padding: 14px 16px; }
  .hero-card h1 { font-size: 22px; }
  .hero-card p, .hero-card .map-tip { display: none; }
  header.top .wrap { gap: 10px; }
  .btn.apple.small { padding: 7px 10px; }
  .btn.apple.small .label { display: none; }
  .btn.apple.small .label-short { display: inline; }
  .langs button { padding: 4px 5px; }
  .beta-card { padding: 20px; }
  .board th, .board td { padding: 10px; }
  .auth .who { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hero { padding: 48px 0 36px; }
  .board th:nth-child(4), .board td:nth-child(4) { display: none; }
}

/* Map objects and the backpack. */
.pop-icon { width: 40px; height: 40px; flex: none; }
.pop-icon.big { width: 52px; height: 52px; }
.pop-p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.bp-btn { position: absolute; left: 12px; bottom: 28px; z-index: 2; width: 58px; height: 58px; border-radius: 50%;
  background: rgba(20, 18, 15, 0.86); border: 1px solid var(--line); padding: 6px; cursor: pointer; }
.bp-btn img { width: 100%; height: 100%; }
.bp-btn[hidden], .bp-panel[hidden] { display: none; }
.bp-panel { position: absolute; left: 12px; bottom: 96px; z-index: 3; width: min(320px, calc(100% - 24px));
  background: rgba(20, 18, 15, 0.95); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.bp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 16px; }
.bp-head .link { background: none; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; }
.bp-wallet { display: flex; gap: 18px; align-items: center; margin-bottom: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bp-wallet span { display: inline-flex; align-items: center; gap: 6px; }
.bp-wallet img { width: 24px; height: 24px; }
.bp-bar { display: inline-block; width: 46px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.15); overflow: hidden; }
.bp-bar i { display: block; height: 100%; background: #7fd36b; }
.bp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.bp-slot { position: relative; aspect-ratio: 1; background: #1c1915; border: 1px solid #3a342b; border-radius: 8px;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.6); display: grid; place-items: center; }
.bp-slot img { width: 76%; height: 76%; }
.bp-slot em { position: absolute; right: 4px; bottom: 2px; font: 700 12px "Oswald", sans-serif; font-style: normal;
  color: #fff; text-shadow: 0 1px 2px #000; }
@media (max-width: 720px) { .bp-btn { bottom: auto; top: 12px; } .bp-panel { bottom: auto; top: 80px; } }
.tier-art { width: 84px; height: 84px; flex: none; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 35%, transparent) 55%, transparent 70%); }
.hero-card[hidden] { display: none; }
.hero-close { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%;
  background: transparent; border: 1px solid var(--line); color: var(--muted); font-size: 13px; cursor: pointer; }
.hero-close:hover { color: var(--text); border-color: var(--muted); }
/* A soft glow so the backpack is noticed; stops once opened. */
.bp-btn.pulse { animation: bp-pulse 2.4s ease-in-out infinite; }
@keyframes bp-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 160, 96, 0.55); }
  50% { box-shadow: 0 0 0 12px rgba(224, 160, 96, 0); border-color: #e0a060; }
}
@media (prefers-reduced-motion: reduce) { .bp-btn.pulse { animation: none; border-color: #e0a060; } }
.board-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.board-head h2 { margin: 0; }
.board-ctrl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.board-tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.board-tabs .tab { appearance: none; display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent;
  color: var(--muted); font: 600 13px/1 "Inter", sans-serif; padding: 8px 12px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.board-tabs .tab:hover { color: var(--text); }
.board-tabs .tab.on { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px rgba(224, 160, 96, 0.45); }
.board-tabs .tab-flag { font-size: 15px; line-height: 1; }
.board-more { appearance: none; font: 600 13px "Inter", sans-serif; color: var(--muted); background: var(--panel)
  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23999' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 32px 10px 12px; cursor: pointer; max-width: 220px; }
.board-more:hover { color: var(--text); }
.brand-land { color: #e0a060; }
.admin-link { font-size: 13px; font-weight: 600; color: #e0a060; margin-right: 12px; }
.pop-p.warn { color: #e0675a; }
.shield-row span:first-child { display: inline-flex; align-items: center; gap: 6px; color: #9ee6ff !important; }
.shield-ring { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #9ee6ff; background: #14120f; display: inline-grid; place-items: center; }
.shield-ring img { width: 15px; height: 15px; }
/* Map popups sit on the riveted rusty plate, as in the app. */
.maplibregl-popup-content {
  background: none !important; border-style: solid !important; border-width: 22px !important; border-radius: 0 !important;
  border-image: url(/assets/popup-frame.png) 132 fill / 22px stretch; padding: 4px 6px !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}
.maplibregl-popup-tip { display: none; }
.maplibregl-popup-close-button { top: 6px !important; right: 8px !important; }
