/* ══════════════════════════════════════════════════════════
   OFTA Admin Panel — style.css
   All styles live here. No inline styles in the HTML.
   ══════════════════════════════════════════════════════════ */


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

/* ── DESIGN TOKENS ────────────────────────────────────────── */
:root {
  --pitch:       #0d2818;   /* Deep forest green — primary dark */
  --pitch-mid:   #134a28;   /* Mid green — hover states */
  --green:       #1a8a3c;   /* Action green */
  --green-lt:    #22a84a;   /* Lighter green — hover */
  --red:         #c0392b;   /* Danger / red card */
  --yellow:      #f0b429;   /* Warning / yellow card */
  --purple:      #7c3aed;   /* Admin tools accent */
  --bg:          #f2f4f3;   /* Page background */
  --card:        #ffffff;   /* Card surface */
  --text:        #111111;   /* Primary text */
  --muted:       #6b7280;   /* Secondary text */
  --border:      #e2e8e4;   /* Dividers and borders */
  --radius:      10px;
  --radius-lg:   14px;
  --shadow:      0 2px 10px rgba(0, 0, 0, 0.08);
  --shadow-lg:   0 8px 30px rgba(0, 0, 0, 0.15);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  padding-bottom: 48px;
  -webkit-font-smoothing: antialiased;
}


/* ══════════════════════════════════════════════════════════
   AUTH WALL
   ══════════════════════════════════════════════════════════ */

#authWall {
  position: fixed;
  inset: 0;
  background: var(--pitch);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  /* Background subtle grid texture */
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* Views inside the auth wall switch with .active class */
.auth-view {
  display: none;
  width: 100%;
  max-width: 380px;
}

.auth-view.active {
  display: block;
}

.auth-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  backdrop-filter: blur(8px);
}

.auth-card--center {
  text-align: center;
}

.auth-brand {
  font-family: 'Montserrat', sans-serif;
  font-size: 36px;
  font-weight: 900;
  letter-spacing: 6px;
  color: #4ade80;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.auth-tagline {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
  margin-bottom: 28px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── Field group ── */
.auth-form .field-group {
  margin-bottom: 14px;
}

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 6px;
}

/* Auth wall inputs override the global input style */
.auth-form input,
.auth-form select.form-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  width: 100%;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}

.auth-form input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.auth-form input:focus,
.auth-form select.form-select:focus {
  border-color: #4ade80;
}

/* Auth wall selects need custom arrow color */
.auth-form select.form-select option {
  background: #1a3325;
  color: #fff;
}

.auth-error {
  font-size: 12px;
  color: #f87171;
  min-height: 18px;
  margin-bottom: 10px;
  text-align: center;
}

.auth-switch {
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 14px;
}

.auth-switch a {
  color: #4ade80;
  cursor: pointer;
  text-decoration: underline;
  font-weight: 600;
}

/* ── Register profile row ── */
.reg-profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.reg-avatar-wrap {
  position: relative;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.reg-avatar-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  display: none;
  border: 2px solid rgba(255,255,255,0.2);
}

.reg-avatar-placeholder {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 2px dashed rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}

/* ── Pending view ── */
.pending-icon {
  font-size: 52px;
  margin-bottom: 16px;
}

.pending-msg {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  line-height: 1.6;
  margin-bottom: 24px;
}


/* ══════════════════════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════════════════════ */

.admin-header {
  background: var(--pitch);
  color: #fff;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  gap: 12px;
}

.header-left,
.header-right {
  flex: 1;
  display: flex;
  align-items: center;
}

.header-right {
  justify-content: flex-end;
  position: relative;
}

.brand {
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand span {
  color: #4ade80;
}

/* Match selector in header */
.header-center select {
  background: var(--pitch-mid);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}

/* ── Profile chip ── */
.profile-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 5px 10px 5px 6px;
  cursor: pointer;
  transition: background 0.15s;
  max-width: 180px;
}

.profile-chip:hover {
  background: rgba(255, 255, 255, 0.16);
}

.chip-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.chip-initial {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chip-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

.chip-caret {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
}

/* ── Profile dropdown menu ── */
.profile-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  min-width: 220px;
  overflow: hidden;
  border: 1px solid var(--border);
  z-index: 200;
}

.menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--bg);
}

.menu-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.menu-avatar-initial {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.menu-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.menu-role {
  font-size: 11px;
  color: var(--muted);
  text-transform: capitalize;
  margin-top: 2px;
}

.menu-divider {
  height: 1px;
  background: var(--border);
}

.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  background: none;
  border: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.1s;
  font-family: inherit;
  margin: 0;
}

.menu-item:hover {
  background: var(--bg);
}

.menu-item--danger {
  color: var(--red);
}

/* ── Role banner (shown for limited-access roles) ── */
.role-banner {
  background: #fef9c3;
  border-bottom: 1px solid #fde68a;
  padding: 8px 16px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #7c4a00;
}


/* ══════════════════════════════════════════════════════════
   PAGE LAYOUT
   ══════════════════════════════════════════════════════════ */

.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px 16px;
}

/* ── Cards ── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}

.card--danger .card-header {
  background: var(--purple);
}

.card-header {
  background: var(--pitch);
  color: #fff;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}


/* ══════════════════════════════════════════════════════════
   SCOREBOARD
   ══════════════════════════════════════════════════════════ */

.scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 20px 16px 16px;
}

.team-col {
  text-align: center;
}

/* Team logo container — tries image, falls back to letter */
.team-logo-sb {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  margin: 0 auto 8px;
  background: var(--bg);
  display: block;
}

.team-logo-sb-fallback {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 900;
  color: var(--muted);
  margin: 0 auto 8px;
}

.team-name-sb {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.score-num {
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
  color: var(--pitch);
}

.center-col {
  text-align: center;
}

/* ── Status badge ── */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--border);
  color: var(--muted);
  margin-bottom: 6px;
}

.status-badge.live { background: #dcfce7; color: var(--green); }
.status-badge.ht   { background: #fef9c3; color: #854d0e; }
.status-badge.ft   { background: #f1f5f9; color: #475569; }

/* ── Clock ── */
.clock {
  font-size: 22px;
  font-weight: 800;
  color: var(--pitch);
  font-variant-numeric: tabular-nums;
}

/* ── Scorer lists ── */
.scorers-row {
  padding: 0 16px 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 8px;
}

.scorer-side {
  font-size: 11px;
  color: var(--muted);
  min-height: 12px;
}

.scorer-side--right {
  text-align: right;
}

.scorer-item {
  padding: 2px 0;
}

/* ── Match meta bar ── */
.match-meta {
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}


/* ══════════════════════════════════════════════════════════
   MATCH CONTROLS
   ══════════════════════════════════════════════════════════ */

.controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 16px;
}

.ctrl-btn {
  padding: 10px 4px;
  border: none;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  font-family: inherit;
}

.ctrl-btn:active {
  transform: scale(0.96);
}

.ctrl-btn--start  { background: var(--green);     color: #fff; }
.ctrl-btn--ht     { background: var(--yellow);    color: #7c4a00; }
.ctrl-btn--resume { background: var(--pitch-mid); color: #fff; }
.ctrl-btn--ft     { background: var(--red);       color: #fff; }


/* ══════════════════════════════════════════════════════════
   PLAYER EVENTS
   ══════════════════════════════════════════════════════════ */

.team-labels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px 16px 6px;
}

.team-label-pill {
  text-align: center;
  background: var(--pitch);
  color: #fff;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px 16px 16px;
}

.ev-row-label {
  grid-column: 1 / -1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 4px 0 2px;
}

.ev-btn {
  padding: 12px 8px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: opacity 0.15s, transform 0.1s;
  font-family: inherit;
}

.ev-btn:active {
  transform: scale(0.96);
}

.ev-btn--goal   { background: #dcfce7; color: #166534; }
.ev-btn--assist { background: #dbeafe; color: #1e3a5f; }
.ev-btn--yellow { background: #fef9c3; color: #854d0e; }
.ev-btn--red    { background: #fee2e2; color: #7f1d1d; }
.ev-btn--undo   { background: #f1f5f9; color: #475569; }


/* ══════════════════════════════════════════════════════════
   SQUAD MANAGEMENT
   ══════════════════════════════════════════════════════════ */

.squad-team-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--border);
}

.squad-team-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.squad-form {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Photo upload row (used in squad & edit modals) ── */
.pic-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pic-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.pic-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  position: absolute;
  inset: 0;
  border-radius: 50%;
}

.pic-status {
  font-size: 11px;
  color: var(--green);
  margin-top: 4px;
}

/* ── Squad player list ── */
.squad-list {
  border-top: 1px solid var(--border);
}

.squad-player-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.squad-player-row:last-child {
  border-bottom: none;
}

.squad-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.squad-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

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

.squad-name {
  font-size: 13px;
  font-weight: 700;
}

.squad-pos {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

/* Squad row action buttons */
.squad-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.edit-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--pitch);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.edit-btn:hover {
  background: var(--border);
}

.remove-btn {
  background: none;
  border: 1px solid #fca5a5;
  color: var(--red);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.squad-empty {
  padding: 20px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}


/* ══════════════════════════════════════════════════════════
   DATABASE TOOLS CARD
   ══════════════════════════════════════════════════════════ */

.db-warning {
  font-size: 13px;
  color: var(--muted);
}

.seed-status {
  font-size: 13px;
  text-align: center;
  min-height: 18px;
  font-weight: 600;
}


/* ══════════════════════════════════════════════════════════
   MODALS (squad picker, edit player, profile editor, admin panel)
   ══════════════════════════════════════════════════════════ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}

/* Show when .open class is added by JS */
.modal-overlay.open {
  display: flex;
}

/* Bottom sheet panel */
.picker-sheet {
  background: #fff;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  overflow-y: auto;
  padding-bottom: 20px;
}

/* Larger sheet for admin user panel */
.admin-panel-sheet {
  background: #fff;
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding-bottom: 20px;
}

/* Drag handle visual */
.picker-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 12px auto 16px;
}

.picker-header {
  padding: 0 16px 12px;
  border-bottom: 1px solid var(--border);
}

.picker-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}

.picker-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

/* Picker player rows */
.picker-player-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}

.picker-player-row:hover {
  background: #f9fafb;
}

.picker-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
  border: 2px solid var(--border);
}

.picker-avatar--empty {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.picker-player-name {
  font-size: 14px;
  font-weight: 700;
}

.picker-player-pos {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

.picker-player-short {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  flex-shrink: 0;
}

.picker-cancel {
  width: calc(100% - 32px);
  margin: 14px 16px 0;
  padding: 11px;
  background: var(--bg);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}

/* Edit player form inside the modal */
.edit-player-form {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.edit-player-actions {
  display: flex;
  gap: 10px;
}

.edit-player-actions .btn-primary,
.edit-player-actions .btn-outline {
  flex: 1;
}


/* ══════════════════════════════════════════════════════════
   ADMIN PANEL (user management)
   ══════════════════════════════════════════════════════════ */

.admin-user-list {
  padding: 8px 0;
}

/* Each user row in the admin panel */
.admin-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.admin-user-row:last-child {
  border-bottom: none;
}

.admin-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.admin-user-initial {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.admin-user-name {
  font-size: 13px;
  font-weight: 700;
}

.admin-user-email {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Role badge */
.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.role-badge--pending    { background: #fef9c3; color: #7c4a00; }
.role-badge--viewer     { background: #f1f5f9; color: #475569; }
.role-badge--assistant  { background: #dbeafe; color: #1e3a5f; }
.role-badge--editor     { background: #dcfce7; color: #166534; }
.role-badge--admin      { background: var(--pitch); color: #4ade80; }

/* Role select for changing a user's role */
.admin-role-select {
  padding: 4px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  outline: none;
  font-family: inherit;
  background: #fff;
}

.approve-btn {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.loading-msg {
  padding: 24px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}


/* ══════════════════════════════════════════════════════════
   SHARED FORM ELEMENTS
   ══════════════════════════════════════════════════════════ */

/* Two-column field row */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Standard inputs (outside auth wall — light theme) */
input,
select.form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}

input:focus,
select.form-select:focus {
  border-color: var(--green);
}

/* ── Button system ── */
.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  font-family: inherit;
}

.btn-primary:hover  { background: var(--green-lt); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-outline {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}

.btn-outline:hover { background: var(--bg); }

/* Small outline button for file upload labels */
.btn-outline-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s;
}

.btn-outline-sm:hover { background: var(--border); }

.btn-purple {
  width: 100%;
  padding: 12px;
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.btn-danger {
  width: 100%;
  padding: 12px;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}


/* ══════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════ */

@media (max-width: 400px) {
  .score-num {
    font-size: 40px;
  }

  .controls {
    grid-template-columns: repeat(2, 1fr);
  }

  .chip-name {
    display: none;
  }

  .brand {
    font-size: 14px;
  }
}

@media (min-width: 520px) {
  .picker-sheet,
  .admin-panel-sheet {
    border-radius: 16px;
    margin: 20px;
    max-height: 85vh;
  }

  .modal-overlay.open {
    align-items: center;
  }
}
