/* =========================================================
   90'S CLASSIC FC — Stadium Night & Royal Gold Theme
   ========================================================= */

:root {
  --bg-deep: #070c18;
  --bg-navy: #0f172a;
  --bg-card: rgba(17, 26, 46, 0.84);
  --bg-card-strong: rgba(23, 35, 61, 0.94);
  --border-subtle: rgba(148, 163, 184, 0.18);
  --border-gold: rgba(250, 204, 21, 0.45);

  --gold: #facc15;
  --gold-deep: #f59e0b;
  --flame: #ea580c;
  --emerald: #10b981;
  --emerald-bright: #34d399;
  --sky: #38bdf8;
  --rose: #fb7185;
  --purple: #c084fc;

  --text-main: #f8fafc;
  --text-soft: #cbd5e1;
  --text-muted: #94a3b8;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 14px 36px rgba(0, 0, 0, 0.35);
  --font-display: 'Kanit', 'Sarabun', system-ui, sans-serif;
  --font-body: 'Sarabun', 'Kanit', system-ui, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-dragging-player {
  user-select: none;
  -webkit-user-select: none;
  cursor: grabbing !important;
}

/* Vibrant Stadium Floodlight Background */
.stadium-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 12% 8%, rgba(245, 158, 11, 0.22), transparent 38%),
    radial-gradient(circle at 88% 12%, rgba(234, 88, 12, 0.18), transparent 36%),
    radial-gradient(circle at 50% 60%, rgba(16, 185, 129, 0.16), transparent 52%),
    linear-gradient(180deg, #070c18 0%, #0d1527 55%, #070b15 100%);
}

h1, h2, h3, button, select, input, .kpi-value, .match-pill, .formation-pill {
  font-family: var(--font-display);
}

/* ==================== HEADER ==================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: rgba(7, 12, 24, 0.82);
  border-bottom: 1px solid rgba(250, 204, 21, 0.22);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 12px;
}

.crest-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(135deg, #fde047, #f59e0b, #ea580c);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.45);
  flex-shrink: 0;
}

.crest-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
  padding: 4px;
  background: #ffffff;
  display: block;
}

.brand-kicker {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--gold);
  font-weight: 600;
}

.brand-title {
  margin: 0;
  font-size: 1.32rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.gold-accent {
  background: linear-gradient(90deg, #fde047, #fb923c);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Desktop Nav */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.75);
  padding: 5px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
}

.nav-btn {
  border: 0;
  background: transparent;
  color: var(--text-soft);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.nav-btn.active {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.38);
}

.nav-btn-gold:not(.active) {
  color: var(--gold);
}

.nav-count {
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

/* Sync Pill */
.sync-pill {
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.85);
  color: var(--text-soft);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.sync-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

.sync-pill.sync-cloud {
  border-color: rgba(16, 185, 129, 0.5);
  color: #6ee7b7;
}

.sync-pill.sync-cloud .dot {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

/* ==================== MAIN & LAYOUT ==================== */
.app-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 18px 96px;
}

.tab-panel {
  display: none;
  animation: fadeSlideIn 0.25s ease;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* KPI Row */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
}

.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
}

.kpi-gold::before { background: linear-gradient(90deg, #fde047, #ea580c); }
.kpi-emerald::before { background: linear-gradient(90deg, #34d399, #059669); }
.kpi-sky::before { background: linear-gradient(90deg, #38bdf8, #818cf8); }

.kpi-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.15;
  margin: 4px 0;
  color: #fff;
}

.kpi-value small {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--gold);
}

.kpi-value-sm {
  font-size: 1.12rem;
  font-weight: 700;
  margin: 6px 0 10px;
  color: #e0f2fe;
}

.kpi-sub {
  font-size: 0.86rem;
  color: var(--text-soft);
}

.kpi-actions-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Glass Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}

.highlight-card {
  border-color: var(--border-gold);
  background: linear-gradient(160deg, rgba(245, 158, 11, 0.1), rgba(17, 26, 46, 0.9) 45%);
}

.compact-card {
  padding: 14px 18px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.card-header h2, .card-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.two-col-layout {
  display: grid;
  grid-template-columns: minmax(320px, 440px) 1fr;
  gap: 18px;
  align-items: start;
}

.col-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Forms & Inputs */
.form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.field label {
  font-size: 0.84rem;
  color: var(--text-soft);
  font-weight: 500;
}

.field input,
.field select,
.my-player-select,
.export-select,
.gk-manual-select {
  width: 100%;
  background: rgba(7, 12, 24, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #fff;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field input:focus,
.field select:focus,
.my-player-select:focus,
.export-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.18);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.88rem;
  color: var(--text-soft);
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold-deep);
  cursor: pointer;
  flex-shrink: 0;
}

/* Buttons */
.btn {
  border: 0;
  border-radius: var(--radius-md);
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.2s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-lg {
  padding: 13px 22px;
  font-size: 1.02rem;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.btn-gold {
  background: linear-gradient(135deg, #facc15, #f59e0b, #ea580c);
  color: #0b1120;
  font-weight: 700;
  box-shadow: 0 6px 22px rgba(245, 158, 11, 0.4);
}

.btn-ghost {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.18);
  color: #fda4af;
  border: 1px solid rgba(251, 113, 133, 0.35);
}

.btn-mini {
  border: 0;
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}

.btn-mini-gold {
  background: rgba(245, 158, 11, 0.2);
  color: #fde047;
  border: 1px solid rgba(250, 204, 21, 0.45);
}

.btn-mini-emerald {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.45);
}

.btn-mini-ghost {
  background: rgba(148, 163, 184, 0.14);
  color: var(--text-soft);
  border: 1px solid var(--border-subtle);
}

.btn-mini:hover {
  filter: brightness(1.15);
}

/* Badges */
.pill-badge {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.pill-gold {
  background: rgba(245, 158, 11, 0.2);
  color: #fde047;
  border: 1px solid rgba(250, 204, 21, 0.45);
}

.pill-success {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.5);
}

.pill-sky {
  background: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  border: 1px solid rgba(125, 211, 252, 0.4);
}

/* ==================== PLAYERS LIST ==================== */
.players-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border-subtle);
  transition: border-color 0.2s, transform 0.15s;
}

.player-row-card:hover {
  border-color: rgba(250, 204, 21, 0.35);
}

.player-row-card.is-paid {
  border-left: 4px solid var(--emerald);
}

.player-row-card.is-me {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.16), rgba(15, 23, 42, 0.82));
  border-color: rgba(250, 204, 21, 0.55);
}

.player-row-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.player-rank {
  width: 22px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 600;
}

.player-jersey-badge {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  color: #0b1120;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.08rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.24);
}

.player-details {
  min-width: 0;
}

.player-name-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 1rem;
}

.tag-me {
  background: var(--gold);
  color: #0b1120;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
}

.pos-chip {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.player-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.gk-queue-inline {
  color: #fde047;
  font-weight: 600;
}

.player-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn-pay-toggle {
  border: 1px solid rgba(250, 204, 21, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: #fde047;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.btn-pay-toggle.paid {
  border-color: rgba(52, 211, 153, 0.5);
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: rgba(30, 41, 59, 0.7);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
}

.icon-btn.active-star {
  border-color: var(--gold);
  background: rgba(245, 158, 11, 0.25);
}

.icon-btn.danger:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(251, 113, 133, 0.6);
}

.empty-state-card {
  text-align: center;
  padding: 36px 20px;
  border: 1px dashed rgba(148, 163, 184, 0.3);
  border-radius: var(--radius-md);
}

.empty-emoji {
  font-size: 2.6rem;
  margin-bottom: 8px;
}

/* ==================== TAB 2: TACTICAL PITCH ==================== */
.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.section-title-sm {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--gold);
}

.toolbar-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.match-tabs-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(250, 204, 21, 0.35) transparent;
}

.match-pill {
  flex: 0 0 auto;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-soft);
  padding: 8px 14px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 112px;
  transition: all 0.2s;
}

.match-pill-num {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.match-pill-gk {
  font-size: 0.74rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.match-pill.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.32), rgba(234, 88, 12, 0.24));
  border-color: var(--gold);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.28);
}

.match-pill.active .match-pill-gk {
  color: #fef08a;
}

/* Formation Strip */
.formation-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.formation-strip-label {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.formation-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(16, 185, 129, 0.4) transparent;
}

.formation-pill {
  flex: 0 0 auto;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.82);
  color: var(--text-soft);
  padding: 7px 13px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.2s;
}

.formation-pill strong {
  font-size: 0.96rem;
  color: #fff;
}

.formation-pill span {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.formation-pill.active {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #6ee7b7;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.formation-pill.active strong,
.formation-pill.active span {
  color: #fff;
}

/* Pitch Workspace */
.pitch-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 560px) 1fr;
  gap: 18px;
  align-items: start;
}

.pitch-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.pitch-gk-banner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.88rem;
}

.badge-gold {
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(250, 204, 21, 0.5);
  color: #fef08a;
  padding: 4px 11px;
  border-radius: 999px;
}

.badge-muted {
  color: var(--text-muted);
  font-size: 0.84rem;
}

.pitch-formation-tag {
  color: #6ee7b7;
  font-size: 0.84rem;
  font-weight: 600;
}

.interaction-hint {
  font-size: 0.84rem;
  color: var(--text-soft);
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border-subtle);
  padding: 8px 12px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.interaction-hint.hint-active {
  border-color: var(--gold);
  background: rgba(245, 158, 11, 0.16);
  color: #fef08a;
}

/* Pitch Board */
.pitch-frame {
  padding: 6px;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(52, 211, 153, 0.45), rgba(250, 204, 21, 0.28));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.pitch-board {
  position: relative;
  width: 100%;
  aspect-ratio: 600 / 820;
  border-radius: 19px;
  overflow: hidden;
  background: #067647;
}

.pitch-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.pitch-watermark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 24%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  opacity: 0.12;
  pointer-events: none;
  object-fit: cover;
}

.pitch-slots-layer {
  position: absolute;
  inset: 0;
}

.pitch-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: grab;
  touch-action: none;
  transition: left 0.36s cubic-bezier(0.22, 1, 0.36, 1), top 0.36s cubic-bezier(0.22, 1, 0.36, 1), transform 0.18s ease;
  z-index: 2;
}

.pitch-slot.empty {
  cursor: pointer;
}

.pitch-slot.dragging-source {
  opacity: 0.35;
}

.pitch-slot.selected .jersey-token {
  box-shadow: 0 0 0 4px #fde047, 0 0 22px rgba(250, 204, 21, 0.85);
  transform: scale(1.1);
}

.pitch-slot.can-drop .empty-token,
.pitch-slot.can-drop .jersey-token {
  animation: pulseDrop 1.2s infinite;
}

.pitch-slot.drop-hover .empty-token,
.pitch-slot.drop-hover .jersey-token {
  transform: scale(1.18);
  box-shadow: 0 0 0 4px #fde047, 0 0 28px rgba(250, 204, 21, 0.95);
}

@keyframes pulseDrop {
  0%, 100% { box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.65); }
  50% { box-shadow: 0 0 0 6px rgba(250, 204, 21, 0.25); }
}

.jersey-token {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, #ffffff44, transparent 60%), var(--jersey-color, #38bdf8);
  border: 3px solid #ffffff;
  color: #0b1120;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.42);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.pitch-slot.is-me .jersey-token {
  border-color: #fde047;
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.4), 0 8px 18px rgba(0, 0, 0, 0.45);
}

.jersey-num {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}

.gk-glove-tag {
  position: absolute;
  bottom: -4px;
  left: -5px;
  font-size: 0.9rem;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
}

.slot-remove-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  background: #ef4444;
  color: #fff;
  font-size: 0.8rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.92;
}

.slot-player-name {
  margin-top: 4px;
  padding: 2px 9px;
  border-radius: 8px;
  background: rgba(7, 12, 24, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pitch-slot.gk-slot.occupied .slot-player-name {
  background: linear-gradient(90deg, #facc15, #f59e0b);
  color: #0b1120;
  border-color: #fef08a;
}

.slot-role-micro {
  font-size: 0.65rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  margin-top: 1px;
}

.empty-token {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2.5px dashed rgba(255, 255, 255, 0.62);
  background: rgba(7, 12, 24, 0.42);
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.pitch-slot.gk-slot .empty-token {
  border-color: #facc15;
  background: rgba(245, 158, 11, 0.22);
}

.slot-role-label {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  color: #fff;
  background: rgba(7, 12, 24, 0.68);
  padding: 1px 8px;
  border-radius: 999px;
}

/* Bench Column */
.bench-column {
  transition: border-color 0.2s, background 0.2s;
}

.bench-column.drop-hover {
  border-color: var(--gold);
  background: rgba(245, 158, 11, 0.15);
}

.bench-sub {
  margin: -6px 0 14px;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.bench-players-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.bench-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 11px;
  border-radius: 13px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid var(--border-subtle);
  cursor: grab;
  touch-action: none;
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
}

.bench-chip:hover {
  border-color: rgba(250, 204, 21, 0.5);
  transform: translateY(-1px);
}

.bench-chip.selected {
  border-color: var(--gold);
  background: rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.25);
}

.bench-chip.dragging-source {
  opacity: 0.35;
}

.bench-num {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #0b1120;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.96rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bench-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.bench-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bench-pos {
  font-size: 0.72rem;
  font-weight: 600;
}

.drag-grip {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.empty-bench-msg {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px;
  border: 1px dashed var(--border-subtle);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* Floating Drag Ghost */
.drag-ghost {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.6));
}

/* ==================== TAB 3: GK RANDOMIZER ==================== */
.spotlight-card {
  border-color: var(--border-gold);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(15, 23, 42, 0.92) 60%);
}

.spotlight-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.spotlight-top h2 {
  margin: 0;
  font-size: 1.15rem;
}

.my-player-select {
  max-width: 290px;
}

.my-gk-banner {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.95rem;
}

.my-gk-banner.neutral {
  display: block;
  line-height: 1.55;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-subtle);
  color: var(--text-soft);
}

.my-gk-banner.assigned {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(234, 88, 12, 0.24));
  border: 2px solid var(--gold);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.25);
}

.my-gk-banner.safe {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.24), rgba(5, 150, 105, 0.18));
  border: 2px solid var(--emerald-bright);
}

.my-gk-icon {
  font-size: 2.3rem;
  flex-shrink: 0;
}

.my-gk-title {
  font-family: var(--font-display);
  font-size: 1.18rem;
  font-weight: 700;
}

.my-gk-title span {
  color: #fde047;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.my-gk-sub {
  font-size: 0.86rem;
  color: var(--text-soft);
  margin-top: 2px;
}

.gk-controls-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.match-stepper-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stepper-label {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(7, 12, 24, 0.75);
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 5px 10px;
}

.stepper-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 0;
  background: rgba(245, 158, 11, 0.22);
  color: #fde047;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
}

.stepper strong {
  min-width: 60px;
  text-align: center;
  font-size: 1.1rem;
  color: #fff;
}

.gk-toggles {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gk-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* GK Schedule Grid */
.gk-schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.gk-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.gk-card.filled {
  border-color: rgba(245, 158, 11, 0.42);
}

.gk-card.locked {
  border-color: var(--sky);
  background: linear-gradient(160deg, rgba(56, 189, 248, 0.12), rgba(17, 26, 46, 0.92));
}

.gk-card.is-mine-gk {
  border: 2px solid var(--gold);
  background: linear-gradient(155deg, rgba(245, 158, 11, 0.28), rgba(17, 26, 46, 0.94));
  box-shadow: 0 0 26px rgba(250, 204, 21, 0.3);
  transform: translateY(-2px);
}

.gk-card.spinning {
  border-color: var(--gold);
  animation: cardShake 0.14s infinite;
}

@keyframes cardShake {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.gk-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gk-match-badge {
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #0b1120;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.9rem;
  padding: 3px 12px;
  border-radius: 999px;
}

.gk-card-tools {
  display: flex;
  gap: 6px;
}

.gk-lock-btn, .gk-pitch-link {
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-soft);
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 0.78rem;
  cursor: pointer;
}

.gk-lock-btn.active {
  border-color: var(--sky);
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.18);
}

.gk-card-player {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}

.gk-jersey-mini {
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid rgba(250, 204, 21, 0.55);
  color: #fde047;
  font-size: 0.9rem;
  padding: 2px 8px;
  border-radius: 8px;
}

.gk-waiting {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 400;
}

.gk-manual-select {
  padding: 7px 10px;
  font-size: 0.84rem;
}

.fairness-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fair-chip {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.82rem;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--border-subtle);
  color: var(--text-soft);
}

.fair-chip.has-turn {
  border-color: rgba(250, 204, 21, 0.45);
  color: #fef08a;
  background: rgba(245, 158, 11, 0.14);
}

.fair-chip.excluded {
  opacity: 0.55;
  text-decoration: line-through;
}

/* ==================== TAB 4: EXPORT ==================== */
.export-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
}

.export-toolbar h2 {
  margin: 0 0 4px;
}

.export-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.export-select {
  width: auto;
  min-width: 180px;
}

.canvas-preview-wrap {
  display: flex;
  justify-content: center;
  background: rgba(7, 12, 24, 0.65);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid var(--border-subtle);
}

.export-canvas {
  width: 100%;
  max-width: 520px;
  height: auto;
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
}

/* ==================== MODALS, TOAST, CONFETTI ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(3, 6, 14, 0.76);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card-strong);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-head h3 {
  margin: 0;
}

.muted-text {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin: 0;
}

.toast-container {
  position: fixed;
  top: 78px;
  right: 18px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid var(--border-subtle);
  color: #fff;
  padding: 11px 16px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 0.9rem;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.24s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast-success { border-left: 4px solid var(--emerald); }
.toast-warn { border-left: 4px solid var(--gold); }
.toast-info { border-left: 4px solid var(--sky); }

/* Confetti */
.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 150;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -16px;
  width: 10px;
  height: 16px;
  border-radius: 3px;
  animation: confettiFall 1.8s ease-out forwards;
}

@keyframes confettiFall {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  100% { transform: translate(var(--drift, 40px), 100vh) rotate(560deg); opacity: 0; }
}

/* ==================== MOBILE BOTTOM NAV & RESPONSIVE ==================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: rgba(7, 12, 24, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(250, 204, 21, 0.25);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.mnav-btn {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: 12px;
  cursor: pointer;
}

.mnav-ico { font-size: 1.25rem; line-height: 1; }
.mnav-lbl { font-size: 0.72rem; font-weight: 500; }

.mnav-btn.active {
  background: rgba(245, 158, 11, 0.2);
  color: var(--gold);
}

@media (max-width: 960px) {
  .desktop-nav { display: none; }
  .mobile-bottom-nav { display: grid; }
  .two-col-layout,
  .pitch-workspace {
    grid-template-columns: 1fr;
  }
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .header-inner { padding: 8px 12px; }
  .crest-wrap { width: 42px; height: 42px; }
  .brand-title { font-size: 1.08rem; }
  .app-main { padding: 14px 12px 92px; }
  .glass-card { padding: 14px; }
  .form-row-2 { grid-template-columns: 1fr; }
  .player-row-card { flex-direction: column; align-items: stretch; }
  .player-row-actions { justify-content: flex-end; }
  .jersey-token { width: 44px; height: 44px; }
  .jersey-num { font-size: 1.05rem; }
  .empty-token { width: 42px; height: 42px; }
  .slot-player-name { font-size: 0.72rem; padding: 2px 7px; }
}


/* ==================== PERSONAL 1-TAP HERO BANNER ==================== */
.personal-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 15px 18px;
  margin-bottom: 16px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(234, 88, 12, 0.14), rgba(17, 26, 46, 0.92));
  border: 1.5px solid var(--border-gold);
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.14);
}

.personal-hero.checked {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.24), rgba(5, 150, 105, 0.14), rgba(17, 26, 46, 0.92));
  border-color: rgba(52, 211, 153, 0.55);
}

.hero-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 220px;
}

.hero-emoji {
  font-size: 1.9rem;
  line-height: 1;
  flex-shrink: 0;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
  color: #fff;
}

.hero-sub {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-top: 2px;
}

.hero-select {
  min-width: 240px;
  max-width: 100%;
  background: rgba(7, 12, 24, 0.85);
  border: 1.5px solid var(--gold);
  color: #fff;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 0.95rem;
  outline: none;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==================== 1-TAP REGULARS CHECK-IN BOARD ==================== */
.regulars-head {
  flex-wrap: wrap;
  align-items: flex-start;
}

.regulars-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 210px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.92rem;
  pointer-events: none;
  opacity: 0.75;
}

.search-box input {
  width: 100%;
  background: rgba(7, 12, 24, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #fff;
  padding: 10px 12px 10px 36px;
  border-radius: 12px;
  font-size: 0.95rem;
  outline: none;
}

.search-box input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.16);
}

.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill {
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.75);
  color: var(--text-soft);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  min-height: 36px;
  transition: all 0.18s;
}

.filter-pill.active {
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #0b1120;
  border-color: #fde047;
  font-weight: 700;
}

.regulars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 10px;
}

.reg-tile {
  position: relative;
  border-radius: 14px;
  padding: 10px 11px;
  background: rgba(15, 23, 42, 0.8);
  border: 1.5px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: transform 0.12s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.reg-tile:hover {
  border-color: rgba(250, 204, 21, 0.45);
}

.reg-tile:active {
  transform: scale(0.97);
}

.reg-tile.checked {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.26), rgba(5, 150, 105, 0.16));
  border-color: #34d399;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.22);
}

.reg-tile.is-me-reg {
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.5);
}

.reg-tile-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.reg-num {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #0b1120;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.96rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.reg-tile.checked .reg-num {
  color: #fff;
}

.reg-name-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.reg-name {
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reg-status {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reg-tile.checked .reg-status {
  color: #6ee7b7;
  font-weight: 600;
}

.reg-star-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 0;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.reg-star-btn.active {
  background: rgba(250, 204, 21, 0.22);
  color: var(--gold);
}

/* ==================== MANAGE REGULARS MODAL ==================== */
.modal-card-lg {
  max-width: 680px;
  max-height: 86vh;
  max-height: 86dvh;
  display: flex;
  flex-direction: column;
}

.manage-regulars-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}

.manage-reg-row {
  display: grid;
  grid-template-columns: 1.5fr 64px 86px 112px auto;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  background: rgba(7, 12, 24, 0.55);
  border: 1px solid var(--border-subtle);
}

.manage-reg-row input,
.manage-reg-row select {
  width: 100%;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #fff;
  padding: 6px 8px;
  border-radius: 8px;
  font-size: 0.84rem;
}

.mreg-btns {
  display: flex;
  gap: 4px;
}

/* Hidden offscreen canvas for crisp <img> LINE long-press support */
.sr-canvas {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
}

/* ==================== UNIVERSAL ALL-MOBILE HARDENING ==================== */
html, body {
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

button, a, select, input, .reg-tile, .match-pill, .formation-pill {
  touch-action: manipulation;
}

.pitch-board {
  overscroll-behavior: contain;
}

body.is-dragging-player {
  overscroll-behavior: none;
  overflow: hidden;
}

.app-header {
  padding-top: env(safe-area-inset-top);
}

.match-tabs-scroll,
.formation-pills {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
  /* Prevent iOS Safari / LINE In-App Browser auto-zoom on form focus */
  input, select, textarea {
    font-size: 16px !important;
  }

  .btn, .mnav-btn, .stepper-btn, .icon-btn, .btn-pay-toggle {
    min-height: 40px;
  }

  .hero-select {
    width: 100%;
    min-width: 0;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions .btn {
    flex: 1;
  }

  .manage-reg-row {
    grid-template-columns: 1fr 72px;
  }

  .mreg-btns {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .toast-container {
    left: 12px;
    right: 12px;
    top: calc(66px + env(safe-area-inset-top));
  }
}

@media (max-width: 540px) {
  .app-main {
    padding: 12px 10px calc(92px + env(safe-area-inset-bottom));
  }

  .regulars-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .reg-tile {
    padding: 9px 8px;
  }

  .reg-num {
    width: 28px;
    height: 28px;
    font-size: 0.84rem;
    border-radius: 8px;
  }

  .reg-name {
    font-size: 0.84rem;
  }

  .reg-status {
    font-size: 0.68rem;
  }

  .reg-star-btn {
    width: 26px;
    height: 26px;
    font-size: 0.82rem;
  }

  .jersey-token {
    width: clamp(38px, 11.5vw, 46px);
    height: clamp(38px, 11.5vw, 46px);
  }

  .empty-token {
    width: clamp(36px, 11vw, 44px);
    height: clamp(36px, 11vw, 44px);
  }

  .slot-player-name {
    max-width: 82px;
    font-size: 0.7rem;
  }

  .export-actions {
    width: 100%;
  }

  .export-actions .btn,
  .export-actions .export-select {
    flex: 1 1 46%;
    min-width: 0;
  }
}

/* Extra narrow phones (iPhone SE 1st Gen / 320px-360px Androids) */
@media (max-width: 360px) {
  .brand-kicker { display: none; }
  .brand-title { font-size: 0.98rem; }
  .sync-pill { padding: 4px 8px; font-size: 0.7rem; }
  .regulars-grid {
    grid-template-columns: 1fr;
  }
  .mnav-lbl { font-size: 0.66rem; }
}


/* ==================== CAPTAIN PIN LOCK PILL ==================== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pin-pill.locked {
  border-color: rgba(251, 113, 133, 0.55);
  background: rgba(239, 68, 68, 0.16);
  color: #fda4af;
}

.pin-pill.unlocked {
  border-color: rgba(250, 204, 21, 0.55);
  background: rgba(245, 158, 11, 0.2);
  color: #fde047;
}

/* ==================== RSVP MINI BAR & WAITING LIST ==================== */
.reg-tile.is-maybe {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(15, 23, 42, 0.85));
  border-color: rgba(250, 204, 21, 0.55);
}

.reg-tile.is-out {
  opacity: 0.65;
  border-color: rgba(148, 163, 184, 0.25);
}

.reg-rsvp-mini-bar {
  display: flex;
  gap: 5px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.rsvp-mini-btn {
  flex: 1;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(7, 12, 24, 0.5);
  color: var(--text-muted);
  border-radius: 7px;
  padding: 3px 5px;
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
}

.rsvp-mini-btn.active-maybe {
  background: rgba(245, 158, 11, 0.26);
  border-color: var(--gold);
  color: #fef08a;
}

.rsvp-mini-btn.active-out {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(251, 113, 133, 0.55);
  color: #fda4af;
}

.rsvp-summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.list-divider {
  margin: 12px 0 6px;
  font-family: var(--font-display);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--gold);
  padding-bottom: 4px;
  border-bottom: 1px dashed rgba(250, 204, 21, 0.28);
}

.player-row-card.is-secondary {
  opacity: 0.82;
  background: rgba(15, 23, 42, 0.45);
}

/* ==================== PROMPTPAY QR CARD ==================== */
.promptpay-card {
  border-color: rgba(56, 189, 248, 0.4);
  background: linear-gradient(155deg, rgba(56, 189, 248, 0.1), rgba(17, 26, 46, 0.92) 55%);
}

.promptpay-qr-box {
  margin-top: 12px;
}

.pp-empty {
  padding: 14px;
  border-radius: 12px;
  border: 1px dashed rgba(56, 189, 248, 0.35);
  color: var(--text-soft);
  font-size: 0.85rem;
  text-align: center;
}

.pp-error {
  border-color: rgba(251, 113, 133, 0.5);
  color: #fda4af;
}

.pp-ready-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 14px;
  background: rgba(7, 12, 24, 0.72);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.pp-qr-img {
  width: 124px;
  height: 124px;
  border-radius: 10px;
  background: #fff;
  padding: 5px;
  cursor: pointer;
  flex-shrink: 0;
}

.pp-info {
  min-width: 0;
  flex: 1;
}

.pp-label {
  font-size: 0.78rem;
  color: #7dd3fc;
  font-weight: 600;
}

.pp-amount {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1.15;
  margin: 2px 0;
}

.pp-meta {
  font-size: 0.82rem;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== 2-TEAM SPLITTER ==================== */
.submode-switcher {
  display: inline-flex;
  gap: 6px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-subtle);
  padding: 5px;
  border-radius: 14px;
  margin-bottom: 14px;
  max-width: 100%;
  flex-wrap: wrap;
}

.submode-btn {
  border: 0;
  background: transparent;
  color: var(--text-soft);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.submode-btn.active {
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #0b1120;
}

.pitch-subpanel {
  display: none;
}

.pitch-subpanel.active {
  display: block;
}

.team-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 14px;
}

.split-team-card {
  border-radius: var(--radius-lg);
  padding: 16px;
  border: 1.5px solid var(--border-subtle);
  background: rgba(7, 12, 24, 0.58);
}

.split-team-card.team-gold {
  border-color: rgba(250, 204, 21, 0.5);
  background: linear-gradient(160deg, rgba(245, 158, 11, 0.14), rgba(7, 12, 24, 0.72));
}

.split-team-card.team-emerald {
  border-color: rgba(52, 211, 153, 0.5);
  background: linear-gradient(160deg, rgba(16, 185, 129, 0.14), rgba(7, 12, 24, 0.72));
}

.split-team-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.split-team-head h3 {
  margin: 0;
  font-size: 1.05rem;
}

.split-players-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.split-player-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 11px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  cursor: pointer;
  text-align: left;
  transition: transform 0.12s, border-color 0.2s;
}

.split-player-row:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.split-pname {
  flex: 1;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.94rem;
}

.swap-arrow {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==================== LIVE TIMER, SCORES & MOTM ==================== */
.timer-card {
  border-color: var(--border-gold);
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.14), rgba(17, 26, 46, 0.92) 55%);
}

.timer-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.timer-gk-callout {
  font-size: 0.9rem;
  color: var(--text-soft);
  margin-top: 4px;
}

.timer-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.timer-display-wrap {
  text-align: center;
  margin-top: 14px;
}

.timer-clock {
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 11vw, 5.4rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.04em;
  color: #fff;
  text-shadow: 0 0 28px rgba(250, 204, 21, 0.35);
}

.timer-clock.warning {
  color: #fb7185;
  text-shadow: 0 0 28px rgba(251, 113, 133, 0.55);
}

.timer-progress-track {
  width: 100%;
  max-width: 560px;
  height: 10px;
  margin: 12px auto 16px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.2);
  overflow: hidden;
}

.timer-progress-bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #10b981, #facc15, #ea580c);
  transition: width 0.3s linear;
}

.timer-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.timer-match-switcher {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.whistle-modal-card {
  text-align: center;
  border: 2px solid var(--gold);
}

.whistle-big-ico {
  font-size: 3.2rem;
  margin-bottom: 6px;
}

.whistle-gk-text {
  font-size: 1.05rem;
  color: var(--text-soft);
  line-height: 1.6;
}

.whistle-gk-name {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 18px;
  border-radius: 12px;
  background: linear-gradient(135deg, #facc15, #f59e0b);
  color: #0b1120;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
}

/* Scoreboards */
.live-scores-layout {
  grid-template-columns: 1.25fr 1fr;
}

.scores-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.score-match-card {
  padding: 14px;
  border-radius: 16px;
  background: rgba(7, 12, 24, 0.65);
  border: 1px solid var(--border-subtle);
}

.score-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.score-res {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
}

.score-res.win { background: rgba(16, 185, 129, 0.22); color: #6ee7b7; }
.score-res.draw { background: rgba(245, 158, 11, 0.22); color: #fde047; }
.score-res.loss { background: rgba(239, 68, 68, 0.22); color: #fda4af; }
.score-res.neutral { background: rgba(148, 163, 184, 0.16); color: var(--text-muted); }

.scoreboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.sb-side {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.sb-team-lbl {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

.sb-stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 4px 8px;
}

.sb-stepper button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 0;
  background: rgba(245, 158, 11, 0.2);
  color: #fde047;
  font-size: 1.15rem;
  font-weight: 700;
  cursor: pointer;
}

.sb-stepper strong {
  min-width: 28px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.sb-vs {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--gold);
  font-size: 0.9rem;
}

.goal-logger-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.goal-player-select {
  flex: 1;
  min-width: 140px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #fff;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 0.84rem;
}

.goal-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.goal-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #d1fae5;
}

.goal-chip.assist {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(250, 204, 21, 0.45);
  color: #fef08a;
}

.goal-chip button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-weight: 700;
  padding: 0 2px;
}

/* Top Scorers & MOTM */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.leader-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--border-subtle);
}

.leader-row.rank-1 {
  border-color: var(--gold);
  background: rgba(245, 158, 11, 0.18);
}

.leader-rank { font-size: 1.1rem; width: 26px; text-align: center; }
.leader-name { flex: 1; font-family: var(--font-display); }
.leader-stat { color: #6ee7b7; font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; }

.motm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}

.motm-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  font-size: 0.84rem;
  cursor: pointer;
  transition: all 0.16s;
}

.motm-chip.voted {
  border-color: var(--sky);
  background: rgba(56, 189, 248, 0.2);
}

.motm-chip.leader {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.26), rgba(234, 88, 12, 0.16));
}

.motm-count {
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--gold);
}

/* 5-tab Mobile Bottom Nav */
.mobile-nav-5 {
  grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 960px) {
  .team-split-grid,
  .live-scores-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .pp-ready-wrap {
    flex-direction: column;
    text-align: center;
  }
  .mnav-lbl {
    font-size: 0.66rem;
  }
}

.export-suboptions {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.3);
}

/* ==================== FAIR MULTI-MATCH ROTATION SUMMARY ==================== */
.rotation-summary-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rotation-balance-pill {
  padding: 10px 14px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.rotation-balance-pill.balanced {
  background: rgba(16, 185, 129, 0.16);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}

.rotation-balance-pill.uneven {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(250, 204, 21, 0.45);
  color: #fde047;
}

.rot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 9px 12px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--border-subtle);
}

.rot-row.is-me {
  border-color: var(--gold);
  background: rgba(245, 158, 11, 0.14);
}

.rot-player {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 140px;
  flex: 1;
}

.rot-num {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold);
}

.rot-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.rot-dot {
  font-family: var(--font-display);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 8px;
  white-space: nowrap;
}

.rot-dot.gk {
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid var(--gold);
  color: #fef08a;
}

.rot-dot.play {
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
}

.rot-dot.bench {
  background: rgba(100, 116, 139, 0.2);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #94a3b8;
}

.rot-counts {
  display: flex;
  gap: 6px;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
}

.rot-play-tag {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  padding: 2px 9px;
  border-radius: 999px;
}

.rot-bench-tag {
  background: rgba(148, 163, 184, 0.16);
  color: #cbd5e1;
  padding: 2px 9px;
  border-radius: 999px;
}
