/* ============================================================
   FantaPick WC26 — Global Styles
   ============================================================ */

:root {
  --bg:        #0D1A2E;
  --panel:     #0D2A52;
  --panel2:    #0a2248;
  --border:    #1A3A6A;
  --border-hi: #2a5090;
  --accent:    #1A5A99;
  --gold:      #F0B429;
  --gold-dim:  #9a7010;
  --text:      #FFFFFF;
  --muted:     #8899AA;
  --muted2:    #5a7080;
  --good:      #22c55e;
  --bad:       #ef4444;
  --neutral:   #F0B429;

  --role-p: #F0B429;
  --role-d: #3b82f6;
  --role-c: #22c55e;
  --role-a: #ef4444;

  --font-title: 'Barlow Condensed', sans-serif;
  --font-body:  'Inter', sans-serif;

  --radius: 16px;
  --radius-sm: 10px;
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: #060e1a;
  font-family: var(--font-body);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
}

#frame {
  position: relative;
  width: 390px;
  isolation: isolate;
  max-width: 100vw;
  min-height: min(844px, calc(100vh - 40px));
  background: var(--bg);
  border-radius: 36px;
  overflow: hidden;
  box-shadow: 0 0 0 8px #0a1830, 0 40px 100px -20px #000, 0 0 80px -30px #1A5A9960;
  display: flex;
  flex-direction: column;
}

@media (max-width: 430px) {
  body { padding: 0; align-items: stretch; }
  #frame { width: 100%; min-height: 100vh; border-radius: 0; box-shadow: none; }
}

/* -------- TOPBAR -------- */
#topbar {
  flex: none;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 3px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
}
#topbar b { color: var(--gold); }

/* -------- SCREENS -------- */
#app { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; position: relative; }
::-webkit-scrollbar { width: 0; height: 0; }

.screen {
  min-height: 100%;
  padding: 24px 18px 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* -------- TYPOGRAPHY -------- */
.eyebrow {
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2.5px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.title {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 36px;
  line-height: 1;
  letter-spacing: -0.5px;
  color: var(--text);
}

.subtitle {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* -------- BUTTONS -------- */
.btn {
  border: none;
  cursor: pointer;
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: var(--radius-sm);
  transition: transform 0.1s ease, opacity 0.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: default; }

.btn-primary {
  width: 100%;
  background: var(--gold);
  color: #1a0f00;
  font-size: 18px;
  padding: 18px;
  border-radius: var(--radius);
  box-shadow: 0 12px 28px -10px #F0B42970;
}

.btn-secondary {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  padding: 12px 16px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  padding: 10px 14px;
}

/* -------- ROLE BADGE -------- */
.role-badge {
  font-family: var(--font-title);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 7px;
  border-radius: 5px;
  text-transform: uppercase;
  color: #E2E8F0;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
}
.role-p  { color: var(--role-p);  background: rgba(240,180,41,0.15);  border-color: rgba(240,180,41,0.3); }
.role-d  { color: var(--role-d);  background: rgba(59,130,246,0.15);  border-color: rgba(59,130,246,0.3); }
.role-c  { color: var(--role-c);  background: rgba(34,197,94,0.15);   border-color: rgba(34,197,94,0.3);  }
.role-a  { color: var(--role-a);  background: rgba(239,68,68,0.15);   border-color: rgba(239,68,68,0.3);  }

/* -------- STARS -------- */
.stars { color: var(--gold); font-size: 10px; letter-spacing: 0.5px; }
.stars .empty { color: var(--muted2); }

/* -------- PLAYER CARD (draft pick) -------- */
.pick-card {
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  position: relative;
  overflow: hidden;
}
.pick-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #ffffff06, transparent);
  pointer-events: none;
}
.pick-card:hover { border-color: var(--border-hi); box-shadow: 0 0 0 1px var(--border-hi) inset; }
.pick-card:active { transform: scale(0.97); }
.pick-card.selected {
  border-color: var(--gold);
  box-shadow: 0 0 20px -6px var(--gold), 0 0 0 1px var(--gold) inset;
}

.pick-card-name {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.3px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pick-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pick-card-flag { font-size: 16px; }
.pick-card-team { font-size: 11px; color: var(--muted); font-weight: 500; }

/* -------- HORIZONTAL PLAYER CARD -------- */
.pick-card-h {
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.pick-card-h:active { transform: scale(0.98); }
.pick-card-h:hover  { border-color: var(--border-hi); }
.pch-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 42px;
  flex: none;
}
.pch-flag     { font-size: 22px; line-height: 1; }
.pch-center   { flex: 1; min-width: 0; }
.pch-firstname {
  font-size: 10px;
  color: #8899AA;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.pch-surname {
  font-family: var(--font-title);
  font-size: 18px;
  font-weight: 600;
  color: #CBD5E0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}
.pch-fix {
  flex: none;
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 700;
  color: #8899AA;
  text-align: right;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

/* -------- CT CARD -------- */
.ct-card {
  background: var(--panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.15s ease;
  width: 100%;
  color: var(--text);
  font: inherit;
}
.ct-card:active { transform: scale(0.98); }
.ct-card.selected { border-color: var(--gold); box-shadow: 0 0 12px -4px var(--gold); }

.ct-flag { font-size: 32px; flex: none; }
.ct-info { flex: 1; min-width: 0; text-align: left; }
.ct-name  { font-family: var(--font-title); font-weight: 600; font-size: 16px; color: #CBD5E0; }
.ct-team  { font-size: 12px; color: #8899AA; margin-top: 2px; }
.ct-formation {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--gold);
  background: rgba(240,180,41,0.10);
  border: 1px solid rgba(240,180,41,0.30);
  padding: 3px 9px;
  border-radius: 6px;
  flex: none;
}

/* -------- PROGRESS BAR -------- */
.progress-wrap { display: flex; flex-direction: column; gap: 6px; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-title);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.progress-track {
  height: 6px;
  background: var(--panel);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 99px;
  transition: width 0.4s ease;
}

/* -------- PICK DOTS -------- */
.pick-dots { display: flex; gap: 4px; }
.pick-dot {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--panel);
  border: 1px solid var(--border);
  transition: background 0.3s ease;
}
.pick-dot.done { background: var(--gold); border-color: var(--gold); }
.pick-dot.ct   { background: var(--accent); border-color: var(--accent); }

/* -------- DRAFTED MINI LIST -------- */
.drafted-mini {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.drafted-mini-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.drafted-mini-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.drafted-mini-pts {
  font-family: var(--font-title);
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  min-width: 32px;
  text-align: right;
}

/* -------- PITCH -------- */
.pitch-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(180deg, #0a2d16 0%, #082510 55%, #060e08 100%);
  border: 1px solid #1a4a28;
  flex: 1;
  min-height: 380px;
}
.pitch-lines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
}
.pitch-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 68px;
  cursor: pointer;
  z-index: 1;
}
.pitch-shirt {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 12px;
  color: var(--gold);
  background: #0a2248;
  box-shadow: 0 4px 12px #00000060;
  position: relative;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.pitch-shirt.captain {
  border-color: #ffd700;
  box-shadow: 0 0 14px -2px #ffd700, 0 4px 12px #00000060;
  background: #2a1a00;
}
.pitch-crown {
  position: absolute;
  top: -13px;
  font-size: 13px;
}
.pitch-label {
  font-family: var(--font-title);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #a0c8a8;
  background: #060e0880;
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
  max-width: 68px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

/* -------- RESULT -------- */
.score-big {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 72px;
  line-height: 1;
  letter-spacing: -2px;
  color: var(--gold);
  text-align: center;
}
.score-label {
  font-family: var(--font-title);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
  text-align: center;
}

.breakdown-row {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.breakdown-row:last-child { border-bottom: none; }
.breakdown-name {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.breakdown-pts {
  font-family: var(--font-title);
  font-size: 16px;
  font-weight: 700;
  min-width: 36px;
  text-align: right;
}
.pts-positive { color: var(--good); }
.pts-negative { color: var(--bad); }
.pts-zero     { color: var(--muted); }

/* -------- LEADERBOARD -------- */
.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.lb-row.me {
  border-color: var(--gold);
  background: #1a0f00;
}
.lb-rank {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 18px;
  color: var(--muted);
  min-width: 28px;
  text-align: center;
}
.lb-rank.top3 { color: var(--gold); }
.lb-nick { flex: 1; font-size: 14px; font-weight: 500; }
.lb-pts  { font-family: var(--font-title); font-weight: 700; font-size: 16px; color: var(--gold); }

/* -------- SHARE TEXT -------- */
.share-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: var(--font-title);
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-line;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.share-box:hover { border-color: var(--border-hi); }

/* -------- DIVIDER -------- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* -------- TOAST -------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--text);
  color: #1a0f00;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 13px;
  padding: 11px 20px;
  border-radius: 99px;
  z-index: 200;
  box-shadow: 0 10px 30px -8px #000;
  white-space: nowrap;
  pointer-events: none;
}

/* -------- CONSTRAINT HINT -------- */
.role-hint {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
  padding: 8px 12px;
  background: var(--panel2);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.role-hint b { color: var(--gold); }

/* -------- LOADING -------- */
.spinner {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -------- SECTION HEADER -------- */
.section-head {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px;
}

/* -------- RETRY BADGE -------- */
.retry-badge {
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--gold);
  background: #1a0f00;
  border: 1px solid var(--gold-dim);
}
.retry-badge.used { color: var(--muted2); background: transparent; border-color: var(--border); }

/* -------- PERFECT XI COMPARISON -------- */
.comparison-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.comparison-col-head {
  font-family: var(--font-title);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

/* -------- ANIMATIONS -------- */
@keyframes fp-rise {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes fp-pop {
  0%   { transform: scale(0.90); opacity: 0; }
  60%  { transform: scale(1.03); }
  100% { transform: scale(1);    opacity: 1; }
}
@keyframes fp-fade { from { opacity: 0; } to { opacity: 1; } }

.anim-rise { animation: fp-rise 0.35s ease both; }
.anim-pop  { animation: fp-pop  0.3s  ease both; }

/* -------- UTILITY -------- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-4  { gap: 4px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-20 { gap: 20px; }
.mt-4   { margin-top: 4px; }
.mt-8   { margin-top: 8px; }
.mt-12  { margin-top: 12px; }
.mt-16  { margin-top: 16px; }
.mt-20  { margin-top: 20px; }
.mt-24  { margin-top: 24px; }
.mb-4   { margin-bottom: 4px; }
.mb-8   { margin-bottom: 8px; }
.mb-12  { margin-bottom: 12px; }
.mb-16  { margin-bottom: 16px; }
.center { text-align: center; }
.justify-between { justify-content: space-between; }
.items-center    { align-items: center; }
.w-full { width: 100%; }

.emoji-result { font-size: 20px; }

/* -------- FORMATION TABS -------- */
.formation-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.formation-tabs::-webkit-scrollbar { display: none; }

.formation-tab {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  flex: none;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.formation-tab.active {
  border-color: var(--gold);
  color: var(--gold);
  background: #1a0f00;
  box-shadow: 0 0 8px -3px var(--gold);
}
.formation-tab:active { transform: scale(0.95); }

/* -------- PITCH SLOT NODE -------- */
.slot-node {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 60px;
  cursor: pointer;
  z-index: 1;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.slot-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 10px;
  background: rgba(10, 34, 72, 0.6);
  transition: all 0.15s;
  position: relative;
}
.slot-circle.filled { border-style: solid; border-width: 2px; }
.filled-p { border-color: var(--role-p); color: var(--role-p); background: #1a0f00cc; }
.filled-d { border-color: var(--role-d); color: var(--role-d); background: #0a1a3acc; }
.filled-c { border-color: var(--role-c); color: var(--role-c); background: #0a2218cc; }
.filled-a { border-color: var(--role-a); color: var(--role-a); background: #1a0808cc; }
.captain-slot {
  box-shadow: 0 0 14px -2px #ffd700;
  border-color: #ffd700 !important;
}
.slot-crown {
  position: absolute;
  top: -13px;
  font-size: 12px;
  pointer-events: none;
}
.slot-label {
  font-family: var(--font-title);
  font-size: 9px;
  font-weight: 700;
  color: #a0c8a8;
  background: rgba(6, 14, 8, 0.8);
  padding: 2px 5px;
  border-radius: 4px;
  white-space: nowrap;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.slot-remove {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--bad);
  border: 1px solid #ff8888;
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  z-index: 3;
  font-family: monospace;
  -webkit-tap-highlight-color: transparent;
}
.slot-remove:active { transform: scale(0.85); }

/* -------- BENCH STRIP -------- */
.bench-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.bench-strip::-webkit-scrollbar { display: none; }

.bench-player {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  padding: 7px 8px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--panel);
  min-width: 58px;
  max-width: 70px;
  transition: all 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.bench-player.selected {
  border-color: var(--gold);
  background: #1a0f00;
  box-shadow: 0 0 10px -4px var(--gold);
}
.bench-player.assigned {
  opacity: 0.28;
  pointer-events: none;
}
.bench-player:active:not(.assigned) { transform: scale(0.94); }
.bench-player-name {
  font-family: var(--font-title);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 56px;
  text-align: center;
  color: var(--text);
}

/* -------- SWAP DRAWER -------- */
.swap-drawer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.swap-drawer-row:last-of-type { border-bottom: none; }

/* ============================================================
   DESKTOP NAV & SIDEBAR — hidden by default (mobile-first)
   ============================================================ */
#d-nav, #d-sidebar { display: none; }

/* ============================================================
   TABLET — 431px to 1023px: full-width, no phone frame
   ============================================================ */
@media (min-width: 431px) and (max-width: 1023px) {
  body { padding: 0; align-items: stretch; }
  #frame {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    border-radius: 0;
    box-shadow: none;
  }
}

/* Pick grid 2-col on medium screens */
@media (min-width: 560px) {
  .pick-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    flex-direction: unset !important;
  }
}

/* ============================================================
   DESKTOP — 1024px+
   ============================================================ */
@media (min-width: 1024px) {
  html, body { height: 100%; overflow: hidden; }

  body {
    padding: 0;
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-rows: 56px 1fr;
    grid-template-areas: "nav nav" "side main";
    align-items: stretch;
    justify-content: stretch;
  }

  /* ---- Desktop nav ---- */
  #d-nav {
    grid-area: nav;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 16px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    z-index: 20;
    flex: none;
  }

  /* ---- Desktop sidebar ---- */
  #d-sidebar {
    grid-area: side;
    display: block !important;
    overflow-y: auto;
    background: var(--bg);
    border-right: 1px solid var(--border);
    padding: 20px 14px 40px;
  }

  /* ---- Main frame ---- */
  #frame {
    grid-area: main;
    width: 100%;
    max-width: none;
    min-height: auto;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
    overflow-y: auto;
    overflow-x: hidden;
    background: #060e1a;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  #topbar { display: none; }

  #app {
    max-width: 680px;
    width: 100%;
    overflow-y: visible;
    flex: 0 0 auto;
    min-height: calc(100vh - 56px);
    height: auto;
    position: static;
  }

  .screen { min-height: calc(100vh - 56px); }

  /* Admin screen: fixed height so internal flex scroll works */
  #s-admin {
    height: calc(100vh - 56px);
    min-height: 0;
    overflow: hidden;
  }

  /* ---- Pick screen ---- */
  .pick-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    flex-direction: unset !important;
  }

  /* CT options: 3 in a row */
  #ct-list {
    flex-direction: row !important;
    gap: 12px !important;
  }
  #ct-list .ct-card { flex: 1; min-width: 0; }

  /* ---- Formation ---- */
  .pitch-wrap { min-height: 420px; }

  /* ---- Result 2-column ---- */
  .result-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
  }
  /* Hide the mobile-only separator divider at top of right column */
  .result-mob-sep { display: none; }
}

/* Result columns: default stacking (mobile) */
.result-main { display: block; }
.result-col-left, .result-col-right { display: block; }
