@import url('https://fonts.googleapis.com/css2?family=Unbounded:wght@500;700;800&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  --bg: #0a0a0a;
  --surface: #131313;
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.18);
  --red: #e0202e;
  --red-dim: #7a1017;
  --gold: #e8b923;
  --white: #f5f5f5;
  --gray: #8c8c8c;

  --font-display: 'Unbounded', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 16px 18px 28px;
  background-image:
    radial-gradient(circle at 50% 0%, rgba(224, 32, 46, 0.14), transparent 55%);
}

/* ---------- Topbar (centered brand) ---------- */
.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0 8px;
}
.topbar__brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}
.topbar__logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line-strong);
}
.topbar__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--white);
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 0 10px rgba(224, 32, 46, 0.5);
}
.topbar__lang {
  position: absolute;
  top: 4px;
  right: 0;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--gray);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 5px 10px;
  border-radius: 20px;
  cursor: pointer;
}

/* ---------- Tournament carousel ---------- */
.carousel-section {
  padding: 22px 0 6px;
}
.carousel {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 2px;
  margin: 0 -18px;
  padding-left: 18px;
  padding-right: 18px;
}
.carousel::-webkit-scrollbar { display: none; }

.carousel__card {
  flex: 0 0 80%;
  scroll-snap-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 6px;
  padding: 18px;
  min-height: 96px;
  justify-content: center;
}
.carousel__card--poster {
  min-height: 220px;
  justify-content: flex-end;
  background-size: cover;
  background-position: center 22%;
  background-repeat: no-repeat;
}
.carousel__eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--red);
}
.carousel__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
  letter-spacing: 0.01em;
  color: var(--white);
  margin-top: 2px;
  text-shadow: 0 0 10px rgba(224, 32, 46, 0.4);
}
.carousel__sub {
  font-size: 13px;
  color: var(--white);
  opacity: 0.85;
}
.carousel__date {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray);
}

.carousel__dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}
.carousel__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
  transition: background 0.15s ease, transform 0.15s ease;
}
.carousel__dot--active {
  background: var(--red);
  transform: scale(1.2);
}

/* ---------- Section blocks ---------- */
.block { padding: 18px 0 6px; }
.block__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.03em;
  color: var(--white);
  margin-bottom: 12px;
  text-shadow: 0 0 8px rgba(224, 32, 46, 0.35);
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 4px 0;
}

/* ---------- Stats tiles ---------- */
.tile-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 10px;
}
.tile {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 4px;
  padding: 14px;
  min-height: 92px;
  text-decoration: none;
  color: var(--white);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.tile:active { background: #1a1a1a; border-color: var(--red-dim); }
.tile--small { min-height: 40px; justify-content: center; }
.tile-stack { display: flex; flex-direction: column; gap: 10px; }
.tile__label {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
}
.tile__sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--gray);
}

.tile--photo {
  position: relative;
  overflow: hidden;
}
.tile__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
}
.tile__fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--surface) 0%, rgba(19, 19, 19, 0) 22%);
  z-index: 1;
  pointer-events: none;
}
.tile--photo .tile__label,
.tile--photo .tile__sub {
  position: relative;
  z-index: 2;
}

/* ---------- Icon grid (circular buttons) ---------- */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.icon-grid--3 { grid-template-columns: repeat(3, 1fr); }

.icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--white);
  text-decoration: none;
  cursor: pointer;
  font-family: var(--font-body);
}
.icon-circle {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--white);
  transition: border-color 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.icon-circle svg { width: 24px; height: 24px; }
.icon-btn:active .icon-circle {
  transform: scale(0.95);
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red-dim);
}
.icon-btn__label {
  font-size: 11px;
  color: var(--gray);
  text-align: center;
  line-height: 1.2;
}

/* ---------- Bottom bar ---------- */
.bottombar {
  margin-top: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.bottombar__brand {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--red);
  flex-shrink: 0;
}
.bottombar__logo { width: 100%; height: 100%; object-fit: cover; }

.bottombar__pill {
  display: flex;
  align-items: baseline;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 10px 20px;
  font-family: var(--font-mono);
}
.bottombar__pill span:first-child {
  font-size: 16px;
  font-weight: 600;
  color: var(--white);
}
.bottombar__pill-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--gray);
}

.bottombar__profile {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.bottombar__profile svg { width: 18px; height: 18px; }

/* ---------- Event page: header ---------- */
.eventheader {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 6px;
}
.eventheader__back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  text-decoration: none;
  flex-shrink: 0;
}
.eventheader__back svg { width: 16px; height: 16px; }
.eventheader__title-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.eventheader__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.25;
  text-shadow: 0 0 10px rgba(224, 32, 46, 0.4);
}
.eventheader__date {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray);
}

/* ---------- Fight list ---------- */
.fightlist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}
.fight-row {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 6px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fight-row--title {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(232, 185, 35, 0.25), 0 0 14px rgba(232, 185, 35, 0.12);
}
.fight-row__badge {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--gold);
}
.fight-row__matchup {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  color: var(--white);
}
.fight-row--title .fight-row__matchup {
  color: var(--gold);
}
.fight-row__fighter {
  flex: 1;
  min-width: 0;
}
.fight-row__fighter--right {
  text-align: right;
}
.fight-row__vs {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--gray);
  flex-shrink: 0;
}
.fight-row__weight {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--gray);
}

/* ---------- Fighters page: search + list ---------- */
.search-input {
  width: 100%;
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 12px 14px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease;
}
.search-input::placeholder { color: var(--gray); }
.search-input:focus { border-color: var(--red); }

.fighterlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.fighter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 6px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.fighter-row:active { background: #1a1a1a; border-color: var(--red-dim); }
.fighter-row__name {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  color: var(--white);
}
.fighter-row__weight {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--gray);
  white-space: nowrap;
}

/* ---------- Fighter profile page ---------- */
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-top: 20px;
}
.profile-header__name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  color: var(--red);
  text-shadow: 0 0 10px rgba(224, 32, 46, 0.4);
  line-height: 1.15;
}
.profile-header__weightclass {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray);
  letter-spacing: 0.06em;
}
.profile-header__record-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}
.profile-header__record-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--gray);
}
.profile-header__record {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 14px;
  color: var(--white);
  white-space: nowrap;
}

.profile-card {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 6px;
  padding: 16px;
  margin-top: 14px;
}
.profile-card__title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--gray);
  margin-bottom: 12px;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.profile-grid__item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.profile-grid__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--gray);
}
.profile-grid__value {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  color: var(--white);
}

.profile-legend {
  font-family: var(--font-body);
  font-size: 11px;
  line-height: 1.6;
  color: var(--gray);
}
.profile-legend p { margin-bottom: 8px; }
.profile-legend p:last-child { margin-bottom: 0; }
.profile-legend b { color: var(--white); }

/* ---------- Events page ---------- */
.eventlist {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}
.event-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 6px;
  padding: 14px 16px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.event-card:active { background: #1a1a1a; border-color: var(--red-dim); }
.event-card__title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
  color: var(--white);
}
.event-card__date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gray);
}

/* ---------- Rankings page ---------- */
.rankings-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-top: 18px;
  padding-bottom: 4px;
}
.rankings-nav::-webkit-scrollbar { display: none; }

.rankings-nav__item {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--gray);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.rankings-nav__item--active {
  color: var(--white);
  border-color: var(--red);
}

.ranking-champion {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--gold);
  box-shadow: 0 0 0 1px rgba(232, 185, 35, 0.25), 0 0 14px rgba(232, 185, 35, 0.12);
  background: var(--surface);
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.ranking-champion__badge {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  color: var(--gold);
  margin-right: 4px;
}
.ranking-champion__name {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 15px;
  color: var(--gold);
}

.rankinglist {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}
.ranking-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  border-radius: 6px;
  padding: 10px 14px;
}
.ranking-row__num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--red);
  width: 18px;
  flex-shrink: 0;
}
.ranking-row__name {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  color: var(--white);
}

@media (prefers-reduced-motion: reduce) {
  .tile, .icon-circle, .carousel__dot, .fighter-row { transition: none; }
}