/* ============ RANKINGS + FIGHTER PROFILE ============ */
.rk-panel { padding: 20px; }
.rk-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.rk-head h2 { font-family: var(--font-head); text-transform: uppercase; margin: 0; font-size: 1.6rem; }

/* Result + streak pills */
.res {
  display: inline-block; min-width: 26px; text-align: center; font-size: .72rem; font-weight: 700;
  text-transform: uppercase; padding: 2px 7px; border-radius: 4px; margin-right: 4px;
}
.res-win { background: #1f8f4e; color: #fff; }
.res-loss { background: var(--accent); color: #fff; }
.res-draw, .res-nc { background: #6b6b78; color: #fff; }
.res-upcoming { background: var(--accent-2); color: #111; }
.streak { font-family: var(--font-head); font-size: 1.05rem; }
.streak.up { color: #3ccf7a; }
.streak.down { color: #ff5a52; }
.belt { font-size: .9em; }

.champ-badge {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px;
  background: var(--accent-2); color: #111; font-family: var(--font-head); font-weight: 700;
}

/* Tables */
.rk-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.rk-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.rk-table th {
  text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted);
  background: var(--surface-2); padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.rk-table td { padding: 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.rk-table tbody tr:last-child td { border-bottom: 0; }
.rk-table tbody tr:hover { background: rgba(255, 255, 255, .03); }
.rk-table .meta { font-size: .78rem; }
.rk-rank { width: 56px; text-align: center; font-family: var(--font-head); font-size: 1.4rem; color: var(--muted); }
.rk-table tr.is-champ { background: linear-gradient(90deg, rgba(255, 180, 0, .08), transparent 60%); }
.rk-fighter a { display: flex; align-items: center; gap: 10px; }
.rk-fighter a:hover strong { color: var(--accent); }
.rk-flag { font-size: 1.5rem; line-height: 1; }
.rk-record { white-space: nowrap; }
.rk-record strong { font-family: var(--font-head); font-size: 1.15rem; letter-spacing: .5px; }

/* Champion card */
.champ-card {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; padding: 18px;
  border: 1px solid rgba(255, 180, 0, .5); border-radius: var(--radius);
  background: radial-gradient(ellipse at left, rgba(255, 180, 0, .14), transparent 70%), var(--surface-2);
  transition: transform .2s;
}
.champ-card:hover { transform: translateY(-2px); }
.champ-avatar, .fp-avatar {
  flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #5a0b0b); font-family: var(--font-head); color: #fff;
}
.champ-avatar { width: 64px; height: 64px; font-size: 1.4rem; box-shadow: 0 0 0 3px var(--accent-2); }
.champ-info { flex: 1 1 200px; }
.champ-label { color: var(--accent-2); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.champ-info h3 { font-family: var(--font-head); font-size: 1.6rem; margin: 2px 0 0; line-height: 1.2; }
.champ-info p { margin: 0; }
.champ-stats { display: flex; gap: 24px; margin: 0; }
.champ-stats dt, .fp-facts dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.champ-stats dd { margin: 0; font-family: var(--font-head); font-size: 1.3rem; }

/* All-divisions overview */
.div-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); gap: 16px; }
.div-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; }
.div-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.div-card h2 { font-family: var(--font-head); text-transform: uppercase; font-size: 1.3rem; margin: 0; border-left: 4px solid var(--accent); padding-left: 10px; }
.div-champ, .div-list a { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 8px; border-radius: 8px; }
.div-champ { background: rgba(255, 180, 0, .1); border: 1px solid rgba(255, 180, 0, .35); margin-bottom: 6px; font-weight: 600; }
.div-list { list-style: none; margin: 0 0 12px; padding: 0; flex: 1; }
.div-list a:hover, .div-champ:hover { background: var(--surface); }
.div-rank { text-align: center; font-family: var(--font-head); color: var(--muted); font-size: 1.05rem; }
.div-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.div-rec { font-family: var(--font-head); color: var(--muted); font-size: .95rem; }
.div-card .link-btn { align-self: flex-start; text-decoration: none; font-size: .9rem; }

/* ---------- Fighter profile ---------- */
.fp-top { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 18px; }
.fp-avatar { width: 104px; height: 104px; font-size: 2.2rem; border: 3px solid var(--border); }
.fp-id { flex: 1 1 260px; }
.fp-id h1 { margin: 4px 0 0; }
.fp-rank {
  display: inline-block; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
  padding: 3px 10px; border-radius: 999px; background: rgba(225, 6, 0, .15); border: 1px solid rgba(225, 6, 0, .5);
}
.fp-rank.is-champ { background: var(--accent-2); border-color: var(--accent-2); color: #111; }
.fp-nick { margin: 0; color: var(--accent-2); font-family: var(--font-head); font-size: 1.2rem; }
.fp-country { margin: 4px 0 0; color: var(--muted); }

.fp-record { text-align: center; }
.fp-record .meta { margin: 8px 0 0; }
.fp-wld { display: flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.fp-wld div { padding: 10px 22px; display: flex; flex-direction: column; align-items: center; background: var(--surface); }
.fp-wld div + div { border-left: 1px solid var(--border); }
.fp-wld strong { font-family: var(--font-head); font-size: 2.2rem; line-height: 1.1; }
.fp-wld span { font-size: .72rem; text-transform: uppercase; color: var(--muted); letter-spacing: .5px; }
.fp-wld .w strong { color: #3ccf7a; }
.fp-wld .l strong { color: #ff5a52; }

.fp-facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; margin: 24px 0 0;
  background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.fp-facts div { background: var(--surface); padding: 12px 14px; }
.fp-facts dd { margin: 2px 0 0; font-weight: 600; }
.fp-facts small { color: var(--muted); font-weight: 400; }
.fp-facts a { color: var(--accent); }

.fp-next {
  margin-bottom: 24px; padding: 18px 20px; border-radius: var(--radius);
  border: 1px solid rgba(255, 180, 0, .5); background: linear-gradient(90deg, rgba(255, 180, 0, .1), var(--surface));
}
.fp-next-label { color: var(--accent-2); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.fp-next h2 { font-family: var(--font-head); font-size: 1.6rem; margin: 2px 0; }
.fp-next p { margin: 0; }

.fp-breakdown { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 36px; }
.bd { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.bd-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-family: var(--font-head); text-transform: uppercase; font-size: 1.15rem; }
.bd-head strong { font-size: 1.6rem; }
.bd-row { display: grid; grid-template-columns: 90px 1fr 70px; gap: 10px; align-items: center; padding: 4px 0; font-size: .88rem; }
.bd-label { color: var(--muted); }
.bd-bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.bd-bar span { display: block; height: 100%; border-radius: inherit; }
.bd-win .bd-bar span { background: #1f8f4e; }
.bd-loss .bd-bar span { background: var(--accent); }
.bd-num { text-align: right; font-weight: 600; }
.bd-num small { color: var(--muted); font-weight: 400; }

.fh-table td:nth-child(6), .fh-table td:nth-child(7) { white-space: nowrap; }
.fh-opp { font-weight: 600; }
.opp-link { color: var(--text); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.opp-link:hover { color: var(--accent); text-decoration-color: var(--accent); }
.fh-table tr.fh-win td:first-child { box-shadow: inset 3px 0 #1f8f4e; }
.fh-table tr.fh-loss td:first-child { box-shadow: inset 3px 0 var(--accent); }
.fh-table tr.fh-draw td:first-child { box-shadow: inset 3px 0 #6b6b78; }

.fp-videos-head { margin-top: 40px; }
.fp-videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 16px; }
.fp-video h4 { margin: 10px 0 2px; font-size: .95rem; line-height: 1.3; }
.fp-video:hover h4 { color: var(--accent); }
.fp-video .play { width: 52px; height: 52px; font-size: 1.1rem; }

@media (max-width: 960px) {
  .rk-table .rk-next { display: none; }
  .rk-table th:last-child { display: none; }
}
@media (max-width: 720px) {
  .rk-panel { padding: 14px; }
  .rk-table .rk-last, .rk-table th:nth-child(5) { display: none; }
  .rk-rank { width: 40px; }
  .champ-stats { width: 100%; justify-content: space-between; }
  .fp-top { gap: 16px; }
  .fp-avatar { width: 72px; height: 72px; font-size: 1.6rem; }
  .fp-record { width: 100%; }
  .fp-wld div { flex: 1; padding: 8px; }
  .fp-breakdown { grid-template-columns: 1fr; }

  /* Fight history turns into stacked cards on phones */
  .fh-table thead { display: none; }
  .fh-table, .fh-table tbody, .fh-table tr, .fh-table td { display: block; }
  .fh-table tr { padding: 12px 14px; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; }
  .fh-table tbody tr:last-child { border-bottom: 0; }
  .fh-table td { padding: 0; border: 0; box-shadow: none !important; }
  .fh-table td:nth-child(1) { grid-row: span 2; }
  .fh-table td:nth-child(n+3) { grid-column: 2; font-size: .85rem; }
  .fh-table td:nth-child(3) .meta, .fh-table td:nth-child(4) .meta { display: inline; margin-left: 6px; }
  .fh-table td:nth-child(6)::before { content: 'Round '; color: var(--muted); }
  .fh-table td:nth-child(7)::before { content: 'Time '; color: var(--muted); }
  .fh-table td:nth-child(6), .fh-table td:nth-child(7) { display: inline-block; margin-right: 12px; }
  .fh-table tr.fh-win { box-shadow: inset 3px 0 #1f8f4e; }
  .fh-table tr.fh-loss { box-shadow: inset 3px 0 var(--accent); }
  .fh-table tr.fh-draw { box-shadow: inset 3px 0 #6b6b78; }
}

/* ============ ORGANIZATIONS + FAN VOTES ============ */
.org-picker { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.org-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 130px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-family: var(--font-head); font-size: 1.15rem; letter-spacing: .5px; text-transform: uppercase;
}
.org-btn span { font-family: var(--font-body); font-size: .72rem; color: var(--muted); text-transform: none; letter-spacing: 0; }
.org-btn:hover { border-color: var(--text); }
.org-btn.active { border-color: var(--accent); background: rgba(225, 6, 0, .15); box-shadow: inset 0 -3px var(--accent); }

.vote-btn {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: .85rem;
}
.vote-btn:hover { border-color: #ff7a1a; }
.vote-btn.voted { background: linear-gradient(135deg, #ff7a1a, var(--accent)); border-color: transparent; color: #fff; }
.vote-btn-lg { padding: 8px 16px; font-size: .92rem; }
.vote-btn-lg span { background: rgba(0, 0, 0, .25); border-radius: 999px; padding: 0 8px; }
.rk-vote { width: 1%; }
.champ-card > .vote-btn { margin-left: auto; }

.fans-badge {
  display: inline-block; vertical-align: 2px; font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .3px;
  background: linear-gradient(135deg, #ff7a1a, var(--accent)); color: #fff; padding: 2px 6px; border-radius: 3px;
}
.fp-vote { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.fans-board {
  margin-bottom: 20px; padding: 16px; border-radius: var(--radius);
  border: 1px solid rgba(255, 122, 26, .45); background: linear-gradient(135deg, rgba(255, 122, 26, .1), var(--surface-2) 60%);
}
.fans-board header { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fans-board h2 { font-family: var(--font-head); text-transform: uppercase; font-size: 1.3rem; margin: 0; }
.fans-board ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 6px 16px; }
.fans-board li { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border-radius: 8px; }
.fans-board li:hover { background: var(--surface); }
.fans-pos { font-family: var(--font-head); font-size: 1.3rem; color: #ff7a1a; width: 20px; text-align: center; }
.fans-name { flex: 1; min-width: 0; font-weight: 600; }
.fans-name .meta { display: block; font-weight: 400; font-size: .78rem; }
.fans-name:hover { color: var(--accent); }

@media (max-width: 720px) {
  .org-picker { display: grid; grid-template-columns: 1fr 1fr; }
  .org-btn { min-width: 0; }
  .rk-table .rk-streak, .rk-table th:nth-child(4) { display: none; }
  .champ-card > .vote-btn { margin-left: 0; }
}

/* Dropdown with every organization, next to the top ones */
.org-select {
  display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 210px;
  padding: 6px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
}
.org-select span { font-size: .72rem; color: var(--muted); }
.org-select select {
  background: transparent; color: var(--text); border: 0; padding: 2px 0; cursor: pointer;
  font-family: var(--font-head); font-size: 1.05rem; letter-spacing: .5px; text-transform: uppercase;
}
.org-select select:focus { outline: none; }
.org-select:focus-within { border-color: var(--text); }
.org-select.active { border-color: var(--accent); background: rgba(225, 6, 0, .15); box-shadow: inset 0 -3px var(--accent); }
.org-select option, .org-select optgroup { background: var(--surface); color: var(--text); text-transform: none; font-family: var(--font-body); }

@media (max-width: 720px) {
  .org-select { grid-column: 1 / -1; min-width: 0; }
}

/* Division without a champion */
.div-champ.vacant, .champ-card.vacant { opacity: .7; border-style: dashed; }
.champ-card.vacant:hover { transform: none; }
.div-champ.vacant .div-name { color: var(--muted); font-style: italic; }

/* ===== Events page ===== */
.ev-list { display: grid; gap: 18px; padding: 18px; }
.ev-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.ev-head h2 { font-family: var(--font-head); font-size: 1.35rem; margin: 6px 0 4px; text-transform: uppercase; letter-spacing: .02em; }
.ev-head .meta { margin: 2px 0; }
.ev-bouts { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; }
.ev-bout { padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); }
.ev-main { border-color: var(--accent); background: rgba(225, 6, 0, .06); }
.ev-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
.ev-label { color: var(--accent-2); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.ev-fight { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; }
.ev-corner { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ev-corner-b { justify-content: flex-end; text-align: right; }
.ev-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
a.ev-name:hover { color: var(--accent); }
.ev-vs { color: var(--muted); font-size: .8rem; text-transform: uppercase; }
.ev-how { margin-top: 6px; font-size: .8rem; color: var(--muted); text-align: center; }
.ev-source { margin: 12px 0 0; font-size: .78rem; color: var(--muted); }
.ev-source a { text-decoration: underline; }
@media (max-width: 600px) {
  .ev-fight { grid-template-columns: 1fr; gap: 4px; }
  .ev-corner-b { justify-content: flex-start; text-align: left; }
  .ev-vs { text-align: left; }
}
