/* ================= LOGOTYPE COCKROACHES ================= */
/* Anton = condensé display, fit "COCKROACHES" sans déborder même sur iPhone SE. */
.sabie-wordmark {
  font-family: 'Anton', 'Bebas Neue', 'Impact', sans-serif;
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #f97316;
  text-shadow:
    0 1px 0  #7f1d1d,
    0 2px 0  #7f1d1d,
    0 3px 0  #450a0a,
    0 4px 0  #1a0508,
    0 6px 14px rgba(239, 68, 68, 0.35),
    0 0 18px rgba(251, 146, 60, 0.15);
  display: inline-block;
  position: relative;
}
.sabie-wordmark.small  { font-size: 1.6rem; }              /* header */
.sabie-wordmark.medium { font-size: 2.4rem; }
.sabie-wordmark.large  { font-size: 3.4rem; }
.sabie-wordmark.xl     { font-size: clamp(2.6rem, 14vw, 5.2rem); }   /* hero */

/* Safety net : empêche tout débordement horizontal sur mobile */
html, body { overflow-x: hidden; max-width: 100vw; }

/* Sous-titre "'s games" — typo machine à écrire/grunge */
.cockroach-tagline {
  font-family: 'Special Elite', 'Courier New', monospace;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: #a3e635;
  text-shadow:
    0 0 6px rgba(163, 230, 53, 0.55),
    0 2px 0 rgba(0,0,0,0.6);
}

/* ================= GANG LINEUP — 7 mascottes sur l'accueil ================= */
@keyframes gangPop {
  0%   { opacity: 0; transform: translateY(14px) scale(0.9) rotate(var(--rot, 0deg)); }
  60%  { opacity: 1; transform: translateY(-3px) scale(1.05) rotate(var(--rot, 0deg)); }
  100% { opacity: 1; transform: translateY(0) scale(1) rotate(var(--rot, 0deg)); }
}
@keyframes gangFloat {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50%      { transform: translateY(-4px) rotate(var(--rot, 0deg)); }
}

.gang-lineup {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 0;
  max-width: 100%;
  padding: 8px 0 0;
}
.gang-slot {
  display: block;
  position: relative;
  aspect-ratio: 3 / 5;
  z-index: 1;
  transition: transform 220ms cubic-bezier(.34,1.56,.64,1), filter 220ms;
}
.gang-slot:hover, .gang-slot:focus-visible {
  transform: translateY(-6px) scale(1.08);
  z-index: 10;
}
.gang-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.55));
  opacity: 0;
  animation: gangPop 620ms cubic-bezier(.34,1.56,.64,1) forwards,
             gangFloat 4.5s ease-in-out infinite;
  animation-delay: 0ms, 700ms;
  user-select: none;
  -webkit-user-drag: none;
}
/* Décalages alternés pour effet "photo de groupe" */
.gang-slot[data-i="0"] { --rot: -3deg;  margin-bottom: 16px; }
.gang-slot[data-i="1"] { --rot:  2deg;  margin-bottom: 4px;  z-index: 2; }
.gang-slot[data-i="2"] { --rot: -2deg;  margin-bottom: 22px; z-index: 4; }
.gang-slot[data-i="3"] { --rot:  3deg;  margin-bottom: 0;    z-index: 5; }
.gang-slot[data-i="4"] { --rot: -2deg;  margin-bottom: 12px; z-index: 3; }
.gang-slot[data-i="5"] { --rot:  3deg;  margin-bottom: 6px;  z-index: 2; }
.gang-slot[data-i="6"] { --rot: -4deg;  margin-bottom: 18px; }
/* Légère collision/chevauchement */
.gang-slot + .gang-slot { margin-left: -8%; }

@media (max-width: 380px) {
  .gang-slot + .gang-slot { margin-left: -12%; }
}

/* ================= FOND CHALEUREUX (accueil / setup / stats) ================= */
.bg-warm {
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(251, 146, 60, 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(244, 114, 182, 0.20), transparent 60%),
    radial-gradient(800px 600px at 50% 50%, rgba(254, 215, 170, 0.12), transparent 70%),
    linear-gradient(180deg, #fff7ed 0%, #fef3c7 50%, #fde4cf 100%);
  background-attachment: fixed;
}

/* ================= FOND IMMERSIF DE JEU (question / reveal) ================= */
/* Sombre, ambiance trivia crack. Tinte légère selon la catégorie via --cat. */
.bg-play {
  --cat: #a855f7; /* fallback violet */
  background:
    radial-gradient(900px 700px at 15% 10%, color-mix(in srgb, var(--cat) 45%, transparent), transparent 65%),
    radial-gradient(1100px 800px at 100% 100%, rgba(219, 39, 119, 0.45), transparent 65%),
    radial-gradient(700px 500px at 50% 50%, rgba(124, 58, 237, 0.25), transparent 70%),
    linear-gradient(180deg, #0f0a24 0%, #1e1b4b 45%, #2a1448 100%);
  background-attachment: fixed;
  color: #fff;
}
.bg-play .text-slate-800,
.bg-play .text-slate-900 { color: #fff; }
.bg-play .text-slate-700 { color: rgba(255,255,255,0.85); }
.bg-play .text-slate-600,
.bg-play .text-slate-500 { color: rgba(255,255,255,0.65); }
.bg-play .text-slate-400 { color: rgba(255,255,255,0.45); }

/* Empêcher zoom iOS sur focus input */
@media (max-width: 768px) {
  input, select, textarea, button { font-size: 16px; }
}

/* ================= COULEURS PAR CATÉGORIE ================= */
.cat-culture-generale { --cat: #6366f1; --cat-bg: #eef2ff; --cat-fg: #4338ca; }
.cat-histoire         { --cat: #d97706; --cat-bg: #fef3c7; --cat-fg: #92400e; }
.cat-geographie       { --cat: #10b981; --cat-bg: #d1fae5; --cat-fg: #047857; }
.cat-science          { --cat: #06b6d4; --cat-bg: #cffafe; --cat-fg: #0e7490; }
.cat-sport            { --cat: #65a30d; --cat-bg: #ecfccb; --cat-fg: #3f6212; }
.cat-cinema-tv        { --cat: #ec4899; --cat-bg: #fce7f3; --cat-fg: #9d174d; }
.cat-musique          { --cat: #8b5cf6; --cat-bg: #ede9fe; --cat-fg: #6d28d9; }
.cat-litterature      { --cat: #f97316; --cat-bg: #ffedd5; --cat-fg: #9a3412; }
.cat-nature           { --cat: #22c55e; --cat-bg: #dcfce7; --cat-fg: #15803d; }
.cat-quebec           { --cat: #ef4444; --cat-bg: #fee2e2; --cat-fg: #b91c1c; }

.cat-badge {
  background: var(--cat-bg, #f1f5f9);
  color: var(--cat-fg, #475569);
  border: 1px solid color-mix(in srgb, var(--cat, #94a3b8) 25%, transparent);
}

/* Sur fond de jeu, le badge est transparent + couleur de la catégorie */
.bg-play .cat-badge {
  background: color-mix(in srgb, var(--cat) 25%, transparent);
  color: white;
  border: 1.5px solid color-mix(in srgb, var(--cat) 60%, white);
  backdrop-filter: blur(8px);
}

.cat-stripe { background: linear-gradient(90deg, var(--cat, #94a3b8), color-mix(in srgb, var(--cat, #94a3b8) 70%, #fff)); }

/* ================= RANGE SLIDER ================= */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #f43f5e, #f97316);
  box-shadow: 0 2px 6px rgba(244, 63, 94, .35);
  cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #f43f5e, #f97316);
  border: none; cursor: pointer;
}

/* ================= CARDS / BOUTONS ================= */
.card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.04);
  border: 1px solid rgba(255, 237, 213, 0.7);
}

.btn-primary {
  background: linear-gradient(135deg, #f43f5e 0%, #f97316 100%);
  color: white;
  box-shadow: 0 6px 16px -4px rgba(244, 63, 94, 0.45);
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { transform: scale(0.98); }

.btn-secondary {
  background: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);
  color: white;
  box-shadow: 0 6px 16px -4px rgba(139, 92, 246, 0.45);
}

/* ================= CHOIX TYPE TRIVIA CRACK (boutons pilule) ================= */
.btn-pill {
  display: block;
  width: 100%;
  padding: 1.05rem 1.25rem;
  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: rgba(15, 12, 35, 0.45);
  color: white;
  font-weight: 700;
  text-align: center;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 140ms ease, background 160ms ease, border-color 160ms ease;
  box-shadow: 0 4px 14px -4px rgba(0,0,0,0.4);
}
.btn-pill:hover { background: rgba(15, 12, 35, 0.65); border-color: rgba(255,255,255,0.8); }
.btn-pill:active { transform: scale(0.97); }
.btn-pill.selected { background: color-mix(in srgb, var(--cat, #a855f7) 60%, rgba(15,12,35,0.5)); border-color: white; }
.btn-pill.correct  { background: rgba(34, 197, 94, 0.65); border-color: #4ade80; }
.btn-pill.wrong    { background: rgba(239, 68, 68, 0.55); border-color: #f87171; }
.btn-pill.dim      { opacity: 0.5; }

/* Cartes de question sur fond sombre */
.q-card-dark {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ================= ANIMATIONS (plus visibles) ================= */
@keyframes fadeIn   { from {opacity:0} to {opacity:1} }
@keyframes slideUp  { from {opacity:0; transform:translateY(18px)} to {opacity:1; transform:translateY(0)} }
@keyframes slideDown{ from {opacity:0; transform:translateY(-12px)} to {opacity:1; transform:translateY(0)} }
@keyframes catPop {
  0%   { opacity:0; transform: scale(0.7) translateY(-8px); }
  60%  { opacity:1; transform: scale(1.08) translateY(0); }
  100% { opacity:1; transform: scale(1) translateY(0); }
}
@keyframes qPop {
  0%   { opacity:0; transform: scale(0.92); filter: blur(4px); }
  70%  { opacity:1; transform: scale(1.02); filter: blur(0); }
  100% { opacity:1; transform: scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
@keyframes pulseOk {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.7); }
  70%  { box-shadow: 0 0 0 18px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

.a-fade-in  { animation: fadeIn 500ms ease-out both; }
.a-slide-up { animation: slideUp 600ms cubic-bezier(.22,1,.36,1) both; }
.a-slide-down { animation: slideDown 500ms cubic-bezier(.22,1,.36,1) both; }
.a-cat-pop  { animation: catPop 700ms cubic-bezier(.34,1.56,.64,1) both; }
.a-q-pop    { animation: qPop 550ms cubic-bezier(.22,1,.36,1) both; }
.a-shake    { animation: shake 500ms cubic-bezier(.36,.07,.19,.97) both; }
.a-pulse-ok { animation: pulseOk 900ms ease-out both; }

/* Stagger sur les choix */
.stagger > * { opacity: 0; animation: slideUp 520ms cubic-bezier(.22,1,.36,1) both; }
.stagger > *:nth-child(1) { animation-delay: 220ms; }
.stagger > *:nth-child(2) { animation-delay: 320ms; }
.stagger > *:nth-child(3) { animation-delay: 420ms; }
.stagger > *:nth-child(4) { animation-delay: 520ms; }
