/* Universal 8-Promotion Fighter Profile Engine — Bare And Brawl colorway
 * Supports light mode (default) and html[data-theme=dark]. Zero emojis.
 */

.fph-root {
  --fph-bg: #f4f6fa;
  --fph-surface: #ffffff;
  --fph-surface-alt: #f8fafd;
  --fph-hero-bg: linear-gradient(135deg, #0d1b2e 0%, #152842 58%, #221626 100%);
  --fph-navy: #102036;
  --fph-crimson: #c41e3a;
  --fph-crimson-soft: rgba(196, 30, 58, 0.12);
  --fph-gold: #c9972c;
  --fph-gold-bright: #e5be67;
  --fph-gold-soft: rgba(201, 151, 44, 0.16);
  --fph-ink: #101c2d;
  --fph-muted: #54657c;
  --fph-line: #d9e2ee;
  --fph-win: #15803d;
  --fph-win-bg: rgba(21, 128, 61, 0.12);
  --fph-loss: #b91c1c;
  --fph-loss-bg: rgba(185, 28, 28, 0.12);
  --fph-draw: #475569;
  --fph-draw-bg: rgba(71, 85, 105, 0.14);
  --fph-shadow: 0 8px 24px rgba(12, 24, 42, 0.08);
  --fph-radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--fph-ink);
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
}

.fph-root *,
.fph-root *::before,
.fph-root *::after {
  box-sizing: border-box;
}

html[data-theme=dark] .fph-root {
  --fph-bg: #0c1522;
  --fph-surface: #152439;
  --fph-surface-alt: #101e31;
  --fph-hero-bg: linear-gradient(135deg, #0b1524 0%, #132338 56%, #281624 100%);
  --fph-navy: #0f1d30;
  --fph-crimson: #ed7687;
  --fph-crimson-soft: rgba(237, 118, 135, 0.16);
  --fph-gold: #e5be67;
  --fph-gold-bright: #f2d283;
  --fph-gold-soft: rgba(229, 190, 103, 0.18);
  --fph-ink: #e2ecf8;
  --fph-muted: #9dafc6;
  --fph-line: #304158;
  --fph-win: #6ee7a8;
  --fph-win-bg: rgba(23, 61, 51, 0.85);
  --fph-loss: #f49aa8;
  --fph-loss-bg: rgba(68, 39, 51, 0.88);
  --fph-draw: #b8c7dc;
  --fph-draw-bg: rgba(48, 65, 88, 0.72);
  --fph-shadow: 0 10px 28px rgba(4, 10, 20, 0.42);
}

.fph-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: middle;
}

/* ==================== PROFILE HERO ==================== */
.fph-hero {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 24px 28px;
  border-radius: var(--fph-radius);
  background: var(--fph-hero-bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 3px solid var(--fph-crimson);
  color: #f1f5fb;
  box-shadow: var(--fph-shadow);
  overflow: visible;
}

.fph-portrait-wrap {
  width: 220px;
  height: 248px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(10, 20, 36, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.fph-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.fph-initials {
  font-size: 54px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #e5be67;
  user-select: none;
}

.fph-hero-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fph-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.fph-promo-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f4f7fc;
}

.fph-rank-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.fph-rank-champ {
  background: linear-gradient(135deg, #d4a238, #f0cf7b);
  color: #161207;
  border: 1px solid #f7df9d;
}

.fph-rank-contender {
  background: #c41e3a;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.fph-rank-unranked {
  background: rgba(148, 163, 184, 0.2);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.fph-name {
  margin: 0;
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: #ffffff;
}

.fph-nickname {
  margin: -4px 0 0;
  font-size: 15px;
  font-weight: 600;
  color: #e5be67;
  letter-spacing: 0.02em;
}

.fph-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 13.5px;
  color: #cbd8ea;
}

.fph-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.fph-flag {
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  flex: 0 0 auto;
}

.fph-hero-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  min-width: 196px;
}

.fph-record-card {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  padding: 12px 18px;
  text-align: right;
  min-width: 180px;
}

.fph-record-label {
  display: block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #a8bbd4;
  margin-bottom: 4px;
}

.fph-record-value {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #ffffff;
  line-height: 1.1;
}

.fph-record-nc {
  font-size: 12px;
  font-weight: 700;
  color: #a8bbd4;
  margin-left: 6px;
}

/* Interactive Last 5 Form Pills */
.fph-form-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.fph-form-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #a8bbd4;
}

.fph-form-pills {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fph-form-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 800;
  border: 1px solid transparent;
  cursor: default;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.fph-form-pill:hover,
.fph-form-pill:focus-visible {
  transform: translateY(-2px);
  outline: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.fph-form-w {
  background: #16a34a;
  color: #ffffff;
  border-color: #4ade80;
}

.fph-form-l {
  background: #c41e3a;
  color: #ffffff;
  border-color: #fb7185;
}

.fph-form-d,
.fph-form-nc {
  background: #475569;
  color: #f1f5f9;
  border-color: #94a3b8;
}

.fph-form-tip {
  position: absolute;
  bottom: calc(100% + 9px);
  right: 0;
  min-width: 210px;
  max-width: 260px;
  padding: 9px 11px;
  border-radius: 8px;
  background: #0a1422;
  color: #eef4fd;
  border: 1px solid rgba(229, 190, 103, 0.45);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.38;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 30;
}

.fph-form-tip strong {
  display: block;
  color: #f3d485;
  font-size: 12.5px;
  margin-bottom: 2px;
}

.fph-form-pill:hover .fph-form-tip,
.fph-form-pill:focus-visible .fph-form-tip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ==================== VITALS & BIO BAR ==================== */
.fph-vitals {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: var(--fph-line);
  border: 1px solid var(--fph-line);
  border-radius: var(--fph-radius);
  overflow: hidden;
  box-shadow: var(--fph-shadow);
}

.fph-vital-cell {
  background: var(--fph-surface);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.fph-vital-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fph-muted);
}

.fph-vital-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--fph-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== PANELS & GRID ==================== */
.fph-panel {
  background: var(--fph-surface);
  border: 1px solid var(--fph-line);
  border-radius: var(--fph-radius);
  padding: 20px 22px;
  box-shadow: var(--fph-shadow);
}

.fph-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--fph-line);
}

.fph-panel-title {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--fph-ink);
}

.fph-panel-title .fph-icon {
  color: var(--fph-crimson);
}

.fph-stats-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 20px;
}

/* Win Breakdown */
.fph-finish-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--fph-gold-soft);
  color: var(--fph-gold);
  font-size: 12px;
  font-weight: 800;
}

.fph-win-bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fph-bar-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fph-bar-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
}

.fph-bar-label {
  font-weight: 700;
  color: var(--fph-ink);
}

.fph-bar-val {
  font-weight: 800;
  color: var(--fph-muted);
}

.fph-bar-track {
  height: 10px;
  border-radius: 999px;
  background: var(--fph-surface-alt);
  border: 1px solid var(--fph-line);
  overflow: hidden;
}

.fph-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.fph-bar-ko {
  background: linear-gradient(90deg, #b91c1c, #e11d48);
}

.fph-bar-sub {
  background: linear-gradient(90deg, #b8861e, #e5be67);
}

.fph-bar-dec {
  background: linear-gradient(90deg, #1d3a5f, #3b6ea5);
}

/* Milestones / Records */
.fph-milestones {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--fph-line);
}

.fph-milestone {
  background: var(--fph-surface-alt);
  border: 1px solid var(--fph-line);
  border-radius: 9px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fph-milestone-val {
  font-size: 18px;
  font-weight: 900;
  color: var(--fph-ink);
  line-height: 1.15;
}

.fph-milestone-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fph-muted);
}

/* Advanced Metrics Grid */
.fph-adv-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.fph-metric-tile {
  background: var(--fph-surface-alt);
  border: 1px solid var(--fph-line);
  border-radius: 9px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fph-metric-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fph-muted);
}

.fph-metric-value {
  font-size: 20px;
  font-weight: 900;
  color: var(--fph-ink);
  line-height: 1.15;
}

/* ==================== FIGHT HISTORY TABLE ==================== */
.fph-year-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fph-year-btn {
  appearance: none;
  border: 1px solid var(--fph-line);
  background: var(--fph-surface-alt);
  color: var(--fph-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.fph-year-btn:hover {
  border-color: var(--fph-crimson);
  color: var(--fph-ink);
}

.fph-year-btn.is-active,
.fph-year-btn[aria-pressed="true"] {
  background: var(--fph-crimson);
  border-color: var(--fph-crimson);
  color: #ffffff;
}

.fph-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.fph-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 720px;
}

.fph-table thead th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--fph-muted);
  background: var(--fph-surface-alt);
  border-bottom: 2px solid var(--fph-line);
  white-space: nowrap;
}

.fph-table tbody td {
  padding: 12px;
  border-bottom: 1px solid var(--fph-line);
  color: var(--fph-ink);
  vertical-align: middle;
}

.fph-table tbody tr:hover {
  background: var(--fph-surface-alt);
}

.fph-table tbody tr.fph-row-hidden {
  display: none;
}

.fph-res-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fph-res-w {
  background: var(--fph-win-bg);
  color: var(--fph-win);
}

.fph-res-l {
  background: var(--fph-loss-bg);
  color: var(--fph-loss);
}

.fph-res-d,
.fph-res-nc {
  background: var(--fph-draw-bg);
  color: var(--fph-draw);
}

.fph-opp-link {
  color: var(--fph-ink);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.fph-opp-link:hover {
  color: var(--fph-crimson);
  border-bottom-color: var(--fph-crimson);
}

.fph-title-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--fph-gold-soft);
  color: var(--fph-gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.fph-muted {
  color: var(--fph-muted);
}

.fph-empty {
  text-align: center;
  padding: 28px 16px;
  color: var(--fph-muted);
  font-size: 14px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 980px) {
  .fph-hero {
    grid-template-columns: 180px minmax(0, 1fr);
  }
  .fph-hero-side {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }
  .fph-record-card {
    text-align: left;
  }
  .fph-form-block {
    align-items: flex-end;
  }
  .fph-vitals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .fph-stats-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .fph-hero {
    grid-template-columns: 1fr;
    padding: 20px;
    text-align: center;
  }
  .fph-portrait-wrap {
    margin: 0 auto;
    width: 172px;
    height: 196px;
  }
  .fph-badges,
  .fph-meta-row {
    justify-content: center;
  }
  .fph-hero-side {
    flex-direction: column;
    align-items: center;
  }
  .fph-record-card,
  .fph-form-block {
    text-align: center;
    align-items: center;
  }
  .fph-vitals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fph-milestones {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fph-adv-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Elevated Fighter Profile Last 5 Hover Tooltip */
.fph-form-tip {
  background: linear-gradient(180deg, #0d1a2e 0%, #08101d 100%) !important;
  border: 1px solid rgba(225, 189, 112, 0.45) !important;
  border-top: 3px solid #e63956 !important;
  border-radius: 12px !important;
  padding: 12px 14px !important;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.58) !important;
  backdrop-filter: blur(10px);
  min-width: 230px !important;
  line-height: 1.4 !important;
}
.fph-form-tip strong {
  display: block;
  font-size: 13px !important;
  font-weight: 900 !important;
  color: #ffffff !important;
  margin-bottom: 4px !important;
  letter-spacing: 0.01em;
}
.fph-form-tip span {
  display: block;
  font-size: 11.5px !important;
  color: #cbd5e1 !important;
  font-weight: 600 !important;
}
