/* ============================================
   BELOTE SCORE — Design System Global
   ============================================ */

/* Polices auto-hébergées — voir assets/css/fonts.css (RGPD) */

/* ── Variables ── */
:root {
  /* Palette — Landing (brun doré chaud, éclairci) */
  --bg:         #2e1f0a;
  --bg2:        #3a2810;
  --bg3:        #452f14;
  --surface:    #4e3618;
  --surface2:   #5c4020;
  --border:     #7a5828;
  --border2:    #9a7238;

  --gold:       #c9973a;
  --gold-light: #e8bf72;
  --gold-dark:  #8a6420;
  --cream:      #f4ead8;
  --cream-dim:  #c4ae88;

  --red:        #c0392b;
  --red-bright: #e74c3c;
  --black-suit: #1a1a2e;

  --text:       #f4ead8;
  --text-dim:   #a08060;
  --text-muted: #6e5238;

  /* ── Palette APP (tapis de belote) ── */
  --app-bg:          #2d5a3d;   /* vert feutré profond */
  --app-bg2:         #356b49;   /* vert légèrement plus clair */
  --app-surface:     #f5f0e8;   /* ivoire chaud */
  --app-surface2:    #ede5d4;   /* ivoire légèrement plus foncé */
  --app-surface3:    #e4d9c4;   /* ivoire pour contrastes */
  --app-border:      #c8b89a;   /* borde beige */
  --app-border2:     #a89070;   /* borde plus marquée */
  --app-text:        #2c1f0e;   /* brun très foncé */
  --app-text-dim:    #6b5540;   /* brun moyen */
  --app-text-muted:  #9a8068;   /* brun clair */
  --app-header-bg:   #1e3d2a;   /* vert très foncé pour header */
  --app-felt-shadow: 0 2px 12px rgba(0,0,0,0.18), 0 1px 3px rgba(0,0,0,0.12);

  --success:    #27ae60;
  --warning:    #f39c12;
  --danger:     #c0392b;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Crimson Pro', Georgia, serif;
  --font-mono:    'JetBrains Mono', monospace;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Shadows */
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4), 0 1px 4px rgba(0,0,0,0.25);
  --shadow-glow: 0 0 40px rgba(201,151,58,0.15);
  --shadow-btn:  0 2px 12px rgba(201,151,58,0.3);

  /* Suits colors */
  --suit-heart:   #e74c3c;
  --suit-diamond: #e74c3c;
  --suit-spade:   #f4ead8;
  --suit-club:    #f4ead8;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.1rem;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold-light); }
button { cursor: pointer; font-family: inherit; border: none; }
input, select, textarea { font-family: inherit; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ── Utility ── */
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0,0,0,0); }
.text-gold { color: var(--gold); }
.text-dim  { color: var(--text-dim); }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* ── Card suit decorative symbols ── */
.suit-red  { color: var(--suit-heart); }
.suit-black { color: var(--suit-spade); }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .04em;
  transition: all .25s;
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background .2s;
}
.btn:hover::before { background: rgba(255,255,255,0.06); }

.btn-primary {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold), var(--gold-light));
  color: #0d0a08;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 24px rgba(201,151,58,0.5);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--cream);
}
.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  padding: 8px 16px;
}
.btn-ghost:hover { color: var(--text); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-sm { padding: 7px 16px; font-size: .875rem; }
.btn-lg { padding: 16px 40px; font-size: 1.15rem; }

/* ── Gold divider ── */
.divider {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  color: var(--text-muted);
  font-size: .85rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border2), transparent);
}

/* ── Card component ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
}
.card-gold {
  border-color: var(--gold-dark);
  background: linear-gradient(135deg, var(--surface) 0%, #2a1e0f 100%);
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.badge-gold { background: rgba(201,151,58,0.15); color: var(--gold); border: 1px solid var(--gold-dark); }
.badge-red  { background: rgba(192,57,43,0.15); color: var(--red-bright); border: 1px solid var(--red); }
.badge-green { background: rgba(39,174,96,0.15); color: #2ecc71; border: 1px solid var(--success); }

/* ── Toast ── */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-left: 4px solid var(--gold);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: .95rem;
  box-shadow: var(--shadow-card);
  animation: toastIn .3s ease;
  max-width: 320px;
}
.toast.error { border-left-color: var(--red-bright); }
@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ── Modal backdrop ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: all;
}
.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-card), var(--shadow-glow);
  transform: scale(.95) translateY(10px);
  transition: transform .3s;
}
.modal-backdrop.open .modal {
  transform: scale(1) translateY(0);
}

/* ── Form elements ── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label {
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
}
.form-input {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  padding: 10px 14px;
  font-size: 1rem;
  font-family: var(--font-body);
  transition: border-color .2s;
  width: 100%;
}
.form-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,151,58,0.12);
}
.form-input::placeholder { color: var(--text-muted); }

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%238a7a68' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  :root { font-size: 15px; }
  .btn-lg { padding: 14px 28px; }
}
@media (max-width: 480px) {
  :root { font-size: 14px; }
}
