/* ============================================================================
   FRONTIER CROSSING — Dark Slate Tactical & Parchment Light Dual Theme CSS
   Matches Mage Knight / Frontier Crossing UI Aesthetics
   ============================================================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body, #app {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  user-select: none;
}

/* ── Theme Tokens ── */
.fc-root.theme-dark {
  --bg-app: #151b26;
  --bg-map: #1b2434;
  --bg-panel: #1c222e;
  --bg-card: #242b38;
  --bg-card-hover: #2d3646;
  --bg-elev: #273040;
  --border: #323c4e;
  --border-strong: #475569;
  --text-main: #edf2f7;
  --text-sub: #9aa7bc;
  --text-muted: #6b7a90;
  --accent-gold: #eab349;
  --accent-gold-bg: #3b3019;
  --accent-green: #2fa363;
  --accent-red: #dc4c46;
  --accent-blue: #3b82f6;
  --cta-bg: #f0c264;
  --cta-text: #1c1917;
}

.fc-root.theme-light {
  --bg-app: #edeae0;
  --bg-map: #253447;
  --bg-panel: #f7f5ee;
  --bg-card: #ffffff;
  --bg-card-hover: #f2efe5;
  --bg-elev: #efeade;
  --border: #d5cfc0;
  --border-strong: #b8b09c;
  --text-main: #1f2937;
  --text-sub: #525d6d;
  --text-muted: #7c8594;
  --accent-gold: #b47d17;
  --accent-gold-bg: #fef3c7;
  --accent-green: #1e7d4b;
  --accent-red: #c93b36;
  --accent-blue: #2563eb;
  --cta-bg: #1e3a2f;
  --cta-text: #f8fafc;
}

.fc-root {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background: var(--bg-app);
  color: var(--text-main);
  position: relative;
}

/* ── Toast Banner ── */
.fc-toast {
  position: fixed;
  top: 58px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 900;
  background: #0f172a;
  color: #fde68a;
  border: 1px solid #eab308;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  pointer-events: none;
}

/* ── Top Header Bar ── */
.fc-topbar {
  position: relative;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  background: #172133;
  color: #f8fafc;
}

.fc-topbar-sky {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.92;
}

.sky-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.fc-topbar-left, .fc-topbar-right {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fc-compass-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.fc-title-stack {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.fc-title-sub {
  font-size: 9px;
  letter-spacing: 1.4px;
  color: #cbd5e1;
  font-weight: 700;
}

.fc-title-main {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

.fc-round-pill, .fc-dummy-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(15, 23, 42, 0.74);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
}

.fc-round-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.fc-tod-label {
  font-weight: 700;
  font-size: 12px;
}

.fc-round-num {
  font-size: 10px;
  color: #cbd5e1;
}

.fc-dummy-count {
  font-weight: 700;
  color: #fde68a;
}

.fc-menu-btn {
  background: rgba(15, 23, 42, 0.8);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.fc-menu-btn:hover {
  background: rgba(30, 41, 59, 0.95);
}

/* ── Main Split (World Map + Right Sidebar) ── */
.fc-main-split {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

/* ── World Map Pane ── */
.fc-map-pane {
  flex: 1;
  position: relative;
  background-color: var(--bg-map);
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  overflow: hidden;
  cursor: grab;
}

.fc-map-pane:active {
  cursor: grabbing;
}

.fc-map-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hex-cell {
  cursor: pointer;
  transition: filter 0.12s ease;
}

.hex-cell:hover {
  filter: brightness(1.1);
}

.explore-slot {
  cursor: pointer;
}

.explore-slot.explore-ready:hover rect {
  fill: rgba(74, 222, 128, 0.25);
}

.fc-map-stack-pill {
  position: absolute;
  top: 12px;
  left: 10px;
  z-index: 10;
  background: rgba(15, 23, 42, 0.85);
  color: #f1f5f9;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
}

.fc-map-stack-title {
  font-size: 10px;
  color: #94a3b8;
}

.stack-dot {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
}

.stack-green { background: #14532d; color: #bbf7d0; }
.stack-brown { background: #78350f; color: #fde68a; }

.fc-map-zoom-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fc-map-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.84);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.3);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.fc-map-icon-btn:hover {
  background: #334155;
}

.fc-map-bottom-left {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fc-map-round-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.32);
  font-size: 15px;
  cursor: pointer;
}

.fc-undo-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.32);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.fc-undo-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.fc-undo-count {
  background: #334155;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 11px;
  color: #fde68a;
}

/* ── Right Sidebar (Location / Offers) ── */
.fc-sidebar {
  width: 340px;
  flex-shrink: 0;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.fc-sidebar-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.fc-stab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-sub);
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.fc-stab.active {
  color: var(--text-main);
  border-bottom-color: var(--accent-gold);
}

.fc-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Combat Resolved Card */
.fc-combat-resolved {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-left: 4px solid var(--accent-gold);
  border-radius: 10px;
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fc-cr-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fc-cr-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--accent-gold);
}

.fc-cr-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.fc-cr-stat-box {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fc-cr-big {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent-gold);
}

.fc-cr-sub {
  font-size: 10px;
  color: var(--text-sub);
  letter-spacing: 0.8px;
  font-weight: 700;
}

.fc-cr-sec-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.fc-cr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.fc-cr-chip {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.fc-cr-star { color: var(--accent-gold); }

.fc-cr-conq-badge {
  display: inline-block;
  background: #14532d;
  color: #bbf7d0;
  border: 1px solid #22c55e;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}

.fc-cr-reward {
  font-size: 12px;
  font-weight: 700;
  color: #86efac;
}

/* Phase & Location Cards */
.fc-loc-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fc-phase-card, .fc-site-card, .fc-interact-card, .fc-log-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.fc-phase-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.fc-pp {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--bg-elev);
  color: var(--text-muted);
}

.fc-pp.active {
  background: #14532d;
  color: #dcfce7;
}

.fc-phase-desc, .fc-site-desc {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.35;
}

.fc-levelup-alert {
  background: var(--accent-gold-bg);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.fc-site-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fc-site-title {
  font-size: 14px;
  font-weight: 800;
}

.fc-site-cost-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  background: var(--bg-elev);
  padding: 2px 7px;
  border-radius: 5px;
}

.fc-city-bonus {
  background: #1e3a5f;
  color: #dbeafe;
  border: 1px solid #3b82f6;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.fc-site-enemies {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fc-mini-enemy {
  font-size: 11px;
  font-weight: 600;
  background: rgba(185, 28, 28, 0.16);
  border: 1px solid rgba(248, 113, 113, 0.35);
  padding: 4px 7px;
  border-radius: 5px;
}

.fc-interact-title {
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-gold);
}

.fc-interact-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Active Combat Panel */
.fc-combat-panel {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.fc-combat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #fca5a5;
}

.fc-combat-phase-tag {
  background: #7f1d1d;
  color: #fee2e2;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
}

.fc-csteps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.fc-cstep {
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 2px;
  border-radius: 5px;
  background: var(--bg-elev);
  color: var(--text-muted);
}

.fc-cstep.active {
  background: #b91c1c;
  color: #ffffff;
}

.fc-combat-pool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.fc-cp-chip {
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 3px 7px;
  border-radius: 5px;
}

.fc-cp-gold {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.fc-enemy-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.fc-enemy-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 9px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.fc-enemy-card.selected {
  border-color: #f87171;
  box-shadow: 0 0 0 1px rgba(248, 113, 113, 0.45);
}

.fc-enemy-card.defeated {
  opacity: 0.52;
  cursor: default;
}

.fc-ec-top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.fc-ec-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid;
  flex-shrink: 0;
}

.fc-ec-name {
  font-size: 13px;
  font-weight: 800;
  flex: 1;
}

.fc-ec-fame {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-gold);
}

.fc-ec-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sub);
}

.fc-ec-traits {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.fc-trait-tag {
  font-size: 10px;
  font-weight: 700;
  background: var(--bg-elev);
  color: #fde68a;
  padding: 2px 6px;
  border-radius: 4px;
}

.fc-ec-status {
  font-size: 11px;
  font-weight: 800;
}

.fc-ec-status.won { color: #4ade80; }
.fc-ec-status.warn { color: #fbbf24; }

.fc-ec-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 2px;
}

.fc-combat-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

/* Offers Tab */
.fc-offers-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-sub);
}

.fc-inf-badge {
  background: var(--accent-gold-bg);
  color: var(--accent-gold);
  padding: 3px 8px;
  border-radius: 6px;
}

.fc-offer-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fc-offer-group-hdr {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  margin-top: 4px;
}

.fc-offer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 9px;
}

.fc-offer-tier {
  width: 22px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent-gold);
}

.fc-offer-main {
  flex: 1;
  min-width: 0;
}

.fc-offer-name {
  font-size: 12px;
  font-weight: 700;
}

.fc-offer-sub {
  font-size: 11px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Log Box */
.fc-log-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
}

.fc-log-lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fc-log-line {
  font-size: 11px;
  color: var(--text-sub);
  line-height: 1.3;
}

/* Sidebar Sticky Footer */
.fc-sidebar-footer {
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.fc-turn-action-hdr {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.fc-turn-action-phase {
  color: var(--accent-gold);
  font-weight: 700;
}

.fc-turn-action-btns {
  display: flex;
  gap: 7px;
}

.fc-btn-rest {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.fc-btn-finish {
  flex: 1;
  background: var(--cta-bg);
  color: var(--cta-text);
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.fc-btn-finish:hover { filter: brightness(1.06); }

/* Common Buttons */
.fc-btn-primary {
  width: 100%;
  background: var(--bg-elev);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.fc-btn-sm {
  background: var(--bg-elev);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.fc-btn-xs {
  background: var(--bg-elev);
  color: var(--text-main);
  border: 1px solid var(--border-strong);
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.fc-btn-xs:disabled, .fc-btn-sm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.fc-btn-red { background: #991b1b; color: #fff; border-color: #ef4444; }
.fc-btn-green { background: #166534; color: #fff; border-color: #22c55e; }
.fc-btn-blue { background: #1d4ed8; color: #fff; border-color: #60a5fa; }
.fc-btn-gold { background: var(--accent-gold-bg); color: var(--accent-gold); border-color: var(--accent-gold); }

/* ── Bottom Command Dock (3 Columns matching Screenshots 1 & 4) ── */
.fc-bottom-dock {
  height: 274px;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
  display: grid;
  grid-template-columns: 235px 1fr 290px;
  overflow: hidden;
}

/* Column 1: Hero Panel */
.fc-hero-panel {
  border-right: 1px solid var(--border);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  overflow-y: auto;
}

.fc-hero-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fc-hero-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-elev);
  border: 1.5px solid var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.fc-hero-id { flex: 1; }
.fc-hero-name { font-size: 14px; font-weight: 800; }
.fc-hero-fame { font-size: 10px; color: var(--text-sub); }
.fc-hero-lvl {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-gold);
  background: var(--accent-gold-bg);
  padding: 2px 7px;
  border-radius: 5px;
}

.fc-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px;
}

.fc-hstat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fc-hstat-k { font-size: 9px; color: var(--text-muted); font-weight: 700; }
.fc-hstat-v { font-size: 13px; font-weight: 800; }

.fc-tactic-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 8px;
}

.fc-tactic-num {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  background: var(--bg-elev);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 12px;
  color: var(--accent-gold);
}

.fc-tactic-info { display: flex; flex-direction: column; }
.fc-tactic-lbl { font-size: 9px; color: var(--text-muted); }
.fc-tactic-name { font-size: 12px; font-weight: 700; }

.fc-mana-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fc-mana-row-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
}

.fc-crys-list, .fc-tokens-list, .fc-source-dice {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.fc-crys-btn {
  display: flex;
  align-items: center;
  gap: 3px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 3px 6px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.fc-crys-btn.empty { opacity: 0.4; }
.fc-crys-btn:hover:not(.empty) { border-color: var(--accent-gold); }

.mana-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.mana-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid;
}

.fc-die-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1.5px solid;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.fc-die-btn.used { opacity: 0.35; cursor: not-allowed; }
.fc-die-btn.avail:hover { transform: translateY(-1px); }

.fc-muted { font-size: 11px; color: var(--text-muted); }

/* Column 2: Hand Dock */
.fc-hand-dock {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding: 6px 10px 8px 10px;
  gap: 6px;
}

.fc-pool-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.fc-pool-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.fc-pool-chip.lit { background: #14532d; color: #dcfce7; border-color: #22c55e; }
.fc-pool-chip.lit-red { background: #7f1d1d; color: #fee2e2; border-color: #ef4444; }
.fc-pool-chip.lit-blue { background: #1e3a8a; color: #dbeafe; border-color: #60a5fa; }
.fc-pool-chip.lit-gold { background: #451a03; color: #fef08a; border-color: #f59e0b; }

.fc-cards-row {
  flex: 1;
  display: flex;
  gap: 9px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 4px;
  align-items: stretch;
}

.fc-empty-hand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  font-size: 13px;
  color: var(--text-muted);
}

.fc-card {
  width: 178px;
  min-width: 178px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.fc-card:hover:not(.played) {
  transform: translateY(-2px);
  border-color: var(--accent-gold);
}

.fc-card.played {
  opacity: 0.56;
  border-color: #22c55e;
}

.fc-card.wound {
  border-color: #991b1b;
}

.fc-card-art-wrap {
  position: relative;
  height: 62px;
  flex-shrink: 0;
  overflow: hidden;
}

.card-art-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.fc-card-played-tag {
  position: absolute;
  top: 5px;
  right: 5px;
  background: #14532d;
  color: #bbf7d0;
  border: 1px solid #22c55e;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 4px;
}

.fc-card-title-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 3px 7px;
  background: linear-gradient(transparent, rgba(0,0,0,0.86));
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f8fafc;
}

.fc-card-title {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fc-card-body {
  flex: 1;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fc-card-zone {
  text-align: left;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 6px;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fc-card-zone:hover:not(:disabled) {
  border-color: var(--accent-gold);
  background: var(--bg-card-hover);
}

.fc-card-zone:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.fc-card-zone.powered.ready {
  border-color: rgba(234, 179, 73, 0.7);
}

.fc-zone-lbl {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: var(--accent-gold);
}

.fc-zone-txt {
  font-size: 10.5px;
  line-height: 1.25;
  color: var(--text-main);
}

.fc-sw-toggle {
  margin-top: auto;
  background: transparent;
  border: 1px dashed var(--border-strong);
  color: var(--text-sub);
  border-radius: 5px;
  padding: 3px;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.fc-sw-toggle:hover { color: var(--text-main); border-color: var(--accent-gold); }

.fc-sideways-bar {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
}

.fc-sw-btn {
  background: #334155;
  color: #f8fafc;
  border: none;
  border-radius: 4px;
  padding: 3px 2px;
  font-size: 9.5px;
  font-weight: 700;
  cursor: pointer;
}

.fc-sw-btn:hover { background: #eab349; color: #1c1917; }

/* Column 3: Units & Skills Dock */
.fc-us-dock {
  border-left: 1px solid var(--border);
  padding: 8px 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fc-us-section {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fc-us-hdr {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

.fc-units-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.fc-muted-box {
  grid-column: span 2;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 7px;
}

.fc-unit-tile {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 7px;
  padding: 6px;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fc-unit-tile:hover, .fc-unit-tile.inspected {
  border-color: var(--accent-gold);
}

.fc-unit-tile.spent { opacity: 0.55; }
.fc-unit-tile.wounded { border-color: #dc2626; opacity: 0.7; }

.fc-ut-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fc-ut-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #64748b;
}

.fc-ut-dot.ready { background: #22c55e; }
.fc-ut-arm { font-size: 10px; font-weight: 700; color: var(--text-sub); }
.fc-ut-name { font-size: 11px; font-weight: 800; }

.fc-skills-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fc-skill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 7px;
}

.fc-skill-main { min-width: 0; }
.fc-skill-name { font-size: 11.5px; font-weight: 700; }
.fc-skill-desc { font-size: 10px; color: var(--text-sub); }
.fc-passive-tag {
  font-size: 9px;
  font-weight: 800;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 2px 5px;
  border-radius: 4px;
}

/* ── Floating Unit Inspector Card (Exact Screenshot 1 Stone Throwers Card!) ── */
.fc-unit-popup {
  position: fixed;
  right: 26px;
  bottom: 286px;
  width: 268px;
  z-index: 400;
  background: #f5ebd1;
  color: #1c1917;
  border: 3px solid #d4a853;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.fc-up-banner {
  position: relative;
  padding: 12px;
  background: linear-gradient(135deg, #27374d 0%, #4b3928 100%);
  color: #fef9c3;
}

.fc-up-status {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  background: #475569;
  color: #fff;
  margin-bottom: 6px;
}

.fc-up-status.ready { background: #16a34a; }

.fc-up-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.45);
  color: #fff;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
}

.fc-up-tier {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #fde68a;
}

.fc-up-title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 2px;
}

.fc-up-name { font-size: 16px; font-weight: 900; }
.fc-up-stats { font-size: 12px; font-weight: 700; }

.fc-up-abilities {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fc-up-ab-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fdf8eb;
  border: 1px solid #d6c59c;
  border-radius: 7px;
  padding: 7px 9px;
}

.fc-up-ab-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fc-up-ab-label {
  font-size: 12px;
  font-weight: 800;
  color: #292524;
}

/* ── Modals ── */
.fc-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(8, 12, 22, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.fc-modal {
  width: 100%;
  max-width: 680px;
  background: var(--bg-panel);
  border: 1.5px solid var(--accent-gold);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 90vh;
  overflow-y: auto;
}

.fc-modal-sm { max-width: 480px; }

.fc-modal-hdr h2 { font-size: 19px; font-weight: 900; color: var(--accent-gold); }
.fc-modal-hdr p { font-size: 13px; color: var(--text-sub); margin-top: 3px; }

.fc-tactic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.fc-tactic-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.fc-tactic-card:hover {
  border-color: var(--accent-gold);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.fc-tc-num { font-size: 12px; font-weight: 900; color: var(--accent-gold); }
.fc-tc-name { font-size: 14px; font-weight: 800; }
.fc-tc-desc { font-size: 12px; color: var(--text-sub); line-height: 1.3; }

.fc-lu-sec { display: flex; flex-direction: column; gap: 6px; }
.fc-lu-lbl { font-size: 12px; font-weight: 800; color: var(--accent-gold); }
.fc-lu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

.fc-lu-opt {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
}

.fc-lu-opt.active {
  border-color: var(--accent-gold);
  background: var(--accent-gold-bg);
}

.fc-lu-name { font-size: 13px; font-weight: 800; }
.fc-lu-desc { font-size: 11px; color: var(--text-sub); margin-top: 3px; }

.fc-menu-list { display: flex; flex-direction: column; gap: 8px; }
.fc-menu-item {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.fc-menu-item:hover { border-color: var(--accent-gold); }

.fc-rules-mini {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.45;
}

.fc-score-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px;
}

.fc-sc-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.fc-sc-row.total {
  border-top: 1px solid var(--border-strong);
  padding-top: 8px;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 900;
  color: var(--accent-gold);
}

.fc-modal-actions {
  display: flex;
  justify-content: flex-end;
}

/* ── Responsive Breakpoint (Mobile / Portrait like Screenshot 2) ── */
@media (max-width: 900px) {
  .fc-main-split { flex-direction: column; }
  .fc-sidebar { width: 100%; height: 220px; border-left: none; border-top: 1px solid var(--border); }
  .fc-bottom-dock {
    height: 290px;
    grid-template-columns: 1fr;
    overflow-y: auto;
  }
  .fc-hero-panel, .fc-us-dock { border: none; border-bottom: 1px solid var(--border); }
  .fc-tactic-grid { grid-template-columns: repeat(2, 1fr); }
  .fc-dummy-pill { display: none; }
}
