/* WAR BRAIN / FORT RALLIES — DARK TACTICAL UI THEME */
:root {
  --bg-main: #0b0f19;
  --bg-card: #131b2e;
  --bg-card-hover: #1a253f;
  --bg-input: #080c14;
  --border-color: #1f2d4a;
  --border-active: #3b82f6;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-gold: #f59e0b;
  --accent-blue: #3b82f6;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-purple: #8b5cf6;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Container */
.app-container {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 16px;
  flex: 1;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.guild-logo {
  height: 40px;
  width: 40px;
  border-radius: 6px;
  flex-shrink: 0;
  display: block;
}

.header-title h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.header-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}

/* Navigation Tabs */
.tab-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 16px;
  scrollbar-width: thin;
}

.tab-btn {
  flex: 1;
  min-width: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: #334155;
}

.tab-btn.active {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

/* Card Sections */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Form Controls */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s ease;
}

.form-input:focus, .form-select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.3);
}

.quick-btn-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.btn-chip {
  padding: 4px 10px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-chip:hover {
  background: #334155;
  color: #fff;
  border-color: var(--accent-blue);
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 18px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.6);
}

.btn-gold {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Result Box */
.result-box {
  display: none;
  background: #0d1527;
  border: 1px solid #1e3a8a;
  border-radius: 12px;
  padding: 18px;
  margin-top: 16px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-gold);
}

.badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
}

.badge-green { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid #10b981; }
.badge-amber { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid #f59e0b; }
.badge-red { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid #ef4444; }

.tactical-directive {
  font-size: 14px;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.6);
  padding: 12px;
  border-radius: 8px;
  border-left: 4px solid var(--accent-blue);
  margin-bottom: 14px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat-card {
  background: #0b1120;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 10px;
  text-align: center;
}

.stat-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
}

.stat-val {
  font-size: 16px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text-primary);
  margin-top: 4px;
}

/* Accordion / Expandable */
.accordion {
  border: 1px solid #1e293b;
  border-radius: 8px;
  margin-top: 10px;
  overflow: hidden;
}

.accordion-header {
  padding: 10px 14px;
  background: #111c35;
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.accordion-body {
  display: none;
  padding: 12px 14px;
  background: #080c14;
  font-size: 13px;
  color: #94a3b8;
  border-top: 1px solid #1e293b;
}

.accordion-body ul {
  padding-left: 20px;
  margin-top: 6px;
}

.accordion-body li {
  margin-bottom: 4px;
}

/* Tables */
.tactical-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 8px;
}

.tactical-table th, .tactical-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #1e293b;
}

.tactical-table th {
  background: #0d1527;
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.tactical-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Fill Bars */
.fill-bars-container {
  margin-top: 12px;
  background: #0b1120;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #1e293b;
}

.fill-bar-row {
  margin-bottom: 8px;
}

.fill-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  margin-bottom: 4px;
}

.progress-track {
  height: 8px;
  background: #1e293b;
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill-inf { background: #ef4444; height: 100%; }
.progress-fill-rng { background: #3b82f6; height: 100%; }
.progress-fill-cav { background: #10b981; height: 100%; }

/* Mobile Responsiveness */
@media (max-width: 600px) {
  .app-container { padding: 8px; }
  .header-title h1 { font-size: 16px; }
  .tab-btn { min-width: 100px; font-size: 11px; padding: 8px 10px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ==========================================================================
   RALLY LEAD VS OPPONENT SCREENSHOT COMPARISON STYLES
   ========================================================================== */

.screenshot-compare-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}

@media (max-width: 860px) {
  .screenshot-compare-container {
    grid-template-columns: 1fr;
  }
}

.compare-column-card {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.compare-column-card.our-lead-card {
  border-color: rgba(56, 189, 248, 0.3);
}

.compare-column-card.opp-lead-card {
  border-color: rgba(239, 68, 68, 0.3);
}

.compare-card-title {
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.compare-card-title.our-title { color: #38bdf8; }
.compare-card-title.opp-title { color: #f87171; }

.screenshot-drop-target {
  background: #080c14;
  border: 2px dashed #334155;
  border-radius: 8px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
.screenshot-drop-target:hover {
  border-color: var(--accent-gold);
  background: #0d1527;
}

.preview-thumb-box {
  width: 100%;
  max-height: 200px;
  overflow: hidden;
  border-radius: 6px;
  border: 1px solid #1e293b;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-thumb-img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
}

.slots-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.slot-item-pill {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: relative;
}

.slot-item-pill.uncertain {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.pill-slot-name {
  font-size: 9px;
  color: #94a3b8;
  font-weight: 700;
  text-transform: uppercase;
}

.pill-item-name {
  color: #ffffff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pill-meta {
  font-size: 10px;
  color: #38bdf8;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-correct-pill {
  background: #f59e0b;
  color: #000;
  border: none;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 2px;
  align-self: flex-start;
}
.btn-correct-pill:hover {
  filter: brightness(1.1);
}

/* Stat Side Summary */
.side-stats-box {
  background: #080c14;
  border: 1px solid #1e293b;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 3px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.side-stat-label { color: #94a3b8; }
.side-stat-val { font-weight: 700; font-family: var(--font-mono); }

/* Advantage & Difference Comparison */
.comparison-container {
  margin-top: 20px;
  background: #0f172a;
  border: 1px solid var(--accent-gold);
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.adv-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 600px) {
  .adv-grid {
    grid-template-columns: 1fr;
  }
}

.adv-card {
  padding: 12px;
  border-radius: 8px;
  font-size: 12px;
}

.adv-card-ours {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.adv-card-opp {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.adv-title-ours {
  font-weight: 800;
  color: #34d399;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-size: 12px;
}

.adv-title-opp {
  font-weight: 800;
  color: #f87171;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-size: 12px;
}

.diff-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.diff-table th {
  background: #080c14;
  color: var(--accent-gold);
  text-align: left;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-weight: 700;
  border-bottom: 1px solid #1e293b;
}

.diff-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #1e293b;
}

.delta-pos {
  color: #34d399;
  font-weight: 700;
  font-family: var(--font-mono);
}

.delta-neg {
  color: #f87171;
  font-weight: 700;
  font-family: var(--font-mono);
}

.delta-zero {
  color: #94a3b8;
  font-family: var(--font-mono);
}

