* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, "Noto Sans Myanmar", "Myanmar Sangam MN", sans-serif;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  background: #0b1020;
  color: #eef2ff;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  background: #263456;
  color: #fff;
  font: inherit;
  line-height: 1.45;
}

button:hover {
  background: #33436c;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 8px 24px;
  background: #111831;
  border-bottom: 1px solid #273150;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand img {
  display: block;
  width: auto;
  height: 44px;
  inline-size: auto;
  block-size: 44px;
  max-width: 104px;
  max-height: 44px;
  max-inline-size: 104px;
  max-block-size: 44px;
  flex: 0 0 auto;
  object-fit: contain;
  object-position: left center;
}

.brand p {
  margin: 0;
  color: #9ca3af;
  line-height: 1.45;
}

.ad-marquee {
  overflow: hidden;
  border-bottom: 1px solid #273150;
  background: #facc15;
  color: #111827;
  font-weight: 700;
  white-space: nowrap;
}

.ad-marquee-track {
  display: inline-flex;
  min-width: max-content;
  transform: translate3d(0, 0, 0);
  will-change: transform;
  width: max-content;
  animation: ad-marquee 28s linear infinite;
}

.ad-marquee span {
  display: inline-block;
  flex: 0 0 max-content;
  padding: 8px 22px;
  white-space: nowrap;
}

.ad-marquee-player {
  margin-top: 12px;
  border: 1px solid #8a6b0a;
  border-radius: 8px;
}

@keyframes ad-marquee {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(-50%, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ad-marquee-track {
    animation: none;
    white-space: normal;
  }

  .ad-marquee span[aria-hidden="true"] {
    display: none;
  }

  .ad-marquee span {
    white-space: normal;
  }
}

.layout {
  display: grid;
  grid-template-areas:
    "player"
    "matches";
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 18px;
}

.panel {
  overflow: hidden;
  border: 1px solid #273150;
  border-radius: 8px;
  background: #111831;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid #273150;
}

.tab {
  min-width: 0;
}

.tab.active,
.languages button.active {
  background: #4f46e5;
}

.filters {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid #273150;
}

.filters label {
  color: #a8b3cf;
  font-size: 13px;
  line-height: 1.4;
}

.filters select {
  min-width: 0;
  width: 100%;
  min-height: 40px;
  border: 1px solid #33436c;
  border-radius: 8px;
  padding: 8px 10px;
  background: #17213d;
  color: #eef2ff;
  font: inherit;
  line-height: 1.35;
}

.filters select:disabled {
  opacity: .55;
}

.status,
.stream-status {
  padding: 14px;
  color: #cbd5e1;
}

.matches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: 12px;
  padding: 14px;
}

.match {
  display: flex;
  flex-direction: column;
  padding: 14px;
  min-height: 100%;
  border: 1px solid #273150;
  border-radius: 8px;
  cursor: pointer;
  background: #121b35;
}

.match:hover,
.match:focus {
  outline: none;
  background: #19223f;
}

.match-title {
  margin-bottom: 8px;
  font-weight: 700;
  line-height: 1.45;
}

.league,
.time,
.score {
  color: #a8b3cf;
  font-size: 13px;
  line-height: 1.5;
}

.teams {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 8px 0;
}

.teams span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.teams strong {
  flex: 0 0 auto;
  color: #fff;
}

.teams img,
.team-fallback {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 50%;
}

.teams img {
  background: #fff;
  object-fit: contain;
}

.team-fallback {
  display: inline-grid;
  place-items: center;
  background: #263456;
  color: #eef2ff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.badge {
  display: inline-block;
  margin: 8px 6px 0 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: #1f2a44;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.45;
}

.badge.live {
  background: #b91c1c;
  color: #fff;
}

.badge.priority {
  background: #b7791f;
  color: #fff7ed;
}

.load-more {
  display: block;
  width: calc(100% - 28px);
  margin: 14px;
}

.load-more[hidden] {
  display: none;
}

.matches-panel {
  grid-area: matches;
}

.player-panel {
  grid-area: player;
  justify-self: center;
  width: 100%;
  max-width: 980px;
  min-width: 0;
  padding: 16px;
}

.player-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.player-head h2 {
  margin: 0 0 6px;
  line-height: 1.45;
}

.player-head p {
  margin: 0;
  color: #9ca3af;
  line-height: 1.5;
}

.languages {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.player-frame {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: #000;
}

.player-frame::before {
  display: block;
  padding-top: 56.25%;
  content: "";
}

.player-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
}

.player-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 20px;
  color: #eef2ff;
  background: rgba(0, 0, 0, 0.72);
  font-weight: 700;
  text-align: center;
}

.player-loading[hidden] {
  display: none;
}

.player-loading-spinner {
  width: 42px;
  height: 42px;
  margin: 0 auto;
  border: 4px solid rgba(238, 242, 255, 0.28);
  border-top-color: #facc15;
  border-radius: 50%;
  animation: player-loading-spin 0.9s linear infinite;
}

@keyframes player-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 850px) {
  .topbar {
    min-height: 52px;
    padding: 6px 12px;
  }

  .brand {
    flex: 0 1 auto;
    min-width: 0;
    max-width: calc(100% - 138px);
  }

  .brand img {
    width: auto;
    height: 34px;
    inline-size: auto;
    block-size: 34px;
    max-width: 84px;
    max-height: 34px;
    max-inline-size: 84px;
    max-block-size: 34px;
    object-fit: contain;
  }

  .brand p {
    display: none;
  }

  .ad-marquee-track {
    animation-duration: 18s;
  }

  .ad-marquee span {
    padding: 7px 16px;
    font-size: 14px;
  }

  .layout {
    gap: 14px;
    padding: 14px;
  }

  .matches {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .player-head {
    display: block;
  }

  .player-panel {
    max-width: none;
  }

  .languages {
    justify-content: flex-start;
    margin-top: 10px;
  }
}

@media (max-width: 430px) {
  button {
    padding-inline: 10px;
  }

  .topbar {
    align-items: center;
    gap: 10px;
    min-height: 62px;
    padding: 8px 10px;
  }

  .layout {
    padding: 10px;
  }

  .tabs {
    gap: 6px;
    padding: 10px;
  }

  .filters {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 10px;
  }

  .match,
  .status,
  .stream-status {
    padding: 12px;
  }

  .teams {
    flex-wrap: wrap;
  }
}
