/* ============ Entre Nous — styles ============ */
:root {
  color-scheme: dark;
  --bg: #140a1f;
  --bg-2: #1d1030;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-2: rgba(255, 255, 255, 0.1);
  --border: rgba(255, 255, 255, 0.12);
  --text: #fbefff;
  --muted: #bda8cc;
  --accent: #ff4d8d;
  --accent-2: #ff8a5c;
  --good: #3ddc97;
  --bad: #ff5c7a;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --cat: var(--accent);
  --font-display: Georgia, "Times New Roman", "Noto Serif", serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }

.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vmax 50vmax at 10% -10%, rgba(255, 77, 141, 0.28), transparent 60%),
    radial-gradient(50vmax 50vmax at 110% 20%, rgba(142, 125, 255, 0.22), transparent 60%),
    radial-gradient(60vmax 40vmax at 50% 120%, rgba(255, 138, 92, 0.18), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
}

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px max(16px, env(safe-area-inset-left)) 14px max(16px, env(safe-area-inset-right));
  backdrop-filter: blur(14px);
  background: rgba(20, 10, 31, 0.6);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-heart { font-size: 26px; filter: drop-shadow(0 0 12px rgba(255, 77, 141, 0.6)); }
.brand-name { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: 0.2px; }
.brand-name em { color: var(--accent); font-style: italic; }
.topbar-actions { display: flex; gap: 8px; }
.icon-btn {
  position: relative; width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--border);
  transition: background 0.2s, transform 0.2s;
}
.icon-btn:hover { background: var(--surface-2); transform: translateY(-1px); }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
.badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--accent); font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}

main { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 24px 16px 40px; outline: none; }
.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 16px 16px 28px; }
.site-footer p { margin: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); font-weight: 600; font-size: 15px;
  transition: transform 0.15s, background 0.2s, box-shadow 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn-primary {
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 30px -10px rgba(255, 77, 141, 0.7);
  color: #fff;
}
.btn-primary:hover { background: linear-gradient(135deg, #ff6aa0, #ff9c74); }
.btn-lg { padding: 16px 28px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-good { background: rgba(61, 220, 151, 0.15); border-color: rgba(61, 220, 151, 0.4); }
.btn-bad { background: rgba(255, 92, 122, 0.15); border-color: rgba(255, 92, 122, 0.4); }

/* ---------- Home ---------- */
.hero { text-align: center; padding: 28px 0 24px; }
.hero h1 {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(34px, 7vw, 60px); line-height: 1.05; margin: 0 0 12px;
}
.hero h1 .grad {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent; font-style: italic;
}
.hero p { color: var(--muted); max-width: 560px; margin: 0 auto 22px; font-size: 17px; }
.couple-pill {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px;
  padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  font-weight: 600;
}
.couple-pill button { background: none; border: 0; color: var(--muted); font-size: 13px; text-decoration: underline; padding: 0; }
.hero-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.filters { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; margin: 18px 0 8px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-weight: 600; font-size: 14px;
  transition: all 0.2s;
}
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.cat-card {
  position: relative; overflow: hidden; text-align: left;
  padding: 20px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--surface); min-height: 168px;
  display: flex; flex-direction: column; gap: 6px;
  transition: transform 0.25s, border-color 0.25s, background 0.25s;
  animation: rise 0.5s both;
}
.cat-card::before {
  content: ""; position: absolute; inset: auto -40% -60% auto; width: 220px; height: 220px; border-radius: 50%;
  background: var(--cat); opacity: 0.18; filter: blur(30px); transition: opacity 0.3s;
}
.cat-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--cat) 60%, transparent); }
.cat-card:hover::before { opacity: 0.35; }
.cat-emoji { font-size: 34px; line-height: 1; }
.cat-name { font-family: var(--font-display); font-size: 22px; font-weight: 800; margin-top: 6px; }
.cat-tag { color: var(--cat); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; }
.cat-desc { color: var(--muted); font-size: 14px; margin: 0; }
.cat-meta { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; padding-top: 8px; }
.pill { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.pill-adult { background: rgba(255, 77, 109, 0.2); color: #ff9db0; }

.section-title { font-family: var(--font-display); font-size: 26px; margin: 34px 0 14px; }

/* ---------- Play view ---------- */
.play { max-width: 640px; margin: 0 auto; }
.play-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.back { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; flex: 0 0 auto; font-size: 18px; }
.play-title { flex: 1; min-width: 0; }
.play-title h2 { margin: 0; font-family: var(--font-display); font-size: 26px; line-height: 1.1; }
.play-title small { color: var(--muted); }
.counter { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

.levels { display: flex; gap: 6px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; margin-bottom: 16px; }
.levels button { flex: 1; border: 0; background: none; padding: 9px 6px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--muted); transition: all 0.2s; }
.levels button[aria-pressed="true"] { background: var(--cat); color: #1a0d24; }

.turn { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 14px; font-weight: 600; color: var(--muted); }
.turn strong { color: var(--text); font-size: 18px; }
.turn .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--cat); box-shadow: 0 0 12px var(--cat); }

.card-stage { perspective: 1200px; }
.game-card {
  position: relative; min-height: 300px; padding: 34px 26px 26px; border-radius: 28px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--cat) 26%, transparent), transparent 60%),
    rgba(255, 255, 255, 0.05);
  border: 1px solid color-mix(in srgb, var(--cat) 45%, var(--border));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 16px;
  touch-action: pan-y; user-select: none;
}
.game-card.enter { animation: cardIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.game-card .kind { position: absolute; top: 16px; left: 18px; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--cat); }
.game-card .lvl { position: absolute; top: 14px; right: 16px; font-size: 14px; }
.card-text { font-family: var(--font-display); font-size: clamp(22px, 5vw, 30px); line-height: 1.3; font-weight: 600; margin: 0; text-wrap: balance; }
.card-text .name { color: var(--cat); font-style: italic; }
.card-sub { color: var(--muted); margin: 0; font-size: 15px; }
.fav-btn { position: absolute; bottom: 14px; right: 14px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); font-size: 20px; display: grid; place-items: center; transition: transform 0.2s; }
.fav-btn[aria-pressed="true"] { background: rgba(255, 77, 141, 0.25); border-color: var(--accent); }
.fav-btn.pop { animation: pop 0.4s; }

.controls { display: flex; gap: 10px; margin-top: 18px; }
.controls .btn { flex: 1; }
.controls .btn-icon { flex: 0 0 auto; width: 52px; padding: 0; }
.hint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 10px; }

/* Action/Vérité chooser */
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
.choice button {
  padding: 26px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface-2);
  font-family: var(--font-display); font-size: 24px; font-weight: 800; transition: transform 0.2s, background 0.2s;
}
.choice button:hover { transform: translateY(-3px); background: rgba(255, 255, 255, 0.16); }
.choice button span { display: block; font-size: 34px; margin-bottom: 4px; }

/* Tu préfères */
.wyr { display: grid; gap: 10px; width: 100%; }
.wyr-opt { padding: 18px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface-2); font-weight: 600; font-size: 17px; }
.wyr-or { font-family: var(--font-display); font-style: italic; color: var(--cat); font-size: 18px; }

/* Scoreboard */
.score { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 16px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.score .p { text-align: center; }
.score .p .n { font-size: 14px; color: var(--muted); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.score .p .v { font-family: var(--font-display); font-size: 36px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.score .p.lead .v { color: var(--cat); }
.score .vs { color: var(--muted); font-weight: 700; font-size: 13px; }
.score .goal { grid-column: 1 / -1; text-align: center; font-size: 12px; color: var(--muted); }
.progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; grid-column: 1/-1; }
.progress i { display: block; height: 100%; background: var(--cat); transition: width 0.4s; }

/* Countdown (qui de nous deux) */
.countdown { font-family: var(--font-display); font-size: 90px; font-weight: 800; color: var(--cat); line-height: 1; animation: pop 0.6s; }

/* Timer */
.timer { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--border); }
.timer-ring { position: relative; width: 46px; height: 46px; }
.timer-ring svg { transform: rotate(-90deg); width: 46px; height: 46px; }
.timer-ring circle { fill: none; stroke-width: 4; }
.timer-ring .track { stroke: var(--surface-2); }
.timer-ring .bar { stroke: var(--cat); stroke-linecap: round; transition: stroke-dashoffset 0.25s linear; }
.timer-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer button { border: 0; background: var(--surface-2); border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 14px; }
.timer.done { animation: shake 0.5s; border-color: var(--cat); }

/* Dice */
.dice-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.die {
  aspect-ratio: 1; border-radius: 20px; padding: 8px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04));
  border: 1px solid color-mix(in srgb, var(--cat) 50%, var(--border));
  display: grid; place-items: center; text-align: center; font-weight: 700; font-size: clamp(13px, 3.6vw, 17px); line-height: 1.2;
  box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.6);
}
.die small { display: block; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--cat); margin-bottom: 4px; }
.die.rolling { animation: roll 0.6s ease-in-out; }

/* Ideas */
.idea-tag { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 600; color: var(--cat); }

/* Favorites */
.fav-list { display: grid; gap: 10px; }
.fav-item { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.fav-item .e { font-size: 22px; }
.fav-item p { margin: 0; flex: 1; }
.fav-item small { color: var(--muted); display: block; margin-top: 4px; }
.fav-item button { border: 0; background: none; color: var(--muted); font-size: 18px; padding: 4px; }
.empty { text-align: center; color: var(--muted); padding: 50px 20px; }
.empty .big { font-size: 48px; display: block; margin-bottom: 8px; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(8, 3, 14, 0.7); backdrop-filter: blur(6px); animation: fade 0.25s; }
.modal-panel {
  position: relative; width: 100%; max-width: 440px; max-height: calc(100dvh - 32px); overflow-y: auto;
  padding: 30px 24px 24px; border-radius: 26px; background: #22132f; border: 1px solid var(--border);
  box-shadow: var(--shadow); animation: cardIn 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.modal-x { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface); }
.modal-panel h3 { font-family: var(--font-display); font-size: 26px; margin: 0 0 8px; }
.modal-panel p { color: var(--muted); margin: 0 0 18px; }
.modal-emoji { font-size: 48px; text-align: center; margin-bottom: 6px; }
.modal-center { text-align: center; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input {
  width: 100%; padding: 13px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25); color: var(--text); font-size: 16px;
}
.field input:focus { outline: none; border-color: var(--accent); }
.stack { display: grid; gap: 10px; margin-top: 8px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--border); }
.row-between span { font-size: 14px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -20px; font-size: 22px; animation: fall linear forwards; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; z-index: 70;
  padding: 12px 20px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 14px;
  transition: all 0.3s; pointer-events: none; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Animations ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes cardIn { from { opacity: 0; transform: translateY(18px) rotateX(10deg) scale(0.97); } }
@keyframes pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes roll { 0% { transform: rotate(0) scale(1); } 50% { transform: rotate(200deg) scale(0.85); } 100% { transform: rotate(360deg) scale(1); } }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

@media (max-width: 480px) {
  main { padding-top: 16px; }
  .brand-name { font-size: 21px; }
  .game-card { min-height: 280px; padding: 38px 18px 64px; }
  .controls .btn { padding: 12px 12px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cat-card { padding: 14px; min-height: 150px; }
  .cat-desc { display: none; }
  .cat-name { font-size: 18px; }
  .cat-emoji { font-size: 28px; }
}

/* ---------- Monogramme du couple ---------- */
.monogram {
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 18px;
  padding: 8px 20px; border-radius: 999px;
  border: 1px solid rgba(255, 77, 141, 0.45);
  background: linear-gradient(135deg, rgba(255, 77, 141, 0.14), rgba(255, 138, 92, 0.1));
  font-family: var(--font-display); font-weight: 800; letter-spacing: 3px; font-size: 18px;
  box-shadow: 0 0 30px -8px rgba(255, 77, 141, 0.6);
}
.monogram i { font-style: normal; letter-spacing: 0; animation: beat 1.6s ease-in-out infinite; }
.hero h1 .amp { font-style: italic; color: var(--accent); }
.site-footer .sign { font-family: var(--font-display); font-weight: 800; letter-spacing: 3px; color: var(--text); margin-bottom: 6px; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.25); } 30% { transform: scale(1); } 45% { transform: scale(1.15); } }

/* ---------- Connexion ---------- */
body.locked .topbar-actions { display: none; }
.login { max-width: 420px; margin: 4vh auto 0; text-align: center; }
.login h1 { font-family: var(--font-display); font-size: 44px; margin: 6px 0 4px; }
.login h1 em { color: var(--accent); }
.login > p { color: var(--muted); margin: 0 0 24px; }
.login-form { text-align: left; padding: 22px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.who-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.who-opt { position: relative; }
.who-opt input { position: absolute; opacity: 0; pointer-events: none; }
.who-opt span { display: block; text-align: center; padding: 14px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: rgba(0, 0, 0, 0.2); font-weight: 600; cursor: pointer; transition: all 0.2s; }
.who-opt input:checked + span { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; }
.who-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.login-err { color: #ff9db0; min-height: 1.5em; margin: 10px 0 0; text-align: center; font-size: 14px; }

/* ---------- Panneau longue distance ---------- */
.hero-sub { font-family: var(--font-display); font-size: 22px; font-style: italic; color: var(--text) !important; margin-bottom: 8px !important; }
.ldr { max-width: 640px; margin: 0 auto; padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); }
.ldr-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.ldr-p { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; min-width: 0; }
.ldr-p b { font-size: 15px; }
.ldr-p b small { color: var(--muted); font-weight: 500; }
.ldr-p small { color: var(--muted); font-size: 12px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clk { font-family: var(--font-display); font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.av { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-family: var(--font-display); font-size: 20px; background: linear-gradient(135deg, var(--accent), #8e7dff); color: #fff; flex: 0 0 auto; }
.dot-online { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #6b5a7a; border: 2px solid var(--bg); }
.av .dot-online { position: absolute; right: -1px; bottom: -1px; }
.dot-online.on { background: var(--good); box-shadow: 0 0 8px var(--good); }
.ldr-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--muted); font-size: 12px; text-align: center; }
.ldr-mid .plane { font-size: 22px; animation: fly 4s ease-in-out infinite; }
.ldr-mid .dist { color: var(--text); font-weight: 700; font-size: 13px; white-space: nowrap; }
.ldr-count { text-align: center; margin: 14px 0; color: var(--muted); }
.ldr-count strong { color: var(--text); }
.ldr-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ldr-actions .btn-primary { grid-column: 1 / -1; }
.link { background: none; border: 0; color: var(--accent); font-weight: 600; text-decoration: underline; padding: 0; }
.inline-badge { position: static; margin-left: 4px; }
.note { margin: -6px 0 14px; padding: 10px 14px; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.05); border: 1px dashed var(--border); color: var(--muted); font-size: 13px; }
.share-btn { position: absolute; bottom: 14px; left: 14px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); font-size: 18px; display: grid; place-items: center; }
.inline { display: flex; gap: 8px; }
.inline input { flex: 1; min-width: 0; color-scheme: dark; }
.version { text-align: center; font-size: 12px; margin: 16px 0 0 !important; }
.hearts i { font-size: 34px; top: auto; bottom: -40px; animation: rise-up 3s ease-out forwards; }
@keyframes rise-up { to { transform: translateY(-115vh) scale(1.3); opacity: 0; } }
@keyframes fly { 0%, 100% { transform: translateX(-6px) rotate(-4deg); } 50% { transform: translateX(6px) rotate(4deg); } }

/* ---------- Messagerie ---------- */
body.chat-open .site-footer { display: none; }
body.chat-open main { padding-bottom: 0; }
.chat { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; height: calc(100dvh - 71px - 24px); }
.chat-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.chat-title { flex: 1; min-width: 0; }
.chat-title h2 { margin: 0; font-family: var(--font-display); font-size: 20px; line-height: 1.1; }
.chat-title small { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; }
.chat-list { flex: 1; overflow-y: auto; padding: 14px 2px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; }
.chat-list .more { align-self: center; font-size: 13px; padding: 8px 14px; margin-bottom: 8px; }
.day { align-self: center; margin: 10px 0 4px; font-size: 12px; color: var(--muted); padding: 3px 12px; border-radius: 999px; background: var(--surface); }
.msg { max-width: 80%; padding: 9px 13px 6px; border-radius: 18px; animation: rise 0.25s both; overflow-wrap: anywhere; }
.msg p { margin: 0; }
.msg time { display: block; text-align: right; font-size: 10px; opacity: 0.7; margin-top: 2px; }
.msg.mine { align-self: flex-end; background: linear-gradient(135deg, var(--accent), #e0457f); color: #fff; border-bottom-right-radius: 6px; }
.msg.theirs { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 6px; }
.msg.pending { opacity: 0.6; }
.msg-card { margin: 2px 0 6px; padding: 10px 12px; border-radius: 12px; background: rgba(0, 0, 0, 0.22); border-left: 3px solid rgba(255, 255, 255, 0.6); }
.msg-card span { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; opacity: 0.85; }
.msg-card p { font-family: var(--font-display); font-size: 16px; margin-top: 4px; }
.msg-sys { align-self: center; font-size: 13px; color: var(--muted); padding: 6px 14px; border-radius: 999px; background: var(--surface); margin: 6px 0; text-align: center; }
.typing span { animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.2; } 30% { opacity: 1; } }
.quick { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0; scrollbar-width: none; }
.quick::-webkit-scrollbar { display: none; }
.quick button { flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.composer { display: flex; gap: 8px; align-items: flex-end; padding: 6px 0 calc(10px + env(safe-area-inset-bottom)); }
.composer textarea { flex: 1; resize: none; padding: 12px 16px; border-radius: 22px; border: 1px solid var(--border); background: rgba(0, 0, 0, 0.25); color: var(--text); font: inherit; font-size: 16px; max-height: 140px; line-height: 1.35; }
.composer textarea:focus { outline: none; border-color: var(--accent); }
.send { width: 46px; height: 46px; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: 18px; flex: 0 0 auto; }

/* ---------- Ping-pong ---------- */
.pong-score { display: flex; align-items: center; justify-content: center; gap: 18px; margin-bottom: 10px; }
.pong-score div { display: flex; flex-direction: column; align-items: center; min-width: 70px; }
.pong-score b { font-family: var(--font-display); font-size: 34px; line-height: 1; font-variant-numeric: tabular-nums; }
.pong-score div:first-child b { color: #ff4d8d; }
.pong-score div:last-child b { color: #9b8cff; }
.pong-score small { color: var(--muted); font-size: 12px; }
.pong-score > span { color: var(--muted); font-size: 22px; }
.pong-wrap { position: relative; margin: 0 auto; border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); touch-action: none; user-select: none; }
.pong-wrap canvas { display: block; }
.pong-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 20px; text-align: center; background: rgba(10, 20, 30, 0.62); backdrop-filter: blur(3px); }
.pong-overlay h3 { font-family: var(--font-display); font-size: 24px; margin: 0; }
.pong-overlay p { color: var(--muted); margin: 0 0 8px; }
.pong-btns { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 260px; }
.ready-row { display: flex; gap: 14px; margin: 4px 0 12px; font-weight: 600; color: var(--muted); }
.ready-row .ok { color: var(--good); }

/* ---------- Jeux en direct ---------- */
.pill-live { background: rgba(128, 237, 153, 0.18); color: #9ff5b4; }
.presence { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.duel-msg { text-align: center; color: var(--muted); margin: 6px 0 14px; min-height: 1.5em; }
.duel-msg.go { color: var(--text); font-weight: 700; }
.big-emoji { font-size: 54px; line-height: 1; }
.waiting, .over-card { min-height: 260px; }
.gage { font-family: var(--font-display); font-size: 19px; margin: 0; padding: 12px 16px; border-radius: var(--radius-sm); background: rgba(0, 0, 0, 0.22); }
.ready-row.center { justify-content: center; }

/* Pierre-feuille-ciseaux */
.rps-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rps-btn { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 6px 12px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface-2); font-weight: 600; text-transform: capitalize; transition: transform 0.15s, background 0.2s; }
.rps-btn span { font-size: 46px; line-height: 1; }
.rps-btn:not(:disabled):hover { transform: translateY(-3px); background: rgba(255, 255, 255, 0.16); }
.rps-btn:disabled { opacity: 0.45; cursor: default; }
.rps-btn.picked { opacity: 1; background: var(--cat); color: #1a0d24; border-color: transparent; }
.rps-reveal { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: center; gap: 6px; padding: 14px; margin-bottom: 8px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.rps-reveal .hand { font-size: 52px; display: block; line-height: 1.1; }
.rps-reveal small { color: var(--muted); }
.rps-reveal .vs { color: var(--muted); font-weight: 700; }
.rps-reveal p { grid-column: 1 / -1; margin: 6px 0 0; font-weight: 700; }
.rps-reveal.anim .hand { animation: chifoumi 0.9s ease-out; }
.rps-reveal.anim p { animation: rise 0.4s 0.9s both; }
@keyframes chifoumi { 0%, 66% { transform: translateY(0); filter: blur(4px); } 11%, 44% { transform: translateY(-14px); } 22%, 55% { transform: translateY(0); } 100% { filter: none; } }

/* Morpion */
.ttt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 340px; margin: 0 auto; }
.ttt-cell { aspect-ratio: 1; border-radius: 18px; border: 1px solid var(--border); background: var(--surface-2); font-size: clamp(34px, 11vw, 54px); display: grid; place-items: center; transition: background 0.2s, transform 0.15s; }
.ttt-cell:not(:disabled):hover { background: rgba(255, 255, 255, 0.16); transform: scale(1.03); }
.ttt-cell:disabled { cursor: default; color: inherit; }
.ttt-cell.win { background: color-mix(in srgb, var(--cat) 45%, transparent); border-color: var(--cat); animation: pop 0.5s; }

/* Réflexes */
.reflex-zone { width: 100%; min-height: 280px; border-radius: 28px; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-family: var(--font-display); font-size: 40px; font-weight: 800; color: #fff; user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.reflex-zone small { font-family: var(--font-body); font-size: 15px; font-weight: 500; opacity: 0.85; }
.reflex-zone.wait { background: linear-gradient(160deg, #c9184a, #7a0f2e); }
.reflex-zone.go { background: linear-gradient(160deg, #2dc653, #137547); animation: pop 0.25s; }
.reflex-zone.done { background: var(--surface-2); color: var(--text); }
.reflex-res { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; margin-bottom: 10px; }
.reflex-res div { padding: 14px; border-radius: var(--radius-sm); background: var(--surface); border: 1px solid var(--border); }
.reflex-res div.win { border-color: var(--cat); background: color-mix(in srgb, var(--cat) 18%, transparent); }
.reflex-res b { display: block; font-family: var(--font-display); font-size: 24px; }
.reflex-res small { color: var(--muted); }
.reflex-res p { grid-column: 1 / -1; margin: 4px 0 0; font-weight: 700; }

/* Synchro */
.sync-card { min-height: 280px; }
.sync-form { display: flex; gap: 8px; width: 100%; }
.sync-form input { flex: 1; min-width: 0; padding: 13px 16px; border-radius: 999px; border: 1px solid var(--border); background: rgba(0, 0, 0, 0.25); color: var(--text); font-size: 16px; }
.sync-form input:focus { outline: none; border-color: var(--cat); }
.sync-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.sync-answers div { padding: 14px 10px; border-radius: var(--radius-sm); background: rgba(0, 0, 0, 0.22); }
.sync-answers small { display: block; color: var(--muted); font-size: 12px; }
.sync-answers b { font-family: var(--font-display); font-size: 21px; overflow-wrap: anywhere; }
.sync-answers.match div { background: color-mix(in srgb, var(--cat) 30%, transparent); }
.sync-verdict { font-family: var(--font-display); font-size: 26px; font-weight: 800; margin: 0; }
.sync-answers.match + .sync-verdict { color: var(--cat); animation: pop 0.5s; }

/* Tour de jeu (parties synchronisées) */
.turn.my-turn { color: var(--text); }
.turn.my-turn strong { color: var(--cat); }
