/* ==========================================================================
   Frankton Hybrid 2026 — Styles custom (complément de Tailwind CDN)
   ========================================================================== */

/* -- Composants de base réutilisables ------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition: background-color 0.15s, transform 0.05s;
  cursor: pointer;
  user-select: none;
}
.btn:active { transform: scale(0.98); }

.btn-primary {
  background: #f97316;
  color: white;
}
.btn-primary:hover { background: #fb923c; }

.btn-secondary {
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid #475569;
}
.btn-secondary:hover { background: #334155; }

.btn-danger {
  background: #dc2626;
  color: white;
}
.btn-danger:hover { background: #ef4444; }

.btn-ghost {
  background: transparent;
  color: #cbd5e1;
}
.btn-ghost:hover { background: #1e293b; color: white; }

/* -- Cards --------------------------------------------------------------- */
.card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 1rem;
  overflow: hidden;
}
.card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #334155;
  font-weight: 600;
  color: #f1f5f9;
}
.card-body { padding: 1.25rem; }

/* -- Formulaires --------------------------------------------------------- */
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #cbd5e1;
  margin-bottom: 0.375rem;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: #0f172a;
  border: 1px solid #475569;
  color: #e2e8f0;
  padding: 0.625rem 0.875rem;
  border-radius: 0.75rem;
  font-size: 1rem;      /* ≥ 16px pour éviter le zoom iOS */
  min-height: 48px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #f97316;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.2);
}
.form-help  { font-size: 0.75rem; color: #94a3b8; margin-top: 0.25rem; }
.form-error { font-size: 0.75rem; color: #f87171; margin-top: 0.25rem; }

/* -- Leaderboard badges -------------------------------------------------- */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  font-weight: 700;
  font-size: 0.875rem;
  background: #334155;
  color: #e2e8f0;
}
.rank-badge-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1f2937; }
.rank-badge-2 { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #1f2937; }
.rank-badge-3 { background: linear-gradient(135deg, #fb923c, #c2410c); color: white; }

.category-badge {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.category-HH { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.category-HF { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.category-FF { background: rgba(236, 72, 153, 0.15); color: #f472b6; }

/* -- Score highlight on change ------------------------------------------- */
@keyframes scoreFlash {
  0%   { background: rgba(249, 115, 22, 0.4); }
  100% { background: transparent; }
}
.score-changed { animation: scoreFlash 1.5s ease-out; }

/* -- Gros pavé numérique VTT --------------------------------------------- */
.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.numpad-key {
  font-size: 1.75rem;
  font-weight: 700;
  padding: 1rem 0;
  border-radius: 1rem;
  background: #1e293b;
  border: 1px solid #334155;
  color: white;
  text-align: center;
  transition: background 0.1s;
  user-select: none;
  min-height: 64px;
}
.numpad-key:active { background: #f97316; }
.numpad-key-danger { background: #7f1d1d; border-color: #991b1b; }
.numpad-key-success { background: #065f46; border-color: #047857; }

/* -- Tables responsive --------------------------------------------------- */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 1rem;
  border: 1px solid #334155;
}
.table-wrap table { width: 100%; border-collapse: collapse; }
.table-wrap thead {
  background: #0f172a;
  color: #94a3b8;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.table-wrap th,
.table-wrap td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid #1e293b;
}
.table-wrap tbody tr:hover { background: rgba(51, 65, 85, 0.3); }
.table-wrap tbody tr:last-child td { border-bottom: none; }

/* Pastilles catégorie dans le leaderboard */
tr.category-divider td {
  background: #0f172a;
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
}

/* -- Spinner inline ------------------------------------------------------ */
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* -- PDF-friendly (print) ------------------------------------------------ */
@media print {
  body { background: white !important; color: black !important; }
  .no-print { display: none !important; }
  .card, .table-wrap { border-color: #cbd5e1 !important; }
}
