/* ─── RESET & BASE ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:       #034694;
  --blue-dark:  #022f6a;
  --blue-light: #e8f0fc;
  --blue-mid:   #d0e2ff;
  --gold:       #b8972a;
  --gold-light: #fef3cd;
  --text:       #111827;
  --text-2:     #4B5563;
  --text-3:     #9CA3AF;
  --border:     #E5E7EB;
  --surface:    #FFFFFF;
  --bg:         #F3F4F6;
  --bg-2:       #F9FAFB;
  --red:        #DC2626;
  --green:      #16A34A;
  --green-light:#dcfce7;
  --radius:     12px;
  --radius-sm:  8px;
  --shadow:     0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md:  0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg:  0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);
  --font:       'Inter', system-ui, sans-serif;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; min-height: 100dvh; }

/* ─── INTRO SCREEN ──────────────────────────────────────────────────────────── */
#intro-screen {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: linear-gradient(160deg, #f0f4ff 0%, #e8f0fc 40%, #fafbff 100%);
}

.intro-wrap {
  width: 100%;
  max-width: 440px;
  background: var(--surface);
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: 0 20px 60px rgba(3,70,148,0.12), 0 4px 16px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}

.intro-title {
  font-size: 26px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.5px;
  margin-bottom: 16px;
  white-space: nowrap;
}

.intro-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.intro-form { display: flex; flex-direction: column; gap: 20px; }

.field-group { display: flex; flex-direction: column; gap: 6px; }

.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.3px;
}

.field-input {
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
  background: var(--bg-2);
  outline: none;
  transition: border-color 0.15s;
}
.field-input:focus { border-color: var(--blue); background: #fff; }
.field-input::placeholder { color: var(--text-3); }

.budget-slider-wrap { display: flex; flex-direction: column; gap: 8px; }

.budget-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  outline: none;
  cursor: pointer;
}
.budget-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(3,70,148,0.3);
  transition: transform 0.15s;
}
.budget-slider::-webkit-slider-thumb:hover { transform: scale(1.1); }
.budget-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(3,70,148,0.3);
}

.budget-display-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.budget-min, .budget-max { font-size: 11px; color: var(--text-3); }
.budget-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: -0.5px;
}

.btn-start {
  height: 48px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-top: 4px;
}
.btn-start:hover { background: var(--blue-dark); }
.btn-start:active { transform: scale(0.99); }

/* ─── HIDDEN UTILITY ────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ─── APP HEADER ────────────────────────────────────────────────────────────── */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow);
}

.hdr-left { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }

.hdr-crest-img {
  width: 38px;
  height: 38px;
  object-fit: contain;
  flex-shrink: 0;
}
.hdr-crest {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hdr-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  white-space: nowrap;
}
.hdr-sub {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
  white-space: nowrap;
}

.hdr-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
}
.stat-pill-label { font-size: 11px; color: var(--text-3); font-weight: 500; }
.stat-pill-value { font-size: 13px; font-weight: 700; color: var(--text); }
.stat-pill-value.warn { color: #dc2626; }

.btn-simulate {
  height: 38px;
  padding: 0 18px;
  background: var(--border);
  color: var(--text-3);
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: not-allowed;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}
.btn-simulate.ready {
  background: var(--blue);
  color: #fff;
  cursor: pointer;
}
.btn-simulate.ready:hover { background: var(--blue-dark); }

/* ─── MAIN CONTENT ──────────────────────────────────────────────────────────── */
.app-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.task-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 16px;
}

/* ─── TASK CARDS ────────────────────────────────────────────────────────────── */
.tasks-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.task-card {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
  position: relative;
  overflow: hidden;
  user-select: none;
}
.task-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: transparent;
  transition: background 0.2s;
}
.task-card:hover:not(.locked) { border-color: var(--blue); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.task-card.locked { opacity: 0.45; cursor: not-allowed; }
.task-card.done { border-color: #16A34A; background: #f0fdf4; }
.task-card.done::before { background: #16A34A; }

.task-card-inner { padding: 20px 16px; }
.task-num { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; color: var(--text-3); margin-bottom: 10px; }
.task-icon { font-size: 26px; margin-bottom: 10px; display: block; }
.task-name { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.task-desc { font-size: 12px; color: var(--text-2); line-height: 1.4; margin-bottom: 14px; }

.task-status-row { display: flex; }
.task-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  padding: 3px 8px;
  border-radius: 4px;
}
.task-badge.pending { background: #FEF9C3; color: #854D0E; }
.task-badge.done { background: var(--green-light); color: var(--green); }
.task-badge.done::before { content: '✓ '; }

/* ─── SUMMARY ROW ───────────────────────────────────────────────────────────── */
.summary-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.summary-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 12px;
}
.sum-icon { font-size: 14px; }
.sum-text { color: var(--text-2); font-weight: 500; }

/* ─── MODAL OVERLAY ─────────────────────────────────────────────────────────── */
#modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 640px) {
  #modal-overlay { align-items: center; }
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.35);
  backdrop-filter: blur(3px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 720px;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  max-height: 92dvh;
  box-shadow: 0 -4px 40px rgba(0,0,0,0.1);
  overflow: hidden;
}
@media (min-width: 640px) {
  .modal-panel {
    border-radius: 16px;
    max-height: 88dvh;
    margin: 24px;
  }
}

.modal-header {
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  background: var(--surface);
}
.modal-header-left { display: flex; align-items: center; gap: 10px; }
.modal-icon { font-size: 20px; }
.modal-title { font-size: 16px; font-weight: 800; color: var(--text); }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--border); }

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  background: var(--bg-2);
}

/* ─── MODAL BUTTONS ─────────────────────────────────────────────────────────── */
.btn-primary {
  height: 40px;
  padding: 0 20px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--blue-dark); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-ghost {
  height: 40px;
  padding: 0 16px;
  background: transparent;
  color: var(--text-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-ghost:hover { background: var(--bg); }

/* ─── SPONSOR MODAL ─────────────────────────────────────────────────────────── */
.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 480px) { .sponsor-grid { grid-template-columns: 1fr 1fr; } }

.sponsor-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
  background: var(--bg-2);
}
.sponsor-card:hover { border-color: var(--blue); background: var(--blue-light); }
.sponsor-card.selected { border-color: var(--blue); background: var(--blue-light); }
.sponsor-card-icon { font-size: 22px; margin-bottom: 6px; }
.sponsor-card-name { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.sponsor-card-deal { font-size: 12px; font-weight: 600; color: var(--blue); margin-bottom: 2px; }
.sponsor-card-desc { font-size: 10px; color: var(--text-3); margin-bottom: 4px; }
.sponsor-card-prob {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
}
.prob-high  { background: #dcfce7; color: #15803d; }
.prob-mid   { background: #fef9c3; color: #854d0e; }
.prob-low   { background: #fee2e2; color: #b91c1c; }

/* Sponsor attempt tracker */
.attempts-bar {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.attempts-label { font-size: 13px; color: var(--text-2); }
.attempts-pips { display: flex; gap: 5px; }
.attempt-pip {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--blue);
}
.attempt-pip.used { background: var(--border); }

.sponsor-result-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  gap: 8px;
  z-index: 2;
}
.sponsor-result-icon { font-size: 36px; }
.sponsor-result-text { font-size: 16px; font-weight: 800; }
.sponsor-result-sub  { font-size: 13px; color: var(--text-2); text-align: center; padding: 0 12px; }

/* ─── SELL / LOAN MODAL ─────────────────────────────────────────────────────── */
.player-list { display: flex; flex-direction: column; gap: 6px; }
.player-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--bg-2);
  transition: border-color 0.12s, background 0.12s;
  user-select: none;
}
.player-list-item:hover { border-color: var(--blue); background: var(--blue-light); }
.player-list-item.selected { border-color: var(--blue); background: var(--blue-light); }
.player-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  color: #fff;
  background: var(--blue);
}
.player-list-info { flex: 1; min-width: 0; }
.player-list-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-list-meta { font-size: 11px; color: var(--text-3); margin-top: 1px; }
.player-list-right { display: flex; align-items: center; gap: 8px; }
.player-value { font-size: 13px; font-weight: 700; color: var(--text-2); }
.pos-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  letter-spacing: 0.3px;
}
.check-icon { font-size: 16px; color: var(--blue); opacity: 0; transition: opacity 0.1s; }
.player-list-item.selected .check-icon { opacity: 1; }

.modal-info-bar {
  background: var(--blue-light);
  border: 1px solid var(--blue-mid);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--blue);
  font-weight: 500;
  margin-bottom: 14px;
}
.modal-warn-bar {
  background: #fef3cd;
  border: 1px solid #fcd34d;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: #92400e;
  font-weight: 500;
  margin-bottom: 14px;
}

/* ─── SIGN PLAYERS MODAL ────────────────────────────────────────────────────── */
.sign-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.sign-search {
  flex: 1;
  min-width: 160px;
  height: 38px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
  background: var(--bg-2);
}
.sign-search:focus { border-color: var(--blue); background: #fff; }

.pos-filter-wrap { display: flex; gap: 4px; flex-wrap: wrap; }
.pos-filter-btn {
  height: 32px;
  padding: 0 10px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-2);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.12s;
  white-space: nowrap;
}
.pos-filter-btn:hover { border-color: var(--blue); color: var(--blue); }
.pos-filter-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }

.budget-bar {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.budget-bar-label { font-size: 12px; color: var(--text-3); font-weight: 500; }
.budget-bar-val { font-size: 16px; font-weight: 800; color: var(--blue); }
.budget-bar-val.tight { color: #EF4444; }

.world-player-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
@media (max-width: 480px) { .world-player-grid { grid-template-columns: 1fr; } }

.world-player-card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--bg-2);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.world-player-card:hover:not(.signed):not(.over-budget) { border-color: var(--blue); background: var(--blue-light); }
.world-player-card.signed { border-color: var(--green); background: var(--green-light); cursor: default; }
.world-player-card.over-budget { opacity: 0.38; cursor: not-allowed; }

.world-player-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.world-player-info { flex: 1; min-width: 0; }
.world-player-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.world-player-club { font-size: 11px; color: var(--text-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.world-player-right { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.world-player-val { font-size: 13px; font-weight: 700; color: var(--text-2); }
.signed-tick { font-size: 14px; color: var(--green); }

.signed-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.signed-list-title { font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.signed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--green-light);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
}
.signed-item-name { flex: 1; font-size: 13px; font-weight: 600; color: var(--text); }
.signed-item-val { font-size: 13px; font-weight: 700; color: var(--green); }
.signed-remove {
  font-size: 12px;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  transition: color 0.1s;
}
.signed-remove:hover { color: var(--red); }

.no-results {
  text-align: center;
  padding: 32px 0;
  color: var(--text-3);
  font-size: 14px;
}

/* ─── FORMATION MODAL ───────────────────────────────────────────────────────── */
.formation-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}
@media (max-width: 600px) {
  .formation-layout { grid-template-columns: 1fr; }
}

.formation-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-content: center;
}
.formation-btn {
  width: 100%;
  height: 52px;
  padding: 0 8px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 700;
  background: var(--bg-2);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.12s;
}
.formation-btn:hover { border-color: var(--blue); color: var(--blue); }
.formation-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* Pitch */
.pitch-wrap {
  position: relative;
  background: linear-gradient(180deg, #2d7a3f 0%, #388a4a 50%, #2d7a3f 100%);
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 2/3;
  width: 240px;
  flex-shrink: 0;
  border: 2px solid rgba(255,255,255,0.2);
}
@media (max-width: 600px) { .pitch-wrap { width: 100%; max-width: 280px; margin: 0 auto; } }

/* Pitch markings */
.pitch-wrap::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 4px;
  pointer-events: none;
}
.pitch-center-line {
  position: absolute;
  left: 6px; right: 6px;
  top: 50%;
  height: 1.5px;
  background: rgba(255,255,255,0.25);
  pointer-events: none;
}
.pitch-center-circle {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.25);
  pointer-events: none;
}
.pitch-pen-top, .pitch-pen-bot {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  border: 1.5px solid rgba(255,255,255,0.25);
  pointer-events: none;
}
.pitch-pen-top { top: 6px; height: 14%; border-top: none; }
.pitch-pen-bot { bottom: 6px; height: 14%; border-bottom: none; }

/* Formation Slot */
.f-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  gap: 2px;
}
.f-slot-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.9);
  transition: background 0.15s, border-color 0.15s;
  backdrop-filter: blur(4px);
}
.f-slot:hover .f-slot-circle { background: rgba(255,255,255,0.3); border-color: #fff; }
.f-slot.filled .f-slot-circle {
  background: var(--blue);
  border-color: #fff;
  color: #fff;
  font-size: 9px;
}
.f-slot-label {
  font-size: 8px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
  max-width: 48px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Available players panel */
.avail-panel { flex: 1; min-width: 0; }
.avail-panel-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
}
.avail-list { display: flex; flex-direction: column; gap: 4px; max-height: 340px; overflow-y: auto; }
.avail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  font-size: 12px;
}
.avail-name { flex: 1; font-weight: 600; color: var(--text); }
.avail-pos { font-size: 10px; color: var(--text-3); }
.avail-item.used { opacity: 0.35; }

/* ─── PICKER SUB-MODAL ──────────────────────────────────────────────────────── */
#picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
@media (min-width: 640px) { #picker-overlay { align-items: center; } }

.picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
}
.picker-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  max-height: 70dvh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 30px rgba(0,0,0,0.12);
  overflow: hidden;
}
@media (min-width: 640px) { .picker-panel { border-radius: 14px; margin: 0 16px; } }

.picker-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.picker-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  background: var(--bg-2);
}
.picker-item:hover { border-color: var(--blue); background: var(--blue-light); }
.picker-item-name { flex: 1; font-size: 13px; font-weight: 600; color: var(--text); }
.picker-item-meta { font-size: 11px; color: var(--text-3); }
.picker-none { padding: 24px; text-align: center; color: var(--text-3); font-size: 13px; }

/* ─── RESULTS OVERLAY ───────────────────────────────────────────────────────── */
#results-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
}
.results-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(6px);
}
.results-scroll {
  position: relative;
  z-index: 1;
  overflow-y: auto;
  max-height: 100dvh;
  padding: 12px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

/* Results card — fixed 480px portrait, screenshot-ready */
.results-card {
  width: 480px;
  max-width: 100%;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  font-family: var(--font);
}

.rc-header {
  background: var(--blue);
  padding: 14px 18px 12px;
  color: #fff;
}
.rc-header-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.rc-crest {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rc-crest-img {
  width: 36px; height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}
.rc-header-title { font-size: 16px; font-weight: 900; line-height: 1; }
.rc-header-sub { font-size: 10px; color: rgba(255,255,255,0.7); margin-top: 2px; letter-spacing: 0.5px; }

.rc-points-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.rc-points { font-size: 36px; font-weight: 900; line-height: 1; letter-spacing: -1px; }
.rc-points-label { font-size: 10px; color: rgba(255,255,255,0.7); margin-bottom: 4px; }
.rc-position { font-size: 14px; font-weight: 700; color: rgba(255,255,255,0.85); margin-bottom: 3px; }

.rc-body { padding: 10px 18px 8px; }

.rc-section { margin-bottom: 8px; }
.rc-section-title {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 4px;
}

.rc-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}
.rc-stat-row:last-child { border-bottom: none; }
.rc-stat-label { color: var(--text-2); }
.rc-stat-value { font-weight: 700; color: var(--text); }

.rc-trophy-row { display: flex; gap: 4px; flex-wrap: wrap; }
.rc-trophy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gold-light);
  border: 1px solid #fcd34d;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 600;
  color: #92400e;
}
.rc-no-trophy { font-size: 11px; font-weight: 500; color: var(--text-3); }

.rc-xi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px 10px;
}
.rc-xi-player { font-size: 11px; color: var(--text); display: flex; gap: 5px; align-items: center; padding: 1px 0; }
.rc-xi-pos { font-size: 8px; font-weight: 700; color: var(--text-3); min-width: 24px; }

.rc-transfer-list {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.rc-player-tag {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 10px;
  color: var(--text-2);
  font-weight: 500;
}

.rc-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

.rc-header-twitter {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  position: absolute;
  bottom: 12px;
  right: 18px;
}

.rc-footer {
  padding: 8px 18px;
  background: var(--bg-2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rc-footer-director { font-size: 11px; color: var(--text-2); font-weight: 500; }

/* Transfer tag colours in results */
.rc-player-tag { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 2px 7px; font-size: 11px; color: var(--text-2); font-weight: 500; }
.rc-player-tag.signed { background: #dcfce7; border-color: #86efac; color: #15803d; }
.rc-player-tag.sold   { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }
.rc-player-tag.loaned { background: #fef9c3; border-color: #fde047; color: #854d0e; }

.btn-play-again {
  height: 44px;
  padding: 0 28px;
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.btn-play-again:hover { background: var(--bg); border-color: var(--text-2); }

/* ─── RESPONSIVE ────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .tasks-grid { grid-template-columns: 1fr 1fr; }
  .hdr-center { display: none; }
}
@media (max-width: 480px) {
  .tasks-grid { grid-template-columns: 1fr 1fr; }
  .app-header { padding: 0 16px; }
  .app-main { padding: 16px 16px 40px; }
  .hdr-title { font-size: 13px; }
  .hdr-sub { display: none; }
  .intro-wrap { padding: 28px 20px; }
  .intro-title { font-size: 22px; }
}

/* ─── TOAST ──────────────────────────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1e293b;
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
}
#toast.toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.toast-hide { opacity: 0; transform: translateX(-50%) translateY(20px); }

/* ─── SCROLLBAR ─────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
