.dashboard,
.dashboard-main,
.dashboard-side,
.dashboard-panel,
.snapshot-list,
.public-preview {
  display: grid;
  gap: 12px;
}

.dashboard-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.summary-card,
.dashboard-main,
.dashboard-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgb(18 20 23 / 3%);
}

.summary-card {
  display: grid;
  gap: 4px;
  padding: 14px;
}

.summary-card span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.summary-card strong {
  font-size: 1.65rem;
  line-height: 1;
}

.summary-card.success {
  border-color: #a9dfbd;
  background: var(--success-bg);
}

.summary-card.warning {
  border-color: #f0cf7a;
  background: var(--warning-bg);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.dashboard-main,
.dashboard-panel {
  padding: 16px;
}

.snapshot-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.snapshot-row:first-child {
  border-top: 0;
}

.snapshot-row.current-user {
  margin-inline: -8px;
  padding-inline: 8px;
  background: var(--primary-soft);
  border-radius: var(--radius-sm);
  box-shadow: inset 4px 0 0 var(--primary);
}

.snapshot-row.separated {
  margin-top: 8px;
  border-top: 1px dashed var(--line-strong);
}

.snapshot-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  color: #fff;
  background: var(--text);
  border-radius: 50%;
  font-weight: 900;
}

.prediction-readiness {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dashboard-empty {
  display: grid;
  gap: 12px;
}

.matchday-form,
.match-list {
  display: grid;
  gap: 12px;
}

.leaderboard-table {
  min-width: 760px;
}

.matchday-leaderboard-table {
  min-width: 760px;
}

.leaderboard-table th,
.leaderboard-table td,
.matchday-leaderboard-table th,
.matchday-leaderboard-table td {
  white-space: nowrap;
}

.leaderboard-rank,
.leaderboard-points,
.leaderboard-status {
  text-align: right;
}

.leaderboard-user {
  width: 100%;
}

.leaderboard-row.current-user {
  background: var(--primary-soft);
  box-shadow: inset 4px 0 0 var(--primary);
}

.leaderboard-row.current-user:hover {
  background: #ffe8ea;
}

.public-predictions,
.live-matchday-shell,
.prediction-match-section,
.prediction-summary-section,
.prediction-comparison-list {
  display: grid;
  gap: 12px;
}

.live-matchday-shell,
.prediction-match-section,
.prediction-summary-section {
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.live-matchday-shell h2 {
  margin: 0;
  font-size: 1.15rem;
}

.live-board-fragment {
  display: grid;
  gap: 8px;
}

.live-board-fragment.refresh-failed .live-freshness,
.live-freshness.stale {
  color: var(--warning);
  background: var(--warning-bg);
  border-color: #f0cf7a;
}

.live-freshness {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 7px 10px;
  color: var(--muted);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 800;
}

.live-board-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.live-board {
  min-width: 1080px;
  table-layout: fixed;
}

.live-board th,
.live-board td {
  padding: 8px;
}

.live-match-column {
  width: 220px;
}

.live-score-column {
  width: 78px;
}

.live-participant-column {
  width: 78px;
  text-align: center;
}

.live-participant-name,
.live-participant-total,
.live-match-column .kickoff,
.live-score,
.live-tip-cell {
  display: block;
}

.live-participant-name,
.live-score,
.live-tip-cell .prediction-score {
  font-weight: 900;
}

.live-participant-total {
  color: var(--muted);
  font-size: 0.8rem;
}

.live-match-column .matrix-teams {
  margin-top: 4px;
}

.live-score-column,
.live-tip-cell {
  text-align: center;
}

.live-tip-cell.hidden-tip {
  background: var(--success-bg);
}

.live-match-row.hidden-predictions {
  background: #f7fbf9;
}

.prediction-match-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.prediction-summary-section h2 {
  margin: 0;
  font-size: 1.1rem;
}

.prediction-comparison-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.prediction-comparison-row:first-child {
  border-top: 0;
}

.prediction-score {
  font-size: 1.05rem;
  font-weight: 900;
}

.prediction-points {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.missing-score {
  width: fit-content;
}

.summary-values {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.admin-tile {
  display: grid;
  gap: 6px;
  padding: 18px;
  color: var(--text);
}

.admin-grid {
  align-items: stretch;
}

.admin-tile span {
  color: var(--muted);
}

.admin-form,
.admin-sync-action,
.admin-table-wrap {
  margin-bottom: 16px;
}

.table-action-form {
  margin: 0;
}

.admin-table th,
.admin-table td {
  vertical-align: middle;
}

.admin-table td:last-child,
.admin-table th:last-child {
  text-align: right;
}

.copy-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.prediction-actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(220px, 340px) minmax(160px, auto);
  align-items: end;
  gap: 16px;
  margin-top: 4px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 -8px 18px rgb(18 20 23 / 8%);
}

.bonus-field input {
  max-width: 160px;
  min-height: 46px;
  font-weight: 800;
  text-align: center;
}

@media (max-width: 720px) {
  .prediction-actions {
    position: static;
    grid-template-columns: 1fr;
  }

  .prediction-actions .actions {
    margin-top: 0;
  }

  .prediction-actions .button {
    width: 100%;
  }

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

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

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

  .snapshot-row .badge {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .leaderboard-table,
  .matchday-leaderboard-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
    background: transparent;
  }

  .leaderboard-wrap,
  .matchday-leaderboard-wrap {
    overflow-x: visible;
  }

  .leaderboard-table thead,
  .matchday-leaderboard-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .leaderboard-table tbody,
  .matchday-leaderboard-table tbody {
    display: grid;
    gap: 10px;
  }

  .leaderboard-table tr,
  .leaderboard-table td,
  .matchday-leaderboard-table tr,
  .matchday-leaderboard-table td {
    display: block;
  }

  .leaderboard-table tr,
  .matchday-leaderboard-table tr {
    min-width: 0;
  }

  .leaderboard-row,
  .matchday-score-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px 12px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  .leaderboard-table td,
  .matchday-leaderboard-table td {
    padding: 0;
    border: 0;
    white-space: normal;
  }

  .leaderboard-rank {
    grid-row: 1 / span 2;
    min-width: 42px;
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--text);
    border-radius: 50%;
    font-weight: 900;
    text-align: center;
  }

  .leaderboard-user {
    min-width: 0;
    font-size: 1.02rem;
  }

  .leaderboard-total {
    font-size: 1.25rem;
    font-weight: 900;
  }

  .leaderboard-total::after,
  .leaderboard-current::before {
    display: block;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.2;
  }

  .leaderboard-total::after {
    content: attr(data-label);
  }

  .leaderboard-current {
    grid-column: 2 / 3;
    color: var(--muted);
    text-align: left;
  }

  .leaderboard-current::before {
    content: attr(data-label);
  }

  .leaderboard-status {
    grid-column: 3 / 4;
    text-align: right;
  }

  .matchday-score-row .leaderboard-points::before {
    display: block;
    color: var(--muted);
    content: attr(data-label);
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.2;
  }

  .admin-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 10px;
    background: transparent;
  }

  .admin-table-wrap {
    overflow-x: visible;
  }

  .admin-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .admin-table tbody,
  .admin-table tr,
  .admin-table td,
  .status-table th {
    display: block;
  }

  .admin-row,
  .status-table tr {
    display: grid;
    gap: 8px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  .admin-table td,
  .status-table th {
    padding: 0;
    border: 0;
    text-align: left;
    white-space: normal;
  }

  .admin-table td::before,
  .status-table th {
    display: block;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
  }

  .admin-table td::before {
    content: attr(data-label);
  }

  .admin-table td:last-child,
  .admin-table th:last-child {
    text-align: left;
  }

  .table-action-form .button {
    width: 100%;
  }

  .prediction-comparison-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .summary-values {
    justify-content: flex-start;
  }
}
