:root {
  --bg: #070b12;
  --card: rgba(12, 18, 32, 0.82);
  --card-2: rgba(18, 28, 46, 0.88);
  --line: rgba(148, 163, 184, 0.14);
  --text: #e8eef9;
  --muted: #8b9bb4;
  --accent: #3ec6ff;
  --glow: rgba(62, 198, 255, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--text);
  background: #05080f;
}

.page-bg {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 8, 15, 0.72) 0%, rgba(5, 8, 15, 0.82) 45%, rgba(5, 8, 15, 0.9) 100%),
    url("/static/img/stadium.webp") center / cover no-repeat;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

/* —— Navbar: logo only —— */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(7, 11, 18, 0.72);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
}
.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}
.logo img {
  display: block;
  height: 40px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

/* —— Layout (YouTube-style desktop) —— */
.layout {
  position: relative;
  z-index: 1;
  max-width: 1480px;
  margin: 0 auto;
  padding: 20px 24px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 460px);
  grid-template-areas: "player side";
  gap: 16px;
  align-items: start;
}
.player-card { grid-area: player; }
.side-col {
  grid-area: side;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.player-card {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}
.stats-section {
  border-top: 1px solid var(--line);
  background: transparent;
}
.stats-toggle {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 44px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #0c1220;
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.stats-toggle:hover {
  background: #111a2c;
}
.stats-toggle-label {
  position: relative;
  display: inline-block;
}
.stats-toggle[aria-expanded="true"] .stats-toggle-label::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--glow);
}
.stats-toggle-chevron {
  position: absolute;
  right: 16px;
  top: 50%;
  flex-shrink: 0;
  color: var(--muted);
  transform: translateY(-50%);
  transition: transform 0.25s ease, color 0.2s ease;
}
.stats-toggle[aria-expanded="true"] .stats-toggle-chevron {
  transform: translateY(-50%) rotate(180deg);
  color: #fff;
}
.stats-list-wrap[hidden] {
  display: none !important;
}
/* PERTANDINGAN tembus ke background stadion */
.match-header {
  background: transparent !important;
  border: 0;
  box-shadow: none;
}

.player-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #05080f;
  display: grid;
  place-items: center;
}
.player-stage:fullscreen,
.player-stage:-webkit-full-screen {
  aspect-ratio: auto;
  width: 100vw;
  height: 100vh;
  max-width: 100vw;
  max-height: 100vh;
  overflow: hidden;
  background: #000;
}
.player-stage:fullscreen .home-video,
.player-stage:-webkit-full-screen .home-video,
.player-stage.is-native-fs .home-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.fs-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 5;
}

/* Shared icon button — crisp SVG on mobile & desktop */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #f1f1f1;
  cursor: pointer;
  line-height: 0;
  font-size: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  flex-shrink: 0;
}
.icon-btn svg {
  display: block;
  width: 18px;
  height: 18px;
  pointer-events: none;
}
.icon-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}
.fs-btn.icon-btn {
  background: rgba(0, 0, 0, 0.45);
}
.fs-btn.icon-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}
.fs-btn .icon-exit { display: none; }
.fs-btn.is-exit .icon-enter { display: none; }
.fs-btn.is-exit .icon-exit { display: block; }

.chat-fs-exit {
  display: none;
  background: rgba(255, 80, 80, 0.25);
  color: #fff;
}
.chat-fs-exit:hover { background: rgba(255, 80, 80, 0.45); }
.chat-min-btn {
  display: none;
  background: #272727;
}
.chat-min-btn:hover {
  background: #3a3a3a;
}
.chat-min-btn .icon-grow { display: none; }
.chat-min-btn.is-expanded .icon-shrink { display: none; }
.chat-min-btn.is-expanded .icon-grow { display: block; }

.viewer-overlay {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
  backdrop-filter: blur(2px);
}
.viewer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff0033;
  box-shadow: 0 0 8px rgba(255, 0, 51, 0.7);
  animation: pulse 1.4s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.chat-head-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.home-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  z-index: 1;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
.home-video[hidden] { display: none !important; }
.player-stage.is-live .countdown-wrap,
.player-stage.is-live .offline-wrap {
  display: none;
}
.offline-wrap,
.loading-wrap {
  text-align: center;
  padding: 24px 16px;
  z-index: 2;
}
.offline-wrap[hidden],
.loading-wrap[hidden] { display: none !important; }
.offline-title,
.loading-title {
  margin: 0 0 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}
.offline-sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}
.loading-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.player-stage .fs-btn,
.player-stage .viewer-overlay,
.player-stage .unmute-btn {
  z-index: 3;
}
.unmute-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  padding: 0;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.unmute-btn .unmute-icon {
  width: 28px;
  height: 28px;
  fill: currentColor;
  display: block;
}
.unmute-btn[hidden] { display: none !important; }
.unmute-btn:hover { background: rgba(0, 0, 0, 0.88); }

.tabs {
  display: flex;
  gap: 22px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(0,0,0,0.15);
}
.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 14px 2px;
  cursor: default;
  position: relative;
}
.tab.active { color: #fff; }
.tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  box-shadow: 0 0 10px var(--glow);
}

.match-header {
  background: transparent !important;
  border: 0;
  box-shadow: none;
  padding: 16px 12px 12px;
  margin: 0;
}
.match-title {
  margin: 0 0 14px;
  text-align: center;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}
.match-teams {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.match-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  width: 100%;
}
.match-side {
  display: flex;
  align-items: center;
  gap: 12px;
}
.score-slot {
  display: flex;
  align-items: center;
  justify-content: center;
}
.team-block .score,
.match-side .score {
  font-size: 1.6rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
  min-width: 1em;
  text-align: center;
  line-height: 1;
}
.team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
}
.flag {
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  object-fit: cover;
}
.vs {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.08em;
  line-height: 1;
  flex-shrink: 0;
}
.match-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--muted);
}
.match-time, .match-date { font-size: 12px; line-height: 1.2; }

/* Banner slot: below tanggal, above tab Statistik */
.match-banner {
  width: 100%;
  max-width: 100%;
  margin: 10px 0 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 8px;
  line-height: 0;
}
.match-banner:not([hidden]) {
  min-height: 50px;
}
.match-banner img,
.match-banner a,
.match-banner iframe {
  display: block;
  width: 100%;
  max-height: 70px;
  height: auto;
  object-fit: contain;
  border: 0;
  border-radius: 8px;
}
@media (min-width: 961px) {
  .match-banner:not([hidden]) {
    min-height: 60px;
  }
  .match-banner img,
  .match-banner a,
  .match-banner iframe {
    max-height: 80px;
  }
}

/* Desktop: bendera + nama (vertikal), jarak simetris kiri–kanan */
@media (min-width: 961px) {
  .match-row {
    display: grid;
    grid-template-columns: 1fr auto minmax(2.5rem, 1fr) auto minmax(2.5rem, 1fr) auto 1fr;
    align-items: center;
    gap: 0;
    width: 100%;
    padding: 0 8px;
  }
  .match-side {
    display: contents;
  }
  .match-side.home .team {
    grid-column: 2;
    justify-self: center;
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }
  .match-side.home .score-slot {
    grid-column: 3;
    justify-self: center;
    min-width: 2.5rem;
  }
  .match-row > .vs {
    grid-column: 4;
    padding: 0 12px;
    align-self: center;
  }
  .match-side.away .score-slot {
    grid-column: 5;
    justify-self: center;
    min-width: 2.5rem;
  }
  .match-side.away .team {
    grid-column: 6;
    justify-self: center;
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }
  .match-side .score {
    transform: translateY(-1px);
  }
}

.stats-list {
  background: #0f1626;
  border: 1px solid var(--line);
  border-radius: 0;
  overflow: hidden;
  margin: 0;
}
.stat-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 16px 12px;
  border-bottom: 1px solid var(--line);
  width: 100%;
  background: #0f1626;
}
.stat-row:last-child { border-bottom: 0; }
.stat-row:nth-child(even) { background: #121a2c; }
.stat-top {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 72px;
  gap: 8px;
  align-items: center;
  width: 100%;
}
.stat-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 14px;
}
.stat-val.left { text-align: left; color: #fff; }
.stat-val.right { text-align: right; color: #fff; }
.stat-name {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.stat-bar-track {
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}
.stat-bar-half {
  flex: 1;
  display: flex;
  height: 100%;
  min-width: 0;
}
.stat-bar-half--left {
  justify-content: flex-end;
}
.stat-bar-half--right {
  justify-content: flex-start;
}
.stat-bar-gap {
  flex: 0 0 3px;
  background: rgba(0, 0, 0, 0.35);
}
.stat-bar-fill {
  height: 100%;
  min-width: 0;
  transition: width 0.4s ease;
}
.stat-bar-fill--home {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.55), #ffffff);
  border-radius: 999px 0 0 999px;
}
.stat-bar-fill--away {
  background: linear-gradient(90deg, var(--accent), #2a9fd6);
  border-radius: 0 999px 999px 0;
  box-shadow: 0 0 10px rgba(62, 198, 255, 0.35);
}

.side-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(8px);
}
.side-card.match-card {
  padding: 14px 14px 16px;
  flex: 0 0 auto;
}
.side-card h3 {
  margin: 0 0 14px;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-align: center;
  line-height: 1.3;
}
.side-match {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  text-align: center;
  padding-top: 4px;
}
.side-match .team-block {
  gap: 14px;
}
.side-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.side-team img { border-radius: 3px; }
.side-vs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: var(--muted);
  font-size: 11px;
  min-width: 52px;
}
.side-vs strong { color: #fff; font-size: 16px; }

/* —— Live chat (YouTube-style, no XP / money / love) —— */
.chat-card {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-height: 0;
  background: #0f0f0f;
  border: 1px solid #272727;
  border-radius: 12px;
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.chat-card[hidden] {
  display: none !important;
}
.chat-messages-wrap {
  position: relative;
  flex: 0 0 auto;
  overflow: hidden;
  height: calc(15 * 34px);
  max-height: calc(15 * 34px);
  background: #0f0f0f;
}
.chat-poll-slot {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 4;
  pointer-events: none;
}
.chat-poll-slot:not([hidden]) {
  pointer-events: auto;
}
.chat-poll-slot[hidden] {
  display: block !important;
  visibility: hidden;
  pointer-events: none;
}
.chat-poll-sheet {
  background: linear-gradient(180deg, rgba(28, 28, 28, 0.98) 0%, rgba(16, 16, 16, 0.99) 100%);
  border: 1px solid rgba(62, 166, 255, 0.28);
  border-radius: 16px;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  padding: 12px 14px 14px;
  transform: translateY(calc(100% + 12px));
  will-change: transform;
  overflow: hidden;
}
.chat-poll-sheet.is-visible {
  transform: translateY(0);
}
.chat-poll-sheet.poll-enter {
  animation: pollSlideUp 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.chat-poll-sheet.poll-exit {
  animation: pollSlideDown 0.5s cubic-bezier(0.55, 0, 0.85, 0.36) forwards;
}
@keyframes pollSlideUp {
  from {
    transform: translateY(calc(100% + 12px));
    opacity: 0.65;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes pollSlideDown {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(calc(100% + 12px));
    opacity: 0.65;
  }
}
.chat-poll-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  color: #f1f1f1;
  line-height: 1.35;
  letter-spacing: 0.02em;
}
.chat-poll-title-icon {
  flex-shrink: 0;
  color: #aaaaaa;
}
.chat-poll-title-text {
  min-width: 0;
}
.chat-poll-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-poll-option {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.chat-poll-option.clickable {
  cursor: pointer;
}
.chat-poll-option.clickable:hover .chat-poll-label {
  color: #fff;
}
.chat-poll-label {
  font-size: 12px;
  font-weight: 600;
  color: #e8e8e8;
  line-height: 1.2;
}
.chat-poll-track {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-poll-pct {
  flex: 0 0 auto;
  min-width: 34px;
  font-size: 12px;
  font-weight: 700;
  color: #aaa;
  text-align: right;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.chat-poll-stat {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 32px;
  color: #aaaaaa;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}
.chat-poll-stat-avatar {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3f3f3f;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.chat-poll-stat-avatar svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}
.chat-poll-stat.is-mine .chat-poll-stat-avatar {
  background: rgba(0, 200, 83, 0.15);
}
.chat-poll-stat-count {
  font-variant-numeric: tabular-nums;
}
.chat-poll-stat.is-mine {
  color: #00c853;
}
.chat-poll-bar-wrap {
  flex: 1 1 auto;
  min-width: 0;
  height: 10px;
  background: #2a2a2a;
  border-radius: 999px;
  overflow: hidden;
}
.chat-poll-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  min-width: 0;
}
.chat-poll-option.voted .chat-poll-label {
  color: #fff;
}
.chat-poll-option.voted .chat-poll-pct {
  color: #fff;
}
.chat-poll-option.locked:not(.voted) {
  opacity: 0.82;
}
.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #272727;
  background: #0f0f0f;
}
.chat-top-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 0;
  background: transparent;
  color: #f1f1f1;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 4px 2px;
  cursor: default;
}
.chat-top-btn svg {
  display: block;
  flex-shrink: 0;
  opacity: 0.85;
}
.chat-you {
  font-weight: 400;
  font-size: 12px;
  color: #aaaaaa;
  white-space: nowrap;
}
.chat-messages {
  flex: 0 0 auto;
  height: 100%;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px 12px 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 8px; }
.chat-messages::-webkit-scrollbar-thumb {
  background: #aaaaaa55;
  border-radius: 8px;
}
.chat-msg {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 5px 4px;
  border-radius: 6px;
  min-height: 34px;
}
.chat-msg:hover { background: rgba(255,255,255,0.04); }
.chat-msg {
  position: relative;
}
.chat-msg--deleted .chat-text {
  color: #9aa8bc;
  font-style: italic;
}
.chat-msg--ban .chat-text--system {
  color: #ff8a8a;
  font-weight: 600;
}
.chat-msg--unban .chat-text--system {
  color: #7ddea0;
  font-weight: 600;
}
.chat-msg--sponsor .chat-user {
  color: #f7d479;
  font-weight: 700;
}
.chat-msg--sponsor .chat-text--sponsor {
  color: #f1f1f1;
}
.chat-msg--sponsor .chat-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}
.chat-sponsor-btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  padding: 7px 12px;
  border-radius: 999px;
  background: #2f7dde;
  color: #ffffff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #2f7dde;
}
.chat-sponsor-btn-link:hover {
  background: #3f8df0;
  border-color: #3f8df0;
  color: #ffffff;
}
.chat-mod-actions {
  display: none;
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  gap: 6px;
  align-items: flex-start;
}
.chat-msg:hover .chat-mod-actions {
  display: flex;
}
.chat-mod-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 0;
  background: rgba(0, 0, 0, 0.55);
  color: #e8edf5;
  border-radius: 8px;
  min-width: 42px;
  height: auto;
  padding: 5px 6px 4px;
  cursor: pointer;
  font: inherit;
  line-height: 1;
}
.chat-mod-btn-icon {
  display: grid;
  place-items: center;
  line-height: 0;
}
.chat-mod-btn-icon svg {
  display: block;
  width: 16px;
  height: 16px;
}
.chat-mod-btn-label {
  font-size: 9px;
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0.02em;
  color: #c5d0e0;
  white-space: nowrap;
}
.chat-mod-btn:hover { background: rgba(0, 0, 0, 0.8); }
.chat-mod-btn--ban .chat-mod-btn-icon,
.chat-mod-btn--ban .chat-mod-btn-label { color: #ff9e9e; }
.chat-mod-btn--ban:hover { background: rgba(180, 30, 30, 0.85); }
.chat-mod-btn--unban .chat-mod-btn-icon,
.chat-mod-btn--unban .chat-mod-btn-label { color: #8ddea8; }
.chat-mod-btn--unban:hover { background: rgba(30, 140, 70, 0.85); }
.chat-banned-note {
  margin: 0;
  padding: 10px 14px;
  text-align: center;
  color: #ff8a8a;
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 80, 80, 0.1);
  border-top: 1px solid rgba(255, 80, 80, 0.2);
}
.chat-banned-note[hidden] { display: none !important; }
.chat-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #3f3f3f;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.chat-avatar svg {
  width: 14px;
  height: 14px;
  fill: #bdbdbd;
}
.chat-body {
  min-width: 0;
  line-height: 1.35;
  font-size: 13px;
}
.chat-user {
  display: inline;
  font-size: 13px;
  font-weight: 500;
  color: #aaaaaa;
  margin-right: 6px;
  white-space: nowrap;
}
.chat-text {
  font-size: 13px;
  color: #f1f1f1;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.chat-link {
  color: #8ec9ff;
  text-decoration: underline;
}
.chat-link:hover {
  color: #b7ddff;
}
.chat-link--moderator {
  color: #ffd36b;
  text-decoration-color: #ffd36b;
  font-weight: 600;
}
.chat-link--moderator:hover {
  color: #ffe39a;
}
.chat-welcome {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 8px 12px 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #272727;
  color: #f1f1f1;
  font-size: 12px;
  line-height: 1.4;
}
.chat-welcome p { margin: 0; }
.chat-welcome-icon {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  background: #ff0033;
  color: #fff;
  font-size: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.chat-form {
  position: relative;
  padding: 10px 12px 12px;
  border-top: 1px solid #272727;
  background: #0f0f0f;
}
.chat-sponsor-panel {
  border-top: 1px solid #272727;
  background: #10131d;
  padding: 10px 12px;
}
.chat-sponsor-head {
  font-size: 12px;
  font-weight: 700;
  color: #ffd36b;
  margin-bottom: 8px;
}
.chat-sponsor-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-sponsor-row + .chat-sponsor-row {
  margin-top: 8px;
}
.chat-sponsor-panel input,
.chat-sponsor-panel select {
  background: #1d2232;
  border: 1px solid #323b56;
  color: #f1f1f1;
  border-radius: 8px;
  padding: 7px 9px;
  font: inherit;
  font-size: 12px;
  min-height: 34px;
}
.chat-sponsor-panel input[type="text"] {
  width: 100%;
}
.chat-sponsor-controls select {
  flex: 1;
}
.chat-sponsor-controls input[type="number"] {
  width: 74px;
}
.chat-sponsor-btn {
  border: 0;
  border-radius: 8px;
  background: #2f7dde;
  color: #fff;
  padding: 8px 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.chat-sponsor-btn:hover {
  background: #3d8df0;
}
.chat-sponsor-btn--stop {
  background: #5a2931;
}
.chat-sponsor-btn--stop:hover {
  background: #7a3741;
}
.chat-sponsor-note {
  margin: 8px 0 0;
  font-size: 11px;
  color: #9cb0d3;
}
.chat-compose,
.username-bar-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.chat-compose[hidden],
.username-bar[hidden] {
  display: none !important;
}
.username-bar-label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: #f1f1f1;
  background: none;
}
.username-bar-error {
  margin: 6px 0 0;
  color: #ff6b6b;
  font-size: 11px;
}
.chat-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #212121;
  border: 1px solid transparent;
  border-radius: 20px;
  padding: 2px 6px 2px 12px;
}
.chat-input-wrap:focus-within {
  border-color: #3ea6ff;
}
.chat-form input {
  flex: 1;
  border: 0;
  background: transparent;
  color: #f1f1f1;
  padding: 8px 4px;
  font: inherit;
  /* >=16px prevents mobile browser auto-zoom on focus */
  font-size: 16px;
  outline: none;
  min-width: 0;
}
.chat-form input::placeholder { color: #717171; }
.emoji-wrap { position: relative; }
.chat-emoji-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: 50%;
  background: transparent;
  color: #aaaaaa;
}
.chat-emoji-icon {
  width: 22px;
  height: 22px;
}
.chat-emoji-btn:hover,
.chat-emoji-btn.open {
  color: #f1f1f1;
  background: rgba(255, 255, 255, 0.08);
}
.emoji-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  width: 260px;
  max-height: 200px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 8px;
  background: #212121;
  border: 1px solid #3f3f3f;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  z-index: 20;
}
.emoji-panel[hidden] { display: none !important; }
.emoji-panel button {
  border: 0;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
}
.emoji-panel button:hover { background: rgba(255,255,255,0.1); }
.chat-send svg {
  display: block;
  width: 20px;
  height: 20px;
}

/* Mobile fullscreen rotate hint (portrait only) */
.fs-rotate-hint {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(0, 0, 0, 0.92);
  place-items: center;
  padding: 24px;
}
.fs-rotate-hint:not([hidden]) {
  display: grid;
}
.fs-rotate-inner {
  text-align: center;
  color: #fff;
  max-width: 280px;
}
.fs-rotate-inner svg {
  color: var(--accent);
  margin-bottom: 16px;
}
.fs-rotate-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
}
.fs-rotate-sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 14px;
}
.fs-rotate-exit {
  border: 0;
  border-radius: 999px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.chat-send {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: #3ea6ff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.chat-send:hover {
  background: none;
  color: #7cc4ff;
}
.chat-empty {
  color: #aaaaaa;
  font-size: 13px;
  text-align: center;
  padding: 24px 8px;
}

/* —— Mobile: video → PERTANDINGAN → livechat → stats full-bleed —— */
@media (max-width: 960px) {
  /* Stadium bg visible behind transparent match block */
  .page-bg {
    display: block;
    opacity: 0.5;
  }
  body { background: #05080f; }

  .nav {
    background: rgba(10, 14, 20, 0.88);
    backdrop-filter: blur(10px);
  }
  .nav-inner {
    max-width: none;
    padding: 10px 12px;
  }
  .logo img {
    height: 34px;
    max-width: 150px;
  }

  .layout {
    max-width: none;
    margin: 0;
    padding: 0;
    gap: 0;
    display: flex;
    flex-direction: column;
  }

  /* Flatten so we can reorder: stage, match, chat, stats */
  .player-card,
  .side-col {
    display: contents;
  }
  .match-card { display: none !important; }

  .player-stage {
    order: 1;
    width: 100%;
    border-radius: 0;
  }
  .match-header {
    order: 2;
    width: 100%;
    padding: 18px 12px 14px;
    background: transparent !important;
  }
  .chat-card {
    order: 3;
    width: 100%;
    flex: none;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    box-shadow: none;
    backdrop-filter: none;
    background: rgba(12, 18, 28, 0.72);
  }
  .stats-section {
    order: 4;
    width: 100%;
    margin: 0;
    padding: 0;
    border-top: 0;
    border-radius: 0;
  }

  .player-stage,
  .chat-card,
  .stats-section {
    border-left: 0;
    border-right: 0;
  }

  .chat-messages-wrap {
    height: calc(12 * 34px);
    max-height: calc(12 * 34px);
  }

  /* Stats full left-right, no side gap */
  .stats-toggle {
    padding: 14px 40px;
    background: #0c1220;
  }
  .stats-list {
    width: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
    border-top: 1px solid var(--line);
  }
  .stat-row {
    padding-left: 12px;
    padding-right: 12px;
    border-radius: 0;
  }

  /* Fullscreen mobile — split layout ONLY in landscape */
  body.is-fs {
    overflow: hidden;
    background: #000;
  }
  body.is-fs .page-bg,
  body.is-fs .nav,
  body.is-fs .match-header,
  body.is-fs .stats-section,
  body.is-fs .match-card {
    display: none !important;
  }

  /* Portrait: hide broken split, show rotate hint */
  body.is-fs.is-fs-portrait .layout {
    visibility: hidden;
    pointer-events: none;
  }
  body.is-fs.is-fs-portrait .fs-rotate-hint {
    display: grid;
  }

  /* Landscape: video left, chat right — full viewport */
  @media (orientation: landscape) {
    body.is-fs .layout {
      display: grid !important;
      grid-template-columns: 1fr min(300px, 36vw);
      grid-template-rows: 1fr;
      position: fixed;
      inset: 0;
      width: 100vw;
      height: 100vh;
      height: 100dvh;
      z-index: 9990;
      margin: 0;
      padding: 0;
      max-width: none;
    }
    body.is-fs .player-card {
      display: flex !important;
      flex-direction: column;
      position: relative !important;
      grid-column: 1;
      grid-row: 1;
      min-width: 0;
      min-height: 0;
      width: 100%;
      height: 100%;
      border: 0;
      border-radius: 0;
      background: #000;
      overflow: hidden;
    }
    body.is-fs .side-col {
      display: flex !important;
      flex-direction: column;
      position: relative !important;
      grid-column: 2;
      grid-row: 1;
      min-width: 0;
      min-height: 0;
      width: 100%;
      height: 100%;
      margin: 0;
      padding: 0;
    }
    body.is-fs .player-stage {
      position: relative !important;
      flex: 1;
      width: 100% !important;
      height: 100% !important;
      min-height: 0;
      right: auto !important;
      left: auto !important;
      top: auto !important;
      bottom: auto !important;
      aspect-ratio: auto;
      order: unset;
    }
    body.is-fs .chat-card {
      position: relative !important;
      flex: 1;
      display: flex;
      flex-direction: column;
      width: 100% !important;
      height: 100% !important;
      min-height: 0;
      order: unset;
      border: 0;
      border-left: 1px solid #272727;
      border-radius: 0;
      background: #0f0f0f;
    }
    body.is-fs .chat-messages {
      flex: 1;
      height: auto !important;
      max-height: none !important;
      min-height: 0;
    }
    body.is-fs .chat-min-btn,
    body.is-fs .chat-fs-exit {
      display: inline-grid !important;
      place-items: center;
    }
    body.is-fs.fs-chat-min .layout {
      grid-template-columns: 1fr 44px;
    }
    body.is-fs .chat-card.fs-minimized {
      width: 100%;
    }
    body.is-fs .chat-card.fs-minimized .chat-messages,
    body.is-fs .chat-card.fs-minimized .chat-form,
    body.is-fs .chat-card.fs-minimized .chat-you,
    body.is-fs .chat-card.fs-minimized .chat-top-btn,
    body.is-fs .chat-card.fs-minimized .chat-fs-exit {
      display: none !important;
    }
    body.is-fs .chat-card.fs-minimized .chat-head {
      justify-content: center;
      padding: 10px 4px;
      border-bottom: 0;
      flex: 1;
    }
    body.is-fs .chat-card.fs-minimized .chat-min-btn {
      transform: none;
    }
    body.is-fs .fs-btn {
      display: none;
    }
    body.is-fs .viewer-overlay {
      font-size: 12px;
      padding: 6px 10px;
    }
  }
}
