/* ============================================
   RUMMY SCORE TRACKER — styles
   Mobile-first, no dependencies
   ============================================ */

:root {
  --primary:      #6366f1;
  --primary-dark: #4f46e5;
  --primary-light:#eef2ff;
  --danger:       #ef4444;
  --danger-light: #fef2f2;
  --success:      #22c55e;
  --success-light:#f0fdf4;
  --warning:      #f59e0b;
  --warning-light:#fffbeb;
  --bg:           #f1f5f9;
  --surface:      #ffffff;
  --border:       #e2e8f0;
  --text:         #1e293b;
  --text-muted:   #64748b;
  --text-light:   #94a3b8;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:    0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --radius:       12px;
  --radius-sm:    8px;
  --header-h:     56px;
  --safe-top:     env(safe-area-inset-top, 0px);
  --safe-bottom:  env(safe-area-inset-bottom, 0px);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; font: inherit; border: none; background: none; touch-action: manipulation; }
input  { font: inherit; }
a      { color: inherit; text-decoration: none; }

/* ---- App shell ---- */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 640px;
  margin: 0 auto;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: linear-gradient(135deg, #e63946 0%, #f4a261 20%, #2a9d8f 40%, #457b9d 60%, #a8dadc 80%, #6a4c93 100%);
  border-bottom: none;
  display: flex;
  align-items: center;
  padding-left: 8px;
  padding-right: 8px;
  gap: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.app-header h1 {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

#user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 12px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-h) + var(--safe-top));
  z-index: 99;
}

#user-bar[hidden] { display: none; }

#page-content {
  flex: 1;
  padding: 16px;
  padding-bottom: calc(80px + var(--safe-bottom));
}

/* Game screen — lock viewport, no window scroll */
body.game-active {
  overflow: hidden;
  height: 100dvh;
}
body.game-active #app {
  height: 100dvh;
  min-height: unset;
  overflow: hidden;
}
body.game-active .app-header {
  position: relative;
  flex-shrink: 0;
}
body.game-active #page-content {
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.game-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.game-rank-section {
  flex-shrink: 0;
}
.game-scroll-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.game-bottom-bar {
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  transition: all .15s;
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; pointer-events: none; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(99,102,241,.3);
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary-light); }

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-outline.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-outline.btn-danger:hover { background: var(--danger-light); }

.btn-block { width: 100%; }

.btn-sm {
  padding: 5px 12px;
  font-size: 13px;
  border-radius: 6px;
}

.btn-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.btn-icon:hover  { background: rgba(255,255,255,0.2); color: #fff; }
.btn-icon[hidden] { display: none; }

.btn-remove {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--danger);
  font-size: 16px;
  flex-shrink: 0;
}
.btn-remove:hover { background: var(--danger-light); }

.btn-move {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
}
.btn-move:hover { background: var(--bg); color: var(--text); }

/* ---- Mic button ---- */
.btn-mic {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background .15s;
}
.btn-mic:hover { background: var(--bg); }
.btn-mic.mic-active {
  border-color: var(--danger);
  animation: mic-pulse 1s infinite;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.4); }
  50%       { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

/* ---- Forms ---- */
.form-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.form-group { margin-bottom: 14px; }
.form-group:last-child { margin-bottom: 0; }
.modal-body .form-group { margin-bottom: 4px; }
.modal-body .form-label { margin-bottom: 1px; font-size: 11px; }
.modal-body .input { padding: 5px 8px; font-size: 16px; }

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 6px;
}

.input {
  width: 100%;
  padding: 5px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 16px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.input.input-error { border-color: var(--danger); }
input[type="number"].input { -moz-appearance: textfield; }
input[type="number"].input::-webkit-inner-spin-button,
input[type="number"].input::-webkit-outer-spin-button { -webkit-appearance: none; }

.radio-group {
  display: flex;
  gap: 10px;
}
.radio-label {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s;
  font-size: 14px;
}
.radio-label:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}
.radio-label input { accent-color: var(--primary); }

/* Player row in setup */
.player-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
}
.player-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.player-row .input { flex: 1; padding: 6px 10px; font-size: 14px; }
.spacer { width: 32px; flex-shrink: 0; }

/* ---- Cards ---- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
  position: relative;
  overflow: hidden;
}
.card:active { transform: scale(.99); }

.card-active {
  border: 2px solid var(--primary);
  background: linear-gradient(135deg, var(--surface) 0%, var(--primary-light) 100%);
}
.card-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 6px;
}
.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.card-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.card-leader {
  font-size: 13px;
  color: var(--primary-dark);
  font-weight: 600;
}
.card-arrow {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}

.card-history { cursor: pointer; }
.card-history:hover { box-shadow: var(--shadow-md); }

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.card-date {
  font-size: 13px;
  color: var(--text-muted);
}

.card-completed {
  text-align: center;
  background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
  border: 2px solid #fbbf24;
  cursor: default;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.completed-title {
  font-size: 22px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #92400e;
  margin-bottom: 4px;
}
.winner-name {
  font-size: 22px;
  font-weight: 800;
  color: #78350f;
  margin-bottom: 4px;
  text-align: center;
  width: 100%;
}
.completed-date {
  font-size: 12px;
  color: #92400e;
}

/* ---- Badges ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}
.badge-winner {
  background: #fef9c3;
  color: #92400e;
  border: 1px solid #fde047;
}
.badge-out {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fca5a5;
}
.badge-rejoin {
  background: #eff6ff;
  color: #2563eb;
  border: 1px solid #93c5fd;
}
.badge-dealer {
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #86efac;
}

/* ---- Rank list ---- */
.rank-list {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.rank-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  transition: background .1s;
}
.rank-item:last-child { border-bottom: none; }
.rank-first {
  background: linear-gradient(90deg, #fef9c3 0%, var(--surface) 100%);
}
.rank-pos {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}
.rank-first .rank-pos {
  background: #fde047;
  color: #78350f;
}
.rank-name {
  flex: 1;
  font-weight: 600;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.rank-score {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.rank-first .rank-score { color: #b45309; }
.rank-out {
  opacity: .6;
  background: var(--danger-light) !important;
}
.rank-out .rank-pos { background: #fca5a5; color: var(--danger); }
.rank-out .rank-score { color: var(--danger); }
.rank-danger {
  background: #fee2e2 !important;
  border-left: 3px solid var(--danger);
}
.rank-danger .rank-pos { background: var(--danger); color: #fff; }
.rank-danger .rank-name { color: var(--danger); font-weight: 700; }
.rank-danger .rank-score { color: var(--danger); }
.rank-dealer {
  background: #bbf7d0 !important;
  border-left: 3px solid #16a34a;
}
.rank-dealer .rank-pos { background: #16a34a; color: #fff; }
.rank-dealer .rank-name { color: #14532d; font-weight: 700; }
.rank-dealer .rank-score { color: #14532d; }
.total-out {
  color: var(--danger) !important;
  background: var(--danger-light) !important;
  border-left: 2px solid #fca5a5;
}
tr.row-out td {
  background: rgba(220,38,38,0.08) !important;
  color: var(--danger);
}
tr.row-out td.player-col {
  background: rgba(220,38,38,0.08) !important;
  color: var(--danger);
  font-weight: 600;
}
tr.row-out td.total-col {
  background: #fde8e8 !important;
}
tr.row-out td.sticky {
  background: #fde8e8 !important;
}
tr.row-nodrop td {
  background: rgba(220,38,38,0.08) !important;
  color: var(--danger);
}
tr.row-nodrop td.player-col {
  background: rgba(220,38,38,0.08) !important;
  color: var(--danger);
  font-weight: 600;
}
tr.row-nodrop td.total-col {
  background: #fde8e8 !important;
}
tr.row-nodrop td.sticky {
  background: #fde8e8 !important;
}

/* ---- Score table ---- */
.score-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}
.score-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  min-width: 100%;
  font-size: 12px;
}
.score-table th,
.score-table td {
  padding: 5px 8px;
  text-align: center;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.score-table tbody tr:last-child td { border-bottom: none; }
.score-table thead th {
  background: #4f46e5;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .4px;
  border-bottom: 2px solid #4338ca;
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Sticky first column */
.score-table .sticky {
  position: sticky;
  left: 0;
  z-index: 3;
  text-align: left;
  background: #ffffff;
  min-width: 90px;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-right: 2px solid var(--border);
}
.score-table thead .sticky {
  background: #4f46e5;
  z-index: 4;
}

/* Total column — sticky on the right */
.total-col {
  font-weight: 700;
  color: var(--primary);
  background: #eef2ff !important;
  border-left: 2px solid var(--border);
  font-size: 12px;
  position: sticky;
  right: 0;
  z-index: 3;
}
.score-table thead .total-col {
  color: #fff;
  z-index: 4;
  background: #4f46e5 !important;
}

/* Editable score cells */
.score-cell {
  cursor: pointer;
  border-radius: 4px;
  transition: background .1s;
  min-width: 48px;
  font-variant-numeric: tabular-nums;
}
.score-cell:hover { background: var(--primary-light); }
.score-input {
  border: 1.5px solid var(--primary);
  border-radius: 4px;
  text-align: center;
  padding: 2px 4px;
  font-size: 16px;
  font-weight: 600;
  outline: none;
  background: #fff;
  color: var(--text);
  min-width: 44px;
  -moz-appearance: textfield;
}
.score-input::-webkit-inner-spin-button,
.score-input::-webkit-outer-spin-button { -webkit-appearance: none; }

/* ---- FAB ---- */
.fab-container {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
}
.fab {
  background: var(--primary);
  color: #fff;
  padding: 14px 32px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(99,102,241,.4);
  transition: all .15s;
  white-space: nowrap;
}
.fab:hover { background: var(--primary-dark); transform: translateY(-1px); }
.fab:active { transform: translateY(0) scale(.97); }

.game-actions {
  display: flex;
  justify-content: center;
  margin-top: 6px;
  padding-bottom: 6px;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(2px);
  animation: fadeIn .15s ease;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  animation: slideUp .2s ease;
}
@media (min-width: 480px) {
  .modal-overlay { align-items: center; padding: 16px; }
  .modal { border-radius: 20px; max-height: 80vh; }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 6px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.modal-header h2 {
  font-size: 15px;
  font-weight: 700;
}
.modal-body { padding: 8px 16px; }
.modal-footer {
  display: flex;
  gap: 8px;
  padding: 8px 16px calc(12px + var(--safe-bottom));
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.modal-footer .btn { flex: 1; }

/* ---- Alert ---- */
.alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 600;
}
.alert-warning {
  background: var(--warning-light);
  color: #92400e;
  border: 1px solid #fde68a;
}

/* ---- Toast ---- */
#toast {
  position: fixed;
  bottom: calc(80px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: #1e293b;
  color: #fff;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: all .25s;
  white-space: nowrap;
  box-shadow: var(--shadow-md);
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#toast.toast-error   { background: var(--danger); }
#toast.toast-success { background: var(--success); }
#toast.toast-warning { background: var(--warning); color: #000; }

/* ---- Section title ---- */
.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ---- Round edit button in table header ---- */
.btn-round-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-muted);
  background: none;
  vertical-align: middle;
  margin-left: 2px;
  opacity: .6;
  transition: opacity .12s, background .12s;
}
.btn-round-edit:hover { opacity: 1; background: var(--primary-light); color: var(--primary); }

/* ---- Player money summary (history) ---- */
.player-summary-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  border: 1.5px solid var(--primary);
}
.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.summary-row:last-child { border-bottom: none; }
.summary-header { border-bottom: 2px solid var(--border) !important; }
.summary-header .summary-name,
.summary-header .summary-net {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  background: none;
  padding: 0;
}
.summary-name { font-weight: 600; font-size: 13px; flex-shrink: 0; }
.summary-net  { font-size: 13px; font-weight: 800; padding: 2px 8px; border-radius: 20px; }
.net-positive { background: var(--success-light); color: #15803d; }
.net-negative { background: var(--danger-light);  color: var(--danger); }

/* ---- Money settlement modal ---- */
.money-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.money-list { display: flex; flex-direction: column; gap: 5px; }
.money-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 1px solid var(--border);
}
.money-row-out {
  opacity: .6;
  background: var(--danger-light);
  border-color: #fca5a5;
}
.money-player-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
}
.money-player-name { font-weight: 600; font-size: 14px; }
.money-score { font-size: 11px; color: var(--text-muted); margin-left: auto; }
.money-input { width: 80px; flex-shrink: 0; text-align: right; padding: 4px 6px; font-size: 14px; }

/* ---- Settlement card (game summary) ---- */
.settlement-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  border: 1.5px solid #fde047;
}
.settlement-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #92400e;
  margin-bottom: 10px;
}
.settlement-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.settlement-row:last-child { border-bottom: none; }
.settlement-name { font-weight: 600; }
.settlement-amount {
  font-weight: 800;
  font-size: 14px;
}
.amt-positive { color: var(--success); }
.amt-negative { color: var(--danger); }

/* ---- Drop score config grid (setup) ---- */
.drop-scores-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.drop-score-item { display: flex; flex-direction: column; gap: 4px; }
.drop-score-label {
  font-size: 12px;
  font-weight: 700;
  color: #1d4ed8;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.form-section .form-label {
  color: #1d4ed8;
  font-weight: 700;
}

/* ---- D/M/F quick-fill buttons (add round modal) ---- */
.score-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.score-input-row .input { flex: 1; }
.score-quick-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.btn-quick {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 800;
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1.5px solid var(--primary);
  transition: background .12s, transform .1s;
  flex-shrink: 0;
}
.btn-quick:active { transform: scale(.93); }
.btn-quick:hover  { background: var(--primary); color: #fff; }
.btn-quick-m {
  background: #fffbeb;
  color: #92400e;
  border-color: var(--warning);
}
.btn-quick-m:hover { background: var(--warning); color: #fff; }
.btn-quick-f {
  background: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger);
}
.btn-quick-f:hover { background: var(--danger); color: #fff; }

/* ---- Data transfer ---- */
.data-transfer {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ---- Empty state ---- */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ---- Player score chips (history) ---- */
.player-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.player-score-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 12px;
  background: var(--bg);
  color: var(--text-muted);
  font-weight: 500;
}
.chip-winner {
  background: #fef9c3;
  color: #78350f;
  font-weight: 700;
}

/* ---- Animations ---- */
@keyframes fadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ---- Responsive tweaks ---- */
@media (min-width: 480px) {
  .player-row .input { font-size: 16px; }
  .rank-score { font-size: 20px; }
}
