:root {
  --black: #000;
  --surface: #111;
  --surface-2: #1a1a1a;
  --surface-3: #222;
  --neon: #ADFF2F;
  --neon-dim: #7ACC00;
  --white: #fff;
  --border: #333;
  --text-secondary: #888;
  --fat: #EF5B5B;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-num: 'SF Mono', 'Fira Code', monospace;
  --radius: 12px;
  --radius-sm: 8px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--black);
  color: var(--white);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

/* === SCREENS === */
.screen { display: none; min-height: 100vh; min-height: 100dvh; }
.screen.active { display: flex; flex-direction: column; }

/* === SETUP === */
.setup-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 24px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.logo-img {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  display: block;
  border-radius: 16px;
  object-fit: contain;
}

.setup-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 4px;
  text-align: center;
}

.setup-subtitle {
  font-size: 14px;
  font-weight: 700;
  color: var(--neon);
  letter-spacing: 3px;
  text-align: center;
  margin-bottom: 28px;
}

/* === SECTION CARD === */
.section-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--neon);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

/* === PLAYER INPUT === */
.player-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.player-input-row input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--white);
  font-size: 15px;
  font-family: var(--font);
  outline: none;
  min-width: 0;
}
.player-input-row input:focus { border-color: var(--neon); }
.player-input-row input::placeholder { color: #444; }

.player-input-row .rating-input {
  flex: 0 1 168px;
  width: 168px;
  min-width: 120px;
  text-align: center;
  font-family: var(--font);
  font-size: 13px;
  padding: 12px 6px;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--white);
  outline: none;
  cursor: pointer;
}
.player-input-row .rating-input:focus { border-color: var(--neon); }
.player-input-row .rating-input option {
  background: var(--surface-2);
  color: var(--white);
}

.roster-note {
  font-size: 12px;
  color: var(--text-secondary);
  margin: -4px 0 10px;
  line-height: 1.4;
}

.input-hint {
  font-size: 11px;
  color: #555;
  margin-bottom: 10px;
}

.btn-add-small {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--neon);
  color: #000;
  font-size: 24px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-add-small:active { opacity: 0.85; }

/* === PLAYER LIST === */
.player-list {
  max-height: 240px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.player-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  font-size: 14px;
}

.player-tag-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-status {
  flex-shrink: 0;
  width: 44px;
  padding: 5px 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
}
.player-status.in {
  background: #1a2a1a;
  border-color: #2f4f2f;
  color: var(--neon);
}
.player-out { opacity: 0.55; }

.player-name { cursor: pointer; }

.player-rating {
  font-family: var(--font-num);
  font-size: 13px;
  font-weight: 700;
  color: var(--neon);
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
}

.inline-edit {
  background: var(--surface-3);
  border: 1px solid var(--neon);
  border-radius: 6px;
  color: var(--white);
  font-family: var(--font);
  font-size: 14px;
  padding: 4px 8px;
  outline: none;
  width: 110px;
}
.inline-edit-num {
  width: 56px;
  text-align: center;
  font-family: var(--font-num);
}
.inline-edit-select {
  width: 170px;
  text-align: center;
  font-size: 13px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.lineup-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 8px;
}
.lineup-sep { color: #444; }
.btn-link {
  text-decoration: none;
  background: none;
  border: none;
  color: var(--neon);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
}
.btn-link:active { opacity: 1; }

.player-tag-remove {
  background: none;
  border: none;
  color: #e5484d;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 16px;
  font-weight: 700;
}
.player-tag-remove:active { color: #b4232a; }

.player-count {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
}

/* === CONFIG === */
.config-row {
  display: flex;
  gap: 16px;
}

.config-row + .config-row { margin-top: 16px; }

.config-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  text-align: center;
}

.config-item {
  flex: 1;
}

.config-item label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.step-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--neon);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-btn:active { background: var(--surface-3); }

.step-value {
  font-size: 28px;
  font-weight: 800;
  font-family: var(--font-num);
  min-width: 36px;
  text-align: center;
}

/* === BUTTONS === */
.btn-primary {
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: var(--radius);
  background: var(--neon);
  color: #000;
  font-size: 15px;
  font-weight: 800;
  font-family: var(--font);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
}
.btn-primary:active { opacity: 0.85; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  padding: 14px 28px;
  border: 1px solid var(--neon);
  border-radius: var(--radius);
  background: transparent;
  color: var(--neon);
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.btn-secondary:active { background: rgba(173,255,47,0.1); }

/* === HEADER === */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.match-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--neon);
  letter-spacing: 3px;
}

.btn-icon {
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  padding: 8px;
  font-size: 18px;
  display: flex;
  align-items: center;
}

/* === QUALITY SUMMARY === */
.rota-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.chip {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}
.chip-ok { background: #1a2a1a; color: var(--neon); border: 1px solid #2f4f2f; }
.chip-warn { background: #2a1a1a; color: var(--fat); border: 1px solid #4f2f2f; }
.rota-note {
  font-size: 12px;
  color: var(--text-secondary);
  margin: -8px 0 16px;
  line-height: 1.4;
}

/* Tier first-round toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex: 0 0 auto;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-track {
  position: absolute;
  inset: 0;
  background: #4a4a52;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.toggle-track::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s;
}
.toggle-switch input:checked + .toggle-track {
  background: #2e7d32;
}
.toggle-switch input:checked + .toggle-track::before {
  transform: translateX(20px);
}

/* reserves & swap banner */
.player-status.res { background: #1a2a1a; border-color: #4f4f2f; color: #FFC107; }
.reserve-note { display: block; font-size: 10px; color: var(--text-secondary); margin-top: 2px; }
.att-banner {
  background: #2a1a1a;
  border: 2px solid var(--fat);
  border-radius: var(--radius);
  padding: 14px;
  margin-top: 12px;
}
.att-banner-text {
  color: var(--fat);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 12px;
}

/* === ATTENDANCE PAGE === */
.wrap.narrow { max-width: 480px; margin: 0 auto; padding: 0 14px 40px; }

.att-hero {
  text-align: center;
  padding: 26px 16px 18px;
}
.att-date {
  font-size: 15px;
  font-weight: 800;
  color: var(--neon);
  letter-spacing: 3px;
  margin: 2px 0 18px;
}
.att-counter-num {
  font-family: var(--font-num);
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  color: var(--neon);
}
.att-counter-max { font-size: 28px; color: var(--text-secondary); }
.att-counter-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--text-secondary);
  margin-top: 6px;
}
.att-spots {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin: 16px 0 14px;
  flex-wrap: wrap;
}
.att-spot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--surface-3);
  border: 1px solid var(--border);
}
.att-spot.filled {
  background: var(--neon);
  border-color: var(--neon);
  box-shadow: 0 0 6px rgba(173, 255, 47, 0.5);
}
.att-legend { justify-content: center; margin-bottom: 0; }

/* your pinned status card */
.att-you-card {
  background: var(--surface);
  border: 2px solid var(--neon);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 0 14px rgba(173, 255, 47, 0.18);
}
.att-you-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.att-you-badge {
  background: var(--neon);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 3px 7px;
  border-radius: 6px;
}
.att-you-name { font-size: 18px; font-weight: 800; }
.att-you-status {
  margin-left: auto;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-secondary);
}
.att-you-status.yes { color: var(--neon); }
.att-you-status.res { color: #FFC107; }
.att-you-status.no { color: var(--fat); }

.att-hint {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  text-align: center;
  margin-bottom: 12px;
}
.att-hint b { color: var(--white); }

.att-filter-row { margin-bottom: 14px; }
.att-filter-row input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--white);
  font-size: 15px;
  outline: none;
}
.att-filter-row input:focus { border-color: var(--neon); }
.att-filter-row input::placeholder { color: #444; }

/* grouped rows */
.att-group-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-secondary);
  margin: 18px 0 8px;
  display: flex;
  justify-content: space-between;
}
.att-group-title.grp-in { color: var(--neon); }
.att-group-title.grp-res { color: #FFC107; }
.att-group-title.grp-out { color: var(--fat); }

.att-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  transition: border-color 0.15s;
}
.att-row.you { border-color: var(--neon); box-shadow: 0 0 10px rgba(173, 255, 47, 0.15); }
.att-row-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.att-row-name { font-size: 16px; font-weight: 700; }
.att-row-name i { font-style: normal; font-size: 11px; color: var(--text-secondary); font-weight: 400; }
.att-badge {
  flex-shrink: 0;
  min-width: 44px;
  text-align: center;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1px;
  border: 1px solid var(--border);
  background: var(--surface-3);
  color: var(--text-secondary);
}
.att-badge.in { background: #1a2a1a; border-color: #2f4f2f; color: var(--neon); }
.att-badge.res { background: #2a2a1a; border-color: #4f4f2f; color: #FFC107; }
.att-badge.out { background: #2a1a1a; border-color: #4f2f2f; color: var(--fat); }

.att-row-actions { display: flex; gap: 8px; }
.att-btn {
  flex: 1;
  padding: 13px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--white);
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font);
  letter-spacing: 0.5px;
  cursor: pointer;
}
.att-btn:active { transform: scale(0.98); }
.att-btn-in.active {
  background: var(--neon);
  border-color: var(--neon);
  color: #000;
}
.att-btn-out.active {
  background: var(--fat);
  border-color: var(--fat);
  color: #000;
}

.att-guest-row { margin-top: 18px; }
.att-guest-row input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--white);
  font-size: 15px;
  outline: none;
}
.att-guest-row input:focus { border-color: var(--neon); }

.att-live-line {
  margin-top: 16px;
  line-height: 1.6;
}
.att-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon);
  margin-right: 6px;
  animation: att-pulse 2s infinite;
}
@keyframes att-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.att-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  background: var(--neon);
  color: #000;
  font-size: 15px;
  font-weight: 800;
  padding: 13px 22px;
  border-radius: 30px;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 50;
  pointer-events: none;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
}
.att-toast.show { opacity: 1; transform: translate(-50%, 0); }

.player-rating.rating-unset {
  background: #2a1a1a;
  border-color: var(--fat);
  color: var(--fat);
  animation: att-pulse 1.5s infinite;
}

/* WhatsApp share */
/* share box: URL + copy in a clean row */
.share-box {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 10px;
}
.share-box input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 11px;
  font-family: var(--font-num);
  outline: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.btn-small {
  flex-shrink: 0;
  padding: 10px 14px;
  border: 1px solid var(--neon);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--neon);
  font-size: 12px;
  font-weight: 800;
  font-family: var(--font);
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.btn-small:active { background: rgba(173,255,47,0.15); }

/* action buttons after share */
.share-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.share-actions .btn-whatsapp {
  flex: 1;
  margin-top: 0;
  padding: 12px;
  font-size: 14px;
}
.share-actions .btn-secondary {
  flex: 1;
  padding: 12px;
  font-size: 13px;
  text-align: center;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* live status chips */
.att-live-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 12px;
}
.att-live-names {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: center;
}
.att-live-names b { color: var(--white); font-weight: 700; }

.btn-whatsapp {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: none;
  border-radius: var(--radius);
  background: #25D366;
  color: #000;
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  letter-spacing: 0.5px;
}
.btn-whatsapp:active { opacity: 0.85; }

/* === TABS === */
.tabs { display: flex; gap: 8px; width: 100%; margin-bottom: 14px; }
.tab-btn {
  flex: 1;
  padding: 12px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font);
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  position: relative;
}
.tab-btn.active { background: var(--neon); border-color: var(--neon); color: #000; }
.tab-btn.tab-alert::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--fat);
  animation: att-pulse 1.5s infinite;
}
.tab-panel { display: none; width: 100%; }
.tab-panel.active { display: block; }

/* inline grading rows (attendance panel) */
.grade-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid #4f2f2f;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 6px;
}
.grade-row-name { font-size: 15px; font-weight: 700; }

/* === ORGANISER ATTENDANCE LIVE VIEW === */
.att-live-view { text-align: left; margin-top: 4px; }
.att-count-big {
  font-size: 44px;
  font-weight: 900;
  color: var(--neon);
  line-height: 1;
  text-align: center;
}
.att-count-big span { font-size: 18px; color: var(--text-secondary); }
.att-hero-note {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-secondary);
  margin-top: 6px;
  text-align: center;
}
.att-live-view .att-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 14px;
}
.att-pill-row { display: flex; flex-wrap: wrap; }
.att-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin: 0 6px 6px 0;
}
.att-pill i {
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  color: var(--text-secondary);
  background: var(--surface-3);
  border-radius: 999px;
  padding: 2px 6px;
}
.att-pill.reserve i { color: var(--neon); }
.att-pill.needs-grade { border-color: var(--fat); }
.att-pill.out { opacity: 0.55; }
.att-pill.wait { opacity: 0.7; border-style: dashed; }
.att-group { margin-bottom: 12px; }
.att-group-title { margin-bottom: 8px; }

/* === MATCH DAY ROW === */
.match-day-row { display: flex; gap: 12px; align-items: stretch; margin-bottom: 12px; }
.match-day-date {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 64px; padding: 8px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.md-day { font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--neon); }
.md-num { font-size: 24px; font-weight: 900; line-height: 1.1; }
.md-mon { font-size: 10px; font-weight: 800; letter-spacing: 1px; color: var(--text-secondary); }
.match-day-fields { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.match-day-fields input[type="text"] { width: 100%; }
.md-sub { display: flex; align-items: center; gap: 10px; }
.md-sub input[type="date"] {
  flex: 1;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 6px 8px;
  font-family: var(--font);
  font-size: 13px;
  color-scheme: dark;
}
.md-now { font-size: 11px; color: var(--text-secondary); font-weight: 700; white-space: nowrap; }
.md-title-row { display: flex; align-items: center; gap: 8px; }
.md-title {
  flex: 1; font-size: 15px; font-weight: 800;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding: 6px 0;
}
.md-edit {
  background: none; border: none; color: var(--neon);
  font-size: 15px; width: 30px; height: 30px; border-radius: 50%;
}
.md-label-input {
  width: 100%;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 6px 8px;
  font-family: var(--font);
  font-size: 13px;
}

/* === ROSTER EXPORT / IMPORT === */
.roster-io { text-align: center; margin-top: 2px; }
.import-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.55);
  padding: 16px 14px calc(18px + env(safe-area-inset-bottom));
}
.import-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px;
}
.import-title { font-size: 16px; font-weight: 800; letter-spacing: 1px; margin-bottom: 8px; }
.import-info { font-size: 14px; color: var(--text-secondary); margin-bottom: 14px; }
.import-actions { display: flex; flex-direction: column; gap: 10px; }

/* === HISTORY === */
.history-list { display: flex; flex-direction: column; gap: 10px; }
.hist-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.hist-main { flex: 1; min-width: 0; }
.hist-main b { font-size: 14px; display: block; }
.hist-meta { font-size: 11px; color: var(--text-secondary); display: block; margin-top: 2px; }
.hist-chips { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.hist-btns { display: flex; gap: 4px; align-items: center; }
.hist-empty { color: var(--text-secondary); font-size: 13px; text-align: center; padding: 20px 0; }
.player-tag.needs-grade { border-color: var(--fat); }

/* always-visible generate feedback */
.gen-msg {
  width: 100%;
  background: #2a1a1a;
  border: 1px solid var(--fat);
  color: var(--fat);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  white-space: pre-line;
}

/* === ROTA === */
.rota-footer { gap: 10px; }

.powered-by {
  text-align: center;
  padding: 18px 0 30px;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--text-secondary);
}
.powered-by b { color: var(--neon); }

.rota-content {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 80px;
}

.rota-round {
  margin-bottom: 24px;
}

.rota-round-header {
  font-size: 18px;
  font-weight: 800;
  color: var(--neon);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.rota-match {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 8px;
}

.rota-court {
  font-size: 11px;
  font-weight: 700;
  color: var(--neon);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.rota-teams {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rota-team {
  flex: 1;
  text-align: center;
}

.rota-team-names {
  font-size: 15px;
  font-weight: 600;
}

.rota-team-skill {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.rota-vs {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.rota-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
}

/* === BENCH === */
.rota-bench {
  margin-top: 16px;
  padding: 12px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.rota-bench-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.rota-bench-names {
  font-size: 14px;
  color: var(--white);
}

/* === ERROR === */
.error-msg {
  color: var(--fat);
  font-size: 13px;
  text-align: center;
  margin-top: 8px;
  min-height: 20px;
}

/* === CLUB ACCOUNT === */
.account-bar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin: -8px 0 10px;
}
.account-bar span {
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.35;
  min-width: 0;
}
.privacy-note {
  width: 100%;
  font-size: 11px;
  line-height: 1.45;
  color: #777;
  margin: 0 0 16px;
}
.cloud-msg {
  width: 100%;
  background: #2a1a1a;
  border: 1px solid var(--fat);
  color: var(--fat);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  margin: -8px 0 14px;
}
.account-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.account-sheet[hidden] { display: none !important; }
.account-card {
  width: 100%;
  max-width: 480px;
  max-height: min(86vh, 680px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 16px 16px;
}
.account-copy, .account-note {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 12px;
}
.account-note { font-size: 13px; }
.account-error {
  font-size: 14px;
  color: var(--fat);
  font-weight: 700;
  margin-bottom: 12px;
}
.account-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--neon);
  text-transform: uppercase;
  margin: 14px 0 8px;
}
.account-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--white);
  font-size: 16px;
  font-family: var(--font);
  margin-bottom: 8px;
  outline: none;
}
.account-input:focus { border-color: var(--neon); }
.account-secondary { width: 100%; margin-top: 8px; }
.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.hist-sub { margin-top: 18px; }
.att-hero-status {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--neon);
  line-height: 1.2;
}
.att-hero-status.res { color: #FFC107; }
.att-hero-status.no { color: var(--fat); }
.att-privacy { text-align: center; margin: 12px auto 0; max-width: 360px; }
.btn-ghost {
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* === RESPONSIVE === */
@media (min-width: 768px) {
  .setup-inner { padding: 60px 20px 40px; }
  .setup-title { font-size: 36px; }
}
