.live-page .topbar { margin-bottom: 12px; }
.live-page .actions { justify-content: flex-end; }
.live-page .actions :is(.navbtn, button:not([hidden])) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  font: inherit;
  font-size: 14px;
  line-height: 20px;
}
.live-page .actions [aria-pressed="true"] { border-color: #7daff0; }
.live-page #pwaStatus { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.live-page .live-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 6px; }
.live-page .live-heading h1 { margin: 0; }
.live-page .live-status { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.live-page .live-status-badge {
  display: inline-flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid #34455f;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}
.live-page .live-status-badge > * { padding: 4px 6px; }
.live-page .live-status-badge > span { background: #24344c; color: #c3d4eb; }
.live-page .live-status-badge > strong { background: #121c2c; color: #f1f5ff; font-variant-numeric: tabular-nums; }
.live-page .live-status-notice { color: #ffd29b; font-size: 12px; }

@media (max-width: 768px) {
  .live-page .topbar { flex-direction: column; gap: 12px; margin-bottom: 24px; }
  .live-page .actions { width: 100%; }
  .live-page .card { aspect-ratio: 1.2 / 1; }
}

.live-page .card__dday {
  position: absolute;
  z-index: 5;
  top: 12px;
  right: 12px;
  padding: 5px 9px;
  border: 1px solid #ffffff55;
  border-radius: 999px;
  background: #0b1324d9;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.live-page .card__badge.live { gap: 5px; white-space: nowrap; }
.live-page .card__live-elapsed { font-variant-numeric: tabular-nums; }


@media (max-width: 800px) {
  .admin-page :is(#user-table, #stats-table) tr > :last-child {
    position: sticky;
    right: 0;
    z-index: 1;
    background: #111a28;
    box-shadow: -1px 0 0 #354761;
  }
}

.dashboard-page .topbar { margin-bottom: 12px; }
.dashboard-page .topbar h1 { margin-bottom: 0; }
.dashboard-page .dashboard-toolbar { justify-content: flex-end; gap: 8px; }
.dashboard-page .dashboard-toolbar :is(.navbtn, #monthPicker, button) {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #1f2937;
  color: #fff;
  font: 500 14px/1.2 system-ui, sans-serif;
  cursor: pointer;
  white-space: nowrap;
}
.dashboard-page .dashboard-toolbar .navbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dashboard-page .dashboard-toolbar button:disabled { cursor: wait; opacity: .65; }
.dashboard-page .dashboard-toolbar :is(.navbtn, button:enabled):hover { background: #273244; }
.dashboard-page #statusText { margin: 8px 0 0; text-align: right; }
@media (max-width: 768px) {
  .dashboard-page .month-field { flex: 0 1 auto; }
}


.dashboard-page #dashboard-overview {
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #303d52;
  border-radius: 14px;
  background: #111a28;
}
.dashboard-page .ranking-header { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 10px; }
.dashboard-page #ranking-month { margin: 0 0 3px; color: var(--muted); font-size: 13px; }
.dashboard-page #ranking-title { margin: 0; font-size: 22px; }
.dashboard-page .ranking-panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.dashboard-page .ranking-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  padding: 12px 10px;
  border: 1px solid #303d52;
  border-radius: 10px;
  background: #0c1421;
}
.dashboard-page .ranking-panel h3 { margin: 0; font-size: 15px; }
.dashboard-page .ranking-panel .monthly-ranking-empty { align-self: center; text-align: center; }
@media (max-width: 900px) {
  .dashboard-page .ranking-panels { grid-template-columns: 1fr; }
}
.dashboard-page .monthly-ranking { list-style: none; padding: 0; margin: 8px 0 0; }
.dashboard-page .ranking-card {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 5px 0;
}
.dashboard-page .ranking-card + .ranking-card { border-top: 1px solid var(--line); }
.dashboard-page .ranking-medal { justify-self: center; font-size: 18px; line-height: 1; }
.dashboard-page .ranking-name { font-size: 14px; overflow-wrap: anywhere; }
.dashboard-page .ranking-value {
  justify-self: end;
  text-align: right;
  padding-left: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dashboard-page #ranking-today, .dashboard-page .monthly-ranking-empty { margin: 10px 0 0; color: var(--muted); font-size: 13px; }

.admin-page .admin-nav [aria-current="location"] {
  background: #25456d;
  border-color: #7daff0;
}

.admin-page .user-group-list h3 { margin: 0 0 6px; font-size: 1rem; }
.admin-page .user-group-list h3 span { margin-left: 4px; font-size: .85rem; font-weight: 500; color: var(--muted); }
.admin-page .user-group-list [data-group-empty] { margin: 0 0 16px; color: var(--muted); font-size: .9rem; }

.admin-page .user-group-chips { display: flex; flex-wrap: wrap; align-items: end; gap: 6px; }
.admin-page .user-group-chips button { padding: 5px 12px; border-radius: 999px; font: inherit; }
.admin-page .user-group-chips [aria-pressed="true"] { background: #25456d; border-color: #7daff0; }

.dashboard-page #member-stats-heading { margin: 22px 0 10px; font-size: 19px; }
.dashboard-page .member-stats-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 12px; }
.dashboard-page .member-stats-card {
  --profile-accent: #79aefa;
  min-width: 0;
  overflow: hidden;
  border: 1px solid #303d52;
  border-radius: 12px;
  background: #111a28;
}
.dashboard-page .member-stats-card-live { --profile-accent: #ff91ac; border-color: #9d5668; }
.dashboard-page .member-stats-header {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: end;
  min-height: 200px;
  aspect-ratio: 1.9;
  padding: 14px;
  border-bottom: 2px solid var(--profile-accent);
  background: #19283d;
}
.dashboard-page .member-stats-header::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, #0a101bd9 68%, #0a101b 100%);
}
.dashboard-page .member-stats-avatar {
  position: absolute;
  z-index: -2;
  inset: 0;
  display: grid;
  place-items: center;
  padding-bottom: 20px;
  overflow: hidden;
  background: #25364e;
  color: #b2c8e5;
  font-size: clamp(48px, 9vw, 84px);
  font-weight: 800;
}
.dashboard-page .member-stats-avatar img { position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: center 38%; }
.dashboard-page .member-stats-identity { min-width: 0; }
.dashboard-page .member-stats-identity h3 {
  margin: 0;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.18;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.dashboard-page .member-stats-identity p { margin: 4px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.dashboard-page .member-stats-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  color: #c7d7eb;
  font-size: 11px;
}
.dashboard-page .member-stats-state::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #a5b7ce; }
.dashboard-page .member-stats-state-live { color: #ffd0dc; }
.dashboard-page .member-stats-state-live::before { background: var(--profile-accent); }
.dashboard-page .member-stats-empty { color: var(--muted); font-size: 13px; }
.dashboard-page .member-stats-record { padding: 2px 13px; background: #101926; }
.dashboard-page .member-metrics { padding: 7px 0; }
.dashboard-page .member-metrics + .member-metrics { border-top: 1px solid #2b3a51; }
.dashboard-page .member-metrics h4 { margin: 0 0 4px; color: #b6cdf0; font-size: 12px; }
.dashboard-page .member-metrics dl { display: grid; grid-template-columns: .85fr 1.3fr .85fr; gap: 4px; margin: 0; }
.dashboard-page .member-metrics dt { color: var(--muted); font-size: 11px; }
.dashboard-page .member-metrics dd { margin: 1px 0 0; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 1000px) { .dashboard-page .member-stats-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 580px) { .dashboard-page .member-stats-cards { grid-template-columns: 1fr; } }
