@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

* { box-sizing: border-box; }
html {
  /* Keep document scrollable on mobile (avoid clipped stream cards / Watch links). */
  height: auto;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-color: #414868 #16161e;
  scrollbar-width: thin;
}
html::-webkit-scrollbar {
  width: 12px;
}
html::-webkit-scrollbar-track {
  background: #16161e;
}
html::-webkit-scrollbar-thumb {
  background: #414868;
  border: 3px solid #16161e;
  border-radius: 999px;
}
html::-webkit-scrollbar-thumb:hover {
  background: #565f89;
}
body {
  font-family: Poppins, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  margin: 0;
  padding: 0;
  min-height: 100%;
  width: 100%;
  max-width: 100%;
  background: #1a1b26;
  color: #c0caf5;
  line-height: 1.4;
  overflow-x: hidden;
  overflow-x: clip;
  overflow-y: visible;
}
header {
  padding: 1rem 1.25rem;
  background: #16161e;
  border-bottom: 1px solid #292e42;
}
.mobile-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.mobile-header-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
}
.mobile-header-row h1 {
  margin: 0;
  font-size: clamp(0.72rem, 3.8vw, 1.35rem);
  line-height: 1.1;
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile .mobile-header-row {
  justify-content: center;
}
.mobile .mobile-header-brand {
  flex: 0 1 auto;
  justify-content: center;
}
.conn-status {
  position: relative;
  flex-shrink: 0;
  width: 1.35rem;
  height: 1.35rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f7768e;
  cursor: default;
}
.conn-status .conn-icon {
  position: absolute;
  width: 1.35rem;
  height: 1.35rem;
  display: none;
  fill: currentColor;
}
.conn-status.connected { color: #9ece6a; }
.conn-status.waiting { color: #e0af68; }
.conn-status.reconnecting { color: #e0af68; }
.conn-status.disconnected { color: #f7768e; }
.conn-status.connected .conn-icon-connected,
.conn-status.waiting .conn-icon-waiting,
.conn-status.reconnecting .conn-icon-waiting,
.conn-status.disconnected .conn-icon-disconnected {
  display: block;
}
.mobile-header-row .btn { margin: 0; flex-shrink: 0; font-size: 0.85rem; padding: 0.4rem 0.75rem; }
h1 { margin: 0 0 0.25rem; font-size: 1.35rem; }
.subtitle { margin: 0; opacity: 0.75; font-size: 0.9rem; }
main { padding: 1rem 1.25rem; max-width: 720px; margin: 0 auto; }
.hidden { display: none !important; }
.app-boot {
  min-height: 12rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-align: center;
}
.app-boot-mark {
  width: 2.75rem;
  height: 2.75rem;
  object-fit: contain;
}
.app-boot-spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid rgba(155, 92, 255, 0.24);
  border-top-color: #9b5cff;
  border-radius: 50%;
  animation: app-boot-spin 0.8s linear infinite;
}
.app-boot p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.85;
}
@keyframes app-boot-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .app-boot-spinner {
    animation: none;
    border-top-color: #2f80ff;
  }
}
.btn {
  background: #414868;
  color: #c0caf5;
  border: none;
  padding: 0.55rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  margin: 0.25rem 0;
  text-decoration: none;
}
a.btn,
a.btn:link,
a.btn:visited,
a.btn:hover,
a.btn:active,
a.btn:focus {
  text-decoration: none;
}
.btn.primary { background: #7aa2f7; color: #1a1b26; font-weight: 600; }
.btn.block { display: block; width: 100%; }
.btn.danger { background: #f7768e; color: #1a1b26; }
.btn.info {
  background: #7aa2f7;
  color: #1a1b26;
}
.btn.success,
.btn.save {
  background: #9ece6a;
  color: #1a1b26;
  font-weight: 600;
}
.btn.cancel {
  background: #414868;
  color: #f7768e;
  border: 1px solid rgba(247, 118, 142, 0.45);
}
.btn.cancel:hover {
  background: rgba(247, 118, 142, 0.16);
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.monitor-active { background: #f7768e; color: #1a1b26; font-weight: 600; }
.btn.replay-active {
  background: rgba(65, 72, 104, 0.78);
  color: #e0af68;
  font-weight: 700;
  border-color: rgba(224, 175, 104, 0.55);
  letter-spacing: 0.02em;
}
.btn.replay-active:disabled {
  opacity: 1;
  cursor: not-allowed;
  box-shadow: none;
}
.btn.stream-active { background: #f7768e; color: #1a1b26; font-weight: 600; }
.btn.stats-active {
  background: #7aa2f7;
  color: #1a1b26;
  font-weight: 600;
  opacity: 1;
  border-color: rgba(122, 162, 247, 0.85);
}
.btn.stats-inactive {
  background: rgba(36, 40, 59, 0.72);
  color: #565f89;
  border-color: rgba(86, 95, 137, 0.35);
  opacity: 0.72;
  font-weight: 500;
}
.btn.stats-inactive:hover {
  opacity: 0.95;
  color: #a9b1d6;
  border-color: rgba(169, 177, 214, 0.45);
}
body.dashboard-page {
  --dashboard-purple: #9b5cff;
  --dashboard-blue: #2f80ff;
  --dashboard-button: #1b2035;
  --dashboard-button-border: #414b70;
}
body.dashboard-page .btn {
  background: linear-gradient(145deg, rgba(155, 92, 255, 0.11), rgba(47, 128, 255, 0.05)), var(--dashboard-button);
  color: #eef0ff;
  border: 1px solid var(--dashboard-button-border);
  border-radius: 10px;
  box-shadow: 0 0.3rem 0.9rem rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
body.dashboard-page .btn:hover:not(:disabled) {
  border-color: rgba(155, 92, 255, 0.8);
  box-shadow: 0 0.4rem 1.1rem rgba(92, 54, 170, 0.24);
  transform: translateY(-1px);
}
body.dashboard-page .btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 0.15rem 0.45rem rgba(0, 0, 0, 0.24);
}
body.dashboard-page .btn:focus-visible,
body.dashboard-page button:focus-visible {
  outline: 2px solid #b98cff;
  outline-offset: 2px;
}
body.dashboard-page .btn.primary {
  background: linear-gradient(135deg, var(--dashboard-purple), var(--dashboard-blue));
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}
body.dashboard-page .btn.secondary {
  background: rgba(30, 34, 55, 0.9);
  color: #ddd5ff;
  border-color: rgba(155, 92, 255, 0.38);
}
body.dashboard-page .btn.selected,
body.dashboard-page .btn.stats-active {
  background: rgba(155, 92, 255, 0.2);
  color: #f4efff;
  border-color: var(--dashboard-purple);
  outline-color: var(--dashboard-purple);
}
body.dashboard-page .btn.danger,
body.dashboard-page .btn.monitor-active,
body.dashboard-page .btn.stream-active {
  background: rgba(255, 107, 133, 0.14);
  color: #ffdce3;
  border-color: rgba(255, 107, 133, 0.65);
}
body.dashboard-page .btn.info {
  background: rgba(122, 162, 247, 0.14);
  color: #d7e3ff;
  border-color: rgba(122, 162, 247, 0.65);
}
body.dashboard-page .btn.success,
body.dashboard-page .btn.save {
  background: rgba(66, 221, 139, 0.15);
  color: #caffdf;
  border-color: rgba(66, 221, 139, 0.62);
}
body.dashboard-page .btn.cancel {
  background: rgba(255, 107, 133, 0.08);
  color: #ffc1cc;
  border-color: rgba(255, 107, 133, 0.46);
}
body.dashboard-page .dash-tab {
  background: transparent;
  color: #98a6c7;
  border: 1px solid transparent;
}
body.dashboard-page .dash-tab:hover {
  color: #f2f4ff;
  background: #121d33;
  border-color: #263552;
}
body.dashboard-page .dash-tab.active {
  background: linear-gradient(135deg, rgba(47, 128, 255, 0.26), rgba(155, 92, 255, 0.22));
  color: #fff;
  border-color: #2f80ff;
  outline: none;
  box-shadow: inset 0 -2px 0 var(--dashboard-purple);
}
body.dashboard-page .dash-tab.active .dash-tab-icon {
  color: #fff;
}
body.dashboard-page .stats-subtab {
  background: #1b2035;
  color: #d3d6eb;
  border: 1px solid #414b70;
  border-radius: 10px;
  box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
body.dashboard-page .stats-subtab:hover:not(:disabled) {
  color: #f2edff;
  border-color: rgba(155, 92, 255, 0.72);
  transform: translateY(-1px);
}
body.dashboard-page .stats-subtab.active {
  background: linear-gradient(135deg, var(--dashboard-purple), var(--dashboard-blue));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0.4rem 1rem rgba(92, 54, 170, 0.26);
}
body.landing-home,
body.streams-page {
  --public-purple: #9b5cff;
  --public-blue: #2f80ff;
  --public-button: #1b2035;
  --public-button-border: #414b70;
}
body.landing-home .btn,
body.streams-page .btn {
  background: linear-gradient(145deg, rgba(155, 92, 255, 0.11), rgba(47, 128, 255, 0.05)), var(--public-button);
  color: #eef0ff;
  border: 1px solid var(--public-button-border);
  border-radius: 10px;
  box-shadow: 0 0.3rem 0.9rem rgba(0, 0, 0, 0.2);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
body.landing-home .btn:hover,
body.streams-page .btn:hover {
  color: #fff;
  border-color: rgba(155, 92, 255, 0.8);
  box-shadow: 0 0.4rem 1.1rem rgba(92, 54, 170, 0.24);
  transform: translateY(-1px);
}
body.landing-home .btn:active,
body.streams-page .btn:active {
  transform: translateY(0);
}
body.landing-home .btn:focus-visible,
body.streams-page .btn:focus-visible {
  outline: 2px solid #b98cff;
  outline-offset: 2px;
}
body.landing-home .btn.primary,
body.streams-page .btn.primary {
  background: linear-gradient(135deg, var(--public-purple), var(--public-blue));
  color: #fff;
  border-color: transparent;
  font-weight: 700;
}
body.landing-home .btn.secondary,
body.streams-page .btn.secondary {
  background: rgba(30, 34, 55, 0.9);
  color: #ddd5ff;
  border-color: rgba(155, 92, 255, 0.38);
}
.stream-section {
  margin-top: 0.35rem;
  padding: 0.75rem;
}
.stream-section .share-links-heading { margin-top: 0.75rem; }
.stream-stats-mode-row {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
}
.stream-stats-mode-row > .btn {
  width: 100%;
  box-sizing: border-box;
}
#streamStatsSection.stream-stats-disabled {
  opacity: 0.55;
}
#streamStatsSection.stream-stats-disabled .hint {
  opacity: 1;
}
.stream-stats-panel {
  margin: 0.65rem 0 0.25rem;
  padding: 0.75rem 0.85rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}
.stream-stats-title {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  color: #c0caf5;
}
.stream-stats-title.stream-stats-player-name {
  font-size: 1.2rem;
  letter-spacing: 0.01em;
}
.stream-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.stream-stats-table th,
.stream-stats-table td {
  padding: 0.35rem 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.stream-stats-table thead th {
  color: #a9b1d6;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.stream-stats-row-even td { background: rgba(255, 255, 255, 0.02); }
.stream-stats-row-odd td { background: transparent; }
.stream-stats-h2h-table .stream-stats-col-player {
  text-align: center;
  width: 28%;
}
.stream-stats-h2h-table .stream-stats-col-label {
  text-align: center;
  color: #a9b1d6;
  font-size: 0.82rem;
}
.stream-stats-h2h-table .stream-stats-col-value {
  text-align: center;
  font-weight: 700;
  color: #c0caf5;
}
.stream-stats-player-table .stream-stats-col-label {
  text-align: left;
  color: #a9b1d6;
}
.stream-stats-player-table .stream-stats-col-value {
  text-align: right;
  font-weight: 700;
  color: #c0caf5;
}
.stream-stats-col-value.stream-stats-danger { color: #f7768e; }
.stream-stats-col-value.stream-stats-safe { color: #9ece6a; }
.stream-stats-empty {
  text-align: center;
  color: #a9b1d6;
  padding: 0.5rem 0.25rem;
  font-size: 0.9rem;
}
.row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0; }
.row.clips {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
}
.row.clips > .btn {
  width: 100%;
  /* Match .clip-wrap height (play button stretched to side controls) */
  min-height: calc(1.25rem + 1.1rem);
  box-sizing: border-box;
}
.clip-wrap {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  width: 100%;
  flex: none;
}
.clip-wrap .btn[data-cmd="play_clip"] { flex: 1; margin: 0.25rem 0; }
.clip-wrap .clip-clear,
.clip-wrap .clip-edit {
  flex: 0 0 2.5rem;
  padding: 0.55rem 0;
  margin: 0.25rem 0;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 700;
}
.clip-wrap .clip-edit {
  font-size: 1rem;
}
.panel {
  background: #24283b;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
body.dashboard-page #dashboardSection .panel,
body.mobile main .panel {
  border: 1px solid rgba(155, 92, 255, 0.22);
}
.panel h2 { margin: 0 0 0.5rem; font-size: 1rem; }
input, select {
  width: 100%;
  padding: 0.5rem;
  border-radius: 6px;
  border: 1px solid #414868;
  background: #1a1b26;
  color: #c0caf5;
  margin-bottom: 0.5rem;
}
.hint { font-size: 0.85rem; opacity: 0.85; margin: 0 0 0.75rem; line-height: 1.35; }
.btn.secondary { background: #444; color: #eee; margin-top: 0.5rem; }
.error { color: #f7768e; margin-top: 0.75rem; }
.btn.selected { outline: 2px solid #7aa2f7; background: #565f89; }
.live-board {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #16161e;
  border: 1px solid #292e42;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}
.live-ball-section {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid #292e42;
}
.live-score-controls {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid #292e42;
}
.live-meta {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
  opacity: 0.75;
  text-align: center;
}
.live-inline-panel {
  margin: 0.35rem 0 0;
  padding: 0.55rem 0.65rem;
  background: #1a1b26;
  border-radius: 8px;
}
.live-inline-panel h2 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0.9;
}
#playerSlotQuestion {
  text-align: center;
}
.ball-grid-live {
  justify-content: center;
}
.rack-foul-counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0.45rem 0 0;
  font-size: 0.85rem;
  line-height: 1.2;
  opacity: 0.95;
}
.rack-foul-counter.hidden { display: none; }
.rack-stat-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
}
.rack-stat-row.rack-snooker-stats {
  flex-direction: column;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.15rem;
}
.rack-snooker-break-line,
.rack-snooker-margin-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
}
.rack-stat-row.hidden { display: none; }
.rack-break-group,
.rack-remaining-group,
.rack-diff-group {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.rack-break-group.hidden,
.rack-remaining-group.hidden,
.rack-diff-group.hidden,
.rack-snooker-margin-line.hidden,
.rack-foul-player.hidden,
.rack-foul-sep.hidden { display: none; }
.rack-stat-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rack-stat-value.is-ahead {
  color: #43a047;
}
.rack-stat-value.is-behind {
  color: #e53935;
}
.rack-break-balls {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.rack-break-ball {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  border: 2px solid var(--break-ball-color, #90a4ae);
  color: var(--break-ball-color, #90a4ae);
  background: transparent;
  font-size: 0.65rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  box-sizing: border-box;
}
.rack-foul-heading {
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  opacity: 0.7;
}
.rack-foul-player {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
}
.rack-foul-name {
  max-width: 20ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.85;
}
.rack-foul-count {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 0.9em;
  text-align: center;
}
.rack-foul-sep { opacity: 0.45; font-weight: 700; }
.rack-foul-player.is-active .rack-foul-name,
.rack-foul-player.is-active .rack-foul-count { opacity: 1; }
.rack-foul-player:not(.is-active) { opacity: 0.55; }
.dev-login { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid #414868; }
.dash-login-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1.25rem 0 0;
}
.dash-login-feature-card {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid rgba(122, 162, 247, 0.24);
  border-radius: 0.75rem;
  background:
    linear-gradient(145deg, rgba(47, 128, 255, 0.11), rgba(138, 92, 255, 0.07)),
    rgba(15, 16, 24, 0.48);
}
.dash-login-feature-icon {
  display: inline-grid;
  place-items: center;
  width: 2.35rem;
  height: 2.35rem;
  flex: 0 0 auto;
  border-radius: 0.65rem;
  background: linear-gradient(135deg, #9b5cff, #2f80ff);
  color: #fff;
  box-shadow: 0 0.35rem 1rem rgba(155, 92, 255, 0.24);
}
.dash-login-feature-icon svg {
  width: 1.3rem;
  height: 1.3rem;
}
.dash-login-feature-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}
.dash-login-feature-card p {
  margin: 0;
  color: #c8cbe0;
  font-size: 0.85rem;
  line-height: 1.45;
}
@media (max-width: 720px) {
  .dash-login-feature-grid {
    grid-template-columns: 1fr;
  }
}
.dash-login-pane {
  margin-top: 0.75rem;
}
.dash-login-intro {
  margin: 0 0 1rem;
}
.dash-login-intro p {
  margin: 0 0 0.65rem;
}
.dash-login-intro p:last-child {
  margin-bottom: 0;
}
.dash-login-intro ul {
  margin: 0 0 0.65rem;
  padding-left: 1.25rem;
}
.dash-login-intro li {
  margin: 0.2rem 0;
}
.dash-login-switch {
  margin: 0.85rem 0 0;
}
.dash-text-link {
  color: #7aa2f7;
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.92em;
}
.dash-text-link:hover {
  color: #9ece6a;
}
.password-field {
  position: relative;
  display: flex;
  align-items: stretch;
  margin: 0.35rem 0 0.5rem;
}
.password-field input {
  flex: 1;
  width: 100%;
  margin: 0;
  padding-right: 2.6rem;
}
.password-toggle {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #a9b1d6;
  cursor: pointer;
}
.password-toggle:hover,
.password-toggle:focus-visible {
  color: #c0caf5;
  background: rgba(122, 162, 247, 0.12);
  outline: none;
}
.password-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
}
code { font-size: 0.8rem; word-break: break-all; }
ul { padding-left: 1.2rem; }
.stream-list { list-style: none; padding: 0; margin: 0; }
.stream-card {
  background: #24283b;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  overflow: visible;
}
.stream-card h3 {
  margin: 0 0 0.35rem;
  word-break: break-word;
}
.stream-card .score { font-size: 1.25rem; font-weight: 700; margin: 0.25rem 0; }
.stream-card a,
.stream-card .stream-watch {
  display: inline-block;
  color: #7aa2f7;
  margin-top: 0.5rem;
  padding: 0.35rem 0;
  /* Large tap target; keep visible above mobile browser chrome */
  min-height: 2.5rem;
  line-height: 1.4;
}
.mobile .score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin: 0.3rem 0;
}
.mobile .score-row > span:first-child {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mobile .score-row .score-value {
  min-width: 2rem;
  text-align: center;
  font-weight: 700;
  font-size: 1.15rem;
}
.mobile .score-row .btn {
  min-width: 2.4rem;
  padding: 0.4rem 0.55rem;
  font-size: 1rem;
}
.field-row {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
  margin-bottom: 0.5rem;
}
.field-row input,
.field-row select {
  flex: 1;
  width: auto;
  margin-bottom: 0;
  font-size: 1rem;
}
.field-row .autocomplete-wrapper {
  flex: 1;
  position: relative;
  min-width: 0;
}
.field-row .autocomplete-wrapper input {
  width: 100%;
}
/* Keep open player autocomplete above the next field row / panel (stacked mobile layout). */
.field-row:focus-within {
  position: relative;
  z-index: 25;
}
.autocomplete-wrapper {
  position: relative;
}
.autocomplete-wrapper:focus-within {
  z-index: 25;
}
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  /* Above .mobile-bottom-nav / .dash-tabs (20); below account menu (30) and modals (40+). */
  z-index: 25;
  margin-top: 0.15rem;
  background: #1a1b26;
  border: 1px solid #414868;
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.autocomplete-list.autocomplete-browse {
  max-height: 280px;
}
.autocomplete-item {
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  border-bottom: 1px solid #292e42;
  font-size: 0.9rem;
}
.autocomplete-item:last-child {
  border-bottom: none;
}
.autocomplete-item:hover,
.autocomplete-item.autocomplete-active {
  background: #414868;
}
.autocomplete-name {
  display: block;
  font-weight: 600;
}
.autocomplete-preview {
  display: block;
  font-size: 0.75rem;
  opacity: 0.75;
  margin-top: 0.1rem;
}
.autocomplete-new {
  color: #7aa2f7;
  font-style: italic;
}
.setup-variant-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.setup-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 44px;
  padding: 0.55rem 0.75rem;
  border: 1px solid #414868;
  border-radius: 6px;
  background: #1a1b26;
  cursor: pointer;
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
  color: #c0caf5;
  box-sizing: border-box;
}
.setup-option-row span {
  flex: 1;
  min-width: 0;
}
.setup-option-check {
  width: 1.35rem;
  height: 1.35rem;
  margin: 0;
  flex-shrink: 0;
  accent-color: #7aa2f7;
  cursor: pointer;
}
.setup-option-row:has(.setup-option-check:checked) {
  border-color: #7aa2f7;
  background: rgba(122, 162, 247, 0.1);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.panel-head h2 { margin: 0; }
.icon-btn {
  flex: 0 0 2.75rem;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 6px;
  background: #414868;
  color: #c0caf5;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn svg {
  width: 1.3rem;
  height: 1.3rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn img { width: 1.5rem; height: 1.5rem; display: block; }
.icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.icon-btn.save-pending {
  background: #9ece6a;
  color: #1a1b26;
}
.icon-btn.save-pending:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.row.equal { display: flex; flex-wrap: nowrap; gap: 0.4rem; margin: 0.35rem 0; }
.row.equal .btn { flex: 1; margin: 0; min-width: 0; font-size: 0.85rem; padding: 0.55rem 0.35rem; }
.row.equal .btn.rack-breaker-inactive { opacity: 0.35; }
.row.equal .btn.rack-breaker-current:disabled {
  opacity: 1;
  cursor: default;
}
.row.equal .btn.rack-breaker-match-locked { opacity: 0.55; }
#playerSlotP1Btn,
#playerSlotP2Btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
#playerSlotP1Btn .slot-name,
#playerSlotP2Btn .slot-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#playerSlotP1Btn .slot-ball,
#playerSlotP2Btn .slot-ball {
  width: 1rem;
  height: 1rem;
  max-width: 1rem;
  max-height: 1rem;
  flex: 0 0 1rem;
  display: block;
  border-radius: 50%;
  object-fit: contain;
  /* Avoid intrinsic PNG size growing the button before/while loading. */
  line-height: 0;
}
#playerSlotP1Btn.rack-breaker-last-winner .slot-name,
#playerSlotP2Btn.rack-breaker-last-winner .slot-name,
#playerSlotP1Btn.rack-breaker-last-winner,
#playerSlotP2Btn.rack-breaker-last-winner {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.ball-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.ball-btn {
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.ball-btn img { width: 100%; height: 100%; display: block; pointer-events: none; }
.ball-btn.faded { opacity: 0.2; }
.ball-btn:disabled,
.ball-btn.is-disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(0.4);
  pointer-events: none;
}
.ball-btn.ball-cooldown:disabled,
.ball-btn.ball-cooldown.is-disabled {
  opacity: 0.35;
  filter: grayscale(0.4);
}
.ball-btn.ball-clicked {
  opacity: 0.25;
  transform: scale(0.92);
}
.ball-grid.awaiting-breaker .ball-btn:not(.undo-ball) {
  opacity: 0.35;
  pointer-events: none;
  cursor: default;
  filter: grayscale(0.4);
}
.ball-grid-hint {
  font-size: 0.8rem;
  opacity: 0.8;
  margin: 0 0 0.4rem;
}
.ball-btn.undo-ball { opacity: 1; filter: none; }
.ball-btn.undo-ball:disabled { opacity: 0.35; filter: grayscale(0.4); }
.clips { flex-wrap: wrap; }

/* Landing + dashboard */
.site-header {
  padding: 1rem 1.25rem;
  background: #16161e;
  border-bottom: 1px solid #292e42;
}
.site-header-inner {
  max-width: var(--content-max, 720px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.site-version {
  margin-left: 0.35rem;
  font-size: 0.72em;
  font-weight: 600;
  color: #a9b1d6;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
a.site-brand {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
a.site-brand:hover {
  opacity: 0.88;
}
a.site-brand h1 {
  margin: 0;
}
.site-brand-mark {
  display: block;
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  flex: 0 0 auto;
}
.mobile-brand-mark {
  width: 1.8rem;
  height: 1.8rem;
}
.site-nav {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
/* Keep the brand centered while Sign In / Dashboard stays at the right edge. */
body.landing-home .site-header-inner,
body.streams-page .site-header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  width: 100%;
  max-width: none;
}
body.landing-home .site-header-inner > div:first-child,
body.streams-page .site-header-inner > div:first-child {
  grid-column: 2;
  justify-self: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
body.landing-home .site-header-actions,
body.streams-page .site-header-actions {
  grid-column: 3;
  justify-self: end;
}
@media (max-width: 720px) {
  body.landing-home .site-header-inner,
  body.streams-page .site-header-inner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
  }
  body.landing-home .site-header-actions,
  body.streams-page .site-header-actions {
    justify-content: center;
  }
}
/* Header auth only — Shared Streams is a homepage tab. */
body.landing-home .site-nav-streams {
  display: none;
}
.site-nav .btn,
.hero-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 0;
  box-sizing: border-box;
  line-height: 1.2;
  font-size: 1rem;
  padding: 0.55rem 1rem;
}
.site-nav .btn .site-nav-icon,
.hero-actions .btn .site-nav-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  display: block;
}
.site-nav .btn.account-menu-btn[aria-expanded="true"] {
  outline: 2px solid #7aa2f7;
  outline-offset: 0;
}
@media (max-width: 720px) {
  body.has-dash-nav > .site-header .site-header-inner {
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
  }
  body.has-dash-nav > .site-header .site-header-inner > div:first-child {
    display: flex;
    justify-content: center;
    width: 100%;
  }
  body.has-dash-nav > .site-header a.site-brand h1 {
    font-size: clamp(0.9rem, 4.5vw, 1.15rem);
    white-space: nowrap;
  }
  body.has-dash-nav > .site-header .site-header-actions,
  body.has-dash-nav > .site-header .site-nav {
    justify-content: center;
  }
  .site-nav .btn {
    min-width: 2.5rem;
    padding: 0.55rem 0.65rem;
  }
  .site-nav .site-nav-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}
.header-user-email {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.85;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-menu {
  position: relative;
}
.account-menu-panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 30;
  min-width: 14rem;
  padding: 0.75rem;
  background: #16161e;
  border: 1px solid #292e42;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.account-menu-email {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  word-break: break-all;
  opacity: 0.9;
}
.landing-main,
.dashboard-main {
  max-width: var(--content-max, 720px);
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1.25rem calc(2.5rem + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  min-width: 0;
  overflow-x: hidden;
  overflow-x: clip;
}
body.landing-home,
body.streams-page {
  --content-max: 720px;
}
@media (min-width: 900px) {
  body.landing-home,
  body.streams-page {
    --content-max: 1440px;
  }
}
/* Dashboard: phone-friendly by default, room to breathe on desktop */
.dashboard-main {
  --content-max: 720px;
}
@media (min-width: 900px) {
  .dashboard-main {
    --content-max: 1440px;
  }
}
body.landing-home .landing-main {
  /* Extra bottom space so the last Watch Stream control is scrollable into view on phones */
  padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
}

/* Homepage section tabs */
.landing-tabs {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}
.landing-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0.15rem 0 0.25rem;
}
.landing-tab {
  appearance: none;
  cursor: pointer;
  margin: 0;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--public-button-border, #414b70);
  background: linear-gradient(145deg, rgba(155, 92, 255, 0.11), rgba(47, 128, 255, 0.05)), var(--public-button, #1b2035);
  color: #eef0ff;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.2;
  box-shadow: 0 0.25rem 0.7rem rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.landing-tab:hover {
  color: #fff;
  border-color: rgba(155, 92, 255, 0.8);
  transform: translateY(-1px);
}
.landing-tab:focus-visible {
  outline: 2px solid #b98cff;
  outline-offset: 2px;
}
.landing-tab[aria-selected="true"],
.landing-tab.is-active {
  background: linear-gradient(135deg, var(--public-purple, #9b5cff), var(--public-blue, #2f80ff));
  border-color: transparent;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0.35rem 0.95rem rgba(92, 54, 170, 0.28);
}
.landing-tab.hidden,
.landing-tab[hidden] {
  display: none !important;
}
.landing-tabpanel {
  min-width: 0;
}
.landing-tabpanel.hidden,
.landing-tabpanel[hidden] {
  display: none !important;
}
.landing-video-panel h2 {
  margin-top: 0;
}
.landing-video-panel a {
  color: #7aa2f7;
}
.landing-video-frame {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0.75rem auto 0;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #0b0d14;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0.5rem 1.4rem rgba(0, 0, 0, 0.28);
}
.landing-video-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.live-now-panel {
  margin-top: 0;
}
.stream-meta, .stream-subscore {
  font-size: 0.85rem;
  opacity: 0.8;
  margin: 0.35rem 0 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
/*
 * App shell when signed in: header + scrollable main + in-flow tab bar.
 * Avoids position:fixed — wide tables on Android expand the layout viewport
 * and drag fixed footers off-screen both horizontally and vertically.
 * --app-vh is set from visualViewport (see viewport-shell.js) so the tab bar
 * stays at the real screen bottom after mobile keyboard / URL-bar settle.
 */
html:has(body.has-dash-nav) {
  height: var(--app-vh, 100dvh);
  max-height: var(--app-vh, 100dvh);
  overflow: hidden;
}
body.has-dash-nav {
  --content-max: 720px;
  display: flex;
  flex-direction: column;
  height: var(--app-vh, 100dvh);
  max-height: var(--app-vh, 100dvh);
  overflow: hidden;
}
@media (min-width: 900px) {
  body.has-dash-nav {
    --content-max: 1440px;
  }
}
body.has-dash-nav > .site-header {
  flex: 0 0 auto;
}
body.has-dash-nav > .site-header .site-header-inner {
  max-width: var(--content-max);
}
body.has-dash-nav > .dashboard-main {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 1rem 1.25rem 1rem;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
body.has-dash-nav > .dash-tabs {
  flex: 0 0 auto;
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  width: 100%;
  max-width: none;
  margin: 0;
  display: block;
}
body.has-dash-nav .dash-tabs[hidden] {
  display: none;
}
#dashboardSection,
.dash-tab-panel,
.stats-subpanel {
  max-width: 100%;
  min-width: 0;
}
.hero h2 { margin-top: 0; }
.hero-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.marketing-obs-note {
  margin: 1rem 0 0;
  line-height: 1.45;
}
.marketing-obs-note a {
  color: #7aa2f7;
}
.landing-pitch h2 {
  margin-top: 0;
}
.landing-pitch h3 {
  margin: 1.25rem 0 0.55rem;
  font-size: 1.05rem;
}
.landing-pitch p {
  margin: 0.55rem 0 0;
  line-height: 1.5;
}
.landing-pitch p:first-of-type {
  margin-top: 0.65rem;
}
.landing-pitch a {
  color: #7aa2f7;
}
.landing-pitch-audience {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
  line-height: 1.45;
}
.landing-pitch-audience li + li {
  margin-top: 0.35rem;
}
.landing-pitch-asterisk {
  font-size: 0.85em;
  line-height: 0;
}
.landing-pitch .marketing-obs-note {
  margin-top: 0.75rem;
}
.landing-pitch .hero-actions {
  margin-top: 1.15rem;
}
/* Landing product carousel */
.marketing-carousel-panel {
  padding: 0.85rem 0.9rem 1rem;
  margin-bottom: 0.75rem;
}
.marketing-carousel {
  outline: none;
}
.marketing-carousel-viewport {
  overflow: hidden;
  padding: 0.55rem;
  box-sizing: border-box;
  border-radius: 8px;
  background: rgba(15, 16, 24, 0.65);
}
.marketing-carousel-track {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  transition: transform 0.45s ease;
  will-change: transform;
}
.marketing-slide {
  flex: 0 0 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.marketing-slide-media {
  position: relative;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 12rem;
}
.marketing-slide.is-wide .marketing-slide-media img {
  width: 100%;
  height: auto;
  max-height: 22rem;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #414868;
  background: #0f1018;
}
.marketing-phone-frame {
  width: min(14rem, 72vw);
  margin-inline: auto;
  padding: 0.55rem;
  border-radius: 1.35rem;
  border: 2px solid #565f89;
  background: #1a1b26;
  box-shadow: inset 0 0 0 1px #292e42;
}
.marketing-phone-frame img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 19.5;
  object-fit: cover;
  object-position: top center;
  border-radius: 0.95rem;
  background: #0f1018;
}
.marketing-slide-caption h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}
.marketing-slide-caption p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
  opacity: 0.9;
}
.marketing-slide-caption p + p {
  margin-top: 0.55rem;
}
@media (min-width: 900px) {
  .marketing-slide {
    flex-basis: 52%;
    margin: 0;
    opacity: 0.48;
    transform: scale(0.92);
    transition: opacity 0.45s ease, transform 0.45s ease;
    border: 1px solid rgba(155, 92, 255, 0.18);
    border-radius: 8px;
    background: rgba(26, 27, 38, 0.72);
  }
  .marketing-slide.is-active {
    opacity: 1;
    transform: scale(1);
    border-color: rgba(155, 92, 255, 0.48);
    background: rgba(36, 40, 59, 0.96);
  }
  .marketing-slide.is-clone {
    opacity: 0.48;
  }
}
.marketing-carousel-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
}
.marketing-carousel-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  position: relative;
}
.marketing-carousel-btn:first-child {
  justify-self: start;
}
.marketing-carousel-btn:last-child {
  justify-self: end;
}
.carousel-control-icon {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  fill: currentColor;
}
@media (max-width: 760px) {
  .marketing-carousel-controls {
    gap: 0.4rem;
  }
  .marketing-carousel-btn {
    width: 2.75rem;
    min-width: 2.75rem;
    padding: 0.65rem;
    justify-content: center;
  }
  .carousel-control-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}
.marketing-carousel-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}
.marketing-carousel-dots button {
  width: 0.55rem;
  height: 0.55rem;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: #565f89;
  cursor: pointer;
}
.marketing-carousel-dots button.is-active {
  background: #7aa2f7;
  transform: scale(1.15);
}
.landing-pricing h2,
.landing-pricing-soon h2 {
  margin-top: 0;
}
@media (prefers-reduced-motion: reduce) {
  .marketing-carousel-track {
    transition: none;
  }
}
.dash-tabs {
  display: none;
  position: static;
  z-index: 20;
  margin: 0;
  padding: 0;
  background: #16161e;
  border-top: 1px solid #292e42;
  width: 100%;
  box-sizing: border-box;
}
.dash-tabs-inner {
  display: flex;
  width: 100%;
  max-width: var(--content-max, 720px);
  margin: 0 auto;
  padding: 0.5rem 0.4rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  gap: 0.25rem;
}
.dash-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0.4rem 0.2rem 0.45rem;
  border: none;
  border-radius: 8px;
  background: #24283b;
  color: #c0caf5;
  cursor: pointer;
  font-size: 0.65rem;
  font-weight: 600;
  min-height: 3rem;
  min-width: 0;
}
.dash-tab span {
  line-height: 1.1;
}
.dash-tab-icon {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
  flex-shrink: 0;
}
.dash-tab.active {
  background: #414868;
  outline: 2px solid #7aa2f7;
  color: #c0caf5;
}
.account-email {
  margin: 0 0 0.75rem;
  word-break: break-all;
  opacity: 0.9;
}
.account-content {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  width: 100%;
  margin: 0 auto 0.75rem;
}
.account-content .account-section {
  margin: 0;
}
.account-overview-section,
#accountSubscriptionSection {
  grid-column: 1 / -1;
}
.account-overview-section .account-email {
  margin-bottom: 0;
}
.account-deployment-type {
  margin: 0.3rem 0 0;
}
.account-plan-line {
  margin: 0 0 0.45rem;
  line-height: 1.4;
}
.account-billing-details {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(155, 92, 255, 0.2);
}
.account-section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.account-section-actions .btn,
.account-section-actions .btn.secondary {
  margin: 0;
}
#adminAccountMount:not(:empty) {
  margin-bottom: 1rem;
}
@media (max-width: 720px) {
  .account-content {
    grid-template-columns: minmax(0, 1fr);
  }
  .account-overview-section,
  #accountSubscriptionSection {
    grid-column: 1;
  }
}
.account-session-actions {
  margin: 0.25rem 0 0.75rem;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 0.75rem;
}
.account-session-actions .btn {
  margin: 0;
}
.account-session-actions .btn.secondary {
  margin-top: 0;
}
#tabSettings .panel .account-session-actions .btn {
  margin-right: 0;
  margin-bottom: 0;
}
.dash-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  white-space: nowrap;
}
.dash-action-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  display: block;
}
.dash-action-label {
  line-height: 1.1;
}
#tabSettings .panel .btn {
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}
@media (max-width: 720px) {
  .account-session-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .account-session-actions .dash-action-btn,
  .token-list-actions .dash-action-btn {
    min-width: 2.75rem;
    padding: 0.5rem 0.65rem;
  }
  .account-session-actions .dash-action-label,
  .token-list-actions .dash-action-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}
.tables-onboarding {
  overflow: hidden;
  margin-bottom: 1rem;
  padding: 1rem;
}
.tables-onboarding-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
}
.tables-onboarding-head h2 {
  margin: 0.1rem 0 0;
}
.tables-onboarding-head > .hint {
  white-space: nowrap;
}
.tables-onboarding-kicker {
  margin: 0;
  color: #86a8ff;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tables-start-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(12rem, 16rem);
  gap: 0.85rem;
  align-items: stretch;
  margin: 0 0 1rem;
}
.tables-start-row .tables-onboarding {
  margin-bottom: 0;
  min-width: 0;
}
.tables-start-row .table-card-create {
  min-height: 16rem;
  height: 100%;
}
.tables-impromptu-hint:empty {
  display: none;
}
.tables-impromptu-hint {
  margin: 0 0 0.75rem;
}
@media (max-width: 900px) {
  .tables-start-row {
    grid-template-columns: 1fr;
  }
  .tables-start-row .table-card-create {
    min-height: 10rem;
  }
}
.tables-setup-carousel {
  outline: none;
}
.tables-setup-carousel:focus-visible {
  border-radius: 0.65rem;
  box-shadow: 0 0 0 2px #5f83ff;
}
.tables-setup-viewport {
  overflow: hidden;
  border: 1px solid rgba(130, 150, 210, 0.22);
  border-radius: 0.7rem;
  background: rgba(7, 12, 29, 0.45);
}
.tables-setup-track {
  display: flex;
  transition: transform 0.4s ease;
}
.tables-setup-slide {
  display: grid;
  grid-template-columns: minmax(18rem, 1.15fr) minmax(15rem, 0.85fr);
  align-items: center;
  gap: 1.25rem;
  flex: 0 0 100%;
  min-width: 0;
  min-height: 25rem;
  padding: 1rem;
}
.tables-setup-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 23rem;
  margin: 0;
  overflow: hidden;
  border-radius: 0.65rem;
  background: #090e20;
}
.tables-setup-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.tables-setup-media-key img {
  object-position: center bottom;
}
.tables-setup-copy {
  max-width: 31rem;
}
.tables-setup-copy h3 {
  margin: 0.35rem 0 0.65rem;
  font-size: clamp(1.2rem, 2.4vw, 1.75rem);
}
.tables-setup-copy p {
  line-height: 1.55;
}
.tables-setup-number {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #2f80ff, #8a5cff);
  color: #fff;
  font-weight: 800;
}
.tables-setup-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  margin-top: 0.8rem;
}
.tables-setup-controls .btn {
  margin: 0;
}
.tables-setup-control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  position: relative;
}
.tables-setup-control-btn:first-child {
  justify-self: start;
}
.tables-setup-control-btn:last-child {
  justify-self: end;
}
.tables-setup-control-icon {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  fill: currentColor;
}
.tables-setup-dots {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0 0.25rem;
}
.tables-setup-dots button {
  width: 0.65rem;
  height: 0.65rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #505a7a;
}
.tables-setup-dots button.active {
  background: #7f8cff;
  box-shadow: 0 0 0 3px rgba(127, 140, 255, 0.18);
}
.carousel-click-pause-target {
  cursor: pointer;
}
.carousel-click-pause-target:focus-visible {
  outline: 2px solid #7aa2f7;
  outline-offset: -2px;
}
.carousel-pause-indicator {
  position: absolute;
  z-index: 2;
  top: 0.65rem;
  right: 0.65rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background: rgba(7, 12, 29, 0.88);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 0.3rem 1rem rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.carousel-pause-indicator svg {
  width: 0.85rem;
  height: 0.85rem;
  fill: currentColor;
}
@media (max-width: 760px) {
  .tables-setup-slide {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    min-height: 0;
  }
  .tables-setup-media {
    height: min(54vh, 20rem);
  }
  .tables-setup-copy {
    max-width: none;
  }
  .tables-setup-controls {
    gap: 0.4rem;
  }
  .tables-setup-control-btn {
    width: 2.75rem;
    min-width: 2.75rem;
    padding: 0.65rem;
  }
  .tables-setup-control-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .tables-setup-track {
    transition: none;
  }
}
.table-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 22rem));
  justify-content: center;
  gap: 0.75rem;
}
@media (max-width: 720px) {
  .table-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}
.admin-search {
  max-width: 28rem;
  margin: 0.75rem 0;
}
#adminAccountsTable tbody tr {
  cursor: pointer;
}
#adminAccountsTable tbody tr:hover,
#adminAccountsTable tbody tr:focus-visible {
  background: rgba(122, 162, 247, 0.12);
}
#adminAccountsTable tbody tr.admin-row-selected {
  background: rgba(122, 162, 247, 0.2);
}
#adminAccountsTable tbody tr.admin-row-self {
  background: rgba(46, 160, 67, 0.14);
  box-shadow: inset 3px 0 0 #2ea043;
}
#adminAccountsTable tbody tr.admin-row-self:hover,
#adminAccountsTable tbody tr.admin-row-self:focus-visible {
  background: rgba(46, 160, 67, 0.2);
}
#adminAccountsTable tbody tr.admin-row-self.admin-row-selected {
  background: rgba(46, 160, 67, 0.28);
}
.admin-self-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #0d3b16;
  background: rgba(46, 160, 67, 0.35);
}
.admin-self-note {
  margin: 0 0 0.75rem;
}
.admin-detail-meta {
  display: grid;
  gap: 0.35rem;
  margin: 0 0 1rem;
  font-size: 0.9rem;
}
.admin-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}
.admin-trial-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}
.admin-trial-form label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}
.admin-trial-form input {
  width: 5rem;
}
.admin-delete-form,
.admin-unblock-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem;
  margin: 0.5rem 0 1rem;
}
.admin-delete-form > label,
.admin-unblock-form > label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.85rem;
}
.admin-delete-form input[type="email"],
.admin-unblock-form input[type="email"] {
  width: min(22rem, 100%);
}
.admin-delete-form .admin-delete-block-check {
  flex-direction: row;
  align-items: center;
  max-width: 19rem;
}
.admin-delete-block-check input[type="checkbox"] {
  width: auto;
  flex: 0 0 auto;
}
.admin-key-list,
.admin-room-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.admin-key-list li,
.admin-room-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.admin-stats-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.5rem 0 0;
}
.admin-stats-summary span {
  font-size: 0.85rem;
  opacity: 0.85;
}
a.table-card {
  display: block;
  color: inherit;
  text-decoration: none;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(47, 128, 255, 0.08), rgba(155, 92, 255, 0.05)),
    #0d1628;
  border: 1px solid #263552;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  padding: 1rem;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
a.table-card:hover,
a.table-card:focus-visible,
button.table-card:hover,
button.table-card:focus-visible {
  background: linear-gradient(135deg, rgba(47, 128, 255, 0.26), rgba(155, 92, 255, 0.22));
  border-color: #2f80ff;
  box-shadow:
    inset 0 -2px 0 var(--dashboard-purple),
    0 10px 28px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
  outline: none;
}
/* Beat body.dashboard-page #dashboardSection .panel border specificity. */
body.dashboard-page #dashboardSection a.table-card:hover,
body.dashboard-page #dashboardSection a.table-card:focus-visible,
body.dashboard-page #dashboardSection button.table-card:hover:not(:disabled):not(.is-disabled),
body.dashboard-page #dashboardSection button.table-card:focus-visible:not(:disabled):not(.is-disabled) {
  background: linear-gradient(135deg, rgba(47, 128, 255, 0.26), rgba(155, 92, 255, 0.22));
  border: 1px solid #2f80ff;
  box-shadow:
    inset 0 -2px 0 var(--dashboard-purple),
    0 10px 28px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
  outline: none;
}
button.table-card-create.is-disabled:hover,
button.table-card-create:disabled:hover,
button.table-card-create.is-disabled:focus-visible,
button.table-card-create:disabled:focus-visible {
  background:
    linear-gradient(145deg, rgba(47, 128, 255, 0.08), rgba(155, 92, 255, 0.05)),
    #0d1628;
  border-color: #3a5a8c;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  transform: none;
}
body.dashboard-page #dashboardSection button.table-card-create.is-disabled:hover,
body.dashboard-page #dashboardSection button.table-card-create:disabled:hover,
body.dashboard-page #dashboardSection button.table-card-create.is-disabled:focus-visible,
body.dashboard-page #dashboardSection button.table-card-create:disabled:focus-visible {
  background:
    linear-gradient(145deg, rgba(47, 128, 255, 0.08), rgba(155, 92, 255, 0.05)),
    #0d1628;
  border: 1px dashed #3a5a8c;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  transform: none;
}
button.table-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(47, 128, 255, 0.08), rgba(155, 92, 255, 0.05)),
    #0d1628;
  border: 1px dashed #3a5a8c;
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  padding: 1rem;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  cursor: pointer;
}
button.table-card-create.is-disabled,
button.table-card-create:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
button.table-card-create.table-card-create-upgrade {
  border-color: rgba(158, 193, 255, 0.55);
}
button.table-card-create.table-card-create-upgrade .table-card-create-plus {
  color: #c9dcff;
}
.table-card-create-plus {
  display: block;
  font-size: 3rem;
  line-height: 1;
  font-weight: 300;
  color: #9ec1ff;
  margin-bottom: 0.35rem;
}
.table-card-create-plus .dash-action-icon {
  display: block;
  width: 2.75rem;
  height: 2.75rem;
  margin: 0 auto;
}
.table-card-create-label {
  display: block;
  font-size: 1rem;
  font-weight: 650;
}
.table-card-create-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  opacity: 0.7;
}
.table-card-create-detail {
  display: block;
  margin-top: 0.65rem;
  font-size: 0.72rem;
  line-height: 1.35;
  opacity: 0.78;
  max-width: 14rem;
}
.table-card h3 {
  margin: 0.2rem 0 0.45rem;
  font-size: 1rem;
}
.table-status {
  margin: 0;
  font-size: 0.75rem;
  opacity: 0.7;
}
.table-status.online { color: #42dd8b; opacity: 1; }
.table-status.offline { color: #f0b429; opacity: 1; }
.table-status.guest { color: #9ec1ff; opacity: 1; }
.table-kind-badge {
  display: inline-block;
  margin: 0.25rem 0 0;
  padding: 0.1rem 0.45rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #9ec1ff;
  border: 1px solid #3a5a8c;
  border-radius: 999px;
}
.table-card-impromptu {
  border-color: #3a5a8c;
}
.table-account-email,
.stats-account-email {
  margin: 0.1rem 0 0;
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.75;
  word-break: break-word;
}
.table-players { margin: 0.35rem 0; font-weight: 700; color: #f2f4ff; }
.table-score {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 22px rgba(155, 92, 255, 0.3);
}
.table-score-current {
  margin-top: 0.15rem;
  font-size: 1rem;
  font-weight: 600;
  opacity: 0.92;
}
.table-score-primary {
  margin-top: 0.1rem;
}
.user-email { opacity: 0.9; margin-bottom: 0.25rem; }
.copy-notice {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.85rem;
  color: #9ece6a;
}
.api-key-summary {
  word-break: break-all;
}
.api-key-summary.is-revealed {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85rem;
  color: #c0caf5;
}
.api-key-summary.is-revealed:hover,
.api-key-summary.is-revealed:focus-visible {
  color: #7aa2f7;
  outline: none;
}
.api-key-summary .api-key-copy-icon {
  flex-shrink: 0;
  width: 0.95rem;
  height: 0.95rem;
  opacity: 0.85;
}
.api-key-summary.is-copied {
  color: #9ece6a;
  font-family: inherit;
  font-size: inherit;
  cursor: default;
}
.token-list-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
}
.token-list-actions .btn {
  margin: 0;
}
.token-list-actions .btn.secondary {
  margin-top: 0;
}
.dock-key-primary-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0.5rem 0;
}
#tabSettings .dock-key-primary-actions .btn {
  margin: 0;
}
.token-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.token-list-item .btn {
  margin: 0;
  flex-shrink: 0;
  font-size: 0.85rem;
  padding: 0.35rem 0.65rem;
}

/* Mobile snooker foul picker */
.mobile-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.mobile-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.mobile-modal-sheet {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  overflow: auto;
  background: #24283b;
  border-radius: 12px 12px 0 0;
  padding: 0.85rem 1rem 1.25rem;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
}
.mobile-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.mobile-modal-head h2 {
  margin: 0;
  font-size: 1rem;
}
.mobile-modal-close {
  flex: 0 0 2.5rem;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.5rem;
  line-height: 1;
}
.snooker-foul-hint {
  min-height: 1.25rem;
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
  color: #7aa2f7;
  text-align: center;
}
.confirm-modal-message {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.45;
  opacity: 0.92;
}
.confirm-modal-actions { margin-top: 0.25rem; }
.rename-clip-label {
  display: block;
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: #a9b1d6;
}
.rename-clip-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 0.75rem;
  border-radius: 6px;
  border: 1px solid #414868;
  background: #1a1b26;
  color: #c0caf5;
  font-size: 1rem;
}
.rename-clip-hint {
  margin: 0.5rem 0 0.75rem;
}
.snooker-foul-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.foul-target-btn {
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.foul-target-btn img {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
body.mobile.has-mobile-nav {
  padding-bottom: 0;
}
html:has(body.mobile) {
  height: var(--app-vh, 100dvh);
  max-height: var(--app-vh, 100dvh);
  overflow: hidden;
}
body.mobile {
  --content-max: 720px;
  display: flex;
  flex-direction: column;
  height: var(--app-vh, 100dvh);
  max-height: var(--app-vh, 100dvh);
  overflow: hidden;
}
body.mobile > header {
  flex: 0 0 auto;
  width: 100%;
}
body.mobile > header .mobile-header-row {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
}
body.mobile > main#app {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.mobile-bottom-nav {
  flex: 0 0 auto;
  position: static;
  left: auto;
  right: auto;
  transform: none;
  bottom: auto;
  z-index: 20;
  display: block;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding: 0;
  background: #16161e;
  border-top: 1px solid #292e42;
}
.mobile-bottom-nav-inner {
  display: flex;
  width: 100%;
  max-width: var(--content-max, 720px);
  margin: 0 auto;
  padding: 0.5rem 0.4rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  gap: 0.25rem;
}
@media (min-width: 900px) {
  body.mobile > header .mobile-header-row,
  body.mobile .mobile-bottom-nav-inner {
    max-width: 1440px;
  }
}
.mobile-nav-btn {
  flex: 1;
  margin: 0;
  padding: 0.4rem 0.2rem 0.45rem;
  border: none;
  border-radius: 8px;
  background: #24283b;
  color: #c0caf5;
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  min-height: 3rem;
  min-width: 0;
}
.mobile-nav-btn span {
  line-height: 1.1;
}
.mobile-nav-icon {
  width: 1.2rem;
  height: 1.2rem;
  fill: currentColor;
  flex-shrink: 0;
}
.mobile-nav-btn.active {
  background: #414868;
  outline: 2px solid #7aa2f7;
}
a.mobile-nav-btn {
  display: flex;
}
.mobile-view { min-height: 1px; }
/* Pause scoring/setup/replay while waiting for dock or disconnected; Share stays usable. */
body.controls-locked #viewControl,
body.controls-locked #viewSetup,
body.controls-locked #viewReplay {
  opacity: 0.55;
  pointer-events: none;
  user-select: none;
}
/* View-only: keep panels readable while still blocking interaction. */
body.view-only.controls-locked #viewControl,
body.view-only.controls-locked #viewSetup,
body.view-only.controls-locked #viewReplay {
  opacity: 0.92;
}
/* Keep reconnect CTA and bottom nav (incl. Dashboard) tappable while locked. */
body.controls-locked #reconnectBanner,
body.controls-locked #mobileBottomNav {
  opacity: 1;
  pointer-events: auto;
}
.reconnect-banner {
  margin: 0 0 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(247, 118, 142, 0.45);
  background: rgba(247, 118, 142, 0.12);
  text-align: center;
}
.reconnect-banner p {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
}
.reconnect-banner .btn {
  margin: 0;
}
.view-only-banner {
  margin: 0 0 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(122, 162, 247, 0.45);
  background: rgba(122, 162, 247, 0.12);
  text-align: center;
  font-size: 0.92rem;
}
.share-panel h2 { margin-top: 0; text-align: center; }
.share-limitations { text-align: center; margin-bottom: 1rem; }
.share-link-name {
  margin: 0.75rem 0 0.35rem;
  padding: 0;
  text-align: left;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.25;
  color: inherit;
}
.share-link-name.is-placeholder {
  opacity: 0.72;
  font-weight: 600;
}
.share-qr-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.share-qr-wrap.dash-guest-qr-wrap {
  flex-direction: row;
  justify-content: center;
}
.share-qr {
  width: 220px;
  height: 220px;
  background: #fff;
  border-radius: 8px;
  padding: 0.5rem;
}
.share-url {
  font-size: 0.8rem;
  word-break: break-all;
  text-align: center;
  opacity: 0.85;
  margin: 0.5rem 0 0.75rem;
}
.share-actions { margin-top: 0.25rem; }
.share-links-heading {
  margin: 1.25rem 0 0.35rem;
  font-size: 1rem;
}
.guest-link-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  width: 100%;
  text-align: left;
}
.token-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.55rem 0;
  border-top: 1px solid #292e42;
  font-size: 0.85rem;
}
.token-list-item.guest-link-item {
  cursor: pointer;
  border-radius: 6px;
  padding: 0.55rem 0.5rem;
  border-top: 1px solid #292e42;
  transition: background 0.15s ease;
}
.token-list-item.guest-link-item:hover {
  background: rgba(125, 207, 255, 0.08);
}
.token-list-item.guest-link-item.is-current {
  background: #565f89;
  outline: 2px solid #7aa2f7;
  outline-offset: -2px;
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}
.token-list-item > .api-key-summary,
.token-list-item > span {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}
.token-list-item.is-current span {
  color: inherit;
}
.dash-guest-panel .share-links-heading {
  margin-top: 1.5rem;
}
.dash-guest-room-filter {
  margin: 0.75rem 0 0.25rem;
  max-width: 28rem;
}
.dash-guest-qr-wrap {
  position: relative;
  min-height: 244px;
  justify-content: center;
}
.dash-guest-qr-placeholder {
  width: 220px;
  height: 220px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.06),
      rgba(255, 255, 255, 0.06) 8px,
      rgba(0, 0, 0, 0.2) 8px,
      rgba(0, 0, 0, 0.2) 16px
    );
  border: 1px solid rgba(255, 255, 255, 0.12);
  filter: blur(6px);
}
.dash-guest-qr-wrap.is-obscured .share-qr {
  filter: blur(14px);
  opacity: 0.45;
  pointer-events: none;
}
.dash-guest-reveal-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.dash-guest-reveal-overlay .btn {
  pointer-events: auto;
}
.dash-guest-qr-wrap:not(.is-obscured) .dash-guest-reveal-overlay {
  align-items: flex-start;
  justify-content: flex-end;
  padding: 0.5rem 0.5rem 0 0;
}
.dash-guest-url.is-obscured {
  color: rgba(255, 255, 255, 0.55);
  font-style: italic;
}
.dash-guest-owner-badge {
  flex-shrink: 0;
  font-size: 0.75rem;
  opacity: 0.75;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.dash-guest-link-meta {
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
}
.dash-guest-create-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0 0.25rem;
}
.dash-guest-create-row input {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  border: 1px solid #3a415c;
  background: #161925;
  color: inherit;
  font: inherit;
}
.dash-guest-share-actions {
  justify-content: center;
  gap: 0.5rem;
}
.dash-guest-revoke-all {
  margin-top: 1.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid #292e42;
}
.token-list-item .btn {
  flex-shrink: 0;
  margin: 0;
}
@media (max-width: 720px) {
  .token-list-item {
    align-items: flex-start;
  }
  .token-list-item > .api-key-summary,
  .token-list-item > span:first-child,
  .token-list-item > .debug-room-meta {
    flex: 1 1 100%;
  }
  .token-list-actions {
    flex: 1 1 100%;
    justify-content: flex-start;
  }
}
.debug-room-item {
  align-items: flex-start;
}
.debug-room-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
}
.debug-room-title-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}
.debug-room-title {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
  color: #c0caf5;
  overflow-wrap: anywhere;
}
.debug-room-details {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.dash-share-key-actions {
  flex-wrap: wrap;
}
.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0 0 0.85rem;
}
.stats-divider {
  border: none;
  border-top: 1px solid #292e42;
  margin: 0 0 0.85rem;
}
#statsPlayerSummary.stats-summary {
  grid-template-columns: repeat(var(--stats-summary-cols, 3), minmax(0, 1fr));
}
.stats-summary-card {
  background: #1a1b26;
  border: 1px solid #292e42;
  border-radius: 8px;
  padding: 0.65rem 0.7rem;
  text-align: center;
}
.stats-summary-card strong {
  display: block;
  font-size: 1.25rem;
  color: #7aa2f7;
}
.stats-summary-card span {
  font-size: 0.75rem;
  opacity: 0.75;
}
.stats-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: flex-end;
  margin-bottom: 0.75rem;
  /* Keep open Player/Event autocomplete above stats subtabs (hover uses transform). */
  position: relative;
  z-index: 2;
  container-type: inline-size;
  container-name: stats-toolbar;
}
.stats-toolbar:focus-within {
  z-index: 20;
}
.stats-toolbar .stats-toolbar-filter,
.stats-toolbar .stats-date-filter {
  flex: 0 1 auto;
  margin: 0;
  min-width: 0;
  /* Own stacking context so a focused Player/Event row rises above wrapped date inputs. */
  position: relative;
  z-index: 1;
}
.stats-toolbar .stats-toolbar-filter:focus-within,
.stats-toolbar .stats-date-filter:focus-within {
  z-index: 40;
}
.stats-toolbar .stats-player-search,
.stats-toolbar .stats-event-search {
  min-width: 10rem;
  width: 12rem;
  max-width: 14rem;
  flex: none;
}
.stats-toolbar .stats-filter .autocomplete-wrapper {
  min-width: 0;
  width: 100%;
  position: relative;
  z-index: 1;
}
.stats-toolbar .stats-filter .autocomplete-wrapper:focus-within {
  z-index: 45;
}
.stats-toolbar .stats-filter input,
.stats-toolbar .stats-filter .autocomplete-wrapper input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: #1a1b26;
  color: #c0caf5;
  border: 1px solid #414868;
  border-radius: 6px;
  font-size: 1rem;
  line-height: 1.15;
  padding: 0.4rem 0.5rem;
  min-height: 2.25rem;
  margin: 0;
}
.stats-toolbar .stats-date-filter input[type="date"] {
  width: 10rem;
  min-width: 10rem;
  padding-right: 1.7rem;
}
.stats-date-input-wrap {
  position: relative;
  display: block;
}
.stats-date-clear {
  appearance: none;
  position: absolute;
  right: 1.65rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #a9b1d6;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.stats-date-clear:hover {
  color: #c0caf5;
  background: rgba(192, 202, 245, 0.12);
}
.stats-date-clear[hidden] {
  display: none;
}
/* Clear/Refresh: icon+label when the toolbar is wide enough; icon-only when compact. */
.stats-toolbar #statsClearFiltersBtn,
.stats-toolbar #statsRefreshBtn {
  flex: 0 0 auto;
  margin: 0;
  align-self: flex-end;
}
@container stats-toolbar (max-width: 54rem) {
  #statsClearFiltersBtn,
  #statsRefreshBtn {
    width: 2.75rem;
    min-width: 2.75rem;
    padding: 0.5rem 0.65rem;
  }
  #statsClearFiltersBtn .dash-action-label,
  #statsRefreshBtn .dash-action-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}
.stats-player-heading {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0.35rem 0 0.85rem;
  min-height: 2.25rem;
}
.stats-player-title-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  max-width: 100%;
}
.stats-player-title-view.hidden {
  display: none;
}
#statsPlayerTitle {
  margin: 0;
  text-align: center;
  overflow-wrap: anywhere;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.25;
}
.stats-player-edit-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: #7aa2f7;
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stats-player-edit-btn:hover {
  color: #89b4fa;
  background: rgba(122, 162, 247, 0.16);
}
.stats-player-delete-btn {
  color: #f7768e;
}
.stats-player-delete-btn:hover {
  color: #ff9db0;
  background: rgba(247, 118, 142, 0.16);
}
.stats-player-edit-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}
.stats-player-rename-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  max-width: 28rem;
}
.stats-player-rename-inline.hidden {
  display: none;
}
.stats-player-rename-inline input {
  flex: 1 1 10rem;
  min-width: 8rem;
  background: #1a1b26;
  color: #c0caf5;
  border: 1px solid #414868;
  border-radius: 6px;
  padding: 0.4rem 0.55rem;
  font-size: 1.05rem;
  font-weight: 600;
  text-align: center;
}
.stats-player-rename-inline.is-busy {
  cursor: wait;
  opacity: 0.85;
}
.stats-player-rename-inline.is-busy input,
.stats-player-rename-inline.is-busy .btn {
  cursor: wait;
}
.stats-player-filters {
  justify-content: space-between;
  align-items: flex-end;
  width: 100%;
  flex-wrap: nowrap;
}
@media (max-width: 640px) {
  .stats-player-filters {
    flex-wrap: wrap;
  }
}
.stats-player-filters .stats-filter-end {
  margin-left: auto;
  text-align: right;
}
.stats-player-filters .stats-filter-end select {
  text-align: left;
}
.stats-filter {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
  color: rgba(192, 202, 245, 0.95);
}
.stats-toolbar .stats-filter .autocomplete-list {
  /* Opaque panel — do not inherit label opacity tricks from parents. */
  opacity: 1;
  background: #1a1b26;
  color: #c0caf5;
  z-index: 50;
}
.stats-filter select,
.stats-filter input {
  min-width: 10rem;
  background: #1a1b26;
  color: #c0caf5;
  border: 1px solid #414868;
  border-radius: 6px;
  padding: 0.4rem 0.5rem;
}
.stats-filter .autocomplete-wrapper {
  min-width: 12rem;
}
.stats-filter .autocomplete-wrapper input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.stats-section-title {
  margin: 1rem 0 0.45rem;
  font-size: 0.95rem;
}
.stats-h2h-section {
  margin-top: 0.35rem;
}
.stats-h2h-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
}
.stats-h2h-heading .stats-section-title {
  margin: 1rem 0 0;
}
.stats-h2h-chart-mode {
  display: inline-flex;
  gap: 0.25rem;
  margin-top: 1rem;
  padding: 0.15rem;
  background: #16161e;
  border: 1px solid #292e42;
  border-radius: 8px;
}
.stats-h2h-chart-mode-btn {
  border: none;
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  background: transparent;
  color: rgba(192, 202, 245, 0.85);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
}
.stats-h2h-chart-mode-btn:hover {
  color: #c0caf5;
  background: rgba(65, 72, 104, 0.45);
}
.stats-h2h-chart-mode-btn.active {
  background: #7aa2f7;
  color: #1a1b26;
}
.stats-h2h-chart-hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: rgba(192, 202, 245, 0.72);
}
.stats-h2h-chart-wrap {
  position: relative;
  width: 100%;
  height: 260px;
  margin: 0.55rem 0 0.25rem;
  padding: 0.5rem 0.35rem 0.25rem;
  background: rgba(22, 22, 30, 0.55);
  border: 1px solid #292e42;
  border-radius: 8px;
}
@media (max-width: 640px) {
  .stats-h2h-chart-wrap {
    height: 220px;
  }
}
.stats-subtabs {
  display: flex;
  gap: 0.35rem;
  margin: 0.85rem 0 0.65rem;
  position: relative;
  z-index: 1;
}
.stats-subtab {
  flex: 1;
  box-sizing: border-box;
  padding: 0.55rem 1rem;
  border: none;
  border-radius: 6px;
  background: #414868;
  color: #c0caf5;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  min-height: 2.25rem;
  line-height: 1.15;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.stats-subtab-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  display: block;
}
.stats-subtab.active {
  background: #7aa2f7;
  color: #1a1b26;
}
.stats-subpanel.hidden {
  display: none;
}
.stats-pos {
  width: 2.5rem;
  opacity: 0.8;
  font-variant-numeric: tabular-nums;
}
.stats-table-wrap {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.dash-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.dash-stats-table th,
.dash-stats-table td {
  text-align: left;
  padding: 0.4rem 0.45rem;
  border-bottom: 1px solid #292e42;
}
.dash-stats-table th {
  font-size: 0.75rem;
  opacity: 0.75;
  font-weight: 600;
  vertical-align: bottom;
  line-height: 1.15;
  white-space: normal;
}
.dash-stats-table th .stats-th-lines {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.05rem;
}
.dash-stats-table th .stats-th-primary {
  display: inline-flex;
  align-items: baseline;
  gap: 0.15rem;
}
.dash-stats-table th .stats-th-secondary {
  font-weight: 500;
  opacity: 0.85;
  font-size: 0.92em;
}
.dash-stats-table th .stats-th-secondary-spacer {
  visibility: hidden;
}
.dash-stats-table th.stats-sortable {
  cursor: pointer;
  user-select: none;
  max-width: 5.5rem;
}
.dash-stats-table th.stats-sortable[data-sort-key="name"] {
  max-width: 8rem;
}
.dash-stats-table th.stats-sortable:hover,
.dash-stats-table th.stats-sortable.is-sorted {
  opacity: 1;
  color: #c0caf5;
}
.dash-stats-table th.stats-sortable .sort-arrow {
  display: inline-block;
  font-size: 0.85em;
  opacity: 0.95;
  vertical-align: middle;
}
.stats-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.65rem;
  font-size: 0.8rem;
  opacity: 0.9;
}
.stats-pager .stats-pager-label {
  flex: 1 1 auto;
  min-width: 8rem;
}
.stats-pager .btn {
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
}
@media (max-width: 720px) {
  .stats-pager .dash-action-btn {
    width: 2.75rem;
    min-width: 2.75rem;
    padding: 0.5rem 0.65rem;
  }
  .stats-pager .dash-action-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}
.dash-stats-empty {
  text-align: center;
  opacity: 0.7;
}
.stats-winner {
  font-weight: 700;
  color: #42dd8b;
}
.stats-draw {
  font-weight: 600;
  opacity: 0.75;
  font-size: 0.92em;
}
.dash-stats-table tbody tr:nth-child(even) {
  background: rgba(65, 72, 104, 0.35);
}
.dash-stats-table tbody tr.stats-row-clickable {
  cursor: pointer;
}
.dash-stats-table tbody tr.stats-row-clickable:hover {
  background: #292e42;
}
.stats-match-when {
  white-space: nowrap;
  line-height: 1.25;
  vertical-align: middle;
}
.stats-match-date {
  display: block;
  font-weight: 600;
}
.stats-match-time {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.78em;
  opacity: 0.75;
}
.stats-match-duration {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.78em;
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
}
.stats-match-event {
  max-width: 10rem;
  min-width: 4.5rem;
  vertical-align: middle;
}
.stats-match-event-cell {
  min-width: 0;
}
.stats-match-event-game {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.stats-match-event-name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  margin-top: 0.15rem;
  font-size: 0.82em;
  opacity: 0.8;
  line-height: 1.25;
}
.stats-match-event-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.stats-match-pair-cell {
  vertical-align: middle;
  text-align: center;
  white-space: nowrap;
  min-width: 7rem;
}
.stats-match-pair {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.1rem;
  line-height: 1.25;
  min-width: 0;
  max-width: 100%;
}
.stats-match-player {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stats-match-player-link {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  color: #c0caf5;
}
.stats-match-player-link.stats-winner {
  color: #42dd8b;
  font-weight: 700;
}
.stats-match-player-link:hover {
  opacity: 0.85;
}
.stats-match-player-link:focus-visible {
  outline: 2px solid #7aa2f7;
  outline-offset: 2px;
  border-radius: 2px;
}
.stats-match-vs {
  display: block;
  font-size: 0.78em;
  opacity: 0.55;
  font-weight: 600;
  text-transform: lowercase;
}
.stats-match-draw {
  display: block;
  margin-top: 0.1rem;
}
.stats-match-score {
  white-space: nowrap;
  vertical-align: middle;
  text-align: center;
}
.stats-match-score-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  /* Fixed width so 1-digit and 3-digit scores share the same center axis. */
  min-width: 3ch;
  width: 3ch;
  margin: 0 auto;
  text-align: center;
}
.stats-match-score-stack > span {
  display: block;
  width: 100%;
  text-align: center;
}
.stats-match-score-sep {
  opacity: 0.55;
  font-weight: 600;
  line-height: 1;
}
.stats-match-live-label {
  font-weight: 700;
  color: #7aa2f7;
}
.stats-match-live-link {
  font-weight: 700;
  color: #7aa2f7;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.stats-match-live-link:hover {
  opacity: 0.85;
}
.stats-match-live-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7aa2f7;
  opacity: 0.95;
  padding: 0.35rem 0.4rem;
}
.stats-match-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-end;
  gap: 0.35rem;
  vertical-align: middle;
  min-width: 8.5rem;
}
.stats-match-actions > .btn,
.stats-match-actions > .stats-match-live-badge {
  flex: 0 0 auto;
  width: auto;
  max-width: none;
  align-self: stretch;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
  white-space: nowrap;
  line-height: 1.15;
  margin: 0.2rem 0;
  min-height: 0;
  padding: 0.4rem 0.65rem;
  box-sizing: border-box;
}
/* Compact stacked tiles only on narrow viewports */
@media (max-width: 899px) {
  .stats-match-actions > .btn,
  .stats-match-actions > .stats-match-live-badge {
    flex: 0 0 4.55rem;
    width: 4.55rem;
    max-width: 4.55rem;
    flex-direction: column;
    gap: 0.25rem;
    white-space: normal;
    min-height: 3.25rem;
    padding: 0.35rem 0.45rem;
  }
}
.stats-action-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
  display: block;
}
.stats-action-btn.edit,
.stats-action-btn.stats-action-edit {
  background: rgba(122, 162, 247, 0.18);
  color: #7aa2f7;
}
.stats-action-btn.edit:hover,
.stats-action-btn.stats-action-edit:hover {
  background: rgba(122, 162, 247, 0.28);
  color: #89b4fa;
}
.stats-action-btn.danger {
  background: rgba(247, 118, 142, 0.18);
  color: #f7768e;
}
.stats-action-btn.danger:hover {
  background: rgba(247, 118, 142, 0.28);
  color: #ff9db0;
}
.stats-action-btn.success,
.stats-action-btn.save {
  background: rgba(158, 206, 106, 0.18);
  color: #9ece6a;
}
.stats-action-btn.success:hover,
.stats-action-btn.save:hover {
  background: rgba(158, 206, 106, 0.28);
  color: #b9f27c;
}
.stats-action-label {
  font-size: 0.78rem;
}
.stats-match-racks-toggle {
  opacity: 0.92;
}
.stats-match-racks-toggle[aria-expanded="true"] {
  opacity: 1;
}
@media (max-width: 720px) {
  .stats-match-actions {
    min-width: 0;
  }
  .stats-match-actions > .btn {
    flex: 0 0 2.75rem;
    width: 2.75rem;
    max-width: 2.75rem;
    min-width: 2.6rem;
    padding: 0.45rem 0.5rem;
  }
  .stats-action-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}
.stats-match-racks-row td {
  padding-top: 0;
  padding-bottom: 0.75rem;
  background: rgba(0, 0, 0, 0.12);
  border-top: none;
}
.stats-match-racks-wrap {
  margin: 0.15rem 0 0.25rem 0.25rem;
  max-width: 100%;
  min-width: 0;
}
.stats-rack-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 100%;
}
.stats-rack-card {
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.85rem;
  min-width: 0;
}
.stats-rack-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  min-width: 0;
}
.stats-rack-num {
  font-weight: 600;
  opacity: 0.9;
  flex: 0 0 auto;
}
.stats-rack-score {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.stats-rack-outcome {
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}
.stats-rack-dur {
  margin-left: auto;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.stats-rack-players {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  opacity: 0.88;
  font-variant-numeric: tabular-nums;
}
.stats-rack-player-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.75rem;
  min-width: 0;
}
.stats-rack-player-name {
  font-weight: 600;
  opacity: 0.95;
  min-width: 0;
  overflow-wrap: anywhere;
}
.stats-rack-player-id {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}
.stats-rack-broke-icon {
  width: 0.95em;
  height: 0.95em;
  object-fit: contain;
  flex: 0 0 auto;
  vertical-align: middle;
}
.stats-rack-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.85rem;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  opacity: 0.8;
  font-variant-numeric: tabular-nums;
}
.stats-rack-flag {
  font-weight: 600;
  opacity: 1;
  color: #7dcfff;
  cursor: help;
}
.stats-rack-breaker {
  font-weight: 400;
  opacity: 0.9;
  min-width: 0;
  overflow-wrap: anywhere;
}
.stats-match-duration-footer {
  margin: 0.35rem 0 0.1rem;
  font-size: 0.82rem;
  opacity: 0.85;
}
.dash-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1.25rem 1rem;
  background: rgba(0, 0, 0, 0.55);
  overflow: auto;
}
/* Confirm must stack above account/share modals (same base z-index, earlier in DOM). */
#dashConfirmModal {
  z-index: 50;
}
.dash-modal.is-busy {
  cursor: wait;
}
.dash-modal.is-busy .btn {
  cursor: wait;
  opacity: 0.75;
}
.dash-modal.hidden {
  display: none;
}
.dash-confirm-card {
  max-width: 28rem;
  width: 100%;
  margin-top: 12vh;
}
.dash-confirm-message {
  margin: 0 0 1rem;
  line-height: 1.45;
  opacity: 0.92;
  white-space: pre-wrap;
}
.dash-confirm-actions {
  justify-content: flex-end;
  gap: 0.5rem;
}
.dash-confirm-actions .btn {
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.dash-role-field {
  margin: 0.5rem 0 1rem;
}
.dash-role-field .stats-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
}
.dash-role-field select {
  width: 100%;
  max-width: 22rem;
}
.dash-role-desc {
  margin: 0.45rem 0 0;
  line-height: 1.45;
  max-width: 40rem;
}
.dash-role-access-title {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 600;
  opacity: 0.95;
}
.dash-role-access-list {
  margin: 0;
  padding-left: 1.2rem;
}
.dash-role-access-list li {
  margin: 0.15rem 0;
}
.stats-match-game-info {
  margin-top: 0.15rem;
  font-size: 0.85em;
  opacity: 0.75;
  line-height: 1.3;
}
.stats-match-score-summary {
  margin: 0.65rem 0 0.45rem;
  font-weight: 600;
}
.stats-match-racks-editor-wrap {
  margin: 0.35rem 0 0.85rem;
  max-width: 100%;
  min-width: 0;
}
.stats-match-racks-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
  font-weight: 600;
}
.stats-match-racks-editor {
  max-width: 100%;
  min-width: 0;
  max-height: 14rem;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}
.stats-match-racks-editor-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.5rem;
}
.stats-match-racks-editor-footer .btn {
  margin: 0;
}
.stats-match-form-actions {
  justify-content: flex-end;
  margin-top: 0.85rem;
  margin-bottom: 0;
}
.stats-match-form-actions .btn {
  margin: 0;
}
.stats-rack-edit-table {
  width: 100%;
  font-size: 0.85rem;
}
.stats-rack-edit-table th,
.stats-rack-edit-table td {
  padding: 0.25rem 0.35rem;
  vertical-align: middle;
}
.stats-rack-edit-table .stats-rack-edit-actions-col,
.stats-rack-edit-table .stats-rack-edit-actions {
  width: 2.25rem;
  text-align: center;
  white-space: nowrap;
}
.stats-rack-edit-table .stats-rack-delete-btn {
  margin: 0 auto;
}
.stats-rack-edit-table .stats-rack-delete-btn .dash-action-icon {
  width: 1.05rem;
  height: 1.05rem;
}
.stats-rack-edit-table input[type="number"] {
  width: 4.5rem;
  max-width: 100%;
}
.stats-rack-edit-table select.stats-rack-winner {
  width: 14rem;
  min-width: 11rem;
  max-width: 100%;
}
.dash-modal-card {
  width: min(48rem, 100%);
  margin-top: 1.5rem;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.dash-modal-card h2 {
  margin-bottom: 0.85rem;
}
.dash-modal-card .stats-filter {
  width: 100%;
  margin-bottom: 0.65rem;
}
.dash-modal-card .stats-filter input,
.dash-modal-card .stats-filter select {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.google-auth-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: stretch;
  margin: 0.75rem 0 0.35rem;
  max-width: 20rem;
}
.gsi-btn-mount {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  max-width: 20rem;
  min-height: 40px;
}
/* Author display:flex would otherwise override the [hidden] UA rule and leave an empty gap */
.gsi-btn-mount[hidden] {
  display: none !important;
}
.gsi-btn-mount iframe {
  margin: 0 !important;
}
.dash-login-google-hint {
  margin: 0 0 0.75rem;
}
.dash-login-legal {
  margin: 0.35rem 0 0.5rem;
}
.dash-login-legal a {
  color: #7aa2f7;
}
.dash-login-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: stretch;
  margin: 0.65rem 0 0.35rem;
}
.dash-login-actions .btn {
  flex: 1 1 10rem;
  margin: 0;
  min-width: 0;
}
.dash-login-actions .dash-action-btn {
  justify-content: center;
}
/* Google Identity–style button (light theme) — branding guidelines */
.gsi-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-height: 40px;
  width: 100%;
  max-width: 20rem;
  margin: 0;
  padding: 0 12px 0 12px;
  border: 1px solid #747775;
  border-radius: 4px;
  background: #ffffff;
  color: #1f1f1f;
  cursor: pointer;
  font-family: Poppins, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.15px;
  line-height: 20px;
  text-align: center;
  user-select: none;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.gsi-btn:hover {
  background: #f8f9fa;
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.3), 0 1px 3px 1px rgba(60, 64, 67, 0.15);
}
.gsi-btn:active {
  background: #f1f3f4;
  box-shadow: none;
}
.gsi-btn:focus-visible {
  outline: 2px solid #7aa2f7;
  outline-offset: 3px;
}
.gsi-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  background: #fff;
}
.gsi-btn-icon img {
  display: block;
  width: 20px;
  height: 20px;
}
.gsi-btn-label {
  flex: 0 1 auto;
  white-space: nowrap;
}
/* Legacy image-button class still used in older markup / dock fallbacks */
.google-brand-btn {
  appearance: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
  line-height: 0;
  border-radius: 4px;
}
.google-brand-btn:focus-visible {
  outline: 2px solid #7aa2f7;
  outline-offset: 3px;
}
.google-brand-btn img {
  display: block;
  width: min(240px, 100%);
  height: auto;
}
.billing-plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11.5rem, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0 1rem;
}
.billing-promo-panel {
  margin-bottom: 1rem;
  border-color: #7aa2f7;
}
.billing-promo-panel h2 {
  margin-top: 0;
}
.billing-plan-card {
  border: 1px solid #414868;
  border-radius: 8px;
  padding: 0.85rem 0.9rem;
  background: rgba(26, 27, 38, 0.55);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}
.billing-plan-card h3 {
  margin: 0;
  font-size: 1rem;
}
.billing-plan-card .billing-plan-limits {
  margin: 0;
  font-size: 0.82rem;
  opacity: 0.88;
  line-height: 1.35;
  flex: 1;
}
.billing-plan-card .billing-plan-price {
  margin: 0;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(65, 72, 104, 0.9);
  line-height: 1.35;
}
.billing-plan-card > .btn {
  width: 100%;
  min-height: 2.75rem;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.15rem;
}
.billing-plan-card.is-current {
  border: 2px solid #9ece6a;
  background: rgba(158, 206, 106, 0.08);
  box-shadow:
    0 0 0 1px rgba(158, 206, 106, 0.22),
    0 0 18px rgba(158, 206, 106, 0.14);
}
.billing-plan-current-badge {
  align-self: flex-start;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: #9ece6a;
  color: #172014;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.billing-terms-row {
  display: block;
  width: 100%;
  margin: 0.25rem 0 1rem;
  clear: both;
}
.billing-terms-row--above {
  margin: 0.35rem 0 0.15rem;
}
.billing-terms-check {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.55rem;
  width: 100%;
  max-width: 40rem;
  margin: 0;
  box-sizing: border-box;
}
.billing-terms-check--soft {
  opacity: 0.82;
}
.billing-terms-check > span {
  flex: 1 1 auto;
  min-width: 12rem;
  line-height: 1.45;
}
/* Override global `input { width: 100% }` so the checkbox does not eat the row */
.billing-terms-check input[type="checkbox"] {
  width: auto;
  min-width: 1.1rem;
  height: auto;
  margin: 0.2rem 0 0;
  flex: 0 0 auto;
  align-self: flex-start;
}
@property --billing-cta-sparkle-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
body.dashboard-page .btn.primary.billing-cta-trial,
body.landing-home .btn.primary.billing-cta-trial,
body.streams-page .btn.primary.billing-cta-trial {
  position: relative;
  isolation: isolate;
  color: #102014;
  font-weight: 800;
  letter-spacing: 0.01em;
  border: 2px solid transparent;
  background:
    linear-gradient(135deg, #2f8f55 0%, #5fbf6a 45%, #9ece6a 100%) padding-box,
    conic-gradient(
      from var(--billing-cta-sparkle-angle),
      #6fbf6a 0deg,
      #f6ffc4 40deg,
      #ffffff 70deg,
      #8dffb8 110deg,
      #6fbf6a 160deg,
      #fff59a 210deg,
      #ffffff 250deg,
      #b8f06a 300deg,
      #6fbf6a 360deg
    ) border-box;
  box-shadow:
    0 0 0 1px rgba(158, 206, 106, 0.22),
    0 0.35rem 0.9rem rgba(61, 155, 95, 0.3),
    0 0 12px rgba(184, 240, 106, 0.22);
  animation: billing-cta-sparkle-spin 1.6s linear infinite;
}
body.dashboard-page .btn.primary.billing-cta-trial:hover:not(:disabled),
body.landing-home .btn.primary.billing-cta-trial:hover:not(:disabled),
body.streams-page .btn.primary.billing-cta-trial:hover:not(:disabled) {
  filter: brightness(1.06);
  border-color: transparent;
  color: #102014;
  box-shadow:
    0 0 0 1px rgba(196, 240, 138, 0.45),
    0 0.4rem 1.05rem rgba(61, 155, 95, 0.4),
    0 0 16px rgba(255, 245, 154, 0.28);
}
body.dashboard-page .btn.primary.billing-cta-trial strong,
body.landing-home .btn.primary.billing-cta-trial strong,
body.streams-page .btn.primary.billing-cta-trial strong {
  font-weight: 800;
}
@keyframes billing-cta-sparkle-spin {
  to {
    --billing-cta-sparkle-angle: 360deg;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.dashboard-page .btn.primary.billing-cta-trial,
  body.landing-home .btn.primary.billing-cta-trial,
  body.streams-page .btn.primary.billing-cta-trial {
    animation: none;
    background:
      linear-gradient(135deg, #2f8f55 0%, #5fbf6a 45%, #9ece6a 100%) padding-box,
      linear-gradient(135deg, #c8f08a, #fff4a8, #8dffb8) border-box;
  }
}
.plan-trial-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #3d59a1;
  color: #c0caf5;
  vertical-align: middle;
}
.platform-account-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem 1.25rem;
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
}
.platform-account-filter-label {
  margin: 0;
  min-width: min(18rem, 100%);
}
.platform-account-filter-label select {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
}
.platform-account-filter #platformAccountFilterHint {
  margin: 0;
  flex: 1 1 14rem;
}
.simulated-plan-filter {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.5rem 0 0.75rem;
  max-width: 22rem;
}
.simulated-plan-filter select {
  width: 100%;
}

