/* uta.org.ua — огляд БК Топ Матч. Розмітка шаблону fav365ua, стилі — під айдентику Топматч:
   бірюзове тло продукту, лаймові CTA зі скошеним краєм-«прапорцем», помаранчеві кути. */
:root {
  --bg: #022b38;
  --bg-deep: #011f29;
  --surface: #043545;
  --surface-2: #0a4253;
  --line: rgba(240, 239, 231, 0.1);
  --text: #f0efe7;
  --muted: #a9c3c6;
  --lime: #c7e914;
  --lime-hover: #d6f53a;
  --orange: #f04e23;
  --sky: #9fd8ef;
  --radius: 14px;
  --flag: polygon(0 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  --header-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Rubik, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--lime); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0; text-transform: none; }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }
main.content { flex: 1 0 auto; }
.layout { display: flex; flex-direction: column; flex: 1 0 auto; }

/* ===== Кнопки ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 22px 0 18px;
  font: 700 14px/1 Rubik, sans-serif; letter-spacing: .2px;
  border: 0; cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .15s, color .15s, transform .15s;
}
.btn--primary { background: var(--lime); color: var(--bg); clip-path: var(--flag); padding-right: 26px; }
.btn--primary:hover { background: var(--lime-hover); transform: translateY(-1px); }
.btn--outline { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px rgba(240, 239, 231, .45); border-radius: 8px; }
.btn--outline:hover { box-shadow: inset 0 0 0 1.5px var(--lime); color: var(--lime); }

/* ===== Хедер ===== */
.header {
  position: sticky; top: 0; z-index: 200;
  background: rgba(2, 43, 56, .94); backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--surface);
}
.header.scrolled { box-shadow: 0 8px 24px rgba(0, 0, 0, .35); border-bottom-color: var(--lime); }
.header__inner { max-width: 1240px; margin: 0 auto; height: var(--header-h); padding: 0 20px; display: flex; align-items: center; gap: 22px; }
.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo-img { width: 120px; height: 40px; object-fit: contain; }
.header-nav { flex: 1; }
.header-nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.header-nav__link {
  display: block; padding: 8px 12px; color: var(--text); font-size: 15px; font-weight: 500;
  position: relative; text-decoration: none !important;
}
.header-nav__link::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 3px;
  background: var(--orange); transform: scaleX(0) skewX(-20deg); transform-origin: left; transition: transform .2s;
}
.header-nav__item.is-active .header-nav__link::after, .header-nav__link:hover::after { transform: scaleX(1) skewX(-20deg); }
.header-nav__item.is-active .header-nav__link { color: var(--lime); }
.header__right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.auth { display: flex; gap: 8px; }

.lang-dropdown { position: relative; }
.lang-dropdown__toggle {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px;
  background: var(--surface); border: 0; border-radius: 8px; color: var(--text);
  font: 700 13px Rubik, sans-serif; cursor: pointer;
}
.lang-dropdown__chevron { transition: transform .2s; }
.lang-dropdown.is-open .lang-dropdown__chevron { transform: rotate(180deg); }
.lang-dropdown__menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 90px; z-index: 300;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  opacity: 0; pointer-events: none; transform: translateY(-6px); transition: opacity .15s, transform .15s;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
}
.lang-dropdown.is-open .lang-dropdown__menu { opacity: 1; pointer-events: auto; transform: none; }
.lang-dropdown__item { display: block; padding: 10px 16px; color: var(--muted); font-size: 14px; font-weight: 700; }
.lang-dropdown__item + .lang-dropdown__item { border-top: 1px solid var(--line); }
.lang-dropdown__item:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.lang-dropdown__item.is-active { color: var(--lime); }

.header-burger { display: none; width: 40px; height: 40px; border: 0; border-radius: 8px; background: var(--surface); cursor: pointer; align-items: center; justify-content: center; flex-shrink: 0; }
.header-burger span, .header-burger span::before, .header-burger span::after {
  display: block; width: 18px; height: 2px; background: var(--text); border-radius: 2px; position: relative;
}
.header-burger span::before, .header-burger span::after { content: ""; position: absolute; left: 0; }
.header-burger span::before { top: -6px; width: 12px; background: var(--lime); }
.header-burger span::after { top: 6px; }

/* ===== Сайдбар (мобільне off-canvas меню) ===== */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: 290px; z-index: 400;
  background: var(--bg-deep); border-right: 3px solid var(--orange);
  padding: 64px 16px 24px; overflow-y: auto;
  transform: translateX(-105%); transition: transform .25s ease;
  display: flex; flex-direction: column; gap: 18px;
}
.sidebar-mobile-open .sidebar { transform: none; }
.sidebar__close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border: 0; border-radius: 8px; background: var(--surface); color: var(--text); font-size: 26px; line-height: 1; cursor: pointer; }
.sidebar__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sidebar__link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; color: var(--text); background: var(--surface); font-weight: 500; text-decoration: none !important; }
.sidebar__item.is-active .sidebar__link { background: var(--lime); color: var(--bg); }
.sidebar__icon svg { width: 20px; height: 20px; display: block; }
.sidebar__auth { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sidebar__lang { display: flex; gap: 8px; }
.sidebar__lang-item { flex: 1; text-align: center; padding: 8px; border-radius: 8px; background: var(--surface); color: var(--muted); font-weight: 700; }
.sidebar__lang-item.is-active { color: var(--bg); background: var(--sky); }
.sidebar__overlay { position: fixed; inset: 0; z-index: 350; background: rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transition: opacity .2s; }
.sidebar-mobile-open .sidebar__overlay { opacity: 1; pointer-events: auto; }
.sidebar-mobile-open { overflow: hidden; }

/* ===== Банер головної ===== */
.hero-banner {
  position: relative; max-width: 1200px; margin: 24px auto 0; min-height: 420px;
  display: flex; align-items: center; overflow: hidden;
  border-radius: 4px 28px 4px 28px; background: var(--bg-deep);
}
.hero-banner::after { content: ""; position: absolute; right: 0; bottom: 0; width: 90px; height: 90px; background: var(--orange); clip-path: polygon(100% 0, 100% 100%, 0 100%); z-index: 2; }
.hero-banner__bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: right center; }
.hero-banner__overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(2, 43, 56, .98) 0%, rgba(2, 43, 56, .94) 50%, rgba(2, 43, 56, 0) 82%); }
.hero-banner__inner { position: relative; z-index: 1; padding: 44px 48px; width: 100%; }
.hero-banner__content { max-width: 580px; }
.hero-banner__eyebrow { display: inline-block; background: var(--sky); color: var(--bg); font-size: 13px; font-weight: 700; padding: 4px 18px 4px 10px; clip-path: var(--flag); margin-bottom: 16px; }
.hero-banner__title { font-size: clamp(28px, 3.6vw, 44px); font-weight: 800; letter-spacing: -.4px; margin-bottom: 16px; }
.hero-banner__subtitle { color: var(--muted); font-size: 16px; margin: 0 0 24px; }
.hero-banner__btn {
  display: inline-flex; align-items: center; min-height: 52px; padding: 0 38px 0 26px;
  background: var(--lime); color: var(--bg); font-weight: 800; font-size: 16px; clip-path: var(--flag);
  text-decoration: none !important; transition: background .15s;
}
.hero-banner__btn:hover { background: var(--lime-hover); }

/* ===== Види спорту (сітка карток шаблону) ===== */
.popular-games { padding-top: 36px; }
.games-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.popular-games__title { font-size: 24px; font-weight: 800; display: flex; align-items: center; gap: 12px; }
.popular-games__title::before { content: ""; width: 10px; height: 26px; background: var(--orange); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 75%); }
.popular-games__all { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; }
.popular-games__grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.pg-card { display: block; text-decoration: none !important; }
.pg-card__thumb { position: relative; border-radius: 12px 12px 12px 0; overflow: hidden; aspect-ratio: 4 / 3; background: var(--surface); transition: transform .2s, box-shadow .2s; }
.pg-card:hover .pg-card__thumb { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--lime); }
.pg-card__img { width: 100%; height: 100%; object-fit: cover; }
.pg-card__name { position: absolute; left: 0; bottom: 0; padding: 6px 18px 6px 10px; background: var(--bg-deep); color: var(--text); font-weight: 700; font-size: 14px; clip-path: var(--flag); }
.pg-card__badge { position: absolute; top: 8px; left: 8px; font-size: 11px; font-weight: 800; padding: 2px 12px 2px 8px; clip-path: var(--flag); }
.pg-card__badge--top { background: var(--lime); color: var(--bg); }
.pg-card__badge--live { background: var(--orange); color: #fff; }

/* ===== Чипи ===== */
.category-filters { padding-top: 22px; }
.category-filters__scroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.category-filters__scroll::-webkit-scrollbar { display: none; }
.category-chip {
  flex-shrink: 0; padding: 8px 18px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 500;
  transform: skewX(-12deg); border-radius: 4px; text-decoration: none !important; transition: background .15s;
}
.category-chip:hover { background: var(--surface-2); }
.category-chip.is-active { background: var(--sky); color: var(--bg); font-weight: 700; }

/* ===== Хедер внутрішніх сторінок ===== */
.tm-page-hero { position: relative; padding-top: 34px; padding-bottom: 8px; }
.tm-page-hero > * { max-width: 880px; }
.tm-page-hero h1 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; margin: 10px 0 14px; }
.tm-page-hero__lead { color: var(--muted); font-size: 17px; margin: 0 0 20px; }
.tm-page-hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.tm-page-hero__note { color: var(--muted); font-size: 14px; }
.tm-crumbs { font-size: 14px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; }
.tm-crumbs a { color: var(--sky); }

/* ===== Стаття + зміст ===== */
.page-content { padding-top: 32px; padding-bottom: 16px; }
.tm-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 36px; align-items: start; }
.tm-toc { position: sticky; top: calc(var(--header-h) + 20px); background: var(--bg-deep); border-radius: 12px; padding: 18px 16px; border-top: 3px solid var(--lime); max-height: calc(100vh - 110px); overflow-y: auto; }
.tm-toc__title { margin: 0 0 10px; font-weight: 800; font-size: 15px; text-transform: uppercase; letter-spacing: .6px; color: var(--sky); }
.tm-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: t; }
.tm-toc li { counter-increment: t; }
.tm-toc a { display: flex; gap: 8px; padding: 6px 0; color: var(--muted); font-size: 14px; line-height: 1.35; text-decoration: none; }
.tm-toc a::before { content: counter(t, decimal-leading-zero); color: rgba(199, 233, 20, .5); font-weight: 700; font-size: 12px; padding-top: 1px; }
.tm-toc a:hover, .tm-toc a.is-active { color: var(--text); }
.tm-toc a.is-active::before { color: var(--lime); }

.content-box { min-width: 0; }
.tm-narrow { max-width: 860px; }
.page-text h2 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 800; margin: 40px 0 14px; padding-left: 20px; position: relative; scroll-margin-top: 90px; }
.page-text h2::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 8px; background: var(--orange); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 80%); }
.page-text h2:first-child { margin-top: 0; }
.page-text h3 { font-size: 20px; margin: 26px 0 10px; color: var(--sky); }
.page-text p { margin: 0 0 14px; color: #dfe6e3; }
.page-text strong { color: var(--text); }
.page-text ul, .page-text ol { margin: 0 0 18px; padding: 0; list-style: none; display: grid; gap: 8px; }
.page-text ul li { position: relative; padding-left: 26px; }
.page-text ul li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 9px; height: 9px; background: var(--lime); transform: rotate(45deg); }
.page-text ol { counter-reset: o; }
.page-text ol li { counter-increment: o; position: relative; padding: 10px 14px 10px 52px; background: var(--surface); border-radius: 10px; }
.page-text ol li::before { content: counter(o); position: absolute; left: 12px; top: 9px; width: 28px; height: 28px; background: var(--lime); color: var(--bg); font-weight: 800; font-size: 14px; display: flex; align-items: center; justify-content: center; clip-path: var(--flag); }
.img-center { margin: 6px 0 22px !important; }
.tm-img { width: 100%; border-radius: 4px 18px 4px 18px; border: 1px solid var(--line); }

.table-responsive { overflow-x: auto; margin: 0 0 20px; border-radius: 12px; border: 1px solid var(--line); }
.tm-table { width: 100%; border-collapse: collapse; font-size: 15px; min-width: 520px; }
.tm-table th { background: var(--surface-2); color: var(--lime); text-align: left; padding: 12px 14px; font-weight: 700; }
.tm-table td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.tm-table tr:nth-child(even) td { background: rgba(4, 53, 69, .55); }

.tm-cta { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 28px 0; padding: 18px 20px; background: var(--surface); border-radius: 12px; border-left: 4px solid var(--lime); }
.tm-cta p { flex: 1; margin: 0 !important; font-weight: 500; color: var(--text) !important; min-width: 200px; }
.tm-cta__age { background: var(--orange); color: #fff; font-weight: 800; font-size: 13px; padding: 4px 10px; border-radius: 4px; }

/* ===== FAQ (акордеон шаблону) ===== */
.faq { padding-top: 24px; padding-bottom: 24px; }
.faq__title { font-size: clamp(22px, 2.4vw, 28px); font-weight: 800; margin-bottom: 8px; }
.faq__lead { color: var(--muted); margin: 0 0 18px; }
.faq__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.faq__item { background: var(--surface); border-radius: 12px; overflow: hidden; border: 1px solid transparent; transition: border-color .2s; }
.faq__item.open { border-color: var(--lime); }
.faq__question { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 18px; background: none; border: 0; color: var(--text); font: 700 16px/1.35 Rubik, sans-serif; text-align: left; cursor: pointer; }
.faq__icon { flex: 0 0 28px; height: 28px; border-radius: 6px; background: var(--bg); position: relative; }
.faq__icon::before, .faq__icon::after { content: ""; position: absolute; left: 8px; right: 8px; top: 13px; height: 2px; background: var(--lime); transition: transform .2s; }
.faq__icon::after { transform: rotate(90deg); }
.faq__item.open .faq__icon::after { transform: rotate(0); }
.faq__answer { height: 0; overflow: hidden; transition: height .25s ease; }
.faq__answer p { margin: 0; padding: 0 18px 16px; color: #dfe6e3; }
.tm-disclaimer { margin-top: 18px; padding: 14px 18px; border-radius: 10px; background: var(--bg-deep); color: var(--muted); font-size: 14px; }
.tm-disclaimer p { margin: 0; }

/* ===== Футер ===== */
.footer { margin-top: 40px; background: var(--bg-deep); border-top: 3px solid var(--surface); padding: 36px 0 90px; }
.footer__inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer__brand p { color: var(--muted); font-size: 14px; margin: 12px 0 0; max-width: 380px; }
.footer__h { margin: 0 0 10px; font-weight: 800; color: var(--sky); font-size: 14px; text-transform: uppercase; letter-spacing: .6px; }
.footer__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.footer__link { color: var(--text); font-size: 14px; }
.footer__rg { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.footer__rg img { height: auto; opacity: .85; }
.footer__age { border: 2px solid var(--orange); color: var(--orange); border-radius: 50%; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; font-weight: 800; }
.footer__rg-text { color: var(--muted); font-size: 13px; font-weight: 700; }
.footer__bottom { margin-top: 18px; }
.footer__disclaimer { color: var(--muted); font-size: 13px; margin: 0 0 6px; }
.footer__copy { color: rgba(169, 195, 198, .6); font-size: 13px; margin: 0; }

.tm-sticky { display: none; }

/* ===== Адаптив ===== */
@media (max-width: 1024px) {
  .header-nav { display: none; }
  .header-burger { display: inline-flex; }
  .tm-layout { grid-template-columns: 1fr; }
  .tm-toc { display: none; }
  .popular-games__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  :root { --header-h: 58px; }
  .header__inner { gap: 10px; padding: 0 12px; }
  .logo-img { width: 96px; height: 32px; }
  .header__right { gap: 8px; }
  .auth .btn--outline { display: none; }
  .btn { min-height: 38px; padding: 0 20px 0 14px; font-size: 13px; }
  .container { padding: 0 16px; }
  .hero-banner { margin: 14px 12px 0; min-height: 0; }
  .hero-banner__bg { object-position: 70% center; opacity: .35; }
  .hero-banner__overlay { background: linear-gradient(180deg, rgba(2, 43, 56, .7), rgba(2, 43, 56, .95)); }
  .hero-banner__inner { padding: 28px 20px 40px; }
  .hero-banner::after { width: 54px; height: 54px; }
  .popular-games__grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .footer__inner { grid-template-columns: 1fr; gap: 22px; }
  .tm-sticky {
    display: block; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 150;
    background: var(--lime); color: var(--bg); text-align: center; font-weight: 800; padding: 14px;
    clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 100%, 0 100%); box-shadow: 0 8px 20px rgba(0, 0, 0, .4); text-decoration: none !important;
  }
  .page-text ol li { padding-left: 48px; }
}
