/* ============================================================
   LiveTV — modern, responsive rebuild
   Hand-authored HTML5/CSS. No layout tables.
   Visual parity with the original table-based site.
   ============================================================ */

:root {
  --blue: #2862a8;
  --blue-dark: #235591;
  --blue-deep: #1f4c85;
  --red: #e10000;
  --red-bright: #f10000;
  --gray-text: #929292;
  --gray-desc: #a0a0a0;
  --line: #cccccc;
  --page-bg: #f0f0f0;
  --outer-bg: #c8c8c8;
  --frame: #737373;
  --font: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html, body { overflow-x: hidden; }

body {
  margin: 0;
  background: var(--outer-bg);
  font-family: var(--font);
  font-size: 12px;
  color: #000;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { border: 0; max-width: 100%; height: auto; vertical-align: middle; }
h1, h2, h3 { margin: 0; font-weight: bold; }

/* ---------- Page frame ---------- */
.page {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  background: var(--page-bg);
  box-shadow: 0 0 10px #000;
}

/* ---------- Header ---------- */
/* The header is two stacked bands: a blue top (logo + user) and a light
   bottom bar (search + main menu + forum links), spanning full width. */
.site-header {
  display: flex;
  flex-direction: column;
  background: url(../img/h_bg.gif) repeat-x;
  background-size: auto 100%;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  min-height: 58px;
  padding: 0 10px 0 0;
}

.site-header__logo {
  flex: 0 0 262px;
  display: flex;
  align-items: center;
}
.site-header__logo img { display: block; width: 262px; height: auto; }

/* user block — top right, on the blue band */
.site-header__user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 0 0;
  text-align: right;
}
.user-row { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.user-row a { color: #d4deec; font-size: 11px; }
.user-row a:hover { color: #fff; }
.user-row img { vertical-align: middle; }
.lang-flags { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 3px; position: relative; }
.lang-flags img { width: 22px; height: 15px; }

/* bottom menu bar */
.header-menu {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 18px;
  padding: 5px 12px;
  background: linear-gradient(to bottom, #f7f7f7, #d9d9d9);
  border-top: 1px solid rgba(255, 255, 255, .4);
}

.searchbox { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; }
.searchbox input[type="search"],
.searchbox input[type="text"] {
  font-family: var(--font);
  font-size: 12px;
  padding: 2px 4px;
  width: 130px;
  border: 1px solid #8aa6c8;
}

.mainmenu {
  flex: 1 1 auto;
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 22px;
}
.mainmenu a { color: #000; font-size: 11px; font-weight: bold; white-space: nowrap; }
.mainmenu a:hover { color: var(--blue); }

.submenu { flex: 0 0 auto; display: flex; gap: 12px; justify-content: flex-end; }
.submenu a { color: #000; font-size: 11px; font-weight: bold; }
.submenu a:hover { color: var(--blue); }

.lang-dropdown {
  display: none;
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  background: #fff;
  border: 1px solid var(--blue-deep);
  padding: 4px;
  width: 160px;
  text-align: left;
  box-shadow: 0 0 6px rgba(0,0,0,.4);
}
.lang-dropdown.open { display: block; }
.lang-dropdown a { display: flex; align-items: center; gap: 6px; padding: 2px 4px; color: var(--blue); font-size: 11px; }
.lang-dropdown a:hover { background: #eef3fa; }

/* ---------- Info blocks ---------- */
.info-blocks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
}
.info-block {
  background: url(../img/lbg5.gif) repeat-x #164172;
  min-height: 70px;
  padding: 4px 8px 8px;
  color: #fff;
  display: flex;
  flex-direction: column;
}
.info-block__title { color: #b9cfe8; font-size: 11px; font-weight: bold; }
.info-block ul { list-style: none; margin: 7px 0 0; padding: 0; }
.info-block li { margin: 4px 0; }
.info-block a { color: #fff; font-size: 12px; }
.info-block a:hover { color: #fff; text-decoration: underline; }
.info-block--center { flex: 1; text-align: center; display: flex; align-items: center; justify-content: center; }
.info-block .liveb1 { color: #fff; font-size: 12px; }

.timezone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 10px 3px 12px;
}
.timezone .date { color: #676767; font-size: 11px; }
.timezone a { font-size: 11px; }
.bbset {
  border: 0;
  background: #2c3e57;
  color: #fff;
  font-size: 13px;
  line-height: 1;
  padding: 3px 9px;
  border-radius: 8px;
  cursor: pointer;
}
.bbset:hover { background: var(--blue); }

/* ---------- Bookmaker bar ---------- */
.bookmaker-bar {
  background: var(--blue-dark);
  margin: 0 4px 5px;
}
/* "Menu" toggle — only shown on mobile */
.bm-toggle {
  display: none;
  width: 100%;
  align-items: center;
  gap: 8px;
  background: none;
  border: 0;
  color: #fff;
  font-family: var(--font);
  font-size: 13px;
  font-weight: bold;
  padding: 9px 14px;
  cursor: pointer;
  text-align: left;
}
.bm-toggle .bm-burger { font-size: 16px; line-height: 1; }
.bm-toggle:hover { color: #ff5959; }
.bookmaker-bar ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap;
}
.bookmaker-bar > ul > li { position: relative; }
.bookmaker-bar > ul > li > a {
  display: block; color: #fff; padding: 8px 16px;
  border-right: 1px solid #3a6aa6; white-space: nowrap;
}
.bookmaker-bar > ul > li > a:hover { color: #ff5959; text-decoration: none; }
.bookmaker-bar .dropdown {
  display: none; position: absolute; top: 100%; left: 0; z-index: 130;
  background: #2965ac; border: 1px solid #1d4d82;
  width: 320px; padding: 4px;
  grid-template-columns: 1fr 1fr;
}
.bookmaker-bar li:hover .dropdown { display: grid; }
.bookmaker-bar .dropdown a { display: block; color: #f3f6fb; font-size: 13px; padding: 6px 10px; }
.bookmaker-bar .dropdown a:hover { color: #ff5959; }

/* ---------- Main layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 245px 1fr;
  align-items: start;
  column-gap: 6px;
  padding: 0 4px 4px;
}

/* ---------- Sidebar ---------- */
.sidebar { min-width: 0; }
.sidebar > * { margin-bottom: 8px; }

.access-box {
  background: var(--blue);
  border: 4px solid var(--red);
  color: #fff; font-size: 11px; line-height: 1.6; padding: 7px;
}
.access-box a { color: #fff; }
.access-box b { color: #fff; }

.panel { border: 1px solid #d2d2d2; background: #fff; }
.panel__title {
  background: var(--blue); color: #fff;
  font-size: 11px; font-weight: bold; text-transform: uppercase;
  padding: 6px 10px; letter-spacing: .3px;
}
.panel__foot {
  background: var(--blue-dark); text-align: right; padding: 4px 10px;
}
.panel__foot a { color: #fff; font-size: 11px; }

.sport-icons {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; justify-content: center;
}
.sport-icons img { width: 34px; height: 34px; }
.sport-icons a:hover img { opacity: .85; }

.event-group__head {
  display: flex; align-items: center; gap: 6px;
  background: #f0f0f0; padding: 4px 8px; margin-top: 2px;
}
.event-group__head .date { font-weight: bold; color: #676767; font-size: 11px; }

.event-list { list-style: none; margin: 0; padding: 0; }
.event-list li {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 6px 8px; border-bottom: 1px solid #f0f0f0;
}
.event-list .icon { flex: 0 0 27px; text-align: center; }
.event-list .icon img { width: 27px; height: 25px; }
.event-list a.live { color: #000; font-size: 11px; }
.event-list a.live:hover { color: var(--red-bright); }
.event-list .evdesc { display: block; color: #a0a0a0; font-size: 11px; }

/* ---------- Main content ---------- */
.content { min-width: 0; background: #fff; }

.section-title {
  color: #fff; font-size: 12px; font-weight: bold;
  padding: 6px 14px; height: 25px; display: flex; align-items: center;
}
.section-title a { color: #fff; }
.section-title a img { margin-left: 8px; }
.section-title--red { background: var(--red); }
.section-title--blue { background: var(--blue); }

/* slanted leading-edge caps (original m1/m2/m3.gif, 15x25) */
.section-title--cap1,
.section-title--cap2,
.section-title--cap3 {
  background-repeat: no-repeat;
  background-position: left top;
  padding-left: 24px;
}
.section-title--cap1 { background-image: url(../img/m1.gif); }
.section-title--cap2 { background-image: url(../img/m2.gif); }
.section-title--cap3 { background-image: url(../img/m3.gif); }

/* content grid: Match of the Day + site description stacked on the left,
   Other Top Broadcasts + Popular Videos on the right, full-width rows below */
.content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-areas:
    "motd      broadcasts videos"
    "about     broadcasts videos"
    "leagues   leagues    leagues"
    "standings standings  standings"
    "month     month      month";
  align-items: start;
}
.c-motd      { grid-area: motd; }
.c-about     { grid-area: about; }
.c-broadcasts{ grid-area: broadcasts; }
.c-videos    { grid-area: videos; }
.c-leagues   { grid-area: leagues; }
.c-standings { grid-area: standings; }
.c-month     { grid-area: month; }

/* OTB and Popular Videos title bars butt together — divider only in the body */
.c-broadcasts .mini-list { border-right: 1px solid #e4e4e4; }

/* Match of the day */
.motd { padding: 14px 10px; }
.motd__teams {
  display: flex; align-items: flex-start; justify-content: center; gap: 10px;
}
.motd__teams img { width: 42px; }
.motd__names { text-align: center; }
.motd__names .row { display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 13px; }
.motd__names a { color: #000; }
.motd__league { color: var(--gray-desc); margin-top: 4px; }
.motd__video { margin-top: 4px; }

.about { padding: 12px; }
.about .text { line-height: 1.6; color: #000; }
.about .text a { color: var(--blue); }
.about .telegram { display: block; text-align: center; margin-top: 16px; font-size: 16px; font-weight: bold; }

/* broadcast / video lists */
.mini-list { list-style: none; margin: 0; padding: 10px; }
.mini-list li { margin-bottom: 12px; }
.broadcast-item { display: flex; gap: 6px; }
.broadcast-item__flags { flex: 0 0 24px; display: flex; flex-direction: column; gap: 2px; }
.broadcast-item__flags img { width: 20px; }
.broadcast-item__body a { color: var(--blue); }
.broadcast-item__body .date { color: #676767; font-size: 11px; display: block; line-height: 1.5; }

.video-item { display: flex; gap: 6px; align-items: flex-start; }
.video-item__flags { display: flex; gap: 3px; flex: 0 0 auto; }
.video-item__flags img { width: 20px; }
.video-item__body a { color: var(--blue); }
.video-item__body .new { display: inline-block; margin-top: 2px; }

/* leagues */
.leagues {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px 18px; padding: 16px 14px;
}
.league { display: flex; gap: 8px; align-items: flex-start; }
.league__flag { flex: 0 0 22px; }
.league__body { font-size: 11px; }
.league__name { font-weight: normal; }
.league__links { margin-top: 2px; }
.league__links a { font-size: 11px; margin-right: 6px; }
.league__pop { position: relative; display: inline-block; }
.league__pop img { cursor: pointer; }
.league__tooltip {
  display: none; position: absolute; left: 0; top: 18px; z-index: 60;
  background: #fff; border: 1px solid #cdcdcd; padding: 7px; width: 180px;
  box-shadow: 0 0 5px rgba(0,0,0,.3);
}
.league__pop:hover .league__tooltip,
.league__tooltip.open { display: block; }
.league__tooltip a { display: block; font-size: 11px; line-height: 1.7; }

.cups { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 18px; padding: 0 14px 16px; }
.cup { display: flex; gap: 8px; align-items: center; }
.cup img { width: 22px; }

/* standings */
.split-titles { display: grid; grid-template-columns: 1fr 1fr; }
.split-titles .section-title { background: var(--blue); }
.standings-wrap { display: grid; grid-template-columns: 1fr 1fr; }
.standings-wrap > div { padding: 12px; }
.no-schedule { text-align: center; color: #555; padding: 20px 0; }

table.standings { width: 100%; border-collapse: collapse; font-size: 11px; }
table.standings td { padding: 3px 4px; }
table.standings .rank { color: #676767; width: 18px; }
table.standings .crest { width: 24px; text-align: right; }
table.standings .crest img { width: 20px; }
table.standings .team a { color: var(--blue); }
table.standings .num { text-align: right; width: 26px; }
table.standings .pts { text-align: right; font-weight: bold; width: 30px; }
table.standings .sep td { border-top: 1px solid var(--line); padding: 0; height: 1px; }
.standings-more { text-align: right; margin-top: 8px; }
.standings-more a { font-size: 11px; }

/* this month */
.month { display: grid; grid-template-columns: 1fr 1fr; }
.month > div { padding: 12px; }
.month-event { display: flex; gap: 12px; }
.month-event .text { line-height: 1.5; }
.month-event .graydesc { color: var(--gray-text); }
.month-videos { list-style: none; margin: 0; padding: 0; }
.month-videos li { margin-bottom: 10px; }
.month-videos a { font-size: 11px; }
.month-videos .evdesc { display: block; color: #a0a0a0; font-size: 11px; }

/* ---------- Footer ---------- */
.footer-cols {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--frame); margin: 0 4px 5px;
}
.footer-col { background: #fff; }
.footer-col__title { background: var(--blue); padding: 5px 10px; }
.footer-col__title .whitetitle { color: #fff; font-size: 11px; font-weight: bold; }
.forum-posts { list-style: none; margin: 0; padding: 8px 10px; }
.forum-posts li { display: flex; gap: 8px; margin-bottom: 8px; }
.forum-posts .date { color: #676767; font-size: 11px; display: block; }
.sponsored { text-align: center; padding: 14px; color: var(--gray-text); }

.bottom-bar {
  background: #2c3e57; color: #becee2;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  padding: 6px 14px; font-size: 11px;
}
.bottom-bar a { color: #becee2; font-size: 11px; }
.bottom-bar a:hover { color: #e0e9f4; }

.copyright {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px;
  padding: 12px 14px; background: #fff;
}
.copyright .bottomgray { color: var(--gray-text); font-size: 11px; line-height: 1.6; }
.copyright a.bottomgray { color: var(--gray-text); }

/* ---------- Login modal ---------- */
.overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 200;
}
.overlay.open { display: block; }
.modal {
  display: none; position: fixed; left: 50%; top: 40%; transform: translate(-50%, -40%);
  z-index: 210; width: 400px; max-width: 94vw;
  background: #fff; border: 10px solid rgba(82,82,82,.7); border-radius: 8px;
}
.modal.open { display: block; }
.modal__inner { padding: 12px; border: 1px solid #777; }
.modal__title {
  margin: -12px -12px 12px; background: var(--red-bright); color: #fff;
  padding: 6px 12px; font-size: 20px; border: 1px solid #777;
}
.modal label { display: block; margin: 8px 0 2px; }
.modal input[type="text"], .modal input[type="email"], .modal input[type="password"] {
  width: 100%; padding: 5px; font-size: 13px;
}
.modal__actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn { font-family: var(--font); font-size: 12px; padding: 4px 10px; cursor: pointer; }
.btn--fb { background: #5f78ab; color: #fff; border: 1px solid #29447e; font-weight: bold; padding: 4px 8px; }

/* visually hidden (SEO headings) */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.mobile-only { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
  .leagues, .cups { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 200px 1fr; }

  /* hide logo on tablet & mobile */
  .site-header__logo { display: none; }
  .header-top { justify-content: flex-end; min-height: 0; padding: 6px 10px; }
}

@media (max-width: 767px) {
  .page { box-shadow: none; }

  /* ---- larger, more readable fonts on mobile ---- */
  body { font-size: 14px; }

  .section-title { font-size: 15px; height: auto; min-height: 30px; padding: 8px 14px; }

  .motd__names .row { font-size: 16px; }
  .motd__league, .motd__video a { font-size: 13px; }

  .event-list a.live { font-size: 14px; }
  .event-list .evdesc { font-size: 13px; }
  .event-group__head .date { font-size: 13px; }

  .broadcast-item__body a,
  .video-item__body a { font-size: 14px; }
  .broadcast-item__body .date { font-size: 13px; }

  /* Popular Videos: "new" badge inline with the title, not on a new line */
  .video-item__body .vid-br { display: none; }
  .video-item__body .new { margin-left: 6px; vertical-align: middle; }

  .about .text { font-size: 14px; line-height: 1.7; }
  .about .telegram { font-size: 18px; }

  .league__body, .league__name { font-size: 13px; }
  .league__links a, .cup a { font-size: 13px; }

  table.standings { font-size: 13px; }
  .no-schedule { font-size: 14px; }
  .standings-more a { font-size: 13px; }

  .month-event .text { font-size: 14px; }
  .month-videos a, .month-videos .evdesc { font-size: 13px; }

  .timezone .date, .timezone a { font-size: 13px; }

  .forum-posts a, .forum-posts .date { font-size: 13px; }
  .bottom-bar, .bottom-bar a, .copyright .bottomgray { font-size: 12px; }

  /* header / bookmaker menu */
  .bm-toggle { font-size: 15px; padding: 11px 16px; }
  .bookmaker-bar > ul > li > a { font-size: 15px; padding: 11px 16px; }
  .bookmaker-bar .dropdown a { font-size: 14px; padding: 9px 14px 9px 32px; }
  .user-row a { font-size: 13px; }

  /* header: center the top band, menu bar wraps */
  .header-top { flex-direction: column; align-items: center; padding: 6px 0; }
  .site-header__user { align-items: center; text-align: center; padding: 6px 0 0; }
  .user-row, .lang-flags { justify-content: center; }
  .header-menu { justify-content: center; gap: 5px 10px; padding: 6px 8px; }
  .searchbox { flex: 1 1 100%; justify-content: center; }
  .searchbox input[type="search"], .searchbox input[type="text"] { width: 150px; }
  .mainmenu { flex: 1 1 100%; gap: 6px 12px; }
  .mainmenu a, .submenu a { font-size: 12px; }
  .submenu { flex: 1 1 100%; justify-content: center; gap: 12px; }
  .searchbox input[type="search"], .searchbox input[type="text"] { font-size: 14px; }

  /* hide the three info blocks on mobile */
  .info-blocks { display: none; }

  /* bookmaker bar becomes a "Menu" dropdown */
  .bm-toggle { display: flex; }
  .bookmaker-bar > ul { display: none; flex-direction: column; }
  .bookmaker-bar.open > ul { display: flex; }
  .bookmaker-bar > ul > li { position: static; }
  .bookmaker-bar > ul > li > a { border-right: 0; border-top: 1px solid #3a6aa6; }

  /* nested submenus shown inline, indented, under their parent */
  .bookmaker-bar .dropdown {
    display: block;
    position: static;
    width: auto;
    border: 0;
    padding: 0;
    background: #1f4c85;
    grid-template-columns: none;
  }
  .bookmaker-bar .dropdown a {
    padding: 6px 14px 6px 32px;
    font-size: 12px;
    border-top: 1px solid #2a5a96;
  }

  /* main: content first, sidebar below */
  .layout { grid-template-columns: 1fr; }
  .content { order: 1; }
  .sidebar { order: 2; }

  /* single column, reordered:
     Match of the Day -> Other Top Broadcasts -> Popular Videos ->
     Main Leagues -> Standings -> Matchday Videos -> site description (last) */
  .content { display: flex; flex-direction: column; align-items: stretch; }
  .c-motd { order: 1; }
  .c-broadcasts { order: 2; }
  .c-videos { order: 3; }
  .c-leagues { order: 4; }
  .c-standings { order: 5; }
  .c-month { order: 6; }
  .c-about { order: 7; }
  .c-broadcasts .mini-list { border-right: 0; border-bottom: 1px solid #e4e4e4; }
  .leagues, .cups { grid-template-columns: 1fr 1fr; }
  .standings-wrap, .month, .split-titles, .footer-cols { grid-template-columns: 1fr; }
  .split-titles .section-title:first-child { border-bottom: 1px solid #1d4d82; }
}

@media (max-width: 480px) {
  .mainmenu a, .submenu a { font-size: 11px; }
  .header-menu { gap: 5px 12px; }
  .leagues, .cups { grid-template-columns: 1fr; }
  .section-title { font-size: 14px; }
  .modal { width: 94vw; }
}
