/* ============================================================
   KWIZZ — design "sticker arcade" : papier crème, encre chaude,
   contours épais, ombres dures, boutons 3D à la Duolingo.
   ============================================================ */

:root {
  --paper: #fff6eb;
  --paper-2: #ffedd6;
  --ink: #2b1c06;
  --ink-60: #6f5d42;
  --ink-30: #cbbda5;
  --card: #ffffff;
  --yellow: #ffc400;
  --yellow-d: #dfa400;
  --red: #ff4d42;
  --red-d: #d63a30;
  --green: #2fbe5f;
  --green-d: #23984a;
  --blue: #4d7cff;
  --blue-d: #3a61d6;
  --orange: #ff8a00;
  --pink: #ff5ca8;
  --teal: #00b8a9;
  --r: 18px;
  --bw: 2.5px;
  --shadow: 0 4px 0 var(--ink);
  --font-d: 'Titan One', 'Arial Black', sans-serif;
  --font-b: 'Nunito', -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font-b);
  font-weight: 700;
  background: var(--paper);
  background-image: radial-gradient(rgba(43, 28, 6, 0.055) 1.3px, transparent 1.3px);
  background-size: 22px 22px;
  color: var(--ink);
  overflow-x: hidden;
  touch-action: pan-y;
}
img { display: block; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

#app { max-width: 480px; margin: 0 auto; min-height: 100dvh; position: relative; }
.screen { min-height: 100dvh; padding: 18px 18px 110px; animation: screen-in 0.28s cubic-bezier(0.34, 1.4, 0.64, 1); }
.screen.no-nav { padding-bottom: 24px; }
@keyframes screen-in { from { opacity: 0; transform: translateY(14px) scale(0.985); } }

h1, h2, h3, .display { font-family: var(--font-d); font-weight: 400; letter-spacing: 0.5px; }
h2 { font-size: 21px; }
.muted { color: var(--ink-60); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ---------- logo ---------- */
.logo { font-family: var(--font-d); font-size: 44px; display: inline-flex; align-items: center; gap: 2px; line-height: 1; }
.logo .bolt { width: 0.72em; height: 0.95em; margin: 0 1px; transform: rotate(6deg); }
.logo-sm { font-size: 22px; }

/* ---------- boutons 3D ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: var(--bw) solid var(--ink); border-radius: 16px;
  background: var(--card); color: var(--ink);
  font-family: var(--font-b); font-weight: 900; font-size: 16px;
  padding: 13px 20px; box-shadow: 0 5px 0 var(--ink);
  transition: transform 0.06s, box-shadow 0.06s; user-select: none; text-decoration: none;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn.primary { background: var(--yellow); }
.btn.danger { background: var(--red); color: #fff; }
.btn.green { background: var(--green); color: #fff; }
.btn.blue { background: var(--blue); color: #fff; }
.btn.big { font-size: 19px; padding: 17px 26px; border-radius: 20px; }
.btn.block { display: flex; width: 100%; }
.btn.small { font-size: 13px; padding: 8px 13px; border-radius: 12px; box-shadow: 0 3px 0 var(--ink); }
.btn.small:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn .em { font-size: 1.2em; }

/* ---------- cartes ---------- */
.card {
  background: var(--card); border: var(--bw) solid var(--ink);
  border-radius: var(--r); box-shadow: var(--shadow); padding: 16px;
}
.tilt-l { transform: rotate(-0.6deg); }
.tilt-r { transform: rotate(0.5deg); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 2px solid var(--ink); border-radius: 999px;
  padding: 5px 12px; font-weight: 900; font-size: 13px; background: var(--card);
  box-shadow: 0 2.5px 0 var(--ink);
}

/* ---------- avatars ---------- */
.avatar { border-radius: 50%; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); background: var(--paper-2); object-fit: cover; }
.av-sm { width: 40px; height: 40px; }
.av-md { width: 56px; height: 56px; }
.av-lg { width: 96px; height: 96px; border-width: 3px; }
.av-xl { width: 140px; height: 140px; border-width: 3.5px; box-shadow: 0 5px 0 var(--ink); }

/* ---------- onboarding ---------- */
.splash { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100dvh; gap: 18px; padding: 24px; }
.mascot-wrap { animation: float 2.6s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-12px) rotate(2deg); } }
.tagline { font-size: 17px; font-weight: 800; color: var(--ink-60); }
.field {
  width: 100%; border: var(--bw) solid var(--ink); border-radius: 16px;
  padding: 15px 16px; font-size: 18px; font-weight: 800; background: var(--card);
  box-shadow: inset 0 3px 0 rgba(43, 28, 6, 0.08); outline: none; color: var(--ink);
}
.field::placeholder { color: var(--ink-30); }
.field:focus { border-color: var(--blue); }

.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; width: 100%; }
.avatar-grid img { width: 100%; height: auto; border-radius: 50%; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); transition: transform 0.1s; }
.avatar-grid img.sel { outline: 4px solid var(--yellow); transform: scale(1.08); }

.style-tabs { display: flex; gap: 8px; }
.style-tabs .tab { flex: 1; border: 2.5px solid var(--ink); border-radius: 12px; background: var(--card); font-weight: 900; padding: 9px 4px; box-shadow: 0 3px 0 var(--ink); font-size: 14px; }
.style-tabs .tab.on { background: var(--yellow); }

/* ---------- home ---------- */
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.topbar .who { flex: 1; min-width: 0; }
.topbar .who .name { font-weight: 900; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.level-wrap { display: flex; align-items: center; gap: 7px; margin-top: 3px; }
.level-bar { flex: 1; height: 10px; border: 2px solid var(--ink); border-radius: 99px; background: var(--card); overflow: hidden; max-width: 130px; }
.level-bar i { display: block; height: 100%; background: var(--blue); border-radius: 99px; transition: width 0.6s cubic-bezier(0.34, 1.3, 0.64, 1); }
.lvl-num { font-size: 12px; font-weight: 900; color: var(--ink-60); }

.streak-chip { background: #fff3d6; font-size: 15px; }
.streak-chip.hot { background: var(--yellow); animation: pulse 1.6s infinite; }
.streak-chip .flame { animation: flame 0.9s ease-in-out infinite alternate; display: inline-block; }
@keyframes flame { from { transform: scale(1) rotate(-4deg); } to { transform: scale(1.18) rotate(5deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }

.cta-duel {
  width: 100%; margin: 6px 0 18px; padding: 20px; font-size: 24px;
  font-family: var(--font-d); letter-spacing: 1px;
  background: var(--yellow); border: 3px solid var(--ink); border-radius: 22px;
  box-shadow: 0 6px 0 var(--ink); display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform 0.07s, box-shadow 0.07s; color: var(--ink);
}
.cta-duel:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--ink); }
.cta-duel .bolt { width: 26px; height: 34px; animation: flame 0.8s ease-in-out infinite alternate; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 10px; }
.section-title h2 { font-size: 18px; }
.section-title .more { font-size: 13px; font-weight: 900; color: var(--blue); background: none; border: none; }

.duel-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 10px; position: relative; }
.duel-row .mid { flex: 1; min-width: 0; }
.duel-row .who { display: block; font-weight: 900; font-size: 15px; }
.duel-row .sub { display: block; font-size: 12.5px; color: var(--ink-60); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.duel-row .score { font-family: var(--font-d); font-size: 20px; }
.duel-row.attention { background: #fff8dc; }
.badge-dot { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--red); border: 2.5px solid var(--ink); color: #fff; font-size: 12px; font-weight: 900; display: flex; align-items: center; justify-content: center; animation: pulse 1.2s infinite; }
.tag { font-size: 11px; font-weight: 900; border: 2px solid var(--ink); border-radius: 8px; padding: 2px 7px; box-shadow: 0 2px 0 var(--ink); }
.tag.turn { background: var(--yellow); }
.tag.wait { background: var(--paper-2); color: var(--ink-60); }
.tag.win { background: var(--green); color: #fff; }
.tag.lose { background: var(--red); color: #fff; }
.tag.tie { background: var(--blue); color: #fff; }

.quest-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 10px; }
.quest-row .em { font-size: 24px; }
.quest-row .mid { flex: 1; min-width: 0; }
.quest-row .label { display: block; font-weight: 900; font-size: 14px; }
.qbar { display: block; height: 14px; border: 2px solid var(--ink); border-radius: 99px; background: var(--paper-2); overflow: hidden; margin-top: 6px; position: relative; }
.qbar i { display: block; height: 100%; background: var(--green); transition: width 0.5s cubic-bezier(0.34, 1.3, 0.64, 1); }
.qbar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 9.5px; font-weight: 900; color: var(--ink); }
.quest-claim { background: var(--yellow); border: 2.5px solid var(--ink); border-radius: 12px; font-weight: 900; padding: 8px 12px; box-shadow: 0 3px 0 var(--ink); animation: pulse 1.4s infinite; font-size: 13px; }

.league-card { display: flex; align-items: center; gap: 14px; padding: 14px; }
.league-card .cup { font-size: 34px; }
.league-card .mid { flex: 1; }
.rankpill { font-family: var(--font-d); font-size: 22px; }

/* ---------- bottom nav ---------- */
.bottom-nav {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  width: min(440px, calc(100% - 28px)); display: flex; gap: 8px;
  background: var(--card); border: var(--bw) solid var(--ink); border-radius: 20px;
  box-shadow: 0 5px 0 var(--ink); padding: 8px; z-index: 40;
}
.bottom-nav button { flex: 1; border: none; background: none; font-weight: 900; font-size: 12px; padding: 8px 4px; border-radius: 13px; color: var(--ink-60); display: flex; flex-direction: column; align-items: center; gap: 2px; }
.bottom-nav button .ico { font-size: 20px; }
.bottom-nav button.on { background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); }

/* ---------- matchmaking ---------- */
.searching { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100dvh; gap: 22px; padding: 24px; }
.radar { position: relative; width: 150px; height: 150px; }
.radar .ring { position: absolute; inset: 0; border: 3px solid var(--ink); border-radius: 50%; opacity: 0; animation: radar 1.8s infinite; }
.radar .ring:nth-child(2) { animation-delay: 0.6s; }
.radar .ring:nth-child(3) { animation-delay: 1.2s; }
@keyframes radar { 0% { transform: scale(0.4); opacity: 0.9; } 100% { transform: scale(1.25); opacity: 0; } }
.radar .avatar { position: absolute; inset: 25px; width: 100px; height: 100px; }
.cycling-name { font-family: var(--font-d); font-size: 24px; min-height: 32px; }

.vs-wrap { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 10px 0; }
.vs-burst { font-family: var(--font-d); font-size: 44px; color: var(--red); text-shadow: 2.5px 2.5px 0 var(--ink); transform: rotate(-6deg); animation: stamp-in 0.35s cubic-bezier(0.34, 1.8, 0.64, 1); }
.p-col { display: flex; flex-direction: column; align-items: center; gap: 8px; font-weight: 900; }
.count { font-family: var(--font-d); font-size: 88px; animation: stamp-in 0.3s cubic-bezier(0.34, 1.8, 0.64, 1); }
@keyframes stamp-in { from { transform: scale(2.4) rotate(-14deg); opacity: 0; } }

/* ---------- duel ---------- */
.duel-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.pscore { display: flex; align-items: center; gap: 8px; font-family: var(--font-d); font-size: 20px; }
.round-dots { display: flex; gap: 5px; }
.round-dots i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--ink); background: var(--card); }
.round-dots i.on { background: var(--yellow); }
.round-dots i.done { background: var(--ink); }

.cat-banner { display: inline-flex; align-items: center; gap: 7px; border: 2.5px solid var(--ink); border-radius: 999px; padding: 7px 15px; font-weight: 900; color: #fff; box-shadow: 0 3px 0 var(--ink); font-size: 14px; margin-bottom: 12px; }

.timerbar { height: 14px; border: 2.5px solid var(--ink); border-radius: 99px; background: var(--card); overflow: hidden; margin-bottom: 14px; }
.timerbar i { display: block; height: 100%; background: var(--green); transform-origin: left; border-radius: 99px; }

.qcard { padding: 22px 18px; margin-bottom: 14px; min-height: 110px; display: flex; align-items: center; justify-content: center; text-align: center; }
.qcard .qtext { font-size: 19px; font-weight: 900; line-height: 1.35; }
.qnum { font-size: 12px; font-weight: 900; color: var(--ink-60); margin-bottom: 8px; letter-spacing: 1px; }

.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ans {
  border: var(--bw) solid var(--ink); border-radius: 16px; background: var(--card);
  padding: 16px 10px; font-weight: 900; font-size: 15px; min-height: 74px;
  box-shadow: 0 4px 0 var(--ink); transition: transform 0.06s, box-shadow 0.06s, background 0.12s; color: var(--ink); line-height: 1.2;
}
.ans:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.ans.lock { pointer-events: none; }
.ans.good { background: var(--green); color: #fff; animation: pop 0.3s cubic-bezier(0.34, 1.8, 0.64, 1); }
.ans.bad { background: var(--red); color: #fff; animation: shake 0.4s; }
.ans.dim { opacity: 0.45; }
@keyframes pop { 50% { transform: scale(1.06); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px) rotate(-1deg); } 45% { transform: translateX(6px) rotate(1deg); } 70% { transform: translateX(-4px); } 90% { transform: translateX(3px); } }

.opp-ping { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 8px; background: var(--card); border: 2.5px solid var(--ink); border-radius: 999px; padding: 7px 14px 7px 8px; box-shadow: 0 4px 0 var(--ink); font-weight: 900; font-size: 13px; animation: drop-in 0.35s cubic-bezier(0.34, 1.6, 0.64, 1); }
@keyframes drop-in { from { transform: translate(-50%, -60px); } }

.funfact { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); width: min(430px, calc(100% - 32px)); background: var(--ink); color: var(--paper); border-radius: 16px; padding: 13px 16px; font-weight: 800; font-size: 14px; z-index: 60; box-shadow: 0 5px 0 rgba(43, 28, 6, 0.35); animation: drop-up 0.3s cubic-bezier(0.34, 1.5, 0.64, 1); line-height: 1.35; }
.funfact b { color: var(--yellow); }
@keyframes drop-up { from { transform: translate(-50%, 70px); opacity: 0; } }

.catpick { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.cat-chip { display: flex; align-items: center; gap: 12px; border: var(--bw) solid var(--ink); border-radius: 18px; padding: 17px 16px; font-weight: 900; font-size: 17px; color: #fff; box-shadow: 0 5px 0 var(--ink); transition: transform 0.07s, box-shadow 0.07s; }
.cat-chip:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.cat-chip .em { font-size: 24px; }
.cat-chip.picked { animation: pop 0.35s; outline: 4px solid var(--yellow); }

.bot-bubble { position: fixed; bottom: 88px; left: 16px; max-width: 70%; background: var(--card); border: 2.5px solid var(--ink); border-radius: 16px 16px 16px 4px; padding: 10px 14px; font-weight: 800; box-shadow: 0 4px 0 var(--ink); z-index: 55; animation: drop-up 0.3s; font-size: 14px; }
.bot-bubble .from { font-size: 11px; color: var(--ink-60); font-weight: 900; }
.typing i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-60); margin-right: 3px; animation: blink 1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

.round-splash { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 70dvh; gap: 20px; }
.scoreline { display: flex; align-items: center; gap: 16px; font-family: var(--font-d); font-size: 40px; }

/* ---------- résultat ---------- */
.stamp { font-family: var(--font-d); font-size: 46px; transform: rotate(-4deg); display: inline-block; padding: 8px 22px; border: 3.5px solid var(--ink); border-radius: 14px; box-shadow: 0 5px 0 var(--ink); animation: stamp-in 0.4s cubic-bezier(0.34, 1.8, 0.64, 1); }
.stamp.win { background: var(--green); color: #fff; }
.stamp.lose { background: var(--red); color: #fff; }
.stamp.tie { background: var(--blue); color: #fff; }

.dots-grid { display: flex; flex-direction: column; gap: 8px; margin: 6px auto; width: fit-content; }
.dots-line { display: flex; align-items: center; gap: 6px; }
.dots-line .lbl { width: 34px; font-size: 11px; font-weight: 900; color: var(--ink-60); text-align: right; margin-right: 4px; }
.dot { width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--ink); }
.dot.g { background: var(--green); }
.dot.r { background: var(--red); }
.dot.sep { border: none; width: 6px; }

.xp-pill { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-d); font-size: 24px; background: var(--card); border: 2.5px solid var(--ink); border-radius: 999px; padding: 8px 20px; box-shadow: 0 4px 0 var(--ink); }
.gain-toast { display: flex; align-items: center; gap: 10px; background: var(--card); border: 2.5px solid var(--ink); border-radius: 14px; padding: 10px 14px; box-shadow: 0 4px 0 var(--ink); font-weight: 900; font-size: 14px; animation: drop-up 0.3s; margin-top: 8px; }

.result-actions { display: flex; flex-direction: column; gap: 11px; margin-top: 18px; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; background: rgba(43, 28, 6, 0.55); z-index: 100; display: flex; align-items: flex-end; justify-content: center; animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } }
.overlay.centered { align-items: center; padding: 22px; }
.sheet { width: 100%; max-width: 480px; background: var(--paper); border-top: 3px solid var(--ink); border-radius: 26px 26px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); animation: sheet-up 0.3s cubic-bezier(0.34, 1.3, 0.64, 1); }
@keyframes sheet-up { from { transform: translateY(80%); } }
.sheet .grab { width: 44px; height: 5px; border-radius: 99px; background: var(--ink-30); margin: 0 auto 16px; }
.modal { background: var(--paper); border: 3px solid var(--ink); border-radius: 24px; box-shadow: 0 8px 0 var(--ink); padding: 26px 22px; width: 100%; max-width: 400px; text-align: center; animation: stamp-in 0.35s cubic-bezier(0.34, 1.6, 0.64, 1); }

.reveal-robot { font-size: 64px; animation: float 2s infinite; }
.glitch-name { text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 3px; }

.taunt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.taunt-grid .btn { font-size: 14px; padding: 12px 8px; }

/* ---------- ligue ---------- */
.lg-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 2px dashed var(--ink-30); }
.lg-row:last-child { border-bottom: none; }
.lg-row .rank { font-family: var(--font-d); width: 30px; font-size: 17px; color: var(--ink-60); }
.lg-row .nm { flex: 1; font-weight: 900; font-size: 15px; }
.lg-row .pts { font-weight: 900; color: var(--ink-60); font-size: 14px; }
.lg-row.me { background: #fff3cf; border-radius: 14px; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); margin: 4px 0; }
.zone-label { font-size: 11px; font-weight: 900; letter-spacing: 1.5px; color: var(--green-d); padding: 8px 14px 2px; }
.zone-label.down { color: var(--ink-30); }

/* ---------- profil ---------- */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.stat-box { text-align: center; padding: 14px 8px; }
.stat-box .v { font-family: var(--font-d); font-size: 26px; }
.stat-box .k { font-size: 12px; font-weight: 900; color: var(--ink-60); }

/* ---------- tableau de duel (façon QuizDuel) ---------- */
.board-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px; margin-bottom: 8px; }
.board-p { display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 900; font-size: 12px; max-width: 86px; text-align: center; }
.board-p span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 82px; }
.board-score { font-family: var(--font-d); font-size: 38px; letter-spacing: 1px; text-align: center; }
.board-score .dash { color: var(--ink-30); margin: 0 5px; }
.board-unknown { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; font-family: var(--font-d); font-size: 24px; color: var(--ink-30); }
.board-line { text-align: center; font-weight: 800; color: var(--ink-60); margin: 2px 0 14px; font-size: 14px; }
.round-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 13px 12px; margin-bottom: 10px; }
.round-row.current { background: #fff8dc; animation: pulse 2s infinite; }
.round-row.future { opacity: 0.45; box-shadow: none; }
.rside { display: flex; gap: 5px; }
.rsq { width: 19px; height: 19px; border-radius: 6px; border: 2px solid var(--ink); background: var(--paper-2); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 900; color: #fff; }
.rsq.g { background: var(--green); }
.rsq.r { background: var(--red); }
.rsq.hidden { background: var(--ink-30); }
.rmid { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.round-cat { font-size: 10.5px; font-weight: 900; color: #fff; border: 2px solid var(--ink); border-radius: 8px; padding: 3px 8px; box-shadow: 0 2px 0 var(--ink); text-align: center; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.round-cat.ghost { background: var(--paper-2); color: var(--ink-30); box-shadow: none; border-color: var(--ink-30); }
.react-toast { animation: stamp-in 0.45s cubic-bezier(0.34, 1.8, 0.64, 1); background: #fff8dc; }

/* ---------- cartes de thème (façon Duel Quiz) ---------- */
.deck { display: flex; flex-direction: column; gap: 14px; padding: 6px 8px; }
.theme-card {
  position: relative; overflow: hidden; text-align: left;
  border: 3px solid var(--ink); border-radius: 20px; min-height: 108px;
  background: linear-gradient(135deg, var(--tc), color-mix(in srgb, var(--tc) 65%, #000 12%));
  box-shadow: 0 6px 0 var(--ink); color: #fff; padding: 14px 16px;
  display: flex; flex-direction: column; justify-content: flex-end;
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.3s;
}
.theme-card.tcr-0 { transform: rotate(-2.2deg); }
.theme-card.tcr-1 { transform: rotate(1.6deg); }
.theme-card.tcr-2 { transform: rotate(-1.2deg); }
.theme-card:active { transform: translateY(4px) scale(0.99); box-shadow: 0 1px 0 var(--ink); }
.theme-card.picked { transform: scale(1.05) rotate(0deg); box-shadow: 0 8px 0 var(--ink), 0 0 0 4px var(--yellow); z-index: 2; animation: pop 0.4s; }
.theme-card.folded { opacity: 0.25; transform: scale(0.94); }
.tc-pattern { position: absolute; inset: 0; background: repeating-linear-gradient(-45deg, rgba(255,255,255,0.09) 0 14px, transparent 14px 28px); pointer-events: none; }
.tc-emoji { position: absolute; right: 6px; top: 50%; transform: translateY(-50%) rotate(10deg); font-size: 74px; opacity: 0.9; text-shadow: 0 4px 0 rgba(0,0,0,0.18); pointer-events: none; }
.tc-top { position: absolute; top: 10px; left: 16px; font-family: var(--font-d); font-size: 11px; letter-spacing: 1px; opacity: 0.75; }
.tc-label { font-family: var(--font-d); font-size: 21px; text-shadow: 2px 2px 0 rgba(0,0,0,0.28); max-width: 70%; line-height: 1.1; }

/* ---------- calendrier de parties ---------- */
.cal-month { margin-bottom: 14px; }
.cal-title { font-weight: 900; text-transform: capitalize; margin-bottom: 6px; }
.cal-dow { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; font-size: 10px; font-weight: 900; color: var(--ink-30); text-align: center; margin-bottom: 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; font-weight: 900; font-size: 12.5px; color: var(--ink-30);
  border: 2px solid transparent;
}
.cal-cell.empty { visibility: hidden; }
.cal-cell.played { color: var(--ink); border-color: var(--ink); }
.cal-cell.played.h1 { background: #ffe9b3; }
.cal-cell.played.h2 { background: #ffd76e; }
.cal-cell.played.h3 { background: var(--yellow); box-shadow: 0 2px 0 var(--ink); }
.cal-cell.streaked { color: var(--orange); }
.cal-cell.played.streaked { color: var(--ink); outline: 2px solid var(--orange); }
.cal-cell.today { border-color: var(--blue); border-style: dashed; color: var(--ink); }
.cal-badge { position: absolute; top: -5px; right: -4px; background: var(--ink); color: var(--paper); font-size: 9px; border-radius: 99px; padding: 1px 4.5px; }
.cal-fire { position: absolute; top: -9px; left: -5px; font-size: 12px; font-style: normal; animation: flame 0.9s ease-in-out infinite alternate; }

/* ---------- édition profil ---------- */
.social-chip { text-decoration: none; background: #f0f7ff; font-size: 12px; }
.social-chip:active { transform: translateY(2px); box-shadow: 0 0.5px 0 var(--ink); }
.ep-chip { cursor: pointer; opacity: 0.65; }
.ep-chip.on { background: var(--yellow); opacity: 1; }
.flabel { display: block; font-size: 12px; font-weight: 900; color: var(--ink-60); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 5px; }
[data-prof]:not([data-prof=""]) { cursor: pointer; }

/* ---------- chat entre potes ---------- */
.chat-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding: 4px 2px; }
.msg { display: flex; }
.msg .msg-txt {
  max-width: 78%; background: var(--card); border: 2px solid var(--ink); border-radius: 15px 15px 15px 4px;
  padding: 8px 13px; font-weight: 800; font-size: 14.5px; box-shadow: 0 2.5px 0 var(--ink); line-height: 1.35; word-break: break-word;
}
.msg.mine { justify-content: flex-end; }
.msg.mine .msg-txt { background: var(--yellow); border-radius: 15px 15px 4px 15px; }

/* ---------- bulle de chambrage ---------- */
.taunt-bubble {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  width: min(400px, calc(100% - 36px)); display: flex; align-items: center; gap: 12px;
  background: #fff8dc; border: 3px solid var(--ink); border-radius: 20px 20px 20px 6px;
  padding: 12px 16px; box-shadow: 0 6px 0 var(--ink); z-index: 250;
  animation: stamp-in 0.45s cubic-bezier(0.34, 1.8, 0.64, 1);
}
.taunt-bubble .tb-from { display: block; font-size: 11px; font-weight: 900; color: var(--ink-60); }
.taunt-bubble .tb-txt { display: block; font-weight: 900; font-size: 15px; }

/* ---------- résultat : manches visibles ---------- */
.rr-head { display: flex; justify-content: space-between; font-size: 11px; font-weight: 900; color: var(--ink-60); padding: 0 4px 6px 46px; gap: 30px; }
.rr-line { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; }
.rr-num { font-size: 10px; font-weight: 900; color: var(--ink-30); width: 20px; text-align: right; }
.rr-cat { font-size: 15px; width: 20px; }
.rr-vs { font-weight: 900; color: var(--ink-30); }

/* ---------- fiches & stats ---------- */
.board-time { font-size: 10px; color: var(--ink-60); font-weight: 900; }
.fiche-point { font-weight: 800; font-size: 13.5px; margin: 4px 0; line-height: 1.45; }
.fiche-flex { background: #fff3d6; border: 2px dashed var(--yellow-d); border-radius: 12px; padding: 9px 12px; font-size: 13px; margin-top: 10px; line-height: 1.5; }

/* ---------- amis / présence ---------- */
.online-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--green); border: 2px solid var(--ink); vertical-align: middle; animation: pulse 1.6s infinite; }
button.lg-row { background: none; border: none; border-bottom: 2px dashed var(--ink-30); font-family: inherit; cursor: pointer; text-align: left; }
button.lg-row:last-child { border-bottom: none; }

/* ---------- récap questions ---------- */
.rv-choice { display: flex; align-items: center; gap: 8px; border: 2px solid var(--ink-30); border-radius: 12px; padding: 7px 10px; margin-bottom: 6px; position: relative; overflow: hidden; }
.rv-choice.good { border-color: var(--green); background: #eefaf2; }
.rv-choice.bad { border-color: var(--red); background: #fff0ef; }
.rv-txt { flex: 1; font-weight: 800; font-size: 13.5px; position: relative; z-index: 1; }
.rv-who { display: flex; gap: 3px; z-index: 1; }
.rv-who img { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink); }
.rv-pct { width: 54px; height: 9px; border: 1.5px solid var(--ink-30); border-radius: 99px; overflow: hidden; background: var(--paper-2); z-index: 1; }
.rv-pct i { display: block; height: 100%; background: var(--blue); }
.rv-num { font-size: 11.5px; width: 34px; text-align: right; color: var(--ink-60); z-index: 1; }

/* ---------- classement France verrouillé ---------- */
.lock-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px; }

/* ---------- points de vitesse ---------- */
.pts-float { position: fixed; width: 60px; text-align: center; font-family: var(--font-d); font-size: 22px; color: var(--green-d); z-index: 90; pointer-events: none; animation: pts-rise 0.9s ease-out forwards; text-shadow: 2px 2px 0 #fff, -1px -1px 0 #fff; }
@keyframes pts-rise { from { opacity: 0; transform: translateY(8px) scale(0.7); } 20% { opacity: 1; } to { opacity: 0; transform: translateY(-48px) scale(1.2); } }
.duel-row .score { font-size: 16px; }

/* ---------- toast ---------- */
.toast { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); font-weight: 900; padding: 11px 20px; border-radius: 999px; z-index: 200; animation: drop-in 0.3s; box-shadow: 0 4px 0 rgba(43, 28, 6, 0.3); font-size: 14px; max-width: 90%; text-align: center; }

/* ---------- confetti canvas ---------- */
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 300; }

/* ---------- admin ---------- */
.admin-shell { max-width: 860px; margin: 0 auto; padding: 22px 18px 80px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.tabs .tab { border: 2.5px solid var(--ink); background: var(--card); border-radius: 12px; padding: 9px 16px; font-weight: 900; box-shadow: 0 3px 0 var(--ink); font-size: 14px; }
.tabs .tab.on { background: var(--yellow); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.form-grid label, .flabel { display: block; font-size: 12px; font-weight: 900; color: var(--ink-60); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.6px; }
select.field { appearance: none; }
.gen-card { margin-bottom: 12px; position: relative; }
.gen-card .q { font-weight: 900; font-size: 15px; margin-bottom: 8px; padding-right: 60px; }
.gen-card .choices { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.gen-card .choices span { border: 2px solid var(--ink-30); border-radius: 10px; padding: 6px 9px; font-size: 13px; font-weight: 800; }
.gen-card .choices span.good { border-color: var(--green); background: #e8f9ee; }
.gen-card .fun { font-size: 12.5px; color: var(--ink-60); font-weight: 800; font-style: italic; }
.gen-card .kill { position: absolute; top: 12px; right: 12px; }
.bank-row { display: flex; align-items: flex-start; gap: 10px; padding: 11px 4px; border-bottom: 2px dashed var(--ink-30); }
.bank-row .q { flex: 1; font-weight: 800; font-size: 14px; }
.pill-cat { font-size: 11px; font-weight: 900; color: #fff; border: 2px solid var(--ink); border-radius: 8px; padding: 2px 7px; white-space: nowrap; }
.count-badge { font-family: var(--font-d); font-size: 15px; }
.spinner { width: 22px; height: 22px; border: 3.5px solid var(--ink-30); border-top-color: var(--ink); border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 500px) {
  body { padding-top: 12px; }
  #app { border: 3px solid var(--ink); border-radius: 30px; box-shadow: 0 8px 0 var(--ink); overflow: hidden; margin-bottom: 30px; min-height: calc(100dvh - 60px); }
  .screen { min-height: calc(100dvh - 66px); }
}
