/* ============ THEME ============ */
:root {
  --bg: #0d0d10;
  --surface: #17171c;
  --surface-2: #202028;
  --border: #2c2c36;
  --text: #f2f2f5;
  --muted: #9a9aa8;
  --accent: #e10600;       /* fight red */
  --accent-2: #ffb400;     /* gold for ranks */
  --radius: 12px;
  --font-head: 'Oswald', 'Arial Narrow', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }

.container { width: min(1200px, 100% - 32px); margin-inline: auto; }

/* ============ HEADER ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 13, 16, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.logo {
  font-family: var(--font-head); font-weight: 700; font-size: 1.6rem; letter-spacing: 1px;
}
.logo span { color: var(--accent); }
.main-nav { display: flex; gap: 20px; }
.main-nav a { color: var(--muted); font-weight: 500; padding: 4px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a.active { color: var(--text); border-color: var(--accent); }
.header-actions { margin-left: auto; display: flex; gap: 12px; align-items: center; }
.search {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  padding: 8px 12px; border-radius: 8px; width: 220px;
}
.menu-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.5rem; }

.btn { padding: 8px 16px; border-radius: 8px; font-weight: 600; border: 0; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { filter: brightness(1.1); }

/* ============ SECTIONS ============ */
.section { padding-block: 48px; }
.section-head { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.section-head h2 {
  font-family: var(--font-head); font-size: 2rem; margin: 0; text-transform: uppercase;
  border-left: 5px solid var(--accent); padding-left: 12px;
}
.sub { color: var(--muted); margin: 0; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  background: var(--surface); color: var(--muted); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 999px; font-size: .9rem;
}
.chip.active, .chip:hover { color: #fff; border-color: var(--accent); background: rgba(225, 6, 0, .15); }

/* Thumbnail placeholder (swap for real <img> later) */
.thumb {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden;
  background: var(--thumb-bg, linear-gradient(135deg, #3a0d0d, #111));
  display: grid; place-items: center;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-label { font-family: var(--font-head); font-size: 1.1rem; color: rgba(255,255,255,.35); letter-spacing: 2px; text-transform: uppercase; }
.tag {
  position: absolute; top: 10px; left: 10px; background: var(--accent); color: #fff;
  font-size: .72rem; font-weight: 600; padding: 3px 8px; border-radius: 4px; text-transform: uppercase;
}

/* ============ NEWS ============ */
.news-layout { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; }
.featured { background: var(--surface); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.featured .thumb { border-radius: 0; aspect-ratio: 16 / 8; }
.featured-body { padding: 20px; }
.featured h3 { font-family: var(--font-head); font-size: 1.8rem; margin: 6px 0 10px; line-height: 1.2; }
.featured p { color: var(--muted); margin: 0 0 12px; }
.meta { color: var(--muted); font-size: .82rem; }

.news-grid { display: grid; grid-template-columns: 1fr; gap: 14px; align-content: start; }
.news-card {
  display: grid; grid-template-columns: 140px 1fr; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px;
  transition: border-color .2s, transform .2s;
}
.news-card:hover, .featured:hover { border-color: var(--accent); }
.news-card:hover { transform: translateX(3px); }
.news-card .thumb { border-radius: 8px; }
.news-card .thumb-label { font-size: .75rem; }
.news-card h4 { margin: 2px 0 4px; font-size: 1rem; line-height: 1.3; }
.cat { color: var(--accent); font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

/* ============ VIDEOS ============ */
.videos { background: linear-gradient(180deg, var(--bg), #120808 60%, var(--bg)); }
.video-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

.tabs { display: flex; border-bottom: 1px solid var(--border); background: var(--surface-2); overflow-x: auto; }
.tab {
  flex: 0 0 auto; background: none; border: 0; color: var(--muted);
  padding: 16px 24px; font-weight: 600; border-bottom: 3px solid transparent;
}
.tab:hover { color: var(--text); }
.tab.active { color: #fff; border-bottom-color: var(--accent); background: rgba(225, 6, 0, .08); }

.video-panel-body { display: grid; grid-template-columns: 1.5fr 1fr; gap: 0; }
.spotlight { padding: 20px; border-right: 1px solid var(--border); }
.spotlight .thumb { aspect-ratio: 16 / 9; }
.play {
  width: 72px; height: 72px; border-radius: 50%; background: rgba(225, 6, 0, .9);
  display: grid; place-items: center; font-size: 1.6rem; color: #fff; border: 0;
  box-shadow: 0 0 0 8px rgba(225, 6, 0, .25); transition: transform .2s;
}
.play:hover { transform: scale(1.08); }
.spotlight h3 { font-family: var(--font-head); font-size: 1.5rem; margin: 16px 0 6px; }
.spotlight-meta { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; color: var(--muted); font-size: .9rem; }

.like-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: .85rem;
}
.like-btn:hover { border-color: var(--accent); }
.like-btn.liked { background: var(--accent); border-color: var(--accent); color: #fff; }

.ranked-list { list-style: none; margin: 0; padding: 8px; max-height: 560px; overflow-y: auto; }
.rank-item {
  display: grid; grid-template-columns: 36px 120px 1fr; gap: 12px; align-items: center;
  padding: 10px; border-radius: 10px; cursor: pointer; transition: background .15s;
}
.rank-item:hover { background: var(--surface-2); }
.rank-item.selected { background: rgba(225, 6, 0, .12); outline: 1px solid rgba(225, 6, 0, .4); }
.rank-num { font-family: var(--font-head); font-size: 1.5rem; color: var(--muted); text-align: center; }
.rank-num[data-rank="1"] { color: var(--accent-2); }
.rank-num[data-rank="2"] { color: #c0c0c0; }
.rank-num[data-rank="3"] { color: #cd7f32; }
.rank-item.boosted { background: rgba(255, 180, 0, .06); }
.rank-item.boosted .rank-num { color: var(--accent-2); font-size: 1.1rem; }
.rank-item .thumb { border-radius: 6px; }
.rank-item .thumb-label { font-size: .6rem; }
.rank-item h4 { margin: 0 0 2px; font-size: .92rem; line-height: 1.3; }
.rank-info .meta { display: flex; gap: 10px; flex-wrap: wrap; }
.duration {
  position: absolute; bottom: 4px; right: 4px; background: rgba(0,0,0,.8);
  font-size: .68rem; padding: 1px 5px; border-radius: 3px;
}
.empty { color: var(--muted); padding: 24px; text-align: center; }

/* ============ FOOTER ============ */
.site-footer { border-top: 1px solid var(--border); padding-block: 28px; color: var(--muted); }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-inner p { margin: 0; }
.footer-inner nav { display: flex; gap: 16px; }
.footer-inner nav a:hover { color: var(--text); }

/* ============ RESPONSIVE ============ */
@media (max-width: 960px) {
  .news-layout, .video-panel-body { grid-template-columns: 1fr; }
  .spotlight { border-right: 0; border-bottom: 1px solid var(--border); }
  .search { width: 160px; }
}
@media (max-width: 720px) {
  .menu-toggle { display: block; margin-left: auto; }
  .main-nav, .header-actions { display: none; }
  .site-header.open .main-nav {
    display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0;
    background: var(--bg); padding: 16px; border-bottom: 1px solid var(--border);
  }
  .news-card { grid-template-columns: 110px 1fr; }
  .rank-item { grid-template-columns: 28px 96px 1fr; }
  .section-head h2 { font-size: 1.6rem; }
}

/* ============ DIRECTORY (academies + countries) ============ */
.dir-hero {
  padding-block: 40px 28px;
  background:
    radial-gradient(ellipse at top right, rgba(225, 6, 0, .22), transparent 60%),
    linear-gradient(180deg, #160909, var(--bg));
  border-bottom: 1px solid var(--border);
}
.dir-hero h1 {
  font-family: var(--font-head); text-transform: uppercase; font-size: clamp(2rem, 5vw, 3rem);
  margin: 8px 0 6px; line-height: 1.1;
}
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .85rem; }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb [aria-current] { color: var(--text); }

.dir-search {
  display: flex; align-items: center; gap: 8px; margin-top: 22px; max-width: 720px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px 6px 6px 14px;
}
.dir-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(225, 6, 0, .2); }
.dir-search input {
  flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text);
  font: inherit; font-size: 1rem; padding: 8px 0;
}
.dir-search .btn { padding: 10px 20px; }

.dir-tabs { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.dir-tab {
  padding: 6px 14px; border-radius: 999px; font-size: .9rem; color: var(--muted);
  border: 1px solid var(--border); background: var(--surface);
}
.dir-tab:hover { color: var(--text); }
.dir-tab.active { color: #fff; border-color: var(--accent); background: rgba(225, 6, 0, .15); }

.dir-body { padding-top: 28px; }
.dir-toolbar { display: flex; justify-content: space-between; align-items: end; flex-wrap: wrap; gap: 16px; margin-bottom: 24px; }
.dir-filters { display: flex; gap: 12px; flex-wrap: wrap; }
.dir-filters label { display: flex; flex-direction: column; gap: 4px; font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.dir-filters select {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; font: inherit; font-size: .9rem; min-width: 170px;
}
.dir-filters select:focus { outline: none; border-color: var(--accent); }
.result-count { margin: 0; color: var(--muted); font-size: .9rem; }

.country-group { margin-bottom: 36px; }
.country-heading {
  display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding-bottom: 10px;
  font-family: var(--font-head); font-size: 1.4rem; text-transform: uppercase; border-bottom: 1px solid var(--border);
}
.country-heading .flag { font-size: 1.5rem; }
.country-heading small { margin-left: auto; font-family: var(--font-body); font-size: .8rem; color: var(--muted); text-transform: none; font-weight: 500; }

.academy-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.academy-card {
  display: flex; flex-direction: column; gap: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
  transition: border-color .2s, transform .2s;
}
.academy-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.academy-top { display: flex; gap: 12px; align-items: center; }
.academy-avatar {
  flex: 0 0 48px; height: 48px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #5a0b0b); font-family: var(--font-head); font-size: 1.1rem; color: #fff;
}
.academy-card h3 { margin: 0 0 4px; font-size: 1.05rem; line-height: 1.25; }
.academy-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.academy-tags span { font-size: .7rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 4px; padding: 2px 6px; }
.academy-about { margin: 0; color: var(--muted); font-size: .9rem; flex: 1; }
.academy-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); font-size: .88rem; }
.academy-loc { font-weight: 500; }
.academy-link { color: var(--accent); font-weight: 600; white-space: nowrap; }
mark { background: rgba(255, 180, 0, .3); color: inherit; border-radius: 2px; padding: 0 1px; }

.empty-state { text-align: center; padding: 60px 16px; color: var(--muted); }
.empty-state h3 { color: var(--text); font-family: var(--font-head); font-size: 1.5rem; margin: 8px 0; }
.empty-icon { font-size: 2.5rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; text-decoration: underline; }

/* Countries page */
.tab-count { display: inline-block; margin-left: 6px; font-size: .72rem; background: var(--surface); border-radius: 999px; padding: 1px 7px; color: var(--muted); }
.tab.active .tab-count { background: var(--accent); color: #fff; }
.country-panel { padding: 20px; }
.country-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.country-panel-head h2 { font-family: var(--font-head); text-transform: uppercase; margin: 0; font-size: 1.6rem; }
.country-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); gap: 14px; }
.country-card {
  display: flex; align-items: center; gap: 14px; padding: 16px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color .2s, transform .2s;
}
a.country-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.country-card.disabled { opacity: .5; }
.country-flag { font-size: 2.2rem; line-height: 1; }
.country-info { flex: 1; min-width: 0; }
.country-info h3 { margin: 0; font-size: 1.05rem; }
.country-info p { margin: 2px 0 0; color: var(--muted); font-size: .85rem; }
.country-cities { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .78rem !important; }
.country-arrow { color: var(--accent); font-size: 1.2rem; font-weight: 700; }

@media (max-width: 720px) {
  .dir-filters { width: 100%; }
  .dir-filters label { flex: 1 1 140px; }
  .dir-filters select { min-width: 0; width: 100%; }
  .dir-search .btn { padding: 10px 14px; }
}

.academy-website {
  display: flex; align-items: center; gap: 6px; margin-top: -4px;
  font-size: .85rem; color: var(--muted); overflow: hidden;
}
.academy-website span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline; text-underline-offset: 2px; }
.academy-website:hover { color: var(--text); }

/* ============ SPONSORED / FEATURED (set from admin) ============ */
.tab-sponsored { color: var(--accent-2); }
.tab-sponsored.active { color: var(--accent-2); border-bottom-color: var(--accent-2); background: rgba(255, 180, 0, .08); }
.tag-sponsored { background: var(--accent-2); color: #111; }
.badge-sponsored {
  display: inline-block; vertical-align: 1px; font-size: .62rem; font-weight: 700; text-transform: uppercase;
  background: var(--accent-2); color: #111; padding: 1px 5px; border-radius: 3px;
}
a.play { text-decoration: none; }

.academy-card { position: relative; }
.academy-card.promoted { border-color: rgba(255, 180, 0, .55); background: linear-gradient(180deg, rgba(255, 180, 0, .07), var(--surface) 45%); }
.featured-badge {
  position: absolute; top: -9px; right: 14px; font-size: .7rem; font-weight: 700; text-transform: uppercase;
  background: var(--accent-2); color: #111; padding: 2px 8px; border-radius: 4px;
}

/* ============ AUTH IN HEADER + JOIN BAND ============ */
.auth-slot { display: flex; gap: 8px; align-items: center; }
.btn-outline { border: 1px solid var(--border); color: var(--text); background: transparent; }
.btn-outline:hover { border-color: var(--text); }
.btn-lg { padding: 13px 26px; font-size: 1.02rem; }
.btn-block { display: block; width: 100%; text-align: center; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9rem; padding: 4px 12px 4px 4px; border: 1px solid var(--border); border-radius: 999px; }
.user-chip:hover { border-color: var(--accent); }
.user-avatar { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: .85rem; }
.main-nav .nav-auth { display: none; }

.thumb img { position: absolute; inset: 0; }

.join {
  padding-block: 40px;
  background:
    radial-gradient(ellipse at left, rgba(225, 6, 0, .28), transparent 60%),
    linear-gradient(90deg, #1a0707, #0f0f13);
  border-block: 1px solid var(--border);
}
.join-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px 48px; flex-wrap: wrap; }
.join-text { flex: 1 1 420px; }
.join-text h2 { font-family: var(--font-head); text-transform: uppercase; font-size: 2rem; margin: 0 0 8px; }
.join-text p { color: var(--muted); margin: 0 0 14px; max-width: 560px; }
.join-perks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .92rem; }
.join-actions { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.join-signin { color: var(--muted); font-size: .88rem; }
.join-signin:hover { color: var(--text); }

@media (max-width: 720px) {
  .site-header.open .main-nav .nav-auth { display: block; }
  .main-nav .nav-auth-cta { color: var(--accent) !important; font-weight: 600; }
  .join-text { flex-basis: 100%; }
  .join-actions { width: 100%; }
  .join-actions .btn { width: 100%; text-align: center; }
}

/* ============ ARTICLE PAGE ============ */
.article-inner { max-width: 760px; }
.article-back { display: block; width: fit-content; color: var(--muted); font-size: .9rem; margin-bottom: 18px; }
.article-back:hover { color: var(--text); }
.article h1 { font-family: var(--font-head); font-size: clamp(1.8rem, 5vw, 2.8rem); line-height: 1.15; margin: 6px 0 12px; overflow-wrap: anywhere; }
.article-lead { font-size: 1.15rem; color: var(--muted); margin: 0 0 12px; }
.article-figure { margin: 22px 0; }
.article-figure img { width: 100%; border-radius: var(--radius); display: block; }
.article-figure figcaption { color: var(--muted); font-size: .82rem; margin-top: 8px; }
div.article-figure { aspect-ratio: 16 / 8; }
.article-body { font-size: 1.05rem; line-height: 1.75; }
.article-body p { margin: 0 0 1.1em; }
.article-more { font-family: var(--font-head); text-transform: uppercase; border-left: 5px solid var(--accent); padding-left: 12px; margin: 0 0 18px; }

/* Inline error above a section (e.g. a like that failed) */
.form-error { color: #ff6b66; font-size: .88rem; }
.form-error:empty { display: none; }

/* Article source line */
.article-source { color: var(--muted); font-size: .9rem; margin-top: 24px; }
.article-source a { color: var(--text); text-decoration: underline; }
