/* WorldFill — shared design system for all three tabs */

:root {
  --bg: #0b1220;
  --bg-elevated: #111a2e;
  --panel: #141e35;
  --panel-border: #22304d;
  --text: #eef2f8;
  --text-muted: #93a1b8;
  --text-faint: #5c6a85;
  --brand: #5b8cff;
  --brand-hover: #7ba0ff;
  --brand-text: #071022;
  --success: #2dd4bf;

  --map-unclaimed: #1c2740;
  --map-border: #2c3b5c;
  --map-border-hover: #7ba0ff;
  --map-disputed-bg: #3a2a12;
  --map-disputed-line: #f5b942;

  --radius: 12px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
}

a { color: var(--brand); }

h1, h2, h3 { margin: 0 0 0.4em; font-weight: 700; letter-spacing: -0.01em; }

/* ---- Top nav (shared by all 3 tabs) ---- */
.wf-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--panel-border);
  background: var(--bg-elevated);
  position: sticky;
  top: 0;
  z-index: 20;
}
.wf-nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
}
.wf-nav-brand-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: linear-gradient(135deg, #f5b942, #2dd4bf);
}
.wf-nav-links { display: flex; gap: 4px; }
.wf-nav-links a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}
.wf-nav-links a:hover { color: var(--text); background: var(--panel); }
.wf-nav-links a.active { color: var(--brand-text); background: var(--brand); }

/* ---- Buttons ---- */
.wf-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  padding: 12px 22px;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.06s ease, background 0.15s ease;
}
.wf-btn:active { transform: scale(0.98); }
.wf-btn--primary { background: var(--brand); color: var(--brand-text); }
.wf-btn--primary:hover { background: var(--brand-hover); }
.wf-btn--ghost { background: transparent; color: var(--text); border: 1px solid var(--panel-border); }
.wf-btn--ghost:hover { border-color: var(--brand); color: var(--brand-hover); }
.wf-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Hero (home tab) ---- */
.wf-hero {
  padding: 56px 24px 32px;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}
.wf-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.wf-hero p { color: var(--text-muted); font-size: 1.05rem; line-height: 1.55; margin: 0 0 24px; }

/* ---- Map ---- */
.wf-map-container {
  position: relative;
  width: 100%;
  height: 62vh;
  min-height: 380px;
  background: radial-gradient(ellipse at 50% 40%, #0e1830 0%, #080d18 100%);
  border-top: 1px solid var(--panel-border);
  border-bottom: 1px solid var(--panel-border);
  overflow: hidden;
}
.wf-map-container.wf-map--fullbleed { height: 100vh; border: none; }
.wf-map { width: 100%; height: 100%; display: block; cursor: grab; }
.wf-map:active { cursor: grabbing; }
path.wf-region { transition: fill 0.4s ease; }
.wf-map.is-selectable path.wf-region:not(.is-disputed) { cursor: pointer; }
.wf-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(10, 16, 30, 0.95);
  border: 1px solid var(--panel-border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.4;
  transition: opacity 0.1s ease;
  z-index: 30;
  max-width: 220px;
}
.wf-tooltip-tag { color: #f5b942; font-weight: 700; }
.wf-tooltip-claimed { color: var(--success); }
.wf-tooltip-open { color: var(--text-faint); }

.wf-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  padding: 14px 24px;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.wf-map-legend-item { display: flex; align-items: center; gap: 7px; }
.wf-map-legend-swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.wf-map-legend-gradient { display: flex; flex-direction: column; gap: 3px; width: 160px; }
.wf-map-legend-gradient-bar { display: block; height: 10px; border-radius: 4px; background: var(--map-unclaimed); }
.wf-map-legend-gradient-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-faint); }

/* ---- Stat tiles + progress ---- */
.wf-stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px;
}
.wf-stat-tile {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
}
.wf-stat-tile--accent { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.wf-stat-value { font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: break-word; line-height: 1.15; }
.wf-stat-label { color: var(--text-muted); font-size: 0.85rem; margin-top: 2px; }

.wf-progress {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px;
  height: 10px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 999px;
  overflow: hidden;
}
.wf-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #f5b942, #2dd4bf);
  transition: width 0.6s ease;
}
.wf-progress-caption {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 8px 24px 28px;
}

/* ---- Stats columns / lists ---- */
.wf-stats-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 40px;
}
@media (max-width: 760px) {
  .wf-stats-columns { grid-template-columns: 1fr; }
  .wf-stat-row { grid-template-columns: 1fr; }
}
.wf-panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.wf-panel--wide { grid-column: 1 / -1; }
.wf-panel h3 { font-size: 0.95rem; color: var(--text); }
.wf-panel-count { color: var(--text-faint); font-weight: 500; }
.wf-search {
  width: 100%;
  padding: 9px 12px;
  margin-bottom: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.88rem;
}
.wf-search:focus { outline: none; border-color: var(--brand); }
.wf-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 340px;
  overflow-y: auto;
  font-size: 0.88rem;
}
.wf-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--panel-border);
}
.wf-list li:last-child { border-bottom: none; }
.wf-list-sub { margin-left: auto; color: var(--text-faint); font-size: 0.78rem; white-space: nowrap; padding-left: 8px; }
.wf-list-empty { color: var(--text-faint); justify-content: center; }
.wf-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.wf-dot--open { background: var(--map-unclaimed); border: 1px solid var(--map-border); }

/* ---- Claim flow (home tab) ---- */
.wf-claim-bar {
  position: sticky;
  bottom: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 24px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--panel-border);
}
.wf-claim-bar-text { flex: 1; min-width: 200px; color: var(--text-muted); font-size: 0.9rem; }
.wf-claim-bar-text strong { color: var(--text); }
.wf-claim-status { font-size: 0.85rem; padding: 4px 0; }
.wf-claim-status--error { color: #ff8a8a; }
.wf-claim-status--success { color: var(--success); }

.wf-footer {
  text-align: center;
  color: var(--text-faint);
  font-size: 0.8rem;
  padding: 20px 24px 32px;
}
.wf-footer a { color: var(--text-faint); }

/* ---- Stats-only / Map-only tab chrome ---- */
.wf-page-header {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 4px;
}
.wf-page-header p { color: var(--text-muted); margin: 0; }
