/* ==========================================================================
   Cannon Fight Lab — shared design system
   ========================================================================== */

:root {
  --red: #e63946;
  --red-dark: #c1121f;
  --bg: #0a0a0a;
  --bg-2: #111111;
  --bg-3: #181818;
  --bg-4: #1e1e1e;
  --border: #222222;
  --border-2: #2a2a2a;
  --text: #f0f0f0;
  --text-2: #999999;
  --text-3: #555555;
  --blue: #378ADD;
  --green: #4CAF50;
  --amber: #ffb547;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }

/* ============== NAV ============== */
nav.cfl-nav {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.cfl-logo {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.cfl-logo .accent { color: var(--red); }
.cfl-logo .full { display: inline; }
.cfl-logo .short { display: none; }

.cfl-nav-links {
  display: flex;
  gap: 28px;
  align-items: center;
}
.cfl-nav-links a {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
  transition: color 0.15s;
  position: relative;
}
.cfl-nav-links a:hover { color: #fff; }
.cfl-nav-links a.active { color: #fff; }
.cfl-nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -19px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--red);
}
.cfl-nav-links a .full { display: inline; }
.cfl-nav-links a .short { display: none; }
.cfl-nav-tag {
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ============== Reusable bits ============== */
.section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
}
.section-label.tight { margin-bottom: 8px; }

.eyebrow {
  font-size: 11px;
  font-weight: 600;
  color: var(--red);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.card.padded { padding: 20px; }
.card.padded-lg { padding: 28px; }

.btn {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: background 0.15s;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: var(--red-dark); }
.btn.ghost {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  color: var(--text-2);
}
.btn.ghost:hover {
  background: var(--bg-4);
  color: #fff;
}

input[type="text"], input[type="number"], select {
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  color: #fff;
  outline: none;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.15s;
}
input[type="text"]:focus, input[type="number"]:focus, select:focus {
  border-color: var(--red);
}
input::placeholder { color: var(--text-3); }

/* ============== Avatar / fighter chip ============== */
.cfl-avatar {
  border-radius: 50%;
  background: var(--bg-4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  color: var(--red);
  flex-shrink: 0;
  border: 1px solid var(--border-2);
}
.cfl-avatar.sm { width: 36px; height: 36px; font-size: 13px; }
.cfl-avatar.md { width: 44px; height: 44px; font-size: 16px; }
.cfl-avatar.lg { width: 60px; height: 60px; font-size: 20px; }
.cfl-avatar.xl {
  width: 84px; height: 84px; font-size: 30px;
  border: 2px solid var(--red); font-weight: 800;
}

/* ============== Fighter card (list item) ============== */
.fighter-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.fighter-card:hover { border-color: #333; background: var(--bg-3); }
.fighter-card.active { border-color: var(--red); background: var(--bg-3); }
.fighter-top { display: flex; align-items: center; gap: 12px; }
.fighter-info { flex: 1; min-width: 0; }
.fighter-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fighter-meta { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.record-badge {
  background: var(--bg-4);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: 0.5px;
}
.record-tag {
  font-size: 9px;
  color: var(--text-3);
  display: block;
  text-align: center;
  margin-top: 2px;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* ============== Stats ============== */
.stat-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.stat-val {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.stat-val.accent { color: var(--red); }
.stat-val.muted { color: var(--text-3); }
.stat-val.green { color: var(--green); }
.stat-lbl { font-size: 11px; color: var(--text-3); margin-top: 4px; line-height: 1.3; }

.stats-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stats-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.stats-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

/* ============== States ============== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  color: var(--text-3);
  text-align: center;
  padding: 40px 20px;
}
.empty-state .big-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 14px; }

.no-results, .loading-state, .error-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-3);
  font-size: 14px;
}
.error-state { color: var(--red); }

.loading-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-2);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: cfl-spin 0.8s linear infinite;
  margin-bottom: 12px;
}
@keyframes cfl-spin { to { transform: rotate(360deg); } }

/* ============== Footer ============== */
footer.cfl-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  padding: 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 60px;
}
.cfl-footer .footer-logo {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
  font-weight: 800;
  color: var(--text-3);
}
.cfl-footer .footer-logo .accent { color: var(--red); }
.cfl-footer-text { font-size: 12px; color: var(--text-3); }
.cfl-footer-links { display: flex; gap: 20px; }
.cfl-footer-links a {
  font-size: 12px;
  color: var(--text-3);
  transition: color 0.15s;
}
.cfl-footer-links a:hover { color: var(--text-2); }

/* ============== Page hero (lighter than nav) ============== */
.page-hero {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 32px 32px 28px;
}
.page-hero h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 38px;
  font-weight: 800;
  color: #fff;
  line-height: 1.05;
  margin-bottom: 8px;
}
.page-hero p {
  font-size: 14px;
  color: var(--text-2);
  max-width: 560px;
}

/* Page container for content under hero */
.page {
  padding: 28px 32px 0;
  max-width: 1400px;
  margin: 0 auto;
}

/* ============== Mobile ============== */
@media (max-width: 768px) {
  nav.cfl-nav {
    padding: 0 12px;
    height: 52px;
  }
  .cfl-logo .full { display: none; }
  .cfl-logo .short { display: inline; }
  .cfl-logo { font-size: 20px; }
  .cfl-nav-links {
    gap: 14px;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;  /* firefox */
    -ms-overflow-style: none;  /* IE */
  }
  .cfl-nav-links::-webkit-scrollbar { display: none; }
  .cfl-nav-links a {
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .cfl-nav-links a .full { display: none; }
  .cfl-nav-links a .short { display: inline; }
  .cfl-nav-links a.active::after { bottom: -16px; }
  .cfl-nav-tag {
    flex-shrink: 0;
    font-size: 9px;
    padding: 2px 6px;
  }
  .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid-3 { grid-template-columns: repeat(2, 1fr); }
  .page-hero { padding: 24px 16px; }
  .page-hero h1 { font-size: 28px; }
  .page { padding: 20px 16px 0; }
  footer.cfl-footer { padding: 20px 16px; flex-direction: column; align-items: flex-start; }
}

/* =============================================================================
   AUTH UI — nav slot, login/signup forms, account page, premium gating
   ============================================================================= */

/* --- Nav: signed-in avatar / signed-out CTAs --- */
.cfl-nav-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}
.cfl-nav-link {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
}
.cfl-nav-link:hover { color: var(--text); }
.cfl-nav-cta {
  background: var(--red);
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 6px;
  transition: background 0.15s;
}
.cfl-nav-cta:hover { background: var(--red-dark); }
.cfl-nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 4px 8px 4px 4px;
  border-radius: 24px;
  border: 1px solid var(--border);
  transition: border-color 0.15s, background 0.15s;
}
.cfl-nav-user:hover { border-color: var(--border-2); background: var(--bg-3); }
.cfl-nav-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg-4);
  color: var(--red);
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-2);
}
.cfl-tier-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.cfl-tier-badge.premium {
  background: linear-gradient(90deg, var(--red), var(--red-dark));
  color: #fff;
}
.cfl-tier-badge.free {
  background: var(--bg-4);
  color: var(--text-2);
  border: 1px solid var(--border-2);
}

/* --- Auth pages (login / signup / reset / account) --- */
.auth-page {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 20px;
}
.auth-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
}
.auth-card h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 8px;
  letter-spacing: -0.5px;
}
.auth-card .auth-sub {
  color: var(--text-2);
  font-size: 14px;
  margin-bottom: 28px;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.auth-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 6px;
}
.auth-field input {
  width: 100%;
  background: var(--bg-3);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.15s;
}
.auth-field input:focus { border-color: var(--red); }
.auth-field input::placeholder { color: var(--text-3); }
.auth-card .btn {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  margin-top: 8px;
}
.auth-error {
  background: rgba(230, 57, 70, 0.08);
  border: 1px solid rgba(230, 57, 70, 0.3);
  color: #f5a3aa;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}
.auth-success {
  background: rgba(76, 175, 80, 0.08);
  border: 1px solid rgba(76, 175, 80, 0.3);
  color: #a3e6a8;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}
.auth-footer {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
  text-align: center;
}
.auth-footer a {
  color: var(--red);
  text-decoration: none;
  font-weight: 500;
}
.auth-footer a:hover { text-decoration: underline; }

/* --- Account page sections --- */
.account-section {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}
.account-section h2 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 16px;
}
.account-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.account-row:last-child { border-bottom: none; }
.account-row .label {
  font-size: 13px;
  color: var(--text-2);
}
.account-row .value {
  font-size: 14px;
  color: var(--text);
  font-weight: 500;
}

/* --- Premium upgrade prompt (used on locked features) --- */
.premium-prompt {
  background: linear-gradient(135deg, rgba(230, 57, 70, 0.08), rgba(193, 18, 31, 0.04));
  border: 1px solid rgba(230, 57, 70, 0.3);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
}
.premium-prompt-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.premium-prompt-header .lock-icon {
  width: 24px; height: 24px;
  background: var(--red);
  color: #fff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
}
.premium-prompt-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}
.premium-prompt-body {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 12px;
}
.premium-prompt-cta {
  display: inline-block;
  background: var(--red);
  color: #fff !important;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  transition: background 0.15s;
}
.premium-prompt-cta:hover { background: var(--red-dark); }

/* Inline locked-edge variant (smaller, fits in edge panel) */
.premium-prompt.inline {
  padding: 12px 14px;
  margin: 8px 0 0;
}
.premium-prompt.inline .premium-prompt-header {
  margin-bottom: 4px;
}
.premium-prompt.inline .premium-prompt-title { font-size: 14px; }
.premium-prompt.inline .premium-prompt-body { font-size: 12px; margin-bottom: 8px; }
.premium-prompt.inline .premium-prompt-cta { font-size: 12px; padding: 6px 12px; }

/* --- Pricing page --- */
.pricing-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 32px 80px;
}
.pricing-page h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 48px;
  font-weight: 800;
  color: var(--text);
  text-align: center;
  margin: 0 0 12px;
  letter-spacing: -1px;
}
.pricing-page > p.lede {
  text-align: center;
  color: var(--text-2);
  font-size: 16px;
  max-width: 640px;
  margin: 0 auto 48px;
}
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
}
.pricing-tier {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px;
}
.pricing-tier.premium {
  border-color: var(--red);
  position: relative;
}
.pricing-tier.premium::before {
  content: 'RECOMMENDED';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 4px 12px;
  border-radius: 10px;
}
.pricing-tier-name {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
  letter-spacing: -0.3px;
}
.pricing-tier-tagline {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 20px;
}
.pricing-tier-price {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 48px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.pricing-tier-price .currency {
  font-size: 24px;
  vertical-align: top;
  margin-right: 2px;
}
.pricing-tier-price .period {
  font-size: 14px;
  color: var(--text-3);
  font-weight: 500;
  margin-left: 4px;
}
.pricing-tier-price.coming-soon {
  font-size: 28px;
  color: var(--text-2);
  font-weight: 700;
}
.pricing-features {
  list-style: none;
  padding: 0;
  margin: 24px 0;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}
.pricing-features li {
  font-size: 14px;
  color: var(--text);
  padding: 8px 0 8px 24px;
  position: relative;
  line-height: 1.5;
}
.pricing-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}
.pricing-features li.muted { color: var(--text-3); }
.pricing-features li.muted::before { content: '—'; color: var(--text-3); }
.pricing-tier .btn {
  width: 100%;
  padding: 12px;
  font-size: 14px;
}

/* Mobile auth pages */
@media (max-width: 600px) {
  .auth-card { padding: 28px 22px; }
  .pricing-grid { grid-template-columns: 1fr; }
  .pricing-page { padding: 32px 16px 48px; }
  .pricing-page h1 { font-size: 36px; }
}
