/* EnP Toolpak web dashboard — palette scraped from the app's DesignTokens.swift
   (dark-mode E&P navy/blue theme + alliance gold accent). */

:root {
  --enp-navy:      #141C33;  /* page background  (0.08, 0.11, 0.20) */
  --enp-card:      #213361;  /* card surface     (0.13, 0.20, 0.38) */
  --enp-card-soft: rgba(33, 51, 97, 0.6);
  --enp-primary:   #FFFFFF;  /* primary text */
  --enp-subtle:    #99A6BF;  /* muted text       (0.60, 0.65, 0.75) */
  --enp-gold:      #F2C738;  /* alliance gold    (0.95, 0.78, 0.22) */
  --enp-ally:      #61B8FF;  /* ally blue        (0.38, 0.72, 1.00) */
  --enp-enemy:     #FF5940;  /* enemy red        (1.00, 0.35, 0.25) */
  --enp-green:     #34C759;  /* iOS system green (win) */
  --enp-on-accent: #0F1424;  /* dark text on gold buttons */
  --radius: 12px;
  --shadow: 0 3px 6px rgba(0, 0, 0, 0.35);
}

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

body {
  background: var(--enp-navy);
  color: var(--enp-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Top bar ── */
.topbar {
  background: linear-gradient(180deg, #0D1428 0%, var(--enp-navy) 100%);
  border-bottom: 1px solid rgba(242, 199, 56, 0.25);
  position: sticky; top: 0; z-index: 50;
}
.topbar-inner {
  max-width: 1080px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 14px;
}
.app-icon {
  width: 46px; height: 46px; border-radius: 11px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(242, 199, 56, 0.4);
}
.app-icon.clickable { cursor: pointer; transition: filter .12s; }
.app-icon.clickable:hover { filter: brightness(1.12); }
.title-block h1 { font-size: 19px; font-weight: 800; letter-spacing: 0.3px; }
.title-block .subtitle { display: block; font-size: 11.5px; color: var(--enp-gold); font-weight: 600; letter-spacing: 1.2px; text-transform: uppercase; }
.header-back-link { display: block; margin-top: 3px; font-size: 10.5px; font-weight: 700; color: var(--enp-gold); text-decoration: none; }
.header-back-link:hover { text-decoration: underline; }
.topbar-right { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.alliance-select {
  background: var(--enp-card); color: var(--enp-primary);
  border: 1px solid rgba(153, 166, 191, 0.35); border-radius: 8px;
  padding: 7px 10px; font-size: 13px; font-weight: 600; max-width: 220px;
}

.btn-gold {
  background: var(--enp-gold); color: var(--enp-on-accent);
  border: none; border-radius: 9px; padding: 9px 16px;
  font-size: 13px; font-weight: 800; cursor: pointer;
  box-shadow: var(--shadow); white-space: nowrap;
}
.btn-gold:hover { filter: brightness(1.08); }

/* ── Scope bar (global vs alliance view) ── */
.scope-bar { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.scope-title { font-size: 17px; font-weight: 800; }
.back-link { color: var(--enp-gold); font-size: 12.5px; font-weight: 700; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* ── Layout ── */
.dashboard, .upload-panel { max-width: 1080px; width: 100%; margin: 0 auto; padding: 18px 20px; }
.section { margin-bottom: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.section-head .section-label { margin-bottom: 0; }

.section-label {
  font-size: 12.5px; font-weight: 600; color: var(--enp-subtle);
  text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 10px;
}

.card {
  background: var(--enp-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card.pad { padding: 16px; }

.hidden { display: none !important; }
.footnote { font-size: 10.5px; color: var(--enp-subtle); margin-top: 8px; }

/* ── Upload panel ── */
.upload-card { padding: 20px; }
.upload-card h2 { font-size: 16px; margin-bottom: 6px; }
.upload-card .hint { font-size: 12.5px; color: var(--enp-subtle); margin-bottom: 14px; line-height: 1.5; }
.upload-card code { color: var(--enp-gold); }
.upload-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.upload-row label { font-size: 12.5px; font-weight: 600; color: var(--enp-subtle); }
.upload-row input {
  background: var(--enp-navy); color: var(--enp-primary);
  border: 1px solid rgba(153, 166, 191, 0.35); border-radius: 8px;
  padding: 8px 12px; font-size: 13.5px; flex: 1; max-width: 280px;
}
.drop-zone {
  border: 2px dashed rgba(242, 199, 56, 0.45); border-radius: var(--radius);
  padding: 30px 16px; text-align: center; cursor: pointer;
  color: var(--enp-subtle); font-size: 13.5px; transition: all .15s;
}
.drop-zone:hover, .drop-zone.dragover { background: rgba(242, 199, 56, 0.08); color: var(--enp-gold); }
.upload-status { margin-top: 10px; font-size: 13px; font-weight: 600; min-height: 18px; }
.upload-status.ok { color: var(--enp-green); }
.upload-status.err { color: var(--enp-enemy); }

.contributor-list { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.contributor-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--enp-navy); border-radius: 8px; padding: 8px 12px; font-size: 12.5px;
}
.contributor-row .c-name { font-weight: 700; }
.contributor-row .c-meta { color: var(--enp-subtle); font-size: 11px; }
.contributor-row .c-del {
  margin-left: auto; background: none; border: none; color: var(--enp-enemy);
  cursor: pointer; font-size: 12px; font-weight: 700;
}

/* ── Filter bar ── */
.filter-bar { padding: 12px 14px; margin-bottom: 16px; }
.filter-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.filter-head .section-label { margin-bottom: 0; }
.filter-actions { display: flex; gap: 6px; }
.chip-btn {
  background: var(--enp-card-soft); border: 1px solid rgba(153, 166, 191, 0.3);
  color: var(--enp-gold); font-size: 11px; font-weight: 700;
  border-radius: 999px; padding: 4px 12px; cursor: pointer;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.boost-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 600;
  cursor: pointer; border: 1px solid rgba(153, 166, 191, 0.3);
  background: var(--enp-navy); color: var(--enp-subtle);
  user-select: none; transition: all .12s;
}
.boost-chip.on {
  color: var(--enp-primary);
  border-color: var(--boost-color, var(--enp-gold));
  background: color-mix(in srgb, var(--boost-color, var(--enp-gold)) 18%, var(--enp-navy));
}
.boost-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--boost-color, var(--enp-gold)); }

/* ── Tabs ── */
.tabs {
  display: flex; gap: 4px; background: var(--enp-card-soft);
  border-radius: 10px; padding: 4px; margin-bottom: 20px;
}
.tab {
  flex: 1; background: none; border: none; color: var(--enp-subtle);
  font-size: 13.5px; font-weight: 700; padding: 9px 0; border-radius: 8px; cursor: pointer;
}
.tab.active { background: var(--enp-gold); color: var(--enp-on-accent); }

/* ── Tiles ── */
.tile-row { display: flex; gap: 12px; }
.tile {
  flex: 1; background: var(--enp-card); border-radius: var(--radius);
  box-shadow: var(--shadow); text-align: center; padding: 16px 8px;
}
.tile .big { font-size: 27px; font-weight: 900; font-variant-numeric: tabular-nums; }
.tile .lbl { font-size: 11px; font-weight: 600; color: var(--enp-subtle); margin-top: 4px; }
.tile .sub { font-size: 10px; color: var(--enp-subtle); margin-top: 2px; }

/* Compact variant for the global-view community counters. */
.tile-row-sm { max-width: 420px; gap: 8px; }
.tile-sm { padding: 10px 6px; }
.tile-sm .big { font-size: 18px; }
.tile-sm .lbl { font-size: 9.5px; margin-top: 2px; }

/* ── Contributing alliances (global view) ── */
.alliance-list { display: flex; flex-direction: column; gap: 8px; }
.alliance-drop { background: var(--enp-card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.alliance-drop-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; background: none; border: none; cursor: pointer;
  color: var(--enp-primary); text-align: left; font-family: inherit;
}
.alliance-drop-btn .adb-name { font-weight: 700; font-size: 13.5px; }
.alliance-drop-btn .adb-meta { margin-left: auto; font-size: 11px; color: var(--enp-subtle); white-space: nowrap; }
.alliance-drop-btn .adb-caret { font-size: 10px; color: var(--enp-gold); transition: transform .15s; flex-shrink: 0; }
.alliance-drop-btn.open .adb-caret { transform: rotate(180deg); }
.alliance-drop-panel { padding: 0 14px 10px; display: flex; flex-direction: column; gap: 6px; border-top: 1px solid rgba(153, 166, 191, 0.12); }
.alliance-drop-panel .adp-row { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; padding-top: 8px; }
.alliance-drop-panel .adp-label { font-weight: 600; }
.alliance-drop-panel .adp-meta { color: var(--enp-subtle); white-space: nowrap; }
.c-green { color: var(--enp-green); }
.c-gold  { color: var(--enp-gold); }
.c-red   { color: var(--enp-enemy); }
.c-sub   { color: var(--enp-subtle); }

/* ── Bar charts (offense trend / flags left) ── */
.bar-chart-card { padding: 14px; }
.bar-chart { display: flex; align-items: flex-end; gap: 5px; height: 110px; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; min-width: 0; }
.bar-col .bar { width: 100%; border-radius: 4px 4px 2px 2px; min-height: 5px; }
.bar-col .bar-val { font-size: 9.5px; font-weight: 700; color: var(--enp-subtle); }
.bar-col .bar-date { font-size: 8.5px; color: var(--enp-subtle); white-space: nowrap; overflow: hidden; max-width: 100%; }
.chart-legend { display: flex; align-items: center; gap: 14px; margin-top: 10px; font-size: 10.5px; color: var(--enp-subtle); }
.chart-legend .avg { margin-left: auto; color: var(--enp-gold); font-weight: 700; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

/* ── Stat rows / tables ── */
.stat-table { display: flex; flex-direction: column; gap: 7px; }
.stat-header {
  display: flex; align-items: center; padding: 0 14px;
  font-size: 10px; font-weight: 700; color: var(--enp-subtle); text-transform: uppercase; letter-spacing: 0.4px;
}
.stat-row {
  display: flex; align-items: center; gap: 10px;
  background: var(--enp-card); border-radius: 10px; box-shadow: var(--shadow);
  padding: 10px 14px; font-size: 12.5px;
}
.stat-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.stat-row .num { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.w-36 { width: 36px; } .w-44 { width: 44px; } .w-56 { width: 56px; } .w-64 { width: 64px; }
.mini-bar-track { height: 6px; border-radius: 3px; background: rgba(153, 166, 191, 0.2); overflow: hidden; margin-top: 4px; }
.mini-bar-fill { height: 100%; border-radius: 3px; }

.badge {
  font-size: 9.5px; font-weight: 800; border-radius: 4px; padding: 2px 6px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.badge.green { color: var(--enp-green); background: rgba(52, 199, 89, 0.15); }
.badge.red   { color: var(--enp-enemy); background: rgba(255, 89, 64, 0.15); }

/* ── Segmented controls / steppers / selects ── */
.controls-inline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--enp-navy); border-radius: 8px; padding: 3px; gap: 2px; }
.seg-btn {
  background: none; border: none; color: var(--enp-subtle);
  font-size: 12px; font-weight: 700; padding: 5px 14px; border-radius: 6px; cursor: pointer;
}
.seg-btn.active { background: var(--enp-gold); color: var(--enp-on-accent); }
.mini-select {
  background: var(--enp-card-soft); color: var(--enp-gold);
  border: 1px solid rgba(153, 166, 191, 0.3); border-radius: 999px;
  font-size: 12px; font-weight: 700; padding: 5px 10px;
}
.stepper { display: inline-flex; align-items: center; gap: 8px; }
.stepper-label { font-size: 10.5px; color: var(--enp-subtle); }
.step-btn {
  width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--enp-gold);
  background: none; color: var(--enp-gold); font-size: 14px; font-weight: 800; cursor: pointer;
  line-height: 1;
}
.step-btn:disabled { border-color: var(--enp-subtle); color: var(--enp-subtle); }
.step-value { font-size: 14px; font-weight: 800; min-width: 20px; text-align: center; }
.check-label { font-size: 12px; color: var(--enp-subtle); display: flex; align-items: center; gap: 6px; }

/* ── Hero-tab date-range picker ── */
.hero-range-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 10px; margin-bottom: 14px;
}
.range-field {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  background: var(--enp-card-soft); color: var(--enp-primary);
  border: 1px solid rgba(153, 166, 191, 0.35); border-radius: 999px;
  font-size: 13px; font-weight: 700; padding: 9px 16px;
}
.range-field.active { border-color: var(--enp-gold); box-shadow: 0 0 0 2px rgba(242, 199, 56, 0.25); }
.range-field .cal-ico { font-size: 13px; }
.range-field .chev { color: var(--enp-subtle); font-size: 10px; }
.range-actions { display: inline-flex; gap: 4px; }
.range-link {
  background: none; border: none; color: var(--enp-gold);
  font-size: 12px; font-weight: 700; cursor: pointer; padding: 6px 10px; border-radius: 8px;
}
.range-link:hover { background: var(--enp-card-soft); }

.hero-cal { background: var(--enp-card); border-radius: 16px; box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.cal-body { display: flex; align-items: center; gap: 6px; }
.cal-nav {
  flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(153, 166, 191, 0.3); background: none; color: var(--enp-gold);
  font-size: 20px; line-height: 1; cursor: pointer;
}
.cal-nav:hover { border-color: var(--enp-gold); }
.cal-months { display: flex; gap: 30px; flex: 1; justify-content: center; flex-wrap: wrap; }
.cal-month { min-width: 224px; }
.cal-mname { text-align: center; font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.cal-dow, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow span { text-align: center; font-size: 11px; font-weight: 600; color: var(--enp-subtle); padding: 4px 0; }
.cal-cell { height: 36px; }
.day {
  height: 36px; width: 100%; border: none; background: none; color: var(--enp-primary);
  font-size: 13px; cursor: pointer; border-radius: 8px;
}
.day:hover { background: var(--enp-card-soft); }
.day.in-range { background: rgba(242, 199, 56, 0.16); border-radius: 0; }
.day.sel { background: var(--enp-gold); color: var(--enp-on-accent); font-weight: 800; }
.day.sel.start { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.day.sel.end { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.cal-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(153, 166, 191, 0.2);
}
.cal-hint { font-size: 12.5px; font-weight: 600; color: var(--enp-subtle); }
.cal-done {
  background: var(--enp-gold); color: var(--enp-on-accent); border: none; border-radius: 999px;
  font-size: 13px; font-weight: 800; padding: 9px 24px; cursor: pointer;
}
.cal-done:disabled { opacity: 0.5; cursor: default; }

/* ── Hero-color filter dots ── */
.color-seg .seg-btn { padding: 5px 9px; }
.color-seg .seg-btn.active { background: var(--enp-navy); }
.color-seg .seg-btn[data-color="All"].active { background: var(--enp-gold); color: var(--enp-on-accent); }
.cdot {
  display: block; width: 13px; height: 13px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3); opacity: 0.55;
}
.color-seg .seg-btn.active .cdot { opacity: 1; box-shadow: 0 0 0 2px var(--enp-gold); }

/* ── Defender position groups ── */
.pos-groups { display: flex; gap: 10px; align-items: flex-start; }
.pos-group { flex: 1; background: var(--enp-card); border-radius: 10px; box-shadow: var(--shadow); padding: 12px; }
.pos-group h4 { font-size: 11.5px; font-weight: 800; color: var(--enp-gold); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.pos-hero { display: flex; gap: 6px; margin-bottom: 6px; align-items: baseline; }
.pos-hero .rank { font-size: 10.5px; font-weight: 800; width: 16px; flex-shrink: 0; }
.pos-hero .info { min-width: 0; }
.pos-hero .name { font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pos-hero .meta { font-size: 9.5px; color: var(--enp-subtle); }
.thin { color: var(--enp-subtle) !important; }

/* facet rows */
.facet-group { margin-top: 12px; }
.facet-group h4 { font-size: 12px; font-weight: 800; margin-bottom: 6px; }
.facet-row { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 3px 0; }
.facet-row .chip {
  width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.25);
}
.facet-row .f-label { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facet-row .f-score { font-weight: 900; color: var(--enp-gold); font-variant-numeric: tabular-nums; }
.facet-row .f-unit { font-size: 9px; color: var(--enp-subtle); }
.facet-row .f-flags { font-size: 10px; color: var(--enp-subtle); min-width: 32px; text-align: right; }
.scope-line { font-size: 11px; color: var(--enp-subtle); margin: 6px 0 2px; }

/* ── Player table ── */
.ptable-wrap { overflow-x: auto; background: var(--enp-card); border-radius: var(--radius); box-shadow: var(--shadow); }
table.ptable { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 720px; }
.ptable th {
  text-align: right; padding: 10px 10px; font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.4px; color: var(--enp-subtle); cursor: pointer; user-select: none; white-space: nowrap;
}
.ptable th:first-child, .ptable td:first-child { text-align: left; padding-left: 14px; }
.ptable th.sorted { color: var(--enp-gold); }
.ptable td { padding: 8px 10px; text-align: right; font-variant-numeric: tabular-nums; border-top: 1px solid rgba(153, 166, 191, 0.12); }
.ptable td.name { font-weight: 700; text-align: left; }
.ptable .ex-member { color: var(--enp-subtle); font-style: italic; }

/* ── Recent wars ── */
.war-list { max-height: 440px; overflow-y: auto; padding-right: 4px; }
.war-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--enp-card); border: 1px solid transparent; border-radius: 10px; box-shadow: var(--shadow);
  padding: 10px 14px; margin-bottom: 8px; cursor: pointer; color: inherit; font: inherit;
  transition: border-color .12s, transform .06s;
}
.war-row:hover { border-color: rgba(242, 199, 56, 0.5); }
.war-row:active { transform: scale(0.995); }
.war-row .result-bar { width: 4px; height: 34px; border-radius: 3px; flex-shrink: 0; }
.war-row .w-main { min-width: 0; }
.war-row .w-title { font-size: 13px; font-weight: 700; }
.war-row .w-meta { font-size: 10.5px; color: var(--enp-subtle); margin-top: 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.war-row .w-score { margin-left: auto; font-size: 14.5px; font-weight: 900; font-variant-numeric: tabular-nums; }
.war-row .w-status { font-size: 10px; font-weight: 800; }
.war-row .w-caret { color: var(--enp-subtle); font-size: 20px; font-weight: 700; flex-shrink: 0; }

/* ── Single-war detail modal ── */
.war-modal {
  position: fixed; inset: 0; z-index: 200; background: rgba(10, 14, 26, 0.75);
  display: flex; align-items: flex-start; justify-content: center; padding: 26px 18px; overflow-y: auto;
}
.war-modal-card { position: relative; width: 100%; max-width: 560px; padding: 20px; margin: auto; }
.war-modal-close {
  position: absolute; top: -12px; right: -12px; width: 30px; height: 30px; border-radius: 50%;
  border: none; cursor: pointer; background: var(--enp-gold); color: var(--enp-on-accent);
  font-size: 14px; font-weight: 900; box-shadow: var(--shadow);
}
.wd-head { display: flex; align-items: center; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid rgba(153, 166, 191, 0.2); }
.wd-result-bar { width: 5px; align-self: stretch; border-radius: 3px; flex-shrink: 0; }
.wd-head-main { min-width: 0; flex: 1; }
.wd-title { font-size: 17px; font-weight: 800; }
.wd-sub { font-size: 11.5px; color: var(--enp-subtle); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.wd-status { font-weight: 800; }
.wd-score { font-size: 22px; font-weight: 900; font-variant-numeric: tabular-nums; }
.wd-tiles { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.wd-tile { flex: 1; min-width: 120px; background: var(--enp-card-soft); border-radius: 10px; padding: 12px; }
.wd-tile-head { font-size: 11px; font-weight: 800; color: var(--enp-subtle); text-transform: uppercase; letter-spacing: .5px; }
.wd-tile-big { font-size: 24px; font-weight: 900; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.wd-tile-sub { font-size: 10.5px; color: var(--enp-subtle); }
.wd-players { margin-top: 6px; }
.wd-prow { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 6px 2px; border-bottom: 1px solid rgba(153, 166, 191, 0.12); }
.wd-phead { font-size: 10.5px; font-weight: 800; color: var(--enp-subtle); text-transform: uppercase; letter-spacing: .5px; border-bottom-color: rgba(153, 166, 191, 0.28); }
.wd-prow .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Empty state / footer ── */
.empty-state { text-align: center; padding: 70px 20px; }
.empty-icon { width: 84px; height: 84px; border-radius: 20px; margin-bottom: 18px; box-shadow: var(--shadow); }
.empty-state h2 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { font-size: 13px; color: var(--enp-subtle); margin-bottom: 18px; }

.footer {
  margin-top: auto; text-align: center; padding: 22px 18px;
  font-size: 10.5px; color: var(--enp-subtle);
  border-top: 1px solid rgba(153, 166, 191, 0.15);
}
.footer .footer-line { margin: 5px 0; }
.footer .privacy-line { font-size: 11px; }
.footer a { color: var(--enp-gold); text-decoration: none; }
.footer a:hover { text-decoration: underline; }

.kofi-btn {
  display: inline-block; margin-bottom: 14px;
  background: var(--enp-gold); color: var(--enp-on-accent) !important;
  border-radius: 999px; padding: 8px 18px;
  font-size: 12.5px; font-weight: 800; text-decoration: none !important;
  box-shadow: var(--shadow);
}
.kofi-btn:hover { filter: brightness(1.08); }

/* Ko-fi click-to-load overlay */
.kofi-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10, 14, 26, 0.75);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 26px 18px; overflow-y: auto;
}
.kofi-modal {
  position: relative; width: 100%; max-width: 420px; padding: 14px;
  margin: auto; /* centers when short, scrolls when taller than the viewport */
}
.kofi-close {
  position: absolute; top: -12px; right: -12px; width: 30px; height: 30px;
  border-radius: 50%; border: none; cursor: pointer;
  background: var(--enp-gold); color: var(--enp-on-accent);
  font-size: 14px; font-weight: 900; box-shadow: var(--shadow);
}

.muted-note { font-size: 12px; color: var(--enp-subtle); padding: 8px 2px; }

/* ── Legal / privacy page ── */
.legal-page { max-width: 760px; width: 100%; margin: 0 auto; padding: 26px 22px 60px; line-height: 1.6; }
.legal-page .back { display: inline-block; margin-bottom: 18px; font-size: 13px; color: var(--enp-gold); text-decoration: none; font-weight: 700; }
.legal-page .back:hover { text-decoration: underline; }
.legal-page h1 { font-size: 23px; margin-bottom: 6px; }
.legal-page .updated { font-size: 12px; color: var(--enp-subtle); margin-bottom: 20px; }
.legal-page h2 { font-size: 15px; color: var(--enp-gold); margin: 26px 0 8px; }
.legal-page p, .legal-page li { font-size: 13.5px; color: var(--enp-primary); }
.legal-page ul { margin: 8px 0 8px 20px; }
.legal-page li { margin-bottom: 6px; }
.legal-page a { color: var(--enp-gold); }
.legal-page .callout {
  background: var(--enp-card); border-radius: var(--radius);
  padding: 14px 16px; margin: 18px 0; box-shadow: var(--shadow);
  border-left: 3px solid var(--enp-gold);
}
.legal-page .callout p { margin: 0; }

@media (max-width: 760px) {
  .tile-row { flex-wrap: wrap; }
  .tile { min-width: 44%; }
  /* Keep Tank/Flanks/Wings side-by-side like desktop; scroll horizontally
     instead of stacking, so columns don't get squished illegibly. */
  .pos-groups { overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .pos-group { flex: 0 0 auto; width: 42vw; min-width: 150px; }
  .topbar-inner { flex-wrap: wrap; }
  .topbar-right { width: 100%; justify-content: flex-end; }
}
