:root {
  color-scheme: dark;
  --bg: #081b36;
  --panel: rgba(8, 27, 54, .92);
  --panel-2: rgba(13, 43, 87, .88);
  --panel-3: rgba(255, 251, 245, .08);
  --line: rgba(241, 221, 179, .22);
  --muted: rgba(255, 248, 240, .68);
  --text: #fff8f0;
  --accent: #f1ddb3;
  --accent-strong: #cb3f33;
  --accent-deep: #962a24;
  --fairway: #2d6d4e;
  --fairway-deep: #194634;
  --danger: #ff7a6d;
  --warn: #ffcf64;
  --row-h: 84px;
  --course-hero-bg: url("/assets/plastered-open-course-mountain.webp");
  --course-video-bg: url("/assets/plastered-open-course-green.webp");
  --course-dashboard-bg: url("/assets/plastered-open-course-clubhouse.webp");
  --tv-viewport-h: 100vh;
  --tv-safe-x: 0px;
  --tv-safe-y: 0px;
  --tv-safe-x-total: 0px;
  --tv-safe-y-total: 0px;
}

* { box-sizing: border-box; }

@supports (height: 100dvh) {
  :root { --tv-viewport-h: 100dvh; }
}

body {
  margin: 0;
  min-width: 1080px;
  height: var(--tv-viewport-h);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(8, 27, 54, .96) 0%, rgba(13, 43, 87, .9) 42%, rgba(20, 94, 139, .82) 100%),
    var(--course-hero-bg) center center / cover no-repeat fixed;
  background-color: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::before {
  content: attr(data-tv-mark);
  position: fixed;
  z-index: 80;
  top: var(--tv-safe-y);
  left: var(--tv-safe-x);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 0 0 8px 0;
  background: var(--accent);
  color: #04140c;
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  pointer-events: none;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .32);
}

button, input, select, textarea {
  font: inherit;
}

button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(203, 63, 51, .88), rgba(150, 42, 36, .9));
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(8, 27, 54, .18);
}

button:hover { border-color: rgba(241, 221, 179, .52); background: linear-gradient(135deg, #d64a3e, #a9312a); }
button:disabled { cursor: wait; color: rgba(255, 248, 240, .42); }

button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus,
google-cast-launcher:focus {
  outline: 4px solid var(--warn);
  outline-offset: 3px;
  border-color: var(--warn);
  box-shadow: 0 0 0 7px rgba(255, 207, 100, .18), 0 18px 38px rgba(0, 0, 0, .38);
}

input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(5, 14, 29, .72);
  color: var(--text);
  padding: 8px 10px;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
}

textarea { resize: vertical; min-height: 86px; }

.appShell {
  display: grid;
  grid-template-columns: 340px minmax(740px, 1fr);
  height: calc(var(--tv-viewport-h) - var(--tv-safe-y-total));
  margin: var(--tv-safe-y) var(--tv-safe-x);
  min-height: 0;
}

.appShell.sidebarCollapsed {
  grid-template-columns: 64px minmax(740px, 1fr);
}

.appShell.guideHidden {
  grid-template-columns: minmax(0, 1fr);
}

.appShell.tvMode {
  grid-template-columns: minmax(0, 1fr);
}

.appShell.tvMode .sidebar,
.appShell.guideHidden .sidebar,
.appShell.tvMode .contentSection,
.appShell.tvMode .nowBar,
.appShell.tvMode .showNowBarButton {
  display: none;
}

.appShell.tvMode .main {
  grid-template-rows: minmax(0, 1fr);
}

.appShell.guideHidden .main {
  grid-template-rows: minmax(0, 1fr);
}

.appShell.tvMode .playerSection {
  height: 100%;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
  border-bottom: 0;
}

.appShell.guideHidden .playerSection {
  height: 100%;
  min-height: 0;
}

.appShell.tvMode .videoWrap {
  grid-row: 1;
}

.appShell.guideHidden .contentSection {
  display: none;
}

.sidebar {
  min-height: 0;
  overflow: auto;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(8, 27, 54, .95), rgba(13, 43, 87, .88) 48%, rgba(25, 70, 52, .86)),
    var(--course-dashboard-bg) center top / cover no-repeat;
  background-blend-mode: multiply;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.brand {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 12px;
  padding-bottom: 6px;
}

.brand > div:not(.brandMark) {
  min-width: 0;
}

.sidebarToggle {
  width: 56px;
  min-width: 56px;
  padding: 0;
  font-size: 13px;
  line-height: 1;
}

.appShell.sidebarCollapsed .sidebar {
  overflow: hidden;
  padding: 12px 9px;
  align-items: center;
}

.appShell.sidebarCollapsed .brand {
  display: grid;
  grid-template-columns: 1fr;
  width: 100%;
  justify-items: center;
  gap: 10px;
  padding-bottom: 0;
}

.appShell.sidebarCollapsed .brandMark {
  display: none;
}

.appShell.sidebarCollapsed .brand > div:not(.brandMark),
.appShell.sidebarCollapsed .sidebar > :not(.brand) {
  display: none;
}

.appShell.sidebarCollapsed .sidebarToggle {
  width: 46px;
  min-width: 46px;
  margin-left: 0;
  justify-self: center;
}

.brandMark {
  visibility: hidden;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 8px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 251, 245, .96), rgba(241, 221, 179, .82)),
    linear-gradient(135deg, var(--accent-strong), var(--fairway-deep));
  border: 1px solid rgba(241, 221, 179, .52);
  box-shadow: 0 12px 28px rgba(6, 17, 33, .32), inset 0 0 0 2px rgba(203, 63, 51, .12);
}

.brandMark.isReady {
  visibility: visible;
}

.brandMark.courseInitials::before {
  content: attr(data-initials);
  color: #061121;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
}

.brandMark img {
  display: block;
  width: 94%;
  height: 94%;
  object-fit: contain;
  filter: sepia(.34) saturate(1.28) hue-rotate(332deg) contrast(1.08);
  mix-blend-mode: multiply;
}

.brand h1, .sectionHeader h2, .nowBar h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.brand h1 {
  overflow-wrap: anywhere;
}

.brand p, .sectionHeader p, .nowBar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.brand p {
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.filterGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  color: rgba(255, 248, 240, .82);
  font-size: 13px;
}

.toggles label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.toggles input {
  width: 16px;
  min-height: 16px;
}

.favoritesTools {
  display: grid;
  grid-template-columns: minmax(120px, 1fr);
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(5, 14, 29, .62);
}

.favoritesTools button {
  text-align: left;
  padding: 8px 10px;
}

.favoritesTools button.active {
  border-color: var(--accent);
  color: var(--accent);
}

#favoritesHint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.sidebarDropdown {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(5, 14, 29, .62);
}

.sidebarDropdown summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  user-select: none;
}

.sidebarDropdown summary::-webkit-details-marker {
  display: none;
}

.sidebarDropdown summary::after {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--accent);
  font-size: 15px;
  line-height: 1;
}

.sidebarDropdown[open] summary::after {
  content: "-";
}

.sidebarDropdown > .field,
.sidebarDropdown > .epgBox,
.sidebarDropdown > .controlsPanel {
  margin-top: 10px;
}

.controlsPanel {
  display: grid;
  gap: 16px;
}

.controlsPanel .epgBox {
  padding: 0;
}

.buttonRow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 10px;
}

.buttonRow.viewTools {
  grid-template-columns: 1fr 1fr;
}

.epgBox {
  display: grid;
  gap: 10px;
}

.statusLine {
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(5, 14, 29, .62);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.main {
  position: relative;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  isolation: isolate;
}

@media (min-width: 900px) and (orientation: landscape) {
  :root {
    --tv-safe-x: clamp(18px, 2vw, 38px);
    --tv-safe-y: clamp(14px, 2vh, 30px);
    --tv-safe-x-total: clamp(36px, 4vw, 76px);
    --tv-safe-y-total: clamp(28px, 4vh, 60px);
  }
}

.playerSection {
  position: relative;
  z-index: 2;
  height: var(--tv-player-height, min(58vh, 620px));
  min-height: 340px;
  overflow: hidden;
  contain: layout paint;
  display: grid;
  grid-template-columns: minmax(520px, var(--tv-video-width, 1fr));
  grid-template-rows: auto minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 14, 29, .92);
}

.playerSection.nowBarCollapsed {
  grid-template-rows: 48px minmax(0, 1fr);
}

.playerSection.nowBarHidden {
  grid-template-rows: minmax(0, 1fr);
}

.videoWrap {
  position: relative;
  min-width: 0;
  grid-row: 2;
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(140deg, rgba(8, 27, 54, .9), rgba(25, 70, 52, .72)),
    var(--course-video-bg) center center / cover no-repeat;
}

.playerSection.nowBarHidden .videoWrap {
  grid-row: 1;
}

video {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}

.tournamentDashboard {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: auto;
  padding: 22px;
  background:
    linear-gradient(140deg, rgba(4, 20, 43, .95), rgba(13, 43, 87, .91) 44%, rgba(14, 116, 144, .78)),
    var(--course-dashboard-bg) center center / cover no-repeat;
  background-blend-mode: multiply;
  color: var(--text);
}

.tournamentChannelRailWrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 18px;
}

.tournamentChannelRail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
}

.tournamentChannelRail a {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(191, 219, 254, .28);
  border-radius: 6px;
  background: rgba(8, 27, 54, .72);
  color: #eff6ff;
  text-decoration: none;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .18);
}

.tournamentChannelRail a.active {
  border-color: rgba(147, 197, 253, .78);
  background: linear-gradient(135deg, rgba(37, 99, 235, .5), rgba(14, 116, 144, .38));
}

.tournamentChannelRail span {
  padding: 5px 7px;
  border-radius: 6px;
  background: rgba(219, 234, 254, .13);
  color: #bfdbfe;
  font-size: 12px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.tournamentChannelRail strong,
.tournamentChannelRail small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tournamentChannelRail strong {
  color: #eff6ff;
  font-size: 15px;
}

.tournamentChannelRail small {
  grid-column: 1 / -1;
  color: #bfdbfe;
  font-size: 12px;
}

.tournamentChannelCycleButton {
  align-self: stretch;
  min-width: 96px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(147, 197, 253, .32);
  border-radius: 6px;
  background: rgba(15, 23, 42, .72);
  color: #eff6ff;
  font-size: 14px;
  font-weight: 1000;
}

.tournamentChannelCycleButton[aria-pressed="true"] {
  border-color: rgba(125, 211, 252, .72);
  background: linear-gradient(135deg, rgba(37, 99, 235, .62), rgba(14, 116, 144, .44));
}

.tournamentHero {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.tournamentHero h3 {
  margin: 0;
  font-size: 28px;
  line-height: 1.05;
}

.tournamentHero p,
.tournamentCard p {
  margin: 5px 0 0;
  color: var(--muted);
}

.tournamentStatus {
  min-width: 130px;
  padding: 10px 12px;
  border: 1px solid rgba(191, 219, 254, .5);
  border-radius: 6px;
  color: #bfdbfe;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0;
}

.registrationHero {
  grid-template-columns: minmax(320px, 1fr) 320px;
}

.registrationQr {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: #111827;
}

.registrationQr img {
  width: 220px;
  height: 220px;
  display: block;
}

.registrationQr span {
  max-width: 270px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.tournamentStats {
  display: grid;
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.tournamentStat,
.tournamentCard {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(8, 27, 54, .78);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .16);
}

.tournamentStat {
  padding: 12px;
}

.tournamentStat strong {
  display: block;
  font-size: 25px;
  line-height: 1;
}

.tournamentStat span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.tournamentGrid {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) minmax(260px, .8fr);
  gap: 14px;
}

.tournamentDisplaySections {
  display: grid;
  grid-template-columns: minmax(320px, 1.2fr) minmax(260px, .8fr);
  gap: 14px;
  margin-top: 16px;
}

.tournamentDisplaySectionFull {
  grid-column: 1 / -1;
}

.registrationGrid {
  grid-template-columns: minmax(260px, .7fr) minmax(360px, 1.3fr);
}

.leaderboardHero {
  align-items: center;
}

.leaderboardTable {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.leaderboardTable.scrolling {
  animation: tvLeaderboardScroll 55s linear infinite;
}

@keyframes tvLeaderboardScroll {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}

.leaderboardRow {
  display: grid;
  grid-template-columns: 64px minmax(260px, 1fr) 120px 110px;
  gap: 14px;
  align-items: center;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(8, 27, 54, .72);
}

.leaderboardRow.leader {
  border-color: rgba(147, 197, 253, .72);
  background: linear-gradient(135deg, rgba(37, 99, 235, .36), rgba(14, 116, 144, .18));
}

.leaderboardRow strong,
.leaderboardRow em {
  font-size: 28px;
  line-height: 1;
  font-style: normal;
  font-weight: 800;
  color: var(--accent);
}

.leaderboardRow b {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboardRow small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.tournamentCard {
  min-width: 0;
  padding: 14px;
}

.tournamentCard h4 {
  margin: 0 0 10px;
  font-size: 16px;
}

.tournamentRows {
  display: grid;
  gap: 8px;
}

.tournamentRow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(241, 221, 179, .16);
}

.tournamentRow:first-child {
  border-top: 0;
}

.tournamentRow strong,
.tournamentRow span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tournamentRow small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.contestStats {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.contestBoardGrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.contestBoard {
  min-width: 0;
  min-height: 190px;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(241, 221, 179, .32);
  border-radius: 6px;
  background: rgba(8, 27, 54, .76);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .22);
}

.contestBoardTop {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.contestBoardTop strong {
  min-width: 0;
  font-size: 19px;
  line-height: 1.15;
}

.contestBoardTop span {
  flex: 0 0 auto;
  padding: 6px 8px;
  border: 1px solid rgba(241, 221, 179, .28);
  border-radius: 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.contestWinner {
  min-width: 0;
  color: var(--text);
  font-size: 30px;
  font-weight: 900;
  line-height: 1.06;
  overflow-wrap: anywhere;
}

.contestPrize {
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
}

.contestBoard p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}

.plasteredEventTv {
  position: absolute;
  inset: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 32px 40px 92px;
  background:
    linear-gradient(135deg, rgba(4, 20, 43, .96), rgba(8, 45, 92, .92) 46%, rgba(14, 116, 144, .8)),
    var(--course-dashboard-bg) center center / cover no-repeat;
  background-blend-mode: multiply;
}

.eventTvUrgent {
  margin: -12px 0 16px;
  padding: 12px 18px;
  border-radius: 6px;
  background: #ffd166;
  color: #111827;
  font-size: 30px;
  font-weight: 900;
  text-align: center;
}

.eventTvHeader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(219, 234, 254, .28);
}

.eventTvKicker {
  display: block;
  color: #bfdbfe;
  font-size: 24px;
  font-weight: 900;
  text-transform: uppercase;
}

.eventTvHeader h3 {
  margin: 0;
  color: #eff6ff;
  font-size: 58px;
  line-height: 1;
}

.eventTvMeta {
  display: grid;
  justify-items: end;
  gap: 4px;
  color: #dbeafe;
  font-size: 22px;
}

.eventTvMeta strong {
  color: #93c5fd;
  font-size: 30px;
  letter-spacing: 0;
}

.eventTvSlides {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.eventTvSlide {
  position: absolute;
  inset: 0;
  min-width: 0;
  opacity: 0;
  display: grid;
  align-content: center;
  gap: 20px;
  padding-top: 18px;
  animation: plasteredEventTvSlide calc(var(--event-tv-slide-count) * var(--event-tv-slide-duration)) linear infinite;
  animation-delay: calc(var(--event-tv-slide-index) * var(--event-tv-slide-duration));
}

.plasteredEventTv.isPaused .eventTvSlide,
.plasteredEventTv.isPaused .eventTvSlideDots button,
.plasteredEventTv.manualSlide .eventTvSlide,
.plasteredEventTv.manualSlide .eventTvSlideDots button {
  animation-play-state: paused;
}

.plasteredEventTv.manualSlide .eventTvSlide {
  opacity: 0;
  transform: translateX(16px);
}

.plasteredEventTv.manualSlide[data-selected-slide="0"] .eventTvSlide:nth-child(1),
.plasteredEventTv.manualSlide[data-selected-slide="1"] .eventTvSlide:nth-child(2),
.plasteredEventTv.manualSlide[data-selected-slide="2"] .eventTvSlide:nth-child(3),
.plasteredEventTv.manualSlide[data-selected-slide="3"] .eventTvSlide:nth-child(4),
.plasteredEventTv.manualSlide[data-selected-slide="4"] .eventTvSlide:nth-child(5),
.plasteredEventTv.manualSlide[data-selected-slide="5"] .eventTvSlide:nth-child(6),
.plasteredEventTv.manualSlide[data-selected-slide="6"] .eventTvSlide:nth-child(7),
.plasteredEventTv.manualSlide[data-selected-slide="7"] .eventTvSlide:nth-child(8) {
  opacity: 1;
  transform: translateX(0);
}

.eventTvSlide h4 {
  margin: 0;
  color: #eff6ff;
  font-size: 62px;
  line-height: 1;
}

.eventTvSlide h5 {
  margin: 8px 0 -8px;
  color: #bfdbfe;
  font-size: 30px;
  text-transform: uppercase;
}

.eventTvHeroSlide {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, .32fr);
  gap: 28px;
  align-items: center;
}

.eventTvHeroSlide span {
  color: #bfdbfe;
  font-size: 34px;
  font-weight: 900;
  text-transform: uppercase;
}

.eventTvHeroSlide h4 {
  margin: 10px 0;
  font-size: 72px;
}

.eventTvHeroSlide p,
.eventTvCallout {
  margin: 0;
  color: #dbeafe;
  font-size: 34px;
  line-height: 1.22;
}

.eventTvCountdown {
  min-height: 230px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 28px;
  border: 2px solid rgba(147, 197, 253, .42);
  border-radius: 8px;
  background: rgba(15, 23, 42, .72);
  text-align: center;
}

.eventTvCountdown strong {
  color: #eff6ff;
  font-size: 38px;
}

.eventTvCountdown em {
  color: #93c5fd;
  font-size: 58px;
  font-style: normal;
  font-weight: 1000;
}

.eventTvSchedule,
.eventTvStats,
.eventTvQrGrid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.eventTvSchedule div,
.eventTvStat,
.eventTvQr {
  min-width: 0;
  padding: 22px;
  border: 2px solid rgba(147, 197, 253, .28);
  border-radius: 8px;
  background: rgba(15, 23, 42, .74);
}

.eventTvSchedule span,
.eventTvStat span {
  display: block;
  color: #bfdbfe;
  font-size: 22px;
  font-weight: 900;
  text-transform: uppercase;
}

.eventTvSchedule strong,
.eventTvStat strong {
  display: block;
  margin-top: 8px;
  color: #eff6ff;
  font-size: 48px;
  line-height: 1;
}

.eventTvRows {
  display: grid;
  gap: 12px;
}

.eventTvRows > div {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 22px;
  align-items: center;
  padding: 18px 22px;
  border: 2px solid rgba(147, 197, 253, .22);
  border-radius: 8px;
  background: rgba(15, 23, 42, .7);
}

.eventTvRows > div.leader {
  border-color: rgba(96, 165, 250, .72);
  background: linear-gradient(135deg, rgba(37, 99, 235, .44), rgba(15, 23, 42, .76));
}

.eventTvRows strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #eff6ff;
  font-size: 34px;
  line-height: 1.08;
}

.eventTvRows span {
  min-width: 0;
  color: #bfdbfe;
  font-size: 24px;
  white-space: nowrap;
}

.eventTvRows em {
  color: #93c5fd;
  font-size: 40px;
  font-style: normal;
  font-weight: 1000;
}

.eventTvMore,
.eventTvEmpty {
  color: #bfdbfe;
  font-size: 30px;
  font-weight: 900;
}

.eventTvQrGrid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.eventTvQrGrid.compact {
  grid-template-columns: minmax(260px, 360px);
  align-content: center;
}

.eventTvQr {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.eventTvQr img {
  width: 250px;
  height: 250px;
  border: 12px solid #eff6ff;
  border-radius: 8px;
  background: #eff6ff;
}

.eventTvQr strong {
  color: #eff6ff;
  font-size: 30px;
}

.eventTvQr span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #bfdbfe;
  font-size: 18px;
}

.eventTvChannelGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.eventTvChannelGrid > div {
  min-width: 0;
  min-height: 260px;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 24px;
  border: 2px solid rgba(147, 197, 253, .3);
  border-radius: 8px;
  background: rgba(15, 23, 42, .74);
}

.eventTvChannelGrid span {
  color: #93c5fd;
  font-size: 28px;
  font-weight: 1000;
  font-variant-numeric: tabular-nums;
}

.eventTvChannelGrid strong {
  min-width: 0;
  color: #eff6ff;
  font-size: 38px;
  line-height: 1.04;
  overflow-wrap: anywhere;
}

.eventTvChannelGrid p {
  margin: 0;
  color: #dbeafe;
  font-size: 24px;
  line-height: 1.25;
}

.eventTvFooter {
  min-height: 72px;
  display: grid;
  grid-template-columns: minmax(170px, auto) minmax(0, 1fr) minmax(250px, auto);
  gap: 12px;
  align-items: center;
  padding-top: 10px;
  border-top: 2px solid rgba(219, 234, 254, .18);
}

.eventTvFooterLabel {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid rgba(147, 197, 253, .24);
  border-radius: 6px;
  background: rgba(15, 23, 42, .5);
}

.eventTvFooterLabel span,
.eventTvFooterLabel strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eventTvFooterLabel span {
  color: #93c5fd;
  font-size: 12px;
  font-weight: 1000;
  text-transform: uppercase;
}

.eventTvFooterLabel strong {
  color: #eff6ff;
  font-size: 17px;
  font-weight: 1000;
}

.eventTvChannelGuide {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
}

.eventTvChannelGuide a {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 7px;
  align-items: center;
  min-height: 48px;
  padding: 7px 8px;
  border: 1px solid rgba(147, 197, 253, .32);
  border-radius: 6px;
  background: rgba(15, 23, 42, .62);
  color: #bfdbfe;
  text-decoration: none;
}

.eventTvChannelGuide a.active {
  border-color: rgba(147, 197, 253, .76);
  background: linear-gradient(135deg, rgba(37, 99, 235, .42), rgba(14, 116, 144, .34));
}

.eventTvChannelGuide span,
.eventTvChannelGuide strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eventTvChannelGuide span {
  flex: 0 0 auto;
  padding: 5px 7px;
  border-radius: 6px;
  background: rgba(219, 234, 254, .13);
  color: #93c5fd;
  font-size: 14px;
  font-weight: 1000;
  font-variant-numeric: tabular-nums;
}

.eventTvChannelGuide strong {
  color: #eff6ff;
  font-size: 16px;
  font-weight: 1000;
}

.eventTvRotationControls {
  display: grid;
  grid-template-columns: auto auto minmax(0, auto);
  gap: 9px;
  align-items: center;
  justify-content: end;
}

.eventTvCycleButton,
.eventTvPauseButton {
  min-height: 38px;
  padding: 7px 11px;
  border: 1px solid rgba(147, 197, 253, .32);
  border-radius: 6px;
  background: rgba(15, 23, 42, .72);
  color: #eff6ff;
  font-size: 15px;
  font-weight: 1000;
}

.eventTvCycleButton[aria-pressed="true"] {
  border-color: rgba(125, 211, 252, .72);
  background: linear-gradient(135deg, rgba(37, 99, 235, .62), rgba(14, 116, 144, .44));
}

.eventTvPauseButton[aria-pressed="true"] {
  border-color: rgba(250, 204, 21, .7);
  background: rgba(161, 98, 7, .6);
}

.eventTvSlideDots {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  align-items: center;
}

.eventTvSlideDots button {
  display: inline-grid;
  width: 26px;
  height: 26px;
  min-height: 26px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(191, 219, 254, .28);
  border-radius: 999px;
  background: rgba(191, 219, 254, .38);
  color: #eff6ff;
  font-size: 12px;
  font-weight: 1000;
  animation: plasteredEventTvDot calc(var(--event-tv-slide-count) * var(--event-tv-slide-duration)) linear infinite;
  animation-delay: calc(var(--event-tv-slide-index) * var(--event-tv-slide-duration));
}

@media (max-width: 1200px) {
  .tournamentChannelRailWrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .tournamentChannelRail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tournamentChannelCycleButton {
    justify-self: start;
  }

  .plasteredEventTv {
    padding: 28px 28px 88px;
  }

  .eventTvHeader h3 {
    font-size: 48px;
  }

  .eventTvHeader {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .eventTvMeta {
    justify-items: start;
    grid-template-columns: repeat(3, auto);
    gap: 8px 16px;
  }

  .eventTvHeroSlide {
    grid-template-columns: minmax(0, 1fr);
  }

  .eventTvHeroSlide h4 {
    font-size: 58px;
  }

  .eventTvFooter {
    grid-template-columns: minmax(0, 1fr);
  }

  .eventTvChannelGuide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .eventTvRotationControls {
    grid-template-columns: auto auto minmax(0, auto);
    justify-content: start;
  }
}

.eventTvSlideDots button[aria-pressed="true"] {
  border-color: #facc15;
  background: #93c5fd;
  color: #0f172a;
  transform: scale(1.12);
}

.eventTvSlideDots button span {
  line-height: 1;
}

@keyframes plasteredEventTvSlide {
  0%,
  17% { opacity: 1; transform: translateX(0); }
  20%,
  97% { opacity: 0; transform: translateX(-16px); }
  98%,
  100% { opacity: 0; transform: translateX(16px); }
}

@keyframes plasteredEventTvDot {
  0%,
  17% { background: #93c5fd; transform: scale(1.25); }
  20%,
  100% { background: rgba(191, 219, 254, .38); transform: scale(1); }
}

.tournamentEmpty {
  color: var(--muted);
  font-size: 13px;
}

.numberBuffer {
  position: absolute;
  z-index: 9;
  top: 24px;
  left: 50%;
  min-width: 210px;
  padding: 16px 22px;
  border-radius: 8px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, .82);
  border: 1px solid rgba(255,255,255,.28);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .46);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.numberBuffer span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.numberBuffer strong {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 56px;
  line-height: 1;
}

.playOverlayButton {
  position: absolute;
  z-index: 18;
  left: 50%;
  top: 50%;
  width: min(620px, calc(100% - 80px));
  min-height: 92px;
  padding: 20px 28px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 207, 100, .82);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(203, 63, 51, .96), rgba(13, 43, 87, .96));
  color: var(--text);
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .58);
}

.playOverlayButton[hidden] {
  display: none;
}

.playOverlayButton strong,
.playOverlayButton span {
  display: block;
}

.playOverlayButton strong {
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.05;
}

.playOverlayButton span {
  margin-top: 8px;
  color: rgba(255, 248, 240, .84);
  font-size: clamp(16px, 1.6vw, 22px);
}

.teeTicker,
.adTicker {
  position: absolute;
  z-index: 8;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid rgba(241, 221, 179, .34);
  border-radius: 6px;
  background: rgba(5, 14, 29, .88);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .36);
  overflow: hidden;
}

.teeTicker {
  top: 14px;
  bottom: auto;
  border-color: rgba(56, 189, 248, .34);
  background: rgba(8, 27, 54, .88);
}

.teeTicker[hidden],
.adTicker[hidden] {
  display: none;
}

.teeTickerViewport,
.adTickerViewport {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.teeTickerTrack,
.adTickerTrack {
  --ad-duration: 32s;
  display: inline-flex;
  align-items: center;
  width: max-content;
  animation: tickerScroll var(--ad-duration) linear infinite;
}

.teeTickerItem,
.adTickerItem {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 34px;
  color: var(--text);
  font-weight: 700;
}

.teeTickerItem strong,
.adTickerItem strong {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 12px;
}

.teeTickerItem strong {
  color: #7dd3fc;
}

.teeTickerItem span,
.adTickerItem span {
  color: rgba(255, 248, 240, .88);
}

.teeTickerItem em {
  color: var(--muted);
  font-style: normal;
  font-weight: 600;
}

.teeTickerHide,
.adTickerHide {
  min-height: 44px;
  margin-right: 6px;
  padding: 7px 12px;
}

.tickerRestoreControls {
  position: absolute;
  z-index: 9;
  left: 14px;
  top: 72px;
  display: grid;
  gap: 8px;
  width: min(260px, calc(100% - 28px));
  pointer-events: none;
}

.tickerRestoreControls[hidden] {
  display: none;
}

.tickerRestoreControls button {
  justify-self: start;
  min-height: 52px;
  padding: 12px 16px;
  border-color: rgba(241, 221, 179, .38);
  background: rgba(17, 22, 29, .94);
  pointer-events: auto;
}

@keyframes tickerScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.resizeHandle {
  position: absolute;
  z-index: 6;
  background: transparent;
  touch-action: none;
}

.resizeHandle::after {
  content: "";
  position: absolute;
  opacity: 0;
  transition: opacity .12s ease;
  background: rgba(241, 221, 179, .82);
}

.videoWrap:hover .resizeHandle::after,
.resizeHandle.active::after {
  opacity: 1;
}

.resizeHandleRight {
  top: 0;
  right: 0;
  width: 12px;
  height: 100%;
  cursor: ew-resize;
}

.resizeHandleRight::after {
  top: 0;
  right: 0;
  width: 2px;
  height: 100%;
}

.resizeHandleBottom {
  left: 0;
  bottom: 0;
  width: 100%;
  height: 12px;
  cursor: ns-resize;
}

.resizeHandleBottom::after {
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
}

.resizeHandleCorner {
  right: 0;
  bottom: 0;
  width: 24px;
  height: 24px;
  cursor: nwse-resize;
}

.resizeHandleCorner::after {
  right: 5px;
  bottom: 5px;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(241, 221, 179, .88);
  border-bottom: 2px solid rgba(241, 221, 179, .88);
  background: transparent;
}

.nowBar {
  min-height: 0;
  overflow: auto;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  display: grid;
  grid-row: 1;
  grid-template-columns: 44px 62px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.playerSection.nowBarHidden .nowBar {
  display: none;
}

.playerSection.nowBarCollapsed .nowBar {
  overflow: hidden;
  padding: 6px 12px;
  grid-template-columns: 44px minmax(0, 1fr);
}

.nowBarToggle {
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.playerSection.nowBarCollapsed #currentLogo,
.playerSection.nowBarCollapsed #currentMeta,
.playerSection.nowBarCollapsed #currentProgram,
.playerSection.nowBarCollapsed #streamMessage,
.playerSection.nowBarCollapsed .playerControls {
  display: none;
}

.showNowBarButton {
  position: absolute;
  z-index: 6;
  top: 10px;
  right: 12px;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(17, 22, 29, .92);
  color: var(--text);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
}

.showGuideButton {
  position: absolute;
  z-index: 7;
  left: 14px;
  bottom: 14px;
  min-height: 52px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(17, 22, 29, .92);
  color: var(--text);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
}

.appShell.tvMode .showGuideButton {
  display: none;
}

.tvModeControls {
  position: absolute;
  z-index: 8;
  right: 14px;
  bottom: 14px;
  display: grid;
  grid-template-columns: auto 92px auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 8px;
  background: rgba(10, 14, 20, .84);
  box-shadow: 0 14px 36px rgba(0, 0, 0, .42);
  backdrop-filter: blur(8px);
}

.tvModeControls[hidden] {
  display: none;
}

.tvModeControls button,
.tvModeControls input {
  min-height: 44px;
}

.tvModeControls input {
  width: 92px;
  text-align: center;
}

#currentLogo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  border-radius: 8px;
  background: rgba(255, 251, 245, .92);
  border: 1px solid var(--line);
}

.nowText {
  min-width: 0;
}

.playerSection.nowBarCollapsed .nowText {
  align-self: center;
}

.channelKicker {
  display: flex;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.nowBar h2 {
  font-size: 19px;
}

.nowBar p {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#streamHealth[data-state="ok"] { color: var(--accent); }
#streamHealth[data-state="warn"] { color: var(--warn); }
#streamHealth[data-state="error"] { color: var(--danger); }

.playerControls {
  grid-column: auto;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
  min-width: 590px;
  margin-top: 0;
}

.castLauncher {
  width: 100%;
  min-height: 36px;
  display: grid;
  place-items: center;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(135deg, rgba(203, 63, 51, .88), rgba(150, 42, 36, .9));
  box-shadow: 0 10px 22px rgba(8, 27, 54, .18);
  cursor: pointer;
  --connected-color: var(--accent);
  --disconnected-color: var(--text);
}

.castLauncher:hover {
  border-color: rgba(241, 221, 179, .52);
  background: linear-gradient(135deg, #d64a3e, #a9312a);
}

.castLauncher[hidden] {
  display: none;
}

.tournamentDashboard:fullscreen {
  padding: 30px;
  background:
    linear-gradient(140deg, rgba(8, 27, 54, .95), rgba(13, 43, 87, .9) 48%, rgba(25, 70, 52, .84)),
    var(--course-dashboard-bg) center center / cover no-repeat;
}

.streamMessage {
  min-height: 18px;
  color: var(--warn);
  overflow-wrap: anywhere;
}

.streamMessage[data-kind="ok"] { color: var(--accent); }
.streamMessage[data-kind="error"] { color: var(--danger); }

.contentSection {
  position: relative;
  z-index: 0;
  min-height: 0;
  overflow: hidden;
  contain: layout paint;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  background: linear-gradient(180deg, rgba(13, 43, 87, .9), rgba(8, 27, 54, .92));
}

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

.sectionHeader {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.sectionHeader.compact {
  min-height: 48px;
  padding: 10px 12px;
}

.epgSummary {
  color: var(--muted);
  font-size: 13px;
}

.contentTabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: rgba(241, 221, 179, .16);
}

.contentTab {
  min-height: 42px;
  border: 0;
  border-radius: 0;
  background: rgba(5, 14, 29, .72);
  box-shadow: none;
  font-weight: 800;
}

.contentTab.active {
  background: linear-gradient(135deg, rgba(203, 63, 51, .82), rgba(45, 109, 78, .78));
  color: #fff;
}

.contentPanel {
  min-height: 0;
  overflow: auto;
}

.channelList {
  position: relative;
  overflow: auto;
  min-height: 0;
  contain: layout paint;
}

.channelSpacer {
  position: relative;
  min-height: 100%;
}

.channelRow {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--row-h);
  display: grid;
  grid-template-columns: 68px 52px minmax(220px, 1.1fr) minmax(230px, 1.25fr) 128px 44px;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(241, 221, 179, .14);
  cursor: pointer;
}

.channelRow:hover,
.channelRow[aria-selected="true"],
.channelRow:focus {
  background: linear-gradient(135deg, rgba(203, 63, 51, .18), rgba(45, 109, 78, .18));
}

.channelRow.selectedFocus,
.channelRow:focus {
  outline: 4px solid var(--warn);
  outline-offset: -4px;
  box-shadow: inset 0 0 0 2px rgba(255, 248, 240, .25), 0 10px 30px rgba(0, 0, 0, .32);
}

.channelNumber {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.channelLogo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(255, 251, 245, .92);
  border: 1px solid rgba(241, 221, 179, .34);
}

.channelName,
.programTitle,
.metaText {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.channelName {
  font-weight: 700;
  font-size: 17px;
}

.metaText {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.programTitle.noData {
  color: rgba(255, 248, 240, .45);
}

.streamState {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.streamState.failed {
  color: var(--danger);
}

.favoriteButton {
  width: 44px;
  min-height: 44px;
  border-radius: 6px;
  padding: 0;
  font-size: 22px;
  color: rgba(255, 248, 240, .46);
  background: rgba(5, 14, 29, .5);
}

.favoriteButton.active {
  color: var(--warn);
}

.guidePanel {
  position: relative;
  width: auto;
  max-height: none;
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: linear-gradient(180deg, rgba(13, 43, 87, .96), rgba(8, 27, 54, .96));
  box-shadow: none;
  z-index: auto;
}

.guideRow {
  display: grid;
  grid-template-columns: 74px minmax(180px, .85fr) minmax(220px, 1fr) minmax(220px, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid rgba(241, 221, 179, .14);
  align-items: center;
}

.guideRow > div {
  min-width: 0;
}

.adminPanel,
.adsPanel {
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 14px;
}

.adminPanel[hidden],
.adsPanel[hidden] {
  display: none;
}

.toolPanel,
.adForm,
.adTools,
.adRow {
  border: 1px solid rgba(241, 221, 179, .18);
  border-radius: 8px;
  background: rgba(5, 14, 29, .42);
}

.toolPanel {
  padding: 14px;
}

.toolPanel h3 {
  margin: 0 0 12px;
  font-size: 16px;
}

.adminGrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.adminGrid div {
  min-width: 0;
  padding: 10px;
  border-radius: 6px;
  background: rgba(255, 251, 245, .06);
}

.adminGrid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.adminGrid strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adminActions,
.adTools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.adForm {
  display: grid;
  grid-template-columns: minmax(180px, .8fr) minmax(240px, 1.2fr) auto auto;
  align-items: end;
  gap: 10px;
  padding: 12px;
}

.checkLine {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--text);
  font-size: 13px;
}

.checkLine input {
  width: auto;
  min-height: 0;
}

.adTools {
  margin-top: 0;
  padding: 10px 12px;
  justify-content: space-between;
}

.adRows {
  display: grid;
  gap: 10px;
}

.adRow {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.adRowText {
  min-width: 0;
}

.adRowText strong,
.adRowText span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adRowText span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.emptyState {
  padding: 18px;
  color: var(--muted);
  border: 1px dashed rgba(241, 221, 179, .2);
  border-radius: 8px;
}

.loadingOverlay {
  padding: 24px;
  color: var(--muted);
}

@media (max-width: 760px) {
  html {
    overflow-x: hidden;
  }

  body {
    min-width: 0;
    width: 100%;
    height: auto;
    min-height: 100dvh;
    overflow: auto;
    overflow-x: hidden;
  }

  .appShell {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 100dvh;
    width: 100%;
    overflow-x: hidden;
  }

  .main {
    order: 1;
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
    width: 100%;
  }

  .playerSection {
    display: block;
    height: auto;
    min-height: 0;
    overflow: visible;
    border-bottom: 1px solid var(--line);
    width: 100%;
  }

  .videoWrap {
    width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: 16 / 9;
  }

  .resizeHandle {
    display: none;
  }

  .tournamentDashboard {
    position: relative;
    min-height: 280px;
    padding: 14px;
  }

  .tournamentHero,
  .tournamentChannelRail,
  .tournamentGrid,
  .tournamentDisplaySections {
    grid-template-columns: 1fr;
  }

  .registrationHero,
  .registrationGrid {
    grid-template-columns: 1fr;
  }

  .leaderboardRow {
    grid-template-columns: 44px minmax(0, 1fr) 84px;
  }

  .leaderboardRow > span:nth-child(3) {
    display: none;
  }

  .tournamentStats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contestStats,
  .contestBoardGrid {
    grid-template-columns: 1fr;
  }

  .registrationQr img {
    width: 180px;
    height: 180px;
  }

  .nowBar {
    display: grid;
    grid-template-columns: 36px 52px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border-left: 0;
    border-top: 1px solid var(--line);
    border-bottom: 0;
    overflow: visible;
  }

  #currentLogo {
    width: 52px;
    height: 52px;
  }

  .nowBar h2 {
    font-size: 16px;
  }

  .playerControls {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
    margin-top: 4px;
  }

  .playerSection.nowBarCollapsed .nowBar {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .playerControls button,
  .castLauncher {
    min-height: 40px;
    padding: 6px;
  }

  .contentSection {
    display: block;
    overflow: visible;
  }

  .contentTabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .contentTab {
    min-height: 40px;
    padding: 6px;
    font-size: 13px;
  }

  .sectionHeader {
    min-height: 54px;
    padding: 10px 12px;
    align-items: flex-start;
    gap: 10px;
  }

  .sectionHeader h2 {
    font-size: 17px;
  }

  .epgSummary {
    max-width: 46%;
    text-align: right;
    font-size: 11px;
    line-height: 1.3;
  }

  .channelList {
    height: 52dvh;
    min-height: 330px;
    border-bottom: 1px solid var(--line);
  }

  .channelRow {
    grid-template-columns: 42px 38px minmax(0, 1fr) 34px;
    gap: 8px;
    padding: 8px 10px;
  }

  .channelRow > div:nth-of-type(3),
  .streamState {
    display: none;
  }

  .channelLogo {
    width: 34px;
    height: 34px;
  }

  .channelName {
    font-size: 14px;
  }

  .programTitle {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .favoriteButton {
    width: 32px;
    min-height: 32px;
  }

  .sidebar {
    order: 2;
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 14px;
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .brand {
    display: none;
  }

  .filterGrid {
    grid-template-columns: 1fr 1fr;
  }

  .toggles {
    grid-template-columns: 1fr 1fr;
  }

  .guidePanel {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-height: none;
  }

  .guideRow {
    grid-template-columns: 50px minmax(0, .9fr) minmax(0, 1fr);
    gap: 8px;
  }

  .guideRow > div:nth-child(4) {
    display: none;
  }

  .adminGrid,
  .adForm,
  .adRow {
    grid-template-columns: 1fr;
  }

  .adTools {
    display: grid;
    justify-content: stretch;
  }

  .teeTicker,
  .adTicker {
    left: 8px;
    right: 8px;
    grid-template-columns: minmax(0, 1fr);
  }

  .teeTicker {
    top: 8px;
  }

  .adTicker {
    bottom: 8px;
  }

  .teeTickerHide,
  .adTickerHide {
    position: absolute;
    right: 5px;
    top: 5px;
  }

  .tickerRestoreControls {
    left: 8px;
    top: 62px;
    width: min(240px, calc(100% - 16px));
  }
}

@media (max-width: 430px) {
  .filterGrid,
  .toggles,
  .buttonRow {
    grid-template-columns: 1fr;
  }

  .contentTabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .epgSummary {
    display: none;
  }

  .channelRow {
    grid-template-columns: 42px 38px minmax(0, 1fr) 34px;
  }
}

@media (max-width: 1280px) {
  body { min-width: 980px; }
  .appShell { grid-template-columns: 300px minmax(680px, 1fr); }
  .playerSection { grid-template-columns: minmax(450px, 1fr); }
  .playerControls { min-width: 400px; }
  .channelRow { grid-template-columns: 58px 48px minmax(190px, 1fr) minmax(180px, 1fr) 92px 38px; }
  .guidePanel { width: min(760px, calc(100vw - 330px)); }
}

@media (max-width: 760px) {
  body {
    min-width: 0;
  }

  .appShell,
  .main,
  .playerSection,
  .videoWrap,
  .nowBar,
  .contentSection,
  .sidebar {
    width: 100%;
  }

  .appShell {
    grid-template-columns: none;
  }

  .playerSection {
    grid-template-columns: none;
  }

  .channelRow {
    grid-template-columns: 42px 38px minmax(0, 1fr) 34px;
  }

  .guidePanel {
    width: auto;
  }
}

@media (max-width: 760px) {
  .playerControls {
    min-width: 0;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .playerControls button,
  .castLauncher {
    min-width: 0;
    min-height: 44px;
    padding: 8px 6px;
    font-size: 13px;
  }

  #fullscreenButton {
    display: block;
  }

  .showNowBarButton,
  .showGuideButton {
    position: fixed;
    z-index: 95;
    min-height: 48px;
    padding: 10px 14px;
    font-size: 14px;
  }

  .showNowBarButton {
    top: auto;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .showGuideButton {
    left: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .brand {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px;
    align-items: center;
  }

  .brandMark {
    display: none;
  }

  .sidebarToggle {
    width: 64px;
    min-width: 64px;
    min-height: 48px;
  }

  .appShell.sidebarCollapsed .sidebar {
    position: fixed;
    z-index: 96;
    top: calc(56px + env(safe-area-inset-top, 0px));
    left: 10px;
    width: auto;
    height: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .appShell.sidebarCollapsed .brand {
    display: block;
    width: auto;
    padding: 0;
  }

  .appShell.sidebarCollapsed .sidebarToggle {
    width: auto;
    min-width: 64px;
    padding: 0 12px;
  }
}
