/* ───────────────────────── Paire — design tokens ───────────────────────── */
:root {
  --bg: #fff7f2;
  --bg2: #ffeef0;
  --card: #ffffff;
  --ink: #2a1d3a;
  --ink2: #6b5d7b;
  --ink3: #a397b0;
  --line: #f1e3e6;
  --primary: #ff5a7a;
  --primary-ink: #ffffff;
  --primary-soft: #ffe3ea;
  --accent: #7c5cff;
  --accent-soft: #ece7ff;
  --mint: #3ccfa0;
  --sun: #ffc94d;
  --sky: #5ab8ff;
  --coral: #ff8a65;
  --p0: #ff5a7a;
  --p1: #7c5cff;
  --danger: #e5484d;
  --shadow: 0 1px 2px rgba(42, 29, 58, 0.04), 0 8px 24px rgba(42, 29, 58, 0.07);
  --shadow-lg: 0 20px 60px rgba(42, 29, 58, 0.18);
  --r: 20px;
  --r-sm: 12px;
  --font: ui-rounded, 'SF Pro Rounded', 'Nunito', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}
body[data-theme='lavande'] { --primary: #7c5cff; --primary-soft: #ece7ff; --accent: #ff5a7a; --accent-soft: #ffe3ea; --bg2: #f1ecff; }
body[data-theme='menthe'] { --primary: #1fae84; --primary-soft: #d9f6ec; --accent: #5ab8ff; --accent-soft: #e2f2ff; --bg: #f5fbf8; --bg2: #e6f7f0; --line: #ddefe8; }
body[data-theme='ocean'] { --primary: #2e8ee0; --primary-soft: #dcecfb; --accent: #3ccfa0; --accent-soft: #daf6ec; --bg: #f4f8fd; --bg2: #e5f0fb; --line: #dde8f3; }
body[data-theme='soleil'] { --primary: #f08c1a; --primary-soft: #fff0d6; --accent: #ff5a7a; --accent-soft: #ffe3ea; --bg: #fffaf0; --bg2: #fff1d9; --line: #f5e6cc; }
body[data-theme='nuit'] {
  --bg: #17112a; --bg2: #21183b; --card: #251c40; --ink: #f6eefc; --ink2: #c4b6d8; --ink3: #8a7ca3; --line: #352a55;
  --primary: #ff6f8e; --primary-soft: #3b2547; --accent: #9b85ff; --accent-soft: #2e2752;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  background-image: radial-gradient(1200px 600px at 100% -10%, var(--bg2), transparent 60%), radial-gradient(900px 500px at -10% 110%, var(--accent-soft), transparent 60%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
.scene, .cover, .hero-art, .art, .logo { display: block; }
.scene > svg, .cover > svg, .hero-art > svg, .art > svg, .av > svg { width: 100%; height: 100%; }
.grid-home > *, .stack > * { min-width: 0; }
a { color: var(--primary); }
h1, h2, h3, h4 { line-height: 1.15; margin: 0 0 0.4em; letter-spacing: -0.01em; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 900; }
h2 { font-size: 1.35rem; font-weight: 800; }
h3 { font-size: 1.08rem; font-weight: 800; }
p { margin: 0 0 0.8em; }
.muted { color: var(--ink2); }
.small { font-size: 0.86rem; }
.tiny { font-size: 0.76rem; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.nowrap { flex-wrap: nowrap; }
.stack { display: grid; gap: 14px; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ───────────────────────── Buttons & inputs ───────────────────────── */
.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 800;
  cursor: pointer;
  background: var(--primary);
  color: var(--primary-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.12s ease, box-shadow 0.2s ease, background 0.2s ease, opacity 0.2s;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 35%, transparent);
  text-decoration: none;
  white-space: nowrap;
  min-height: 46px;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.soft { background: var(--primary-soft); color: var(--primary); box-shadow: none; }
.btn.accent { background: var(--accent); box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.danger { background: var(--danger); box-shadow: none; }
.btn.sm { padding: 7px 14px; min-height: 36px; font-size: 0.9rem; }
.btn.lg { padding: 16px 28px; font-size: 1.08rem; min-height: 56px; }
.btn.block { width: 100%; }
.icon-btn {
  appearance: none; border: 0; background: var(--card); width: 42px; height: 42px; border-radius: 50%;
  display: inline-grid; place-items: center; cursor: pointer; font-size: 1.15rem; position: relative;
  box-shadow: var(--shadow); transition: transform 0.12s;
}
.icon-btn:active { transform: scale(0.94); }
.badge {
  position: absolute; top: -3px; right: -3px; background: var(--primary); color: #fff; font-size: 0.7rem; font-weight: 800;
  min-width: 19px; height: 19px; border-radius: 10px; display: grid; place-items: center; padding: 0 5px; border: 2px solid var(--bg);
}
label.field { display: grid; gap: 6px; font-weight: 700; font-size: 0.92rem; }
.input, textarea.input, select.input {
  width: 100%; border: 2px solid var(--line); background: var(--card); border-radius: 14px; padding: 12px 14px; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s; font-weight: 500;
}
textarea.input { resize: vertical; min-height: 90px; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.input.code { text-transform: uppercase; letter-spacing: 0.3em; font-weight: 900; font-size: 1.5rem; text-align: center; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--card);
  font-weight: 700; font-size: 0.86rem; box-shadow: inset 0 0 0 1.5px var(--line); white-space: nowrap;
}
.chip.on, .chip[aria-pressed='true'] { background: var(--primary); color: #fff; box-shadow: none; }
button.chip { cursor: pointer; border: 0; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 800; background: var(--accent-soft); color: var(--accent); }
.pill.rose { background: var(--primary-soft); color: var(--primary); }
.pill.mint { background: #d9f6ec; color: #138a66; }

/* ───────────────────────── Cards ───────────────────────── */
.card { background: var(--card); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); position: relative; }
.card.flat { box-shadow: inset 0 0 0 1.5px var(--line); }
.card.tint { background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft)); box-shadow: none; }
.card h3 { display: flex; align-items: center; gap: 8px; }
.card-kicker { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 900; color: var(--primary); margin-bottom: 6px; }

/* ───────────────────────── Landing ───────────────────────── */
.landing { max-width: 1120px; margin: 0 auto; padding: 18px 18px 60px; }
.topbar-land { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 18px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.35rem; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); }
.brand .logo { width: 38px; height: 38px; }
.hero { display: grid; gap: 28px; align-items: center; padding: 10px 0 30px; }
.hero h1 span { background: linear-gradient(90deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { font-size: 1.15rem; color: var(--ink2); max-width: 34em; }
.hero-art { border-radius: 28px; overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 600 / 360; background: #2b1b48; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 18px; }
@media (min-width: 900px) { .hero { grid-template-columns: 1fr 1.05fr; padding-top: 30px; } }
.features { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin: 26px 0 40px; }
.feature { background: var(--card); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.feature .em { font-size: 1.7rem; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); margin-bottom: 10px; }
.feature:nth-child(even) .em { background: var(--accent-soft); }
.forms { display: grid; gap: 18px; }
@media (min-width: 860px) { .forms { grid-template-columns: 1fr 1fr; } }
.avatar-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.avatar-pick { appearance: none; border: 0; padding: 4px; border-radius: 50%; background: transparent; cursor: pointer; transition: transform 0.15s; box-shadow: inset 0 0 0 3px transparent; aspect-ratio: 1; }
.avatar-pick:hover { transform: scale(1.06); }
.avatar-pick[aria-pressed='true'] { box-shadow: inset 0 0 0 3px var(--primary); transform: scale(1.06); }
.footer { text-align: center; color: var(--ink3); font-size: 0.85rem; padding: 30px 0 10px; }
.steps { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); counter-reset: s; margin: 10px 0 30px; }
.step { padding: 16px 16px 16px 58px; position: relative; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.step::before { counter-increment: s; content: counter(s); position: absolute; left: 14px; top: 14px; width: 32px; height: 32px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 900; display: grid; place-items: center; }

/* ───────────────────────── Room shell ───────────────────────── */
.shell { max-width: 1120px; margin: 0 auto; padding: 0 16px 110px; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin: 0 -16px 14px;
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.topbar .room-name { font-weight: 900; font-size: 1.05rem; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .logo { width: 34px; height: 34px; flex: none; }
.presence { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--ink2); font-weight: 600; white-space: nowrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink3); display: inline-block; flex: none; }
.dot.on { background: #2ecc71; box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.2); }
.tabs-top { display: none; }
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
}
.tab { appearance: none; border: 0; background: none; cursor: pointer; display: grid; justify-items: center; gap: 1px; padding: 6px 2px; border-radius: 14px; color: var(--ink3); font-weight: 800; font-size: 0.7rem; }
.tab .ti { font-size: 1.3rem; line-height: 1.1; filter: grayscale(0.7); opacity: 0.8; }
.tab[aria-current='page'] { color: var(--primary); background: var(--primary-soft); }
.tab[aria-current='page'] .ti { filter: none; opacity: 1; }
@media (min-width: 900px) {
  .tabbar { display: none; }
  .tabs-top { display: flex; gap: 4px; margin-left: auto; }
  .tabs-top .tab { grid-auto-flow: column; gap: 6px; font-size: 0.9rem; padding: 8px 12px; }
  .tabs-top .tab .ti { font-size: 1.05rem; }
  .shell { padding-bottom: 60px; }
}
.view { animation: fadeUp 0.25s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.grid-home { display: grid; gap: 16px; }
@media (min-width: 900px) { .grid-home { grid-template-columns: 1.25fr 1fr; align-items: start; } }
.scene { border-radius: var(--r); overflow: hidden; background: #2b1b48; aspect-ratio: 400 / 260; }
.scene-card { padding: 0; overflow: hidden; }
.scene-meta { padding: 14px 18px 18px; }
.stats-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: -2px; }
.progress { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 0.6s ease; }
.answers { display: grid; gap: 10px; }
@media (min-width: 560px) { .answers { grid-template-columns: 1fr 1fr; } }
.answer { background: var(--bg); border-radius: 14px; padding: 12px 14px; white-space: pre-wrap; word-break: break-word; }
.answer .who { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 0.85rem; margin-bottom: 6px; }
.av { width: 28px; height: 28px; flex: none; border-radius: 50%; display: inline-block; }
.av.lg { width: 56px; height: 56px; }
.av.xl { width: 84px; height: 84px; }
.av.off { opacity: 0.4; filter: grayscale(0.6); }
.question-big { font-size: 1.2rem; font-weight: 800; line-height: 1.3; margin-bottom: 12px; }
.invite-code { font-size: 2.2rem; font-weight: 900; letter-spacing: 0.25em; text-align: center; padding: 10px; border-radius: 16px; background: var(--card); border: 2px dashed var(--primary); color: var(--primary); user-select: all; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 26px 0 12px; }
.section-title h2 { margin: 0; }

/* Games catalogue */
.games { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.game-card { appearance: none; border: 0; text-align: left; padding: 0; background: var(--card); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; transition: transform 0.18s ease, box-shadow 0.18s; display: flex; flex-direction: column; }
.game-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.game-card .cover { aspect-ratio: 320 / 180; background: var(--bg2); }
.game-card .gbody { padding: 12px 14px 14px; display: grid; gap: 4px; }
.game-card .gname { font-weight: 900; font-size: 1.02rem; }
.game-card .gdesc { color: var(--ink2); font-size: 0.86rem; line-height: 1.35; }
.game-card .gmeta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.live-banner { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; box-shadow: var(--shadow-lg); margin-bottom: 16px; }
.live-banner .btn { background: #fff; color: var(--primary); box-shadow: none; }

/* Our space */
.subnav { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; margin: 0 -2px 6px; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.timeline { position: relative; display: grid; gap: 12px; padding-left: 26px; }
.timeline::before { content: ''; position: absolute; left: 10px; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; background: linear-gradient(var(--primary), var(--accent)); opacity: 0.35; }
.tl-item { position: relative; }
.tl-item .tl-dot { position: absolute; left: -26px; top: 12px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--card); box-shadow: var(--shadow); font-size: 0.8rem; }
.tl-item .card { padding: 12px 14px; }
.tl-item.auto .card { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.tl-date { font-size: 0.75rem; font-weight: 800; color: var(--ink3); text-transform: uppercase; letter-spacing: 0.06em; }
.list { display: grid; gap: 8px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); }
.list-item.done .txt { text-decoration: line-through; color: var(--ink3); }
.check { appearance: none; width: 26px; height: 26px; border-radius: 9px; border: 2.5px solid var(--line); cursor: pointer; flex: none; display: grid; place-items: center; background: var(--card); transition: 0.15s; }
.check:checked { background: var(--mint); border-color: var(--mint); }
.check:checked::after { content: '✓'; color: #fff; font-weight: 900; font-size: 0.9rem; }
.x-btn { appearance: none; border: 0; background: none; color: var(--ink3); cursor: pointer; font-size: 1.1rem; padding: 4px 8px; border-radius: 8px; }
.x-btn:hover { background: var(--bg2); color: var(--danger); }
.secret { border-radius: var(--r); padding: 16px; background: linear-gradient(135deg, #2b1b48, #4a2c6e); color: #fff; box-shadow: var(--shadow); }
.secret.open { background: var(--card); color: var(--ink); }
.secret .msg { white-space: pre-wrap; word-break: break-word; font-size: 1.02rem; background: var(--bg); padding: 12px 14px; border-radius: 12px; margin-top: 8px; }
.empty { text-align: center; color: var(--ink2); padding: 20px 10px; }
.empty .art { width: 180px; margin: 0 auto 8px; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-pick button { appearance: none; border: 0; width: 40px; height: 40px; border-radius: 12px; background: var(--bg); cursor: pointer; font-size: 1.2rem; }
.icon-pick button[aria-pressed='true'] { background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); }
details.add { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
details.add > summary { list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 800; display: flex; align-items: center; gap: 8px; color: var(--primary); }
details.add > summary::-webkit-details-marker { display: none; }
details.add[open] > summary { border-bottom: 1px solid var(--line); }
details.add .inner { padding: 16px 18px 18px; display: grid; gap: 12px; }
.idea { text-align: center; padding: 28px 20px; }
.idea .em { font-size: 3.4rem; margin-bottom: 4px; }

/* Stats */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.kpi { background: var(--card); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.kpi .v { font-size: 1.9rem; font-weight: 900; line-height: 1.1; }
.kpi .l { font-size: 0.82rem; color: var(--ink2); font-weight: 700; }
.duel { display: flex; height: 16px; border-radius: 99px; overflow: hidden; background: var(--line); }
.duel > i:first-child { background: var(--p0); }
.duel > i:last-child { background: var(--p1); }
.bars { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 150px 1fr 34px; gap: 10px; align-items: center; font-size: 0.88rem; font-weight: 700; }
.bar .track { height: 10px; border-radius: 99px; background: var(--line); overflow: hidden; }
.bar .track i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 99px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { appearance: none; border: 3px solid transparent; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; box-shadow: var(--shadow); }
.swatch[aria-pressed='true'] { border-color: var(--ink); }

/* ───────────────────────── Overlays: game, chat, modal, toasts ───────────────────────── */
.overlay { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto; animation: slideUp 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes slideUp { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.game-wrap { max-width: 860px; margin: 0 auto; padding: 0 16px 40px; min-height: 100%; display: flex; flex-direction: column; }
.game-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 0; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.game-head .title { font-weight: 900; font-size: 1.05rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin: 4px 0 16px; }
.player { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); min-width: 0; transition: box-shadow 0.2s, transform 0.2s; }
.player.right { flex-direction: row-reverse; text-align: right; }
.player .pn { font-weight: 800; font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .ps { font-size: 0.75rem; color: var(--ink2); font-weight: 700; }
.player .score { margin-left: auto; font-weight: 900; font-size: 1.4rem; }
.player.right .score { margin-left: 0; margin-right: auto; }
.player.turn { box-shadow: 0 0 0 3px var(--primary), var(--shadow); transform: translateY(-2px); }
.player.p1.turn { box-shadow: 0 0 0 3px var(--p1), var(--shadow); }
.vs { font-weight: 900; color: var(--ink3); font-size: 0.85rem; }
.game-body { flex: 1; display: grid; gap: 16px; align-content: start; }
.status { text-align: center; font-weight: 800; font-size: 1.05rem; min-height: 1.6em; }
.status.you { color: var(--primary); }
.lobby { display: grid; gap: 16px; }
.lobby .cover { border-radius: var(--r); overflow: hidden; aspect-ratio: 320 / 180; box-shadow: var(--shadow-lg); max-height: 300px; }
.rules { margin: 0; padding-left: 1.2em; color: var(--ink2); }
.rules li { margin: 4px 0; }
.ready-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ready-card { display: grid; justify-items: center; gap: 6px; padding: 16px 10px; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); text-align: center; }
.ready-card.ok { box-shadow: 0 0 0 3px var(--mint), var(--shadow); }
.result { text-align: center; padding: 26px 20px; }
.result .big { font-size: 3.2rem; line-height: 1; margin-bottom: 8px; }
.result .pts { display: inline-block; margin: 10px 0; padding: 8px 16px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-weight: 900; }

/* Board games */
.ttt { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: min(100%, 380px); margin: 0 auto; }
.ttt button { appearance: none; border: 0; aspect-ratio: 1; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); font-size: clamp(2.4rem, 12vw, 3.6rem); cursor: pointer; display: grid; place-items: center; transition: transform 0.12s, background 0.2s; }
.ttt button:not(:disabled):hover { transform: scale(1.03); background: var(--primary-soft); }
.ttt button:disabled { cursor: default; }
.ttt button.win { background: linear-gradient(135deg, var(--primary-soft), var(--accent-soft)); animation: pop 0.5s ease; }
.mark { animation: pop 0.3s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
@keyframes pop { from { transform: scale(0.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.c4 { width: min(100%, 470px); margin: 0 auto; background: linear-gradient(160deg, #3d2a6b, #2b1b48); padding: 10px; border-radius: 22px; box-shadow: var(--shadow-lg); }
.c4-cols { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.c4-col { appearance: none; border: 0; background: none; padding: 0; display: grid; gap: 6px; cursor: pointer; border-radius: 14px; }
.c4-col:not(:disabled):hover { background: rgba(255, 255, 255, 0.08); }
.c4-col:disabled { cursor: default; }
.c4-cell { aspect-ratio: 1; border-radius: 50%; background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.35); }
.c4-cell.p0 { background: radial-gradient(circle at 35% 30%, #ff9db1, var(--p0) 60%); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2); }
.c4-cell.p1 { background: radial-gradient(circle at 35% 30%, #b9a8ff, var(--p1) 60%); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2); }
.c4-cell.last { animation: drop 0.35s cubic-bezier(0.4, 1.4, 0.6, 1) both; }
.c4-cell.win { outline: 4px solid var(--sun); outline-offset: -4px; }
@keyframes drop { from { transform: translateY(-260%); } to { transform: none; } }
.memo { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: min(100%, 520px); margin: 0 auto; perspective: 800px; }
.memo button { appearance: none; border: 0; padding: 0; aspect-ratio: 3 / 4; border-radius: 14px; cursor: pointer; position: relative; transform-style: preserve-3d; transition: transform 0.35s ease; background: none; }
.memo button .f, .memo button .b { position: absolute; inset: 0; border-radius: 14px; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.memo button .b { background: linear-gradient(135deg, var(--primary), var(--accent)); box-shadow: var(--shadow); }
.memo button .b::after { content: '♥'; color: rgba(255, 255, 255, 0.55); font-size: 1.6rem; }
.memo button .f { background: var(--card); transform: rotateY(180deg); font-size: clamp(1.6rem, 7vw, 2.4rem); box-shadow: var(--shadow); }
.memo button.up { transform: rotateY(180deg); }
.memo button.m0 .f { box-shadow: 0 0 0 3px var(--p0); }
.memo button.m1 .f { box-shadow: 0 0 0 3px var(--p1); }
.memo button:disabled { cursor: default; }
.choices3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 520px; margin: 0 auto; width: 100%; }
.big-choice { appearance: none; border: 0; border-radius: 22px; background: var(--card); box-shadow: var(--shadow); padding: 18px 8px; cursor: pointer; display: grid; justify-items: center; gap: 6px; font-weight: 800; transition: transform 0.15s, box-shadow 0.15s; }
.big-choice .e { font-size: clamp(2.2rem, 10vw, 3.4rem); line-height: 1; }
.big-choice:not(:disabled):hover { transform: translateY(-3px); }
.big-choice[aria-pressed='true'] { box-shadow: 0 0 0 3px var(--primary), var(--shadow); }
.big-choice:disabled { cursor: default; }
.rps-face { display: flex; justify-content: center; align-items: center; gap: 22px; font-size: 3.6rem; min-height: 90px; }
.rps-face .who { font-size: 0.8rem; font-weight: 800; color: var(--ink2); text-align: center; }
.history-dots { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.history-dots span { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.history-dots .p0 { background: var(--p0); }
.history-dots .p1 { background: var(--p1); }

/* Discovery games */
.qcard { background: linear-gradient(145deg, var(--primary), var(--accent)); color: #fff; border-radius: 26px; padding: 26px 22px; box-shadow: var(--shadow-lg); text-align: center; }
.qcard .k { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 900; opacity: 0.85; }
.qcard .q { font-size: clamp(1.25rem, 4.5vw, 1.7rem); font-weight: 900; line-height: 1.25; margin-top: 8px; }
.opts { display: grid; gap: 10px; }
@media (min-width: 560px) { .opts.two { grid-template-columns: 1fr 1fr; } }
.opt { appearance: none; border: 0; text-align: left; padding: 14px 16px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); cursor: pointer; font-weight: 700; display: flex; align-items: center; gap: 10px; transition: transform 0.12s, box-shadow 0.15s; }
.opt:not(:disabled):hover { transform: translateY(-2px); }
.opt[aria-pressed='true'] { box-shadow: 0 0 0 3px var(--primary), var(--shadow); }
.opt.guess[aria-pressed='true'] { box-shadow: 0 0 0 3px var(--accent), var(--shadow); }
.opt.right { box-shadow: 0 0 0 3px var(--mint), var(--shadow); }
.opt.wrong { opacity: 0.55; }
.opt:disabled { cursor: default; }
.opt .tags { margin-left: auto; display: flex; gap: 4px; }
.wyr { display: grid; gap: 12px; }
@media (min-width: 640px) { .wyr { grid-template-columns: 1fr auto 1fr; align-items: stretch; } }
.wyr-or { display: grid; place-items: center; font-weight: 900; color: var(--ink3); }
.wyr-btn { appearance: none; border: 0; border-radius: 24px; padding: 28px 18px; min-height: 140px; cursor: pointer; font-weight: 900; font-size: 1.15rem; line-height: 1.3; color: #fff; display: grid; place-items: center; gap: 8px; text-align: center; transition: transform 0.15s, box-shadow 0.15s; box-shadow: var(--shadow); }
.wyr-btn.a { background: linear-gradient(145deg, #ff6f8e, #ff8a65); }
.wyr-btn.b { background: linear-gradient(145deg, #7c5cff, #5ab8ff); }
.wyr-btn:not(:disabled):hover { transform: translateY(-3px) rotate(-0.5deg); }
.wyr-btn[aria-pressed='true'] { box-shadow: 0 0 0 4px var(--ink), var(--shadow-lg); }
.wyr-btn:disabled { cursor: default; }
.wyr-btn .who { display: flex; gap: 4px; justify-content: center; min-height: 32px; }
.flipcard { border-radius: 26px; padding: 30px 24px; min-height: 230px; display: grid; place-items: center; text-align: center; box-shadow: var(--shadow-lg); color: #fff; animation: flipIn 0.5s ease both; }
@keyframes flipIn { from { transform: rotateY(90deg); opacity: 0; } to { transform: none; opacity: 1; } }
.flipcard .q { font-size: clamp(1.25rem, 4.5vw, 1.65rem); font-weight: 900; line-height: 1.3; }
.cat-souvenirs { background: linear-gradient(145deg, #ff8a65, #ff5a7a); }
.cat-reves { background: linear-gradient(145deg, #5ab8ff, #7c5cff); }
.cat-fun { background: linear-gradient(145deg, #ffc94d, #ff8a65); }
.cat-profond { background: linear-gradient(145deg, #4a2c6e, #2b1b48); }
.cat-nous { background: linear-gradient(145deg, #ff5a7a, #7c5cff); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.cat-btn { appearance: none; border: 0; border-radius: 18px; padding: 16px 12px; color: #fff; font-weight: 900; cursor: pointer; display: grid; gap: 4px; justify-items: center; box-shadow: var(--shadow); transition: transform 0.15s; }
.cat-btn:hover { transform: translateY(-2px); }
.cat-btn .e { font-size: 1.8rem; }
.cat-surprise { background: linear-gradient(145deg, #2a1d3a, #6b5d7b); }

/* Draw */
.draw-area { position: relative; width: 100%; max-width: 640px; margin: 0 auto; aspect-ratio: 4 / 3; background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; touch-action: none; }
.draw-area canvas { width: 100%; height: 100%; display: block; cursor: crosshair; }
.draw-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; align-items: center; }
.color-dot { appearance: none; width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--card); box-shadow: 0 0 0 2px var(--line); cursor: pointer; }
.color-dot[aria-pressed='true'] { box-shadow: 0 0 0 3px var(--ink); }
.word-mask { font-size: clamp(1.4rem, 6vw, 2.1rem); font-weight: 900; letter-spacing: 0.3em; text-align: center; font-family: ui-monospace, 'SF Mono', Consolas, monospace; }
.timer { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.timer i { display: block; height: 100%; background: linear-gradient(90deg, var(--mint), var(--sun), var(--primary)); transition: width 0.5s linear; }
.guesses { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-height: 110px; overflow-y: auto; }
.guesses .g { padding: 4px 10px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); font-size: 0.85rem; font-weight: 700; }
.guesses .g.close { box-shadow: inset 0 0 0 2px var(--sun); }
.guesses .g.yes { background: var(--mint); color: #fff; box-shadow: none; }
.guess-form { display: flex; gap: 8px; max-width: 520px; margin: 0 auto; width: 100%; }
.emoji-big { font-size: clamp(3rem, 14vw, 5.4rem); text-align: center; letter-spacing: 0.08em; line-height: 1.2; padding: 18px 0; animation: pop 0.4s ease both; }

/* Story & duo */
.story-text { font-size: 1.12rem; line-height: 1.65; background: var(--card); border-radius: 22px; padding: 22px; box-shadow: var(--shadow); white-space: pre-wrap; }
.story-text::first-letter { font-size: 2.4em; font-weight: 900; float: left; line-height: 0.9; margin: 4px 8px 0 0; color: var(--primary); }
.clues { display: grid; gap: 10px; }
.clue { padding: 14px 16px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); border-left: 5px solid var(--accent); white-space: pre-wrap; font-family: inherit; }
.role-tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #2b1b48; color: #fff; font-weight: 800; font-size: 0.82rem; }
.attempts { display: flex; flex-wrap: wrap; gap: 6px; }
.attempts .a { padding: 4px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 700; background: #fde7e8; color: var(--danger); }
.attempts .a.ok { background: #d9f6ec; color: #138a66; }

/* Chat */
.chat-panel { position: fixed; z-index: 60; top: 0; right: 0; bottom: 0; width: min(420px, 100%); background: var(--card); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slideIn 0.25s ease both; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.chat-list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 6px; background: var(--bg); }
.msg { max-width: 82%; padding: 9px 13px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); white-space: pre-wrap; word-break: break-word; align-self: flex-start; border-bottom-left-radius: 6px; }
.msg.me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-left-radius: 18px; border-bottom-right-radius: 6px; }
.msg .t { display: block; font-size: 0.68rem; opacity: 0.6; margin-top: 2px; text-align: right; }
.chat-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.chat-form .input { border-radius: 999px; }
.quick-hearts { display: flex; gap: 6px; padding: 8px 12px 0; }
.quick-hearts button { appearance: none; border: 0; background: var(--bg); border-radius: 12px; font-size: 1.3rem; padding: 4px 10px; cursor: pointer; }
.fab-chat { position: fixed; right: 16px; bottom: 16px; z-index: 55; }
.fab-chat .icon-btn { width: 54px; height: 54px; font-size: 1.4rem; background: var(--primary); color: #fff; }

.modal-back { position: fixed; inset: 0; z-index: 70; background: rgba(23, 17, 42, 0.5); display: grid; place-items: center; padding: 16px; animation: fade 0.2s ease both; backdrop-filter: blur(4px); }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--card); border-radius: 26px; padding: 24px; width: min(440px, 100%); box-shadow: var(--shadow-lg); animation: pop 0.3s ease both; display: grid; gap: 14px; text-align: center; max-height: 90vh; overflow-y: auto; }
.toasts { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; width: min(420px, calc(100% - 24px)); pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 16px; font-weight: 700; box-shadow: var(--shadow-lg); animation: toastIn 0.3s ease both; pointer-events: auto; text-align: center; }
body[data-theme='nuit'] .toast { background: #fff; color: #2a1d3a; }
.toast.err { background: var(--danger); color: #fff; }
.toast.big { background: linear-gradient(135deg, var(--primary), var(--accent)); color: #fff; font-size: 1.05rem; }
@keyframes toastIn { from { transform: translateY(-12px); opacity: 0; } }
.float-heart { position: fixed; z-index: 95; pointer-events: none; font-size: 2.4rem; animation: floatUp 2.6s ease-out forwards; }
@keyframes floatUp { 0% { transform: translateY(0) scale(0.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-20px) scale(1.15); } 100% { transform: translateY(-70vh) scale(0.9) rotate(15deg); opacity: 0; } }
#confetti { position: fixed; inset: 0; z-index: 96; pointer-events: none; }
.loader { display: grid; place-items: center; align-content: center; min-height: 70vh; gap: 12px; color: var(--ink2); font-weight: 700; }
.loader .logo { width: 64px; height: 64px; animation: beat 1.2s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(1); } 45% { transform: scale(1.08); } }
.heart-picker { position: absolute; top: 52px; right: 0; display: flex; gap: 4px; padding: 6px; border-radius: 999px; background: var(--card); box-shadow: var(--shadow-lg); z-index: 40; animation: pop 0.2s ease both; }
.heart-picker button { appearance: none; border: 0; background: none; font-size: 1.5rem; cursor: pointer; padding: 4px 6px; border-radius: 50%; }
.heart-picker button:hover { background: var(--bg2); }
.kbd { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--bg2); font-family: ui-monospace, Consolas, monospace; font-size: 0.85em; word-break: break-all; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }
