:root {
  --present-bg: #0b1020;
  --present-panel: #111827;
  --present-panel-soft: #172033;
  --present-line: rgba(255, 255, 255, .12);
  --present-text: #f8fafc;
  --present-muted: #94a3b8;
  --present-accent: #22c55e;
  --present-blue: #38bdf8;
  --present-red: #f87171;
}

* { box-sizing: border-box; }

* {
  scrollbar-width: none;
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body.presentation-page {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: var(--present-bg);
  color: var(--present-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.presentation-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 18px;
  gap: 14px;
}

.presentation-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 64px;
}

.presentation-brand {
  position: fixed;
  right: 24px;
  bottom: 20px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 132px;
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.presentation-brand img {
  width: 132px;
  height: auto;
  object-fit: contain;
}

.presentation-controls {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--present-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .05);
}

.presentation-controls label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--present-muted);
  font-size: 12px;
  font-weight: 700;
}

.presentation-controls select,
.presentation-controls input[type="number"],
.presentation-controls button {
  height: 36px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 6px;
  background: #0f172a;
  color: var(--present-text);
  font: inherit;
  font-weight: 700;
}

.presentation-controls select { padding: 0 28px 0 10px; }
.presentation-controls input[type="number"] { width: 72px; padding: 0 8px; }
.presentation-controls button { padding: 0 12px; cursor: pointer; }

.presentation-stage {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}

.presentation-main {
  min-height: 0;
  border: 1px solid var(--present-line);
  border-radius: 8px;
  background: var(--present-panel);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.presentation-main {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.presentation-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--present-line);
}

.phase-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, .14);
  color: #7dd3fc;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.presentation-panel-head h1 {
  margin: 6px 0 0;
  font-size: 32px;
  line-height: 1;
}

.presentation-clock {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: right;
  color: var(--present-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.presentation-clock strong {
  color: var(--present-text);
  font-size: 22px;
  letter-spacing: 0;
}

.presentation-content {
  min-height: 0;
  overflow: auto;
  padding: 18px 20px 150px;
}

.groups-tv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}

.tv-group,
.bracket-section {
  border: 1px solid var(--present-line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, .035);
}

.tv-group h3,
.bracket-section h3 {
  margin: 0;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .06);
  font-size: 18px;
}

.ranking-tv-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.ranking-tv-table th,
.ranking-tv-table td {
  padding: 10px 9px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  text-align: center;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.ranking-tv-table th {
  color: var(--present-muted);
  font-size: 12px;
  text-transform: uppercase;
}

.ranking-tv-table th:nth-child(2),
.ranking-tv-table td:nth-child(2) {
  width: 42%;
  text-align: left;
}

.rank-pos {
  width: 38px;
  color: var(--present-muted);
  font-weight: 900;
}

.team-inline {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
}

.team-inline img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

.team-inline span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pts-cell {
  color: #bbf7d0;
  font-weight: 900;
}

.bracket-tv {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.bracket-rounds {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 1fr);
  gap: 12px;
  align-items: start;
  overflow-x: auto;
  padding: 14px;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bracket-round-title {
  color: var(--present-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.tv-bracket-match {
  border: 1px solid rgba(255, 255, 255, .13);
  border-radius: 8px;
  background: #0f172a;
  overflow: hidden;
}

.tv-bracket-meta {
  padding: 7px 10px;
  color: var(--present-muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.tv-bracket-team {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.tv-bracket-team.winner {
  background: rgba(34, 197, 94, .12);
}

.tv-bracket-score {
  min-width: 32px;
  text-align: right;
  font-size: 20px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.match-section-label {
  margin: 7px 0 0;
  color: var(--present-muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.matches-tv-board {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.matches-tv-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.matches-tv-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tv-match-card {
  border: 1px solid var(--present-line);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  padding: 16px 18px;
}

.tv-match-card.is-live {
  border-color: rgba(248, 113, 113, .65);
  background: rgba(248, 113, 113, .09);
}

.tv-match-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--present-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.tv-match-teams {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(116px, auto) minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.tv-match-teams .team-inline {
  gap: 12px;
  font-size: 24px;
  line-height: 1.05;
}

.tv-match-teams .team-inline img {
  width: 50px;
  height: 50px;
}

.team-inline--right,
.tv-match-teams > .team-inline:last-child {
  justify-content: flex-end;
  text-align: right;
}

.team-inline--right span,
.tv-match-teams > .team-inline:last-child span {
  text-align: right;
}

.tv-match-score {
  min-width: 104px;
  text-align: center;
  color: var(--present-text);
  font-size: 36px;
  line-height: 1;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.tv-match-timer {
  margin-top: 10px;
  color: #fef3c7;
  font-size: 20px;
  font-weight: 900;
  text-align: center;
}

.empty-state {
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--present-muted);
  font-size: 22px;
  font-weight: 800;
}

body.presentation-fullscreen .presentation-shell {
  padding: 14px;
}

body.presentation-fullscreen .presentation-controls {
  opacity: 0;
  pointer-events: none;
}

body.presentation-fullscreen .presentation-brand {
  right: 18px;
  bottom: 14px;
}

body.presentation-fullscreen .presentation-brand img {
  width: 150px;
}

@media (max-width: 980px) {
  body.presentation-page { overflow: auto; }
  .presentation-shell { height: auto; min-height: 100vh; }
  .presentation-topbar,
  .presentation-stage {
    grid-template-columns: 1fr;
  }
  .presentation-controls { flex-wrap: wrap; }
  .presentation-stage { min-height: 900px; }
}
