:root {
  --bg: #FAF8FC;
  --card: #FFFFFF;
  --border: #E8E1F2;
  --text: #241B2E;
  --text-soft: #6B6178;
  --muted-bg: #F1EDF6;
  --accent: #7C3AED;
  --accent-dark: #4C1D95;
  --accent-chip: #F1EAFB;
  --accent-border: #DCC9F5;
  --on-accent: #FFFFFF;
  --on-accent-soft: #EBDBFF;
  --success-bg: #EAF6EE;
  --success-text: #1F7A43;
  --avatar-bg: #F1EAFB;
  --avatar-text: #5B21B6;
  --warn-bg: #FAEEDA;
  --warn-border: #F0C979;
  --warn-text: #7A4D0A;
  --danger-text: #B3261E;
  --label-color: #4C1D95;
}

[data-theme="dark"] {
  --bg: #17111F;
  --card: #241B2E;
  --border: #372A46;
  --text: #F3EEFA;
  --text-soft: #C7BDD8;
  --muted-bg: #372A46;
  --accent: #8B5CF6;
  --accent-dark: #3B2A57;
  --accent-chip: #3B2A57;
  --accent-border: #4E3866;
  --on-accent: #FFFFFF;
  --on-accent-soft: #E4D6FA;
  --success-bg: #1F3A2A;
  --success-text: #7CD9A0;
  --avatar-bg: #3B2A57;
  --avatar-text: #D8C7FA;
  --warn-bg: #3D2A0C;
  --warn-border: #6B4A14;
  --warn-text: #F5C264;
  --danger-text: #F2A0A0;
  --label-color: #FED71D;
}

* { box-sizing: border-box; }

/* ---------- Intro curtain ---------- */
#curtain {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--accent-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Pure-CSS safety net: if JS never runs, this still clears the curtain
     on its own after a couple of seconds rather than blocking the page forever. */
  animation: curtain-fallback 0.6s ease-in-out 2.2s forwards;
}
#curtain img { width: 72px; height: 72px; object-fit: contain; }
@keyframes curtain-fallback {
  to { transform: translateY(100%); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  #curtain { display: none; }
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Manrope', system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

#app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

a { color: inherit; }

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Header ---------- */
.pab-header {
  padding: calc(18px + env(safe-area-inset-top, 0px)) 20px 16px;
  background: var(--accent-dark);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}
.pab-header .brand-sub {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--on-accent-soft);
}
.pab-header .brand-main {
  font-size: 25px;
  font-weight: 800;
  color: var(--on-accent);
}
.brand-row { display: flex; align-items: center; gap: 12px; }
.header-logo { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.header-logo.small { width: 30px; height: 30px; }
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.icon-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  color: var(--on-accent-soft);
  font-size: 14px;
  font-weight: 700;
  padding: 6px;
  border-radius: 8px;
}
.icon-btn:hover { background: rgba(255,255,255,0.12); }
.icon-btn svg { display: block; width: 20px; height: 20px; }

/* ---------- Info banner ---------- */
.infobox {
  overflow: hidden;
  flex-shrink: 0;
  max-height: 0;
  opacity: 0;
}
.infobox-inner {
  margin: 12px 20px 0;
  padding: 12px 14px;
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 15px;
  color: var(--warn-text);
  line-height: 1.4;
}
.infobox-inner strong { font-weight: 700; }
.infobox-inner svg { flex-shrink: 0; margin-top: 1px; }

/* ---------- Content ---------- */
.pab-content {
  padding: 4px 20px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.reveal { opacity: 0; }

.chip {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--label-color);
  background: var(--accent-chip);
  padding: 4px 10px;
  border-radius: 20px;
  margin-top: 2px;
  margin-bottom: 10px;
}

.hero-card, .list-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
}
.list-card { border-radius: 16px; padding: 14px 16px; }

.flip-wrap { perspective: 1200px; overflow: hidden; height: 122px; }
.flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}
.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.flip-front { position: relative; } /* natural document flow, used for JS measurement */
.flip-back {
  transform: rotateX(180deg);
  overflow-y: auto;
  background: #FED71D;
  color: #4C1D95;
  margin: -14px -16px;
  padding: 34px 16px 14px;
  width: calc(100% + 32px);
}
.flip-back > * + * { margin-top: 10px; }
.flip-back .attendee-row span { color: #4C1D95; }
.flip-back .empty-note { color: #4C1D95; opacity: 0.75; }
.count-flip-trigger {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  font: inherit;
  color: inherit;
}
.count-flip-trigger .count-badge { transition: box-shadow 0.15s ease; }
.count-flip-trigger:hover .count-badge { box-shadow: 0 0 0 3px rgba(124,58,237,0.15); }
.flip-back-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(76,29,149,0.12);
  border: none;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4C1D95;
  cursor: pointer;
  z-index: 3;
}
.status-select {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: #7C3AED url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M6 9l6 6 6-6"/></svg>') no-repeat right 14px center / 16px 16px;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 12px 40px 12px 16px;
  font-weight: 700;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.status-select:disabled { opacity: 0.6; cursor: default; }

.card-title { font-size: 22px; font-weight: 800; }
.card-sub { font-size: 16px; color: var(--text-soft); margin-top: 2px; }

.rsvp-row { display: flex; gap: 10px; margin: 14px 0 16px; }
.btn-going, .btn-decline {
  flex: 1;
  font-size: 16px;
  font-weight: 700;
  border-radius: 12px;
  min-height: 46px;
  border: 2px solid transparent;
}
.btn-going {
  color: var(--success-text);
  background: var(--success-bg);
  border-color: var(--success-text);
}
.btn-going.is-off {
  color: var(--text-soft);
  background: var(--bg);
  border: 1px solid var(--border);
  font-weight: 500;
}
.btn-decline {
  color: var(--text-soft);
  background: var(--bg);
  border: 1px solid var(--border);
  font-weight: 500;
}
.btn-decline.is-off {
  color: var(--danger-text);
  background: var(--card);
  border: 1px solid var(--danger-text);
  font-weight: 700;
}

.attendees-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}
.attendees-panel {
  background: #FED71D;
  border: 1px solid #E3BE10;
  border-radius: 14px;
  padding: 14px;
  margin-top: 14px;
}
.attendees-panel .attendees-heading { border-top: none; padding-top: 0; color: #4C1D95; }
.attendees-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgb(76 29 149);
  color: #faf8fc;
  font-size: 15px;
  font-weight: 800;
  border-radius: 999px;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  margin-left: 6px;
  vertical-align: middle;
  line-height: 1;
}
.declined-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgb(254 215 29);
  color: #4c1d95;
  font-size: 12px;
  font-weight: 800;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 3px;
  vertical-align: middle;
  line-height: 1;
}
.attendees-panel .attendee-row span { color: #4C1D95; }
.attendees-panel .empty-note { color: #4C1D95; opacity: 0.75; }
.attendee-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

.declined-wrap { position: relative; margin-top: 14px; }
.declined-tab {
  position: absolute;
  right: 0;
  top: -12px;
  background: #B91C1C;
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 6px 16px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  transition: background 0.15s ease, color 0.15s ease;
}
.declined-tab.is-open { background: #E5E1EA; color: #B91C1C; }
.declined-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  background: #B91C1C;
  border-radius: 0 0 14px 14px;
  margin: 0 -14px -14px -14px;
}
.declined-list { padding: 30px 14px 14px 54px; display: flex; flex-direction: column; gap: 6px; }
.declined-row { color: #fff; font-weight: 700; font-size: 15px; }

.attendee-row { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--avatar-bg); color: var(--avatar-text);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.attendee-row span { font-size: 15px; font-weight: 700; color: var(--label-color); }
.empty-note { font-size: 15px; color: var(--text-soft); margin-top: 10px; }

.section-heading {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.list-card-top { display: flex; align-items: baseline; justify-content: space-between; }
.list-card .list-title { font-size: 16px; font-weight: 700; }
.list-card .list-time { font-size: 15px; color: var(--text-soft); }
.list-card .list-loc { font-size: 15px; color: var(--text-soft); margin: 2px 0 10px; }
.list-card .list-bottom { display: flex; align-items: center; justify-content: space-between; }
.list-card .count { font-size: 15px; color: var(--text-soft); }
.count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #FED71D;
  color: #4C1D95;
  font-weight: 800;
  font-size: 13px;
}

.badge-cancelled {
  font-size: 14px; font-weight: 700;
  color: var(--warn-text); background: var(--warn-bg);
  padding: 2px 8px; border-radius: 10px;
}
.badge-full {
  font-size: 15px; font-weight: 700;
  color: var(--text-soft); background: var(--muted-bg);
  padding: 7px 14px; border-radius: 20px;
}
.btn-join {
  font-size: 15px; font-weight: 700;
  color: var(--on-accent); background: var(--accent);
  border: none; padding: 9px 16px; border-radius: 20px; min-height: 38px;
}
.badge-going {
  font-size: 15px; font-weight: 700;
  color: var(--success-text); background: var(--success-bg);
  padding: 7px 14px; border-radius: 20px;
  border: none;
}

.footer-link { text-align: center; padding-top: 4px; }
.footer-link a { font-size: 15px; font-weight: 500; color: var(--text-soft); }

/* ---------- Login screen ---------- */
.login-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 24px;
  gap: 18px;
}
.login-screen h1 { font-size: 23px; margin: 0; }
.login-screen p { font-size: 16px; color: var(--text-soft); margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 18px; font-weight: 700; color: var(--text-soft); }
.field input {
  height: 46px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 17px; padding: 0 14px;
  font-family: inherit;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn-primary {
  height: 48px; border-radius: 12px; border: none;
  background: var(--accent); color: var(--on-accent);
  font-size: 17px; font-weight: 700;
}
.form-error { font-size: 15px; color: var(--danger-text); min-height: 18px; }

/* ---------- Admin ---------- */
.admin-header { background: var(--accent-dark); }
.admin-header .brand-main {
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100vw - 140px);
}
.back-link { font-size: 15px; font-weight: 500; color: var(--on-accent-soft); margin-bottom: 6px; display: inline-block; }
.admin-actions { display: flex; gap: 14px; }

/* Past sessions in admin list — greyed out, Slet stays red */
.session-past { opacity: 0.45; }
.session-past .list-title,
.session-past .list-time,
.session-past .list-loc,
.session-past .count { color: var(--text-soft); }
.session-past-btn { opacity: 0.5; pointer-events: none; }

.member-card { padding: 12px 16px; }
.coach-card { border: 2px solid #7C3AED; }
.member-row-1 { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.member-row-1 strong { font-size: 15px; min-width: 0; overflow-wrap: break-word; }
.member-row-1-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.member-row-2 { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.member-row-2-icons { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.icon-action-btn {
  background: none; border: none; padding: 5px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-soft);
}
.icon-action-btn:hover { background: var(--muted-bg); }
.icon-action-btn.danger { color: var(--danger-text); }
.icon-action-btn.accent { color: var(--accent); }
.coach-toggle-btn { position: relative; }
.coach-star { position: absolute; top: -1px; right: -1px; display: flex; pointer-events: none; }

.login-status { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; }
.login-status.accent { color: var(--accent); }
.login-status.danger { color: var(--danger-text); }
.link-btn { font-size: 15px; font-weight: 700; background: none; border: none; color: var(--accent); padding: 0; }
.link-btn.muted { color: var(--text-soft); }
.link-btn.danger { color: var(--danger-text); }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: flex; align-items: flex-end; justify-content: center; z-index: 10;
}
.modal-sheet {
  width: 100%; max-width: 480px; background: var(--card);
  border-radius: 20px 20px 0 0; padding: 20px; display: flex; flex-direction: column; gap: 14px;
  max-height: 88vh; overflow-y: auto;
}
.modal-sheet h2 { margin: 0; font-size: 20px; }
.modal-row { display: flex; gap: 10px; }
.modal-row .field { flex: 1; }
.modal-buttons { display: flex; gap: 10px; margin-top: 4px; }
.btn-secondary {
  flex: 1; height: 44px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-soft); font-weight: 500; font-size: 15px;
}

/* ---------- Toast (install prompt / push opt-in) ---------- */
.pab-toast {
  position: fixed;
  left: 16px; right: 16px; bottom: 16px;
  max-width: 448px;
  margin: 0 auto;
  background: var(--accent-dark);
  border: none;
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: 0 14px 34px rgba(20, 10, 35, 0.32);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 40;
  opacity: 0;
}
.pab-toast-body { display: flex; align-items: center; gap: 12px; }
.pab-toast-logo { width: 42px; height: 42px; object-fit: contain; flex-shrink: 0; }
.pab-toast-text { font-size: 15px; color: var(--on-accent-soft); line-height: 1.4; }
.pab-toast-text strong { display: block; font-size: 17px; color: var(--on-accent); margin-bottom: 2px; font-weight: 800; }
.pab-toast-actions { display: flex; gap: 8px; justify-content: flex-end; }
.pab-toast-btn {
  font-size: 14px; font-weight: 700; border-radius: 10px; padding: 9px 16px; border: none;
  background: var(--on-accent); color: var(--accent-dark);
}
.pab-toast-btn.ghost { background: rgba(255,255,255,0.16); color: var(--on-accent); font-weight: 600; }

.ios-steps { display: flex; flex-direction: column; gap: 9px; padding: 2px 2px 0; }
.ios-step { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--on-accent-soft); line-height: 1.35; }
.ios-step-num {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  color: var(--on-accent);
  font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.ios-step strong { color: var(--on-accent); font-weight: 700; }

/* ---------- Notification bell ---------- */
.bell-count {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 3px;
  border-radius: 8px;
  background: #fed71d;
  color: #4c1d95;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
#bell-btn { position: relative; }

.notif-panel {
  position: fixed;
  width: min(320px, 88vw);
  min-height: 90px;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(20, 10, 35, 0.2);
  z-index: 50;
  padding: 6px;
  transform-origin: top right;
}
.notif-empty { padding: 16px; font-size: 15px; color: var(--text-soft); text-align: center; }
.notif-clear-row {
  display: flex;
  justify-content: flex-end;
  padding: 8px 12px 4px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.notif-clear-row .link-btn { font-size: 12px; }
.push-status-line {
  font-size: 14px;
  font-weight: 600;
  padding: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.push-status-line.on { color: var(--success-text); }
.push-status-line.off { color: var(--text-soft); }
.push-status-line.loading { color: var(--text-soft); }
.push-status-line .link-btn { font-size: 13px; flex-shrink: 0; }

.push-toggle {
  position: relative;
  width: 42px; height: 24px;
  border-radius: 999px;
  border: none;
  background: var(--muted-bg);
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s ease;
}
.push-toggle.on { background: var(--success-text); }
.push-toggle:disabled { opacity: 0.6; cursor: default; }
.push-toggle-knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform 0.15s ease;
}
.push-toggle.on .push-toggle-knob { transform: translateX(18px); }

.notify-pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
}
.notify-pref-row:first-of-type { border-top: none; }
.notify-pref-label { font-size: 14px; font-weight: 600; color: var(--text); }
.notify-pref-hint { font-size: 12px; color: var(--text-soft); margin-top: 2px; }
.notif-item {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  text-decoration: none;
}
.notif-item:hover, .notif-item:focus { background: var(--muted-bg); }
.notif-item.unread { background: var(--accent-chip); }
.notif-msg { font-size: 15px; color: var(--text); line-height: 1.35; }
.notif-time { font-size: 13px; color: var(--text-soft); margin-top: 3px; }

/* ---------- Push-admin icon picker ---------- */
.icon-picker { display: flex; gap: 12px; }
.icon-option {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  cursor: pointer;
}
.icon-option img { width: 40px; height: 40px; }
.icon-option span { font-size: 14px; font-weight: 700; color: var(--text-soft); }
.icon-option.selected { border-color: var(--accent); background: var(--accent-chip); }
.icon-option.selected span { color: var(--accent); }
.field textarea {
  border-radius: 12px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 17px; padding: 12px 14px;
  font-family: inherit; resize: vertical; min-height: 90px;
}
.field select {
  height: 46px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 17px; padding: 0 14px;
  font-family: inherit;
}
.send-result { font-size: 15px; color: var(--success-text); min-height: 18px; }

/* ---------- Settings page ---------- */
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type="color"] {
  width: 46px; height: 46px; padding: 0; border-radius: 12px; border: 1px solid var(--border);
  background: var(--card); cursor: pointer;
}
.color-row input[type="text"] {
  flex: 1; height: 46px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 16px; font-family: monospace; padding: 0 14px;
}
.logo-preview {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 14px;
}
.logo-preview img {
  width: 56px; height: 56px; border-radius: 14px; object-fit: cover; background: var(--muted-bg);
}
.field-hint { font-size: 14px; color: var(--text-soft); margin-top: 4px; }
.section-title { font-size: 16px; font-weight: 700; color: var(--text); margin-top: 4px; }

/* ---------- Status badges for the late-flag feature ---------- */
.status-menu { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 16px; }
.status-chip {
  font-size: 14.5px; font-weight: 700; border-radius: 20px; padding: 8px 12px;
  border: 1px solid var(--border); background: var(--bg); color: var(--text-soft);
}
.status-chip.active.going { color: var(--success-text); background: var(--success-bg); border-color: var(--success-text); }
.status-chip.active.late { color: var(--warn-text); background: var(--warn-bg); border-color: var(--warn-border); }
.status-chip.active.declined { color: var(--danger-text); background: var(--card); border-color: var(--danger-text); }
.attendee-status { font-size: 13px; color: var(--warn-text); font-weight: 700; margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.late-icon { position: relative; display: inline-flex; flex-shrink: 0; }
.late-icon-badge {
  position: absolute;
  top: -3px;
  right: -4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #DC2626;
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-summary {
  display: flex; align-items: center; justify-content: space-between;
  margin: 14px 0 16px;
}

/* ---------- Chat / coordination messages ---------- */
.chat-thread {
  display: flex; flex-direction: column; gap: 8px;
  margin-top: 10px;
}
.chat-msg { display: flex; flex-direction: column; gap: 2px; max-width: 88%; }
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg-meta {
  font-size: 13px; font-weight: 700; color: var(--label-color);
  display: flex; align-items: center; gap: 6px;
}
.chat-msg-meta::before {
  content: ''; display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--label-color); flex-shrink: 0;
}
.chat-msg.mine .chat-msg-meta { justify-content: flex-end; }
.chat-msg-bubble {
  font-size: 15px; line-height: 1.4; color: var(--text);
  background: var(--muted-bg); border-radius: 14px; padding: 8px 12px;
}
.chat-msg.mine .chat-msg-bubble { background: var(--accent-chip); }
.chat-input-row { display: flex; gap: 8px; margin-top: 10px; }
.chat-input-row input {
  flex: 1; min-width: 0; height: 42px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 16px; padding: 0 12px; font-family: inherit;
}
.chat-input-row button { height: 42px; padding: 0 16px; }

.typing-indicator {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 2px 0; min-height: 20px;
}
.typing-indicator .typing-name { font-size: 12px; color: var(--text-soft); }
.typing-dots { display: flex; gap: 3px; align-items: center; }
.typing-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: #FED71D;
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .typing-dots span { animation: none; opacity: 1; }
}

/* ---------- Round Robin ---------- */

.rr-empty-state { text-align: center; padding: 8px 20px 20px; }
.rr-empty-icon { width: 48px; height: 48px; margin-bottom: 10px; }
.rr-empty-title { font-size: 18px; font-weight: 800; margin-bottom: 6px; }
.rr-empty-text { font-size: 14px; color: var(--text-soft); }

.rr-player-list { display: flex; flex-direction: column; gap: 4px; }
.rr-player-list-flat { max-height: none; overflow-y: visible; }
.rr-player-check { display: flex; align-items: center; gap: 10px; padding: 8px 4px; font-size: 18px; font-weight: 600; }
.rr-player-count-badge { font-size: 13px; font-weight: 700; background: #7c3aed; color: #fff; border-radius: 20px; padding: 2px 10px; min-width: 28px; text-align: center; }
.rr-player-check input { width: 18px; height: 18px; accent-color: #7C3AED; }

/* Round count picker — dropdown + info box */
.rr-rounds-infobox {
  display: flex; align-items: flex-start; gap: 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 10px 12px;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}
.rr-rounds-infobox-green {
  background: rgba(22, 163, 74, 0.12);
  border-color: rgba(22, 163, 74, 0.45);
  color: #16a34a;
}
.rr-rounds-infobox-orange {
  background: rgba(234, 88, 12, 0.1);
  border-color: rgba(234, 88, 12, 0.5);
  color: #ea580c;
}
.rr-rounds-infobox-red {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.5);
  color: #dc2626;
}

.rr-round-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.rr-round-title { font-size: 18px; font-weight: 800; }
.rr-nav-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid #FED71D;
  background: var(--card);
  color: var(--text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.rr-nav-btn:disabled { opacity: 0.35; cursor: default; }

/* ── Per-court carousels ──────────────────────────────────── */
.rr-carousels { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.rr-carousel { display: flex; flex-direction: column; gap: 4px; }
.rr-carousel-nav {
  display: flex; align-items: center; gap: 6px;
}
.rr-carousel-title { font-size: 18px; font-weight: 800; text-align: center; margin-bottom: 6px; }
.rr-carousel-divider { border: none; border-top: 2px solid #FED71D; margin: 12px 0; }
.rr-carousel-btn {
  width: 36px; height: 56px;
  border-radius: 10px;
  border: none;
  background: #7c3aed;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  flex-shrink: 0;
}
.rr-carousel-btn:disabled { opacity: 0.35; cursor: default; }
.rr-carousel-card { flex: 1; }
.rr-sitting-out-carousel { margin-top: 4px; }
.rr-set-active-wrap { display: flex; justify-content: center; margin: 8px 0 4px; }
.rr-set-active-btn {
  padding: 6px 18px; border-radius: 20px; border: 2px solid #7c3aed;
  background: transparent; color: #7c3aed; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.rr-set-active-btn--on {
  background: #16a34a; border-color: #16a34a; color: #fff;
}
.rr-no-active-round {
  text-align: center; color: #888; font-size: 15px; padding: 24px 0; font-style: italic;
}

/* TEST run button on setup page */
.rr-gameplan-btn {
  display: block; width: 100%; padding: 13px; border-radius: 14px; border: 2px solid rgba(22,163,74,0.4);
  background: rgba(22,163,74,0.07); color: #16a34a;
  font-size: 15px; font-weight: 600; cursor: pointer; text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.rr-gameplan-btn:hover { border-color: #16a34a; background: rgba(22,163,74,0.13); }
/* ── Gameplan modal ─────────────────────────────────────── */
.gp-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 1000;
  display: flex; align-items: flex-end; justify-content: center;
}
.gp-modal {
  background: var(--card); border-radius: 20px 20px 0 0; width: 100%; max-width: 480px;
  max-height: 90vh; overflow-y: auto; padding: 0 0 calc(32px + env(safe-area-inset-bottom, 0px));
}
/* Sticky header — purple gradient like the print page */
.gp-modal-header {
  position: sticky; top: 0; z-index: 1;
  background: linear-gradient(135deg, #4C1D95 0%, #6D28D9 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 14px;
  font-size: 18px; font-weight: 800;
  border-radius: 20px 20px 0 0;
}
.gp-close-btn { background: rgba(255,255,255,.15); border: none; border-radius: 50%; width: 32px; height: 32px; font-size: 16px; cursor: pointer; color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.gp-close-btn:active { opacity: .7; }

/* Action buttons row */
.gp-action-bar { display: flex; gap: 10px; padding: 12px 14px 8px; }
.gp-action-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--muted-bg); border: 1.5px solid var(--border);
  color: var(--text); font-family: inherit; font-weight: 700; font-size: 14px;
  padding: 11px 10px; border-radius: 12px; cursor: pointer;
}
.gp-action-btn:active { opacity: .75; }

/* Meta pills */
.gp-meta { display: flex; flex-wrap: wrap; gap: 7px; padding: 6px 14px 10px; }
.gp-meta-pill { background: #EDE9FE; color: #4C1D95; font-weight: 700; font-size: 12px; padding: 4px 11px; border-radius: 20px; }

/* Round cards */
.gp-rounds-list { display: flex; flex-direction: column; gap: 10px; padding: 4px 14px 10px; }
.gp-round {
  border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden;
}
.gp-round-header {
  background: #4C1D95; color: #fff;
  padding: 7px 13px; font-size: 12px; font-weight: 800;
  letter-spacing: .07em; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.gp-round-num {
  background: rgba(255,255,255,.2); border-radius: 50%;
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
}
.gp-court {
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 14px; border-top: 1px solid var(--border); background: var(--card);
}
.gp-court:first-of-type { border-top: none; }
.gp-court-label {
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: #4C1D95; background: #EDE9FE; border-radius: 6px; padding: 3px 10px;
  align-self: flex-start;
}
.gp-matchup {
  display: flex; flex-direction: column; gap: 0;
}
.gp-team {
  display: flex; flex-direction: column; gap: 2px;
}
.gp-player {
  font-size: 19px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-align: center;
}
.gp-player-a { color: #6D28D9; }
.gp-vs-divider {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--text-soft);
  margin: 8px 0;
}
.gp-vs-divider::before,
.gp-vs-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.gp-sitout-row {
  padding: 8px 14px; border-top: 1px solid var(--border);
  background: #FEF3C7; font-size: 14px; color: #92400E; font-weight: 600;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.gp-sitout-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; opacity: .7; font-weight: 700; }

/* Summary */
.gp-summary-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-soft); padding: 10px 14px 6px; border-top: 1px solid var(--border); margin-top: 4px; }
.gp-legend { display: flex; flex-direction: column; gap: 6px; padding: 4px 14px 40px; }
.gp-legend-item { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 15px; background: var(--muted-bg); border-radius: 8px; padding: 8px 14px; }
.gp-legend-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gp-legend-count { color: var(--text-soft); font-size: 14px; white-space: nowrap; flex-shrink: 0; }
.rr-test-run-btn {
  display: block; width: 100%; padding: 13px; border-radius: 14px; border: 2px dashed var(--border);
  background: transparent; color: var(--text-soft);
  font-size: 15px; font-weight: 600; cursor: pointer; text-align: center;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.rr-test-run-btn:hover:not(:disabled) { border-color: #7c3aed; color: #a78bfa; background: color-mix(in srgb, #7c3aed 8%, transparent); }
.rr-test-run-btn:disabled { opacity: 0.45; cursor: default; }

/* Test report (in-app) */
.tr-back { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.tr-title { font-size: 22px; font-weight: 800; color: var(--text); margin: 0 0 4px; }
.tr-meta { font-size: 13px; color: var(--text-soft); margin-bottom: 20px; }
.tr-section { font-size: 15px; font-weight: 700; color: #a78bfa; margin: 24px 0 8px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.tr-table-wrap { overflow-x: auto; }
.tr-table { border-collapse: collapse; width: 100%; font-size: 13px; min-width: 320px; }
.tr-table th { background: var(--card); color: #a78bfa; text-align: left; padding: 7px 10px; font-weight: 700; }
.tr-table td { padding: 6px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tr-table td.num, .tr-table th.num { text-align: right; }
.tr-table tr.top td { font-weight: 700; color: #c084fc; }
.tr-table td.pos { color: #4ade80; } .tr-table td.neg { color: #f87171; }
.tr-table td.sits { color: var(--text-soft); font-size: 12px; }
.tr-round { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.tr-round-hd { font-weight: 700; font-size: 14px; color: #c084fc; margin-bottom: 8px; }
.tr-court { font-size: 13px; margin-bottom: 5px; line-height: 1.4; }
.tr-court-lbl { font-size: 11px; font-weight: 700; color: #7c3aed; text-transform: uppercase; letter-spacing: .05em; margin-right: 6px; }
.tr-win { font-weight: 700; }
.tr-sit { font-size: 12px; color: #f87171; margin-top: 6px; }

.rr-sitting-out { font-size: 15px; color: var(--text-soft); margin-bottom: 12px; text-align: center; line-height: 1.5; }
.rr-sitting-out-label { font-weight: 700; }

.rr-courts { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }

.rr-court-flip-wrap { perspective: 1200px; overflow: hidden; height: 320px; }
.rr-court-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
}
.rr-court-flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.rr-court-flip-front { position: relative; }
.rr-court-flip-back { transform: rotateX(180deg); overflow-y: auto; }

/* Yellow marks whatever still needs attention — same role it plays
   everywhere else in the app. A court without a recorded score is
   exactly that: something waiting on you. Once scored, the back face
   settles into a calm, muted "done" look instead. */
.rr-court-visual {
  background: #FED71D;
  color: #4C1D95;
  border-radius: 16px;
  padding: 10px 16px 14px;
  margin: 0 22px; /* narrower than the card itself — taller-than-wide, like a real court */
}
.rr-court-visual-done {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}
.rr-court-badge {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(76,29,149,0.15);
  color: #4C1D95;
  font-size: 12px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 8px;
}
.rr-court-visual-done .rr-court-badge { background: var(--muted-bg); color: var(--text-soft); }
.rr-court-badge-row { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 8px; }
.rr-court-badge-row .rr-court-badge { margin: 0; }
.rr-court-edit-btn {
  background: none; border: none; padding: 4px; cursor: pointer;
  color: var(--text-soft); border-radius: 6px; display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.rr-court-edit-btn:hover { color: var(--accent); background: var(--muted-bg); }
.rr-court-player { font-size: 17px; font-weight: 700; padding: 2px 0; text-align: center; }
.rr-court-visual-done .rr-court-player { opacity: 0.6; }
.rr-court-visual-done .rr-court-player.rr-winner { opacity: 1; color: var(--success-text); }
.rr-court-net-line {
  border-top: 2px dashed rgba(76,29,149,0.3);
  margin: 8px 0;
}
.rr-court-visual-done .rr-court-net-line { border-top-color: var(--border); }

/* Member view: animated ball court */
.rr-court-member { overflow: visible; }
.rr-court-spacer { height: 28px; }
.rr-court-label-row { display: flex; justify-content: flex-end; margin-bottom: 6px; padding-right: 22px; }
.rr-court-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-soft); display: flex; align-items: center; gap: 5px; }
.rr-court-num { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--muted-bg); color: var(--text); font-size: 11px; font-weight: 800; }
.rr-ball { position: absolute; width: 18px; height: 18px; pointer-events: none; will-change: left, top, opacity; transition: opacity 0.12s ease; z-index: 10; }

.rr-court-score-input {
  display: block;
  width: 64px;
  height: 40px;
  margin: 4px auto;
  border-radius: 10px;
  border: none;
  text-align: center;
  font-size: 18px;
  font-weight: 800;
  font-family: inherit;
  color: #4C1D95;
  background: rgba(255,255,255,0.7);
}
/* The slot is always the same fixed width, filled or not — that's what
   keeps the score digits themselves centered and aligned between the two
   rows, rather than shifting depending on which team happens to have won. */
.rr-court-team-score-row { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 4px 0; }
.rr-court-winner-logo-slot { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; margin-left: -30px; }
.rr-court-winner-logo { height: 34px; width: auto; display: block; }
.rr-court-team-score {
  font-size: 24px; /* 2px bigger, as asked, for the settled result specifically */
  font-weight: 800;
  opacity: 0.55;
}
.rr-court-team-score.won { opacity: 1; color: var(--success-text); }

.rr-score-save-btn {
  display: block;
  width: auto;
  margin: 8px 22px 0; /* matches .rr-court-visual's own inset, so it lines up with the court above it */
  background: #7C3AED;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 9px 8px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

/* ── Standings card ── */
.rr-standings-card { background: var(--card); border-radius: 16px; border: 1px solid var(--border); overflow: hidden; }
.rr-standings-header { background: #4C1D95; padding: 13px 16px; display: flex; align-items: center; gap: 10px; position: relative; overflow: hidden; }
.rr-standings-header-title { font-size: 19px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #fff; font-family: inherit; }
.rr-standings-header svg { flex-shrink: 0; }
.rr-standings-labels { display: grid; grid-template-columns: 28px 1fr 30px 30px 52px 44px; gap: 0; padding: 6px 16px 5px; border-bottom: 1px solid var(--border); background: var(--bg); }
.rr-standings-lbl { font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--text-soft); }
.rr-standings-lbl.r { text-align: right; }
.rr-standings { display: flex; flex-direction: column; }
.rr-standing-row { display: grid; grid-template-columns: 28px 1fr 30px 30px 52px 44px; align-items: center; gap: 0; padding: 9px 16px; border-bottom: 1px solid var(--border); }
.rr-standing-row:last-child { border-bottom: none; }
.rr-standing-rank-circle { width: 24px; height: 24px; border-radius: 50%; background: var(--border); color: #222; font-size: 13px; font-weight: 900; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.rr-standing-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; padding-left: 6px; }
.rr-standing-wins { font-size: 13px; font-weight: 600; color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.rr-standing-losses { font-size: 13px; font-weight: 600; color: var(--text-soft); text-align: right; font-variant-numeric: tabular-nums; }
.rr-standing-pts { font-size: 16px; font-weight: 800; color: #7C3AED; text-align: right; font-variant-numeric: tabular-nums; line-height: 1; }
.rr-standing-diff { font-size: 12px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; color: var(--text-soft); }
.rr-standing-diff.pos { color: #16a34a; }
.rr-standing-diff.neg { color: #dc2626; }
[data-theme="dark"] .rr-standing-pts { color: #c084fc; }
.rr-standings-live-badge {
  position: absolute;
  top: 0; right: 0;
  width: 64px; height: 64px;
  overflow: hidden;
  pointer-events: none;
}
.rr-standings-live-ribbon {
  position: absolute;
  top: 5px; right: -20px;
  width: 76px;
  background: #fff;
  transform: rotate(45deg);
  transform-origin: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 0;
}
.rr-live-ribbon-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #DC2626;
  flex-shrink: 0;
  animation: rr-live-pulse 2.4s ease-in-out infinite;
}
.rr-live-ribbon-text {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  color: #DC2626;
}

.rr-result-card { display: flex; flex-direction: column; gap: 6px; }
.rr-result-meta { font-size: 12px; color: var(--text-soft); font-weight: 700; text-align: center; }

.rr-complete-banner {
  text-align: center;
  margin-bottom: 14px;
}
.rr-complete-title { font-size: 19px; font-weight: 800; color: var(--success-text); }
.rr-complete-winner { font-size: 15px; font-weight: 700; color: var(--success-text); margin-top: 4px; opacity: 0.85; }
.rr-complete-logo { width: 46px; height: 46px; display: block; margin: 0 auto 8px; animation: rr-pulse 2s ease-in-out infinite; }
@keyframes rr-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

@keyframes rr-live-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

.rr-guest-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.rr-guest-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  background: var(--muted-bg);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}
.rr-guest-remove {
  background: none;
  border: none;
  color: var(--danger-text);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 6px;
  flex-shrink: 0;
}

.hero-chip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
}
.rr-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  color: #4C1D95;
  border: 1.5px solid rgba(76,29,149,0.18);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  margin-top: -6px;
}
[data-theme="dark"] .rr-link-pill {
  background: rgba(255,255,255,0.08);
  color: #c084fc;
  border-color: rgba(192,132,252,0.25);
}
@keyframes rrPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(220,38,38,0.35), 0 2px 8px rgba(220,38,38,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(220,38,38,0.12), 0 2px 8px rgba(220,38,38,0.2); }
}
@keyframes rrDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}
.rr-link-pill.rr-live {
  background: #dc2626;
  color: #fff;
  border-color: #b91c1c;
  font-size: 13px;
  padding: 6px 14px;
  animation: rrPulse 1.4s ease-in-out infinite;
  letter-spacing: 0.01em;
}
.rr-link-pill.rr-live img { filter: brightness(0) invert(1); }
.rr-link-pill.rr-live::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #fff;
  margin-right: 2px;
  animation: rrDot 1.4s ease-in-out infinite;
}
[data-theme="dark"] .rr-link-pill.rr-live {
  background: #dc2626;
  color: #fff;
  border-color: #b91c1c;
}

/* ── Season leaderboard ── */
.rr-season-loading { text-align: center; padding: 20px; font-size: 13px; color: var(--text-soft); }
.rr-season-empty { text-align: center; padding: 16px; font-size: 13px; color: var(--text-soft); }
.rr-season-board {
  margin-top: 10px;
  background: var(--card);
  border-radius: 16px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.rr-season-header {
  background: #4C1D95;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.rr-season-trophy { font-size: 18px; line-height: 1; flex-shrink: 0; }
.rr-season-title { font-size: 16px; font-weight: 800; color: #fff; }
.rr-season-sub { font-size: 13px; color: #fff; margin-left: auto; white-space: nowrap; }
.rr-season-list { display: flex; flex-direction: column; }
.rr-season-row {
  display: grid;
  grid-template-columns: 32px 1fr 44px 44px 14px;
  align-items: center;
  gap: 0;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
}
.rr-season-row:last-child { border-bottom: none; }
.rr-season-row--gold   { background: #fef9ee; }
.rr-season-row--silver { background: #f8f9fb; }
.rr-season-row--bronze { background: #fdf6f0; }
[data-theme="dark"] .rr-season-row--gold   { background: rgba(245,158,11,.08); }
[data-theme="dark"] .rr-season-row--silver { background: rgba(148,163,184,.05); }
[data-theme="dark"] .rr-season-row--bronze { background: rgba(180,83,9,.07); }
.rr-season-medal { font-size: 20px; line-height: 1; text-align: center; }
.rr-season-rank-circle { width: 24px; height: 24px; border-radius: 50%; background: var(--border); color: var(--text); font-size: 13px; font-weight: 900; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; }
.rr-season-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; padding-left: 4px; }
.rr-season-sessions { font-size: 11px; color: var(--text-soft); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rr-season-pts { font-weight: 800; font-size: 18px; color: #7C3AED; text-align: right; font-variant-numeric: tabular-nums; line-height: 1; }
.rr-season-pts-label { font-size: 11px; font-weight: 600; color: #7C3AED; padding-left: 1px; align-self: flex-end; padding-bottom: 1px; }
/* Keep old sparkline classes in case they're used elsewhere */
.rr-sparkline { display: inline-flex; align-items: center; gap: 2px; font-size: 20px; font-weight: 700; line-height: 1; }
.rr-spark.up { color: #16a34a; }
.rr-spark.dn { color: #dc2626; }
.rr-spark.eq { color: var(--text-soft); }
.rr-spark-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--text-soft); margin: 0 2px; }
[data-theme="dark"] .rr-season-pts { color: #c084fc; }

/* ── Admin gear button ── */
.rr-gear-btn {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: rgba(255,255,255,0.75);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  transition: color 0.15s, background 0.15s;
}
.rr-gear-btn:hover { color: #fff; background: rgba(255,255,255,0.15); }

/* ── Admin slide-up sheet ── */
.rr-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
}
.rr-admin-sheet {
  width: 100%;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 0 0 calc(env(safe-area-inset-bottom, 0px) + 36px);
  transform: translateY(100%);
  box-shadow: 0 -4px 32px rgba(0,0,0,0.18);
  max-height: 85vh;
  overflow-y: auto;
}
.rr-admin-sheet-handle {
  display: block;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 12px auto 4px;
}
.rr-admin-sheet-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  padding: 10px 20px 14px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.rr-status-badge {
  margin-left: auto;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  border-radius: 20px;
  padding: 3px 10px;
}
.rr-status-live {
  background: #dc2626;
  color: #fff;
  animation: rr-pulse 1.2s ease-in-out infinite;
}
.rr-status-slut {
  background: var(--muted-bg);
  color: var(--text-soft);
}
@keyframes rr-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.rr-admin-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-soft);
  padding: 12px 20px 4px;
}
.rr-admin-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  background: none;
  border: none;
  border-top: 1px solid var(--border);
  padding: 15px 20px;
  cursor: pointer;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  transition: background 0.12s;
}
.rr-admin-action-btn:hover { background: var(--muted-bg); }
.rr-admin-action-btn.danger { color: var(--danger-text); }
.rr-admin-action-btn svg { flex-shrink: 0; opacity: 0.65; }
.rr-admin-action-btn.danger svg { opacity: 1; }
.rr-admin-best-n-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; border-bottom: 1px solid var(--border); }
.rr-admin-best-n-label { font-size: 16px; color: var(--text-soft); }
.rr-admin-best-n-ctrl { display: flex; align-items: center; gap: 10px; }
.rr-best-n-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); background: var(--muted-bg); color: var(--text); font-size: 20px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.rr-best-n-btn:hover { background: var(--border); }
.rr-best-n-val { font-size: 18px; font-weight: 700; min-width: 24px; text-align: center; }
#rr-season-sessions-list .rr-season-empty { font-size: 13px; color: var(--text-soft); padding: 10px 20px; border-top: 1px solid var(--border); }
#rr-season-sessions-list .rr-season-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 20px; border-top: 1px solid var(--border); gap: 12px; }
#rr-season-sessions-list .rr-season-info { display: flex; flex-direction: column; gap: 2px; }
#rr-season-sessions-list .rr-season-date { font-size: 17px; font-weight: 600; color: var(--text); }
#rr-season-sessions-list .rr-season-meta { font-size: 12px; color: var(--text-soft); }
.rr-season-remove-btn { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; border: none; background: #FEF2F2; color: var(--danger-text); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s; }
.rr-season-remove-btn:hover { background: #FECACA; }
[data-theme="dark"] .rr-season-remove-btn { background: #3D1515; }
[data-theme="dark"] .rr-season-remove-btn:hover { background: #5A1A1A; }
/* Toggle switch for admin settings */
.rr-toggle-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; }
.rr-toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.rr-toggle-track { width: 48px; height: 28px; border-radius: 14px; background: var(--border); transition: background 0.2s; display: flex; align-items: center; padding: 2px; }
.rr-toggle-switch input:checked + .rr-toggle-track { background: #16a34a; }
.rr-toggle-thumb { width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.25); transition: transform 0.2s; }
.rr-toggle-switch input:checked + .rr-toggle-track .rr-toggle-thumb { transform: translateX(20px); }

/* ---- Video Tip card ---- */
.video-tip-card { background: var(--accent); border-radius: 18px; overflow: hidden; margin-bottom: 10px; box-shadow: 0 4px 20px rgba(76,29,149,0.3); }
.video-tip-eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em; color: rgba(255,255,255,0.7); padding: 14px 16px 0; }
.video-tip-title { font-size: 16px; font-weight: 700; color: #fff; padding: 6px 16px 12px; line-height: 1.3; }
.video-tip-frame-wrap { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; }
.video-tip-frame-wrap.video-tip-portrait { aspect-ratio: 9/16; }
.video-tip-frame-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }

/* ── Robin historik — public toggle i admin ── */
.rr-season-public-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--muted-bg);
  color: var(--text-soft);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.rr-season-public-btn:hover { background: var(--border); }
.rr-season-public-btn.is-public { background: var(--accent-chip); color: var(--accent); border-color: var(--accent-border); }

/* ── Robin historik — liste på forsiden ── */
.rr-history-section { margin-top: 16px; }
.rr-history-title {
  font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-soft); margin-bottom: 8px; padding: 0 2px;
}
.rr-history-btn {
  display: flex; align-items: center; gap: 10px;
  width: 100%; background: var(--card);
  border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 8px;
  cursor: pointer; text-align: left;
  transition: background 0.12s, border-color 0.12s;
}
.rr-history-btn:hover { background: var(--muted-bg); border-color: var(--accent-border); }
.rr-history-btn-date { font-size: 15px; font-weight: 700; color: var(--text); flex: 1; }
.rr-history-btn-meta { font-size: 13px; color: var(--text-soft); white-space: nowrap; }

/* ── Robin historik — detail view ── */
.rr-hist-back-row { padding: 4px 0 8px; }
.rr-hist-back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: none; border: none; cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--text-soft); padding: 4px 0;
}
.rr-hist-back-btn:hover { color: var(--text); }
.rr-hist-header { margin-bottom: 16px; }
.rr-hist-title { font-size: 20px; font-weight: 800; color: var(--text); text-transform: capitalize; }
.rr-hist-sub { font-size: 13px; color: var(--text-soft); margin-top: 2px; }
.rr-hist-rounds-title {
  font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--text-soft); margin: 16px 0 8px; padding: 0 2px;
}
.rr-hist-round {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; overflow: hidden; margin-bottom: 10px;
}
.rr-hist-round-hd {
  background: #4C1D95; color: #fff;
  padding: 7px 14px; font-size: 12px; font-weight: 800;
  letter-spacing: .07em; text-transform: uppercase;
}
.rr-hist-court {
  padding: 12px 14px; border-top: 1px solid var(--border);
}
.rr-hist-court:first-of-type { border-top: none; }
.rr-hist-court-label {
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: #4C1D95; background: #EDE9FE; border-radius: 6px;
  padding: 3px 10px; display: inline-block; margin-bottom: 8px;
}
.rr-hist-matchup {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px;
}
.rr-hist-team { display: flex; flex-direction: column; gap: 2px; }
.rr-hist-team.won .rr-hist-player { color: var(--success-text); font-weight: 700; }
.rr-hist-player { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-hist-vs {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.rr-hist-score { font-size: 20px; font-weight: 800; color: var(--text-soft); font-variant-numeric: tabular-nums; }
.rr-hist-score.won { color: var(--success-text); }
.rr-hist-sitout {
  padding: 8px 14px; border-top: 1px solid var(--border);
  background: #FEF3C7; font-size: 13px; color: #92400E; font-weight: 600;
}
