/* ── SA·TURF.WAR — hand-written theme (port of the Tailwind styles) ── */

:root {
  --ink: #0c0a08;
  --surface: #17130d;
  --surface2: #201a11;
  --border: #3a2f1f;
  --fire: #ff7a18;
  --turf: #8cc63f;
  --gold: #ffc24b;
  --amber: #d97706;
  --text-dim: rgba(255, 255, 255, 0.4);
  --text-soft: rgba(255, 255, 255, 0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--ink);
  color: #fff;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography utilities ─────────────────────────────────────────── */
.font-display { font-family: 'Archivo Black', 'Inter', sans-serif; }

.tracking-tag { letter-spacing: 0.08em; }

.text-2xs { font-size: 0.625rem; line-height: 0.875rem; }   /* text-[10px] */
.text-xs  { font-size: 0.75rem;  line-height: 1rem; }
.text-sm  { font-size: 0.875rem; line-height: 1.25rem; }
.text-base{ font-size: 1rem;     line-height: 1.5rem; }
.text-lg  { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl  { font-size: 1.25rem;  line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem;   line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem;  line-height: 2.5rem; }
.text-5xl { font-size: 3rem;     line-height: 1; }
.text-6xl { font-size: 3.75rem;  line-height: 1; }

.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

.uppercase { text-transform: uppercase; }
.tabular-nums { font-variant-numeric: tabular-nums; }

/* ── Colors ───────────────────────────────────────────────────────── */
.text-fire   { color: var(--fire); }
.text-turf   { color: var(--turf); }
.text-gold   { color: var(--gold); }
.text-amber-600 { color: var(--amber); }
.text-white\/40 { color: var(--text-dim); }
.text-white\/60 { color: var(--text-soft); }
.text-white\/80, .text-white\/70 { color: rgba(255, 255, 255, 0.8); }

.bg-ink     { background: var(--ink); }
.bg-surface { background: var(--surface); }
.bg-surface2{ background: var(--surface2); }
.bg-fire    { background: var(--fire); }
.bg-black\/70 { background: rgba(0, 0, 0, 0.7); }
.bg-black\/80 { background: rgba(0, 0, 0, 0.8); }

.border-border { border-color: var(--border); }
.border-fire   { border-color: var(--fire); }

/* ── Layout ───────────────────────────────────────────────────────── */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-baseline { align-items: baseline; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { inset: 0; }
.top-0 { top: 0; }
.left-0 { left: 0; }
.right-0 { right: 0; }
.z-10 { z-index: 10; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-60 { z-index: 60; }

.hidden { display: none; }
.block { display: block; }

.max-w-\[1100px\] { max-width: 1100px; }
.max-w-\[140px\] { max-width: 140px; }
.max-w-md { max-width: 28rem; }
.max-w-sm { max-width: 24rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-h-\[420px\] { max-height: 420px; }
.overflow-auto { overflow: auto; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.h-screen { height: 100vh; }
.min-w-0 { min-width: 0; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.p-6 { padding: 1.5rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-5 { padding-left: 1.25rem; padding-right: 1.25rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.pb-24 { padding-bottom: 6rem; }

.m-auto { margin: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }

.text-center { text-align: center; }

.cursor-pointer { cursor: pointer; }
.cursor-move { cursor: move; }

.rounded-xl { border-radius: 0.75rem; }
.rounded-2xl { border-radius: 1rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

.border { border-width: 1px; border-style: solid; }
.border-0 { border: 0; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-2 { border-width: 2px; border-style: solid; }

/* ── Components ───────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
}
.hint { color: var(--text-dim); font-size: 0.75rem; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.3);
  font-size: 0.625rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}
.chip-dot {
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: var(--turf);
  box-shadow: 0 0 8px rgba(140, 198, 63, 0.8);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease;
  color: #0c0a08;
  background: var(--fire);
  letter-spacing: 0.02em;
}
.btn:hover { filter: brightness(1.1); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease;
  color: #fff;
  background: transparent;
}
.btn-secondary:hover { border-color: #55503f; background: rgba(255,255,255,0.04); }

.btn-danger {
  background: #c0341f;
  color: #fff;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  color: var(--text-soft);
  background: transparent;
}
.btn-ghost.active {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(255, 194, 75, 0.08);
}

/* ── Header ───────────────────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(12, 10, 8, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
}
.brand-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.75rem;
  background: var(--fire);
  font-size: 1.25rem;
  box-shadow: 0 0 24px rgba(255, 122, 24, 0.35);
}
.brand-tile .brand-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.75rem;
  display: block;
}
.shadow-glow { box-shadow: 0 0 24px rgba(255, 122, 24, 0.35); }

/* ── Header socials bar ───────────────────────────────────────────── */
.header-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 0.35rem 1rem;
  border-top: 1px solid var(--border);
  background: rgba(12, 10, 8, 0.6);
  font-size: 0.75rem;
}
.social-item {
  color: var(--text-soft);
}
.social-item a {
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}
.social-item a:hover {
  text-decoration: underline;
  color: var(--fire);
}

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  padding: 2.5rem 1rem;
  text-align: center;
}
.hero-under-map {
  padding: 1.5rem 1rem 0.5rem;
}
.hero h1 {
  font-family: 'Archivo Black', sans-serif;
  font-size: clamp(1.75rem, 5vw, 3rem);
  line-height: 1.1;
}
.text-glow { text-shadow: 0 0 30px rgba(255, 122, 24, 0.45); }

/* ── Map shell ────────────────────────────────────────────────────── */
.map-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
}
.map-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--surface2);
}
.map-wrap svg { display: block; width: 100%; height: 100%; }
.map-hint {
  position: absolute;
  left: 0; right: 0; bottom: 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-soft);
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
}

/* ── Modal ────────────────────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  width: 100%;
}
.modal-sm { max-width: 24rem; }
.modal-md { max-width: 28rem; }
.modal-lg { max-width: 36rem; }
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0.5rem;
}
.modal-body { padding: 0.75rem 1.25rem 1.25rem; }

/* ── Forms ────────────────────────────────────────────────────────── */
.input, .textarea, .select {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--border);
  border-radius: 0.625rem;
  color: #fff;
  font-size: 0.875rem;
  font-family: inherit;
  padding: 0.625rem 0.75rem;
  outline: none;
  transition: border-color 0.15s ease;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--fire); }
.input::placeholder, .textarea::placeholder { color: rgba(255,255,255,0.3); }
.textarea { resize: vertical; min-height: 5rem; }

.field-label {
  display: block;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-soft);
  margin-bottom: 0.375rem;
}

.error-text { color: #f87171; font-size: 0.75rem; margin-top: 0.375rem; }

/* ── Stats / list rows ────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
@media (max-width: 640px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.divide-y > * + * {
  border-top: 1px solid var(--border);
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0;
}
.row-img {
  width: 2rem; height: 2rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.row-click { cursor: pointer; }
.row-click:hover { background: rgba(255,255,255,0.03); }

/* ── Admin ────────────────────────────────────────────────────────── */
.admin-logo {
  cursor: pointer;
}
.admin-logo.selected rect.logo-dot { stroke: var(--gold); }
.logo-dot { stroke: var(--fire); stroke-opacity: 0.9; }

/* ── Game page layout ─────────────────────────────────────────────── */
.logo-g {
  opacity: 0.6;
  transition: opacity 0.15s ease;
  cursor: pointer;
}
.logo-g:hover {
  opacity: 1;
}
.game-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}
.game-top {
  display: grid;
  grid-template-columns: minmax(0, 864px) minmax(0, 465px);
  gap: 1rem;
  align-items: stretch;
  justify-content: center;
}
.game-top #warreport-root { min-width: 0; }
.game-top #warreport-root .card {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.game-top #warreport-root .card .divide-y { flex: 1 1 auto; }
.map-wrap svg { display: block; width: 100%; height: 100%; }
.game-col-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}
@media (max-width: 1100px) { .game-top { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .game-col-2 { grid-template-columns: 1fr; } }

.admin-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }
.admin-grid.only-map { grid-template-columns: 1fr; }

.avatar-badge {
  width: 2.5rem; height: 2.5rem;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--ink);
  flex-shrink: 0;
}
.avatar-badge img { width: 100%; height: 100%; object-fit: cover; }

/* selected profile-image thumbnail next to the pfp button */
.pfp-preview {
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--gold);
  background: var(--ink);
  flex-shrink: 0;
}

.editor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
}

/* ── Toast ────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: #fff;
  font-size: 0.8125rem;
  padding: 0.625rem 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  animation: toast-in 0.2s ease;
}
.toast.error { border-color: #c0341f; }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.spinner {
  display: inline-block;
  width: 1rem; height: 1rem;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: var(--fire);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

a { color: inherit; }
a.link { color: var(--fire); text-decoration: none; }
a.link:hover { text-decoration: underline; }

/* ── Brand popup logo ─────────────────────────────────────────────── */
.popup-logo {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--gold);
  box-shadow: 0 0 24px rgba(255, 194, 75, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
}
.popup-logo img { width: 100%; height: 100%; object-fit: cover; }
.popup-logo .monogram {
  font-family: 'Archivo Black', sans-serif;
  font-size: 2rem;
  color: var(--gold);
}