/* lineup.css — team lineup page */

.lineup-state {
  max-width: 36em;
  margin: 4em auto;
  padding: 2em 1.5em;
  text-align: center;
}
.lineup-state-icon { font-size: 2.5rem; margin-bottom: 0.5em; }
.lineup-state-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.5em;
}
.lineup-state-body { font-size: var(--text-md); color: var(--text-mute); line-height: 1.6; }

.lineup-wrap {
  max-width: 52em;
  margin: 0 auto;
  padding: 1.2em 1em 4em;
}
.lineup-team-header {
  display: flex;
  align-items: baseline;
  gap: 0.75em;
  margin-bottom: 1.4em;
  padding-bottom: 0.75em;
  border-bottom: 0.07em solid var(--border);
}
.lineup-team-label {
  font-family: 'Oswald', sans-serif;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.lineup-team-name {
  font-family: 'Oswald', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold-lt);
  letter-spacing: 0.05em;
}

/* ── Tool bar (Import / Reorder) ── */
.lineup-tools {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75em;
}
.lineup-tool-btn {
  font-family: 'Oswald', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.55em 1.1em;
  border-radius: 0.3em;
  border: 0.07em solid var(--border);
  background: var(--surface2);
  color: var(--text-dim);
  cursor: pointer;
}
.lineup-tool-btn:hover { opacity: 0.8; }
.lineup-tool-btn--right { margin-left: auto; }
.lineup-tool-btn--import { border-color: var(--blue-lt); color: var(--blue-lt); }
.lineup-tool-btn--reorder { border-color: var(--lose-color); color: var(--lose-color); }
.lineup-tool-btn--done { border-color: var(--win-color); color: var(--win-color); }
.lineup-tool-btn--cancel { color: var(--lose-color); border-color: var(--lose-color); }
.lineup-tool-btn--cancel:hover { opacity: 0.8; }

/* ── Reorder tap-to-swap ── */
.lineup-td-order--reorder { cursor: pointer; }
.lineup-order--tap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  border: 0.1em solid var(--border);
  font-size: var(--text-xs);
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.lineup-row--reorder-hover .lineup-order--tap,
.lineup-row:hover .lineup-order--tap { border-color: var(--blue-lt); color: var(--blue-lt); }
.lineup-row--selected { background: rgba(26, 95, 168, 0.12) !important; }
.lineup-row--selected { background: color-mix(in srgb, var(--blue) 12%, transparent) !important; }
.lineup-row--selected .lineup-order--tap {
  background: var(--blue-lt);
  border-color: var(--blue-lt);
  color: #fff;
}

/* ── Import modal ── */
.lineup-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lineup-modal {
  background: var(--surface);
  border: 0.07em solid var(--border);
  border-radius: 0.5em;
  padding: 1.5em 1.4em 1.2em;
  width: min(90vw, 22em);
  display: flex;
  flex-direction: column;
  gap: 1em;
}
.lineup-modal-title {
  font-family: 'Oswald', sans-serif;
  font-size: var(--text-lg);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-lt);
}
.lineup-modal-body { display: flex; flex-direction: column; gap: 0.4em; }
.lineup-modal-label {
  font-size: var(--text-sm);
  color: var(--text-mute);
  font-family: 'Barlow', sans-serif;
}
.lineup-modal-sel {
  width: 100%;
  font-family: 'Barlow', sans-serif;
  font-size: max(1rem, 16px);
  font-weight: 500;
  padding: 0.5em 0.5em;
  border-radius: 0.25em;
  border: 0.07em solid var(--border);
  background: var(--surface2);
  color: var(--text);
}
.lineup-modal-footer {
  display: flex;
  gap: 0.6em;
  justify-content: flex-end;
}

.lineup-form-wrap { overflow-x: auto; }

.lineup-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Barlow', sans-serif;
}
.lineup-th {
  font-family: 'Oswald', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0.4em 0.5em 0.6em;
  text-align: left;
  border-bottom: 0.12em solid var(--gold);
}
.lineup-th--order { width: 2em; text-align: center; }
.lineup-th--num   { width: 5em; }
.lineup-th--pos   { width: 5.5em; }

.lineup-row { border-bottom: 0.07em solid var(--border); }
.lineup-row:last-child { border-bottom: none; }

.lineup-td-order {
  text-align: center;
  padding: 0.4em 0.3em;
  width: 2em;
}
.lineup-order {
  font-family: 'Oswald', sans-serif;
  font-size: var(--text-xs);
  color: var(--text-mute);
  font-weight: 600;
}
.lineup-td-num   { padding: 0.35em 0.4em; width: 5em; }
.lineup-td-name  { padding: 0.35em 0.4em; }
.lineup-td-pos   { padding: 0.35em 0.4em; width: 5.5em; }

.lineup-row--sub { background: var(--surface2); }
.lineup-sub-tag {
  font-family: 'Oswald', sans-serif;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.lineup-inp {
  font-family: 'Barlow', sans-serif;
  font-size: max(1rem, 16px);
  font-weight: 500;
  width: 100%;
  padding: 0.4em 0.5em;
  border-radius: 0.25em;
  border: 0.07em solid var(--border);
  background: var(--surface2);
  color: var(--text);
  box-sizing: border-box;
}
.lineup-inp:focus { outline: 0.13em solid var(--blue-lt); border-color: var(--blue-lt); }
.lineup-inp--num  { text-align: center; font-weight: 700; }

.lineup-sel {
  font-family: 'Barlow', sans-serif;
  font-size: max(1rem, 16px);
  font-weight: 500;
  width: 100%;
  padding: 0.4em 0.3em;
  border-radius: 0.25em;
  border: 0.07em solid var(--border);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  box-sizing: border-box;
}
.lineup-sel:focus { outline: 0.13em solid var(--blue-lt); }

.lineup-actions {
  display: flex;
  align-items: center;
  gap: 0.8em;
  margin-top: 1.4em;
  padding-top: 1em;
  border-top: 0.07em solid var(--border);
}
/* lineup-submit-btn: base styles from base.css primary-button rule;
   larger padding intentional — this is the page's primary CTA */
.lineup-submit-btn { padding: 0.65em 1.6em; }

.lineup-sub-add-btn,
.lineup-sub-del-btn {
  font-family: 'Oswald', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.65em 1.2em;
  border-radius: 0.3em;
  background: transparent;
  cursor: pointer;
}
.lineup-sub-add-btn {
  border: 0.07em solid var(--win-color);
  color: var(--win-color);
}
.lineup-sub-add-btn:hover { opacity: 0.8; }
.lineup-sub-del-btn {
  border: 0.07em solid var(--lose-color);
  color: var(--lose-color);
}
.lineup-sub-del-btn:hover { opacity: 0.8; }
.lineup-sub-del-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.lineup-status {
  font-size: 0.82rem;
  font-weight: 600;
}

@media (max-width: 600px) {
  .lineup-td-num { width: 3.5em; }
  .lineup-inp--num { padding: 0.4em 0.2em; }
}

/* ── Selector row: team + game side by side ── */
.lineup-selectors-row {
  display: flex;
  gap: 0.75em;
  margin-bottom: 0.75em;
}
.lineup-sel-half {
  flex: 1;
  min-width: 0;
}

/* ── Game info / selector box ── */
.lineup-game-info {
  display: flex;
  align-items: center;
  padding: 0.55em 0.75em;
  background: var(--surface2);
  border-radius: 0.3em;
  border: 0.07em solid var(--border);
  min-height: 2.4em;
}

/* Select filling the info box — explicit bg needed; native selects ignore 'transparent' in dark mode */
.lineup-game-sel {
  width: 100%;
  background: var(--surface2);
  border: none;
  color: var(--text);
  font-family: 'Oswald', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  -webkit-appearance: auto;
  appearance: auto;
}
.lineup-game-sel:focus { outline: 0.13em solid var(--blue-lt); }

.lineup-game-sel-placeholder {
  font-family: 'Barlow', sans-serif;
  font-size: 0.82rem;
  color: var(--text-mute);
  font-style: italic;
}

@media (max-width: 600px) {
  .lineup-selectors-row { flex-direction: column; gap: 0.5em; }
}

/* ── Read-only badge ── */
.lineup-readonly-badge {
  font-family: 'Oswald', sans-serif;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-mute);
  background: var(--surface2);
  border: 0.07em solid var(--border);
  border-radius: 0.25em;
  padding: 0.35em 0.7em;
  margin-bottom: 0.75em;
  display: inline-block;
}

/* ── Sign-out button ── */
.lineup-signout-btn {
  font-family: 'Oswald', sans-serif;
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.5em 1.1em;
  border-radius: 0.3em;
  border: 0.07em solid var(--border);
  background: transparent;
  color: var(--text-mute);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.lineup-signout-btn:hover { color: var(--lose-color); border-color: var(--lose-color); }

/* ── No-game message ── */
.lineup-no-game {
  font-family: 'Barlow', sans-serif;
  font-size: var(--text-md);
  color: var(--text-mute);
  padding: 1.5em 0;
}

/* ── Navigation tab bar (injected by JS, shown after session check) ── */
.lineup-nav {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.lineup-nav-tab {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  text-align: center;
  padding: 0.85em 0.3em;
  font-family: 'Oswald', sans-serif;
  font-size: clamp(0.78rem, 1.5vw, 0.95rem);
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 0.18em solid transparent;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.lineup-nav-tab:hover { color: var(--text); }
.lineup-nav-tab.active { color: var(--blue-lt); border-bottom-color: var(--blue-lt); }
.lineup-nav-tab .tab-icon { display: none; }

/* ════════════════════════════════════════════════════════════
   MOBILE — locked flex column, nav at bottom
   ════════════════════════════════════════════════════════════ */
@media (max-width: 1023px) {
  html { height: 100svh; height: var(--app-h, 100svh); }
  body { height: 100svh; height: var(--app-h, 100svh); overflow: hidden; display: flex; flex-direction: column; }
  .site-header { flex-shrink: 0; }

  /* Scrollable content fills remaining space between header and nav */
  #lineupLoading,
  #lineupInvalid { flex: 1; overflow-y: auto; }
  #lineupContent {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    scrollbar-width: none;
  }
  #lineupContent::-webkit-scrollbar { display: none; }

  /* Prevent iOS Safari zoom on input focus */
  .lineup-inp,
  .lineup-sel,
  .lineup-game-sel {
    font-size: var(--text-lg);
  }
}
