/* ============================================================
   MA FAMILLE — Design « Candy Pop »
   Dégradés violet/rose/orange, formes rondes, micro-animations
   ============================================================ */

:root {
  --violet: #8b5cf6;
  --fuchsia: #ec4899;
  --orange: #fb923c;
  --gold: #fbbf24;
  --mint: #34d399;
  --sky: #38bdf8;
  --ink: #3b2c53;
  --ink-soft: #8a7ba8;
  --paper: #fff;
  --bg: #fff5fb;
  --grad-main: linear-gradient(135deg, #8b5cf6 0%, #d946ef 45%, #ec4899 100%);
  --grad-warm: linear-gradient(135deg, #ec4899, #fb923c);
  --grad-gold: linear-gradient(135deg, #fbbf24, #fb923c);
  --grad-mint: linear-gradient(135deg, #34d399, #38bdf8);
  --shadow-pop: 0 10px 25px -6px rgba(217, 70, 239, 0.35);
  --shadow-soft: 0 4px 14px rgba(139, 92, 246, 0.12);
  --radius: 22px;
}

* { box-sizing: border-box; margin: 0; }

html, body { height: 100%; }

body {
  font-family: 'Baloo 2', 'Segoe UI', system-ui, sans-serif;
  background:
    radial-gradient(600px 400px at 110% -10%, rgba(251, 146, 60, 0.18), transparent 60%),
    radial-gradient(700px 500px at -20% 30%, rgba(139, 92, 246, 0.16), transparent 60%),
    radial-gradient(600px 500px at 120% 90%, rgba(236, 72, 153, 0.15), transparent 60%),
    var(--bg);
  color: var(--ink);
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }
.screen { height: 100dvh; }

.center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

/* ---- Animations globales ---- */
@keyframes pulse { 50% { opacity: 0.3; } }
@keyframes pop-in {
  0% { transform: scale(0.7) translateY(12px); opacity: 0; }
  70% { transform: scale(1.04) translateY(-2px); }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-12px) rotate(3deg); }
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.25); }
  30% { transform: scale(1); }
  45% { transform: scale(1.15); }
}
@keyframes fall {
  to { transform: translateY(115vh) rotate(560deg); opacity: 0.85; }
}
@keyframes ring {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  100% { box-shadow: 0 0 0 14px rgba(239, 68, 68, 0); }
}

.pulse { font-size: 52px; animation: heartbeat 1.4s ease-in-out infinite; }

.confetti-piece {
  position: fixed;
  top: -36px;
  z-index: 300;
  pointer-events: none;
  animation: fall 2.2s ease-in forwards;
}

/* ---- Marque (écrans connexion) ---- */
.brand { text-align: center; margin-bottom: 22px; }
.brand-emoji { font-size: 64px; margin-bottom: 6px; animation: float 4s ease-in-out infinite; display: inline-block; }
.brand h1 {
  font-size: 34px;
  font-weight: 800;
  background: var(--grad-main);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand p { color: var(--ink-soft); margin-top: 2px; font-weight: 600; }

/* ---- Cartes / formulaires ---- */
.card {
  width: 100%;
  max-width: 390px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 28px;
  padding: 24px;
  box-shadow: 0 24px 50px -12px rgba(139, 92, 246, 0.35);
  animation: pop-in 0.35s ease;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: #f6efff;
  border-radius: 18px;
  padding: 5px;
  margin-bottom: 20px;
}

.tab {
  border: 0;
  background: transparent;
  border-radius: 14px;
  padding: 12px;
  font-size: 17px;
  font-weight: 800;
  font-family: inherit;
  color: var(--violet);
  cursor: pointer;
  transition: transform 0.15s;
}
.tab:active { transform: scale(0.94); }
.tab.active { background: var(--grad-main); color: #fff; box-shadow: var(--shadow-pop); }

form { display: flex; flex-direction: column; gap: 14px; }

input, textarea, select {
  width: 100%;
  border: 2px solid #eadcff;
  background: #fff;
  border-radius: 18px;
  padding: 14px 16px;
  font-size: 17px;
  outline: none;
  font-family: inherit;
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--fuchsia);
  box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.12);
}

.code-input { text-transform: uppercase; letter-spacing: 0.3em; }

.btn-primary {
  border: 0;
  background: var(--grad-main);
  color: #fff;
  border-radius: 18px;
  padding: 16px;
  font-size: 17px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-pop);
  transition: transform 0.15s, filter 0.15s;
}
.btn-primary:active { transform: scale(0.95); filter: brightness(1.1); }
.btn-primary:disabled { opacity: 0.5; }

.btn-danger {
  width: 100%;
  border: 2px solid #ffd4d4;
  background: #fff;
  color: #ef4444;
  border-radius: 16px;
  padding: 14px;
  font-size: 16px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  margin-top: 20px;
}

.link {
  border: 0;
  background: none;
  color: var(--fuchsia);
  font-weight: 700;
  font-family: inherit;
  font-size: 14px;
  margin-top: 14px;
  cursor: pointer;
  width: 100%;
}
.link.muted { color: var(--ink-soft); }

.msg { border-radius: 14px; padding: 12px; font-size: 14px; font-weight: 600; }
.msg.error { background: #fff1f2; color: #e11d48; }
.msg.info { background: #ecfdf5; color: #059669; }

/* ---- Écran principal ---- */
.chat { display: flex; flex-direction: column; }

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--grad-main);
  color: #fff;
  padding: 14px 18px;
  padding-top: max(14px, env(safe-area-inset-top));
  border-radius: 0 0 26px 26px;
  box-shadow: var(--shadow-pop);
  z-index: 10;
}
.chat-header h1 { font-size: 21px; font-weight: 800; letter-spacing: 0.3px; }
.chat-header p { font-size: 12.5px; color: rgba(255, 255, 255, 0.85); font-weight: 600; }
.header-btns { display: flex; gap: 10px; }
.chat-header button {
  border: 0;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(6px);
  border-radius: 50%;
  width: 46px;
  height: 46px;
  font-size: 20px;
  cursor: pointer;
  transition: transform 0.15s;
}
.chat-header button:active { transform: scale(0.88); }
#sos-btn { background: linear-gradient(135deg, #f87171, #ef4444) !important; animation: ring 2s infinite; }

/* ---- Panneaux ---- */
.pane { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.pane-scroll { flex: 1; overflow-y: auto; padding: 16px; }

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-hint { text-align: center; color: var(--ink-soft); margin-top: 40px; font-weight: 600; }
.empty-line { color: var(--ink-soft); font-size: 14px; padding: 8px 0; font-weight: 600; }

/* ---- Bulles ---- */
.bubble-row { display: flex; align-items: flex-end; gap: 6px; animation: pop-in 0.25s ease; }
.bubble-row.mine { flex-direction: row-reverse; }

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 2px;
}
.av0 { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.av1 { background: linear-gradient(135deg, #38bdf8, #6366f1); }
.av2 { background: linear-gradient(135deg, #fbbf24, #fb923c); }
.av3 { background: linear-gradient(135deg, #34d399, #10b981); }

.bubble {
  max-width: 78%;
  border-radius: 24px;
  padding: 11px 15px;
  font-size: 17px;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: var(--shadow-soft);
}
.bubble-row.mine .bubble {
  background: var(--grad-main);
  color: #fff;
  border-bottom-right-radius: 8px;
  box-shadow: var(--shadow-pop);
}
.bubble-row:not(.mine) .bubble { background: var(--paper); border-bottom-left-radius: 8px; }

.bubble .sender { font-size: 12px; font-weight: 800; margin-bottom: 2px; }
.c0 .sender { color: #ec4899; }
.c1 .sender { color: #38bdf8; }
.c2 .sender { color: #f59e0b; }
.c3 .sender { color: #10b981; }

.bubble .time { font-size: 10px; opacity: 0.5; text-align: right; margin-top: 4px; font-weight: 600; }
.bubble-row.mine .time { color: #ffe4f7; opacity: 0.9; }

.c0, .c1, .c2, .c3 { color: var(--ink); }

/* Réactions */
.react-trigger {
  border: 0;
  background: none;
  font-size: 16px;
  opacity: 0.3;
  cursor: pointer;
  padding: 4px;
  transition: opacity 0.15s, transform 0.15s;
}
.react-trigger:active { transform: scale(1.4); opacity: 1; }

.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.reactions:empty { display: none; }
.react-chip {
  border: 0;
  background: #f6efff;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  animation: pop-in 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.bubble-row.mine .react-chip { background: rgba(255, 255, 255, 0.3); color: #fff; }
.react-chip.mine-react { outline: 2px solid var(--fuchsia); background: #ffe4f3; }
.bubble-row.mine .react-chip.mine-react { outline-color: #fff; }

.react-sheet {
  background: #fff;
  border-radius: 28px 28px 0 0;
  padding: 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  width: 100%;
  max-width: 440px;
  display: flex;
  justify-content: space-around;
  animation: pop-in 0.25s ease;
}
.react-sheet button {
  border: 0;
  background: #f6efff;
  border-radius: 50%;
  width: 54px;
  height: 54px;
  font-size: 27px;
  cursor: pointer;
  transition: transform 0.15s;
}
.react-sheet button:active { transform: scale(1.3); }

/* Coches de lecture */
.ticks { font-weight: 800; }
.ticks.read-all { color: #6ee7b7; }

/* Médias dans les bulles */
.bubble audio { max-width: 230px; width: 230px; height: 40px; display: block; }
.bubble .voice-label, .bubble .alert-title { font-size: 13px; font-weight: 700; opacity: 0.75; margin-bottom: 4px; }

.photo-thumb {
  max-width: 220px;
  max-height: 260px;
  border-radius: 16px;
  display: block;
  cursor: pointer;
  background: #f6efff;
  min-height: 60px;
  min-width: 90px;
}

.bubble.alert {
  background: linear-gradient(135deg, #fef2f2, #ffe4e6) !important;
  color: #881337 !important;
  border: 2px solid #f87171;
}
.alert-title { font-size: 16px !important; font-weight: 800 !important; color: #dc2626 !important; opacity: 1 !important; }

.map-open {
  display: block;
  border: 0;
  background: var(--grad-mint);
  color: #fff;
  border-radius: 12px;
  padding: 9px 13px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: var(--shadow-soft);
}
.bubble-row.mine .map-open { background: rgba(255, 255, 255, 0.95); color: var(--violet); }
.bubble.alert .map-open { background: linear-gradient(135deg, #f87171, #dc2626); color: #fff; }

/* ---- Zone de saisie ---- */
.chat-input {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  gap: 7px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-top: 1px solid #f6e7ff;
  padding: 10px 12px;
}
.chat-input textarea {
  flex: 1;
  resize: none;
  max-height: 120px;
  border-radius: 22px;
  background: #faf6ff;
}
.chat-input button {
  border: 0;
  background: var(--grad-main);
  color: #fff;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 19px;
  cursor: pointer;
  box-shadow: var(--shadow-pop);
  flex-shrink: 0;
  transition: transform 0.15s;
}
.chat-input button:active { transform: scale(0.85); }
.chat-input button:disabled { opacity: 0.4; }

.tool-btn {
  box-shadow: var(--shadow-soft) !important;
  width: 42px !important;
  height: 42px !important;
  font-size: 16px !important;
}
#loc-btn.tool-btn { background: linear-gradient(135deg, #d1fae5, #a7f3d0) !important; }
#photo-btn.tool-btn { background: linear-gradient(135deg, #fef3c7, #fde68a) !important; }
#mic-btn.tool-btn { background: linear-gradient(135deg, #ede9fe, #ddd6fe) !important; }

/* Barre d'enregistrement */
.rec-bar {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  padding: 10px 16px;
  z-index: 5;
}
.rec-dot { animation: pulse 1s infinite; }
#rec-time { font-weight: 800; font-size: 18px; color: #e11d48; min-width: 46px; }
.rec-hint { color: var(--ink-soft); font-size: 14px; flex: 1; font-weight: 600; }
#rec-cancel { background: #f3f4f6 !important; color: #6b7280 !important; box-shadow: none !important; }

/* ---- Navigation ---- */
#bottom-nav {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -8px 30px rgba(139, 92, 246, 0.15);
  padding: 8px 10px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
}
.nav-btn {
  position: relative;
  flex: 1;
  border: 0;
  background: none;
  padding: 9px 0 7px;
  font-size: 22px;
  color: var(--ink-soft);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  border-radius: 18px;
  font-family: inherit;
  transition: transform 0.15s, background 0.2s;
}
.nav-btn span { font-size: 11.5px; font-weight: 800; }
.nav-btn:active { transform: scale(0.92); }
.nav-btn.active { background: var(--grad-main); color: #fff; box-shadow: var(--shadow-pop); }
.nav-btn .dot {
  position: absolute;
  top: 7px;
  right: 26%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f87171, #ef4444);
  border: 2px solid #fff;
}

/* ---- Bannières ---- */
.notif-banner, .locreq-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 12px 0;
  border-radius: 18px;
  padding: 11px 14px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: var(--shadow-soft);
  animation: pop-in 0.3s ease;
}
.notif-banner { background: linear-gradient(135deg, #fef9c3, #fde68a); color: #713f12; }
.locreq-banner { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1e3a8a; }
.notif-banner span, .locreq-banner span { flex: 1; }
.notif-banner button, .locreq-banner button {
  border: 0;
  border-radius: 12px;
  padding: 8px 12px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  color: #fff;
}
.notif-banner button { background: var(--grad-gold); }
.locreq-banner button { background: linear-gradient(135deg, #38bdf8, #2563eb); }
.notif-banner #notif-dismiss, .locreq-banner #locreq-decline { background: none; color: inherit; opacity: 0.6; }

/* ---- Overlays & feuilles ---- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(59, 44, 83, 0.45);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 50;
}

.sheet, .map-sheet {
  width: 100%;
  max-width: 460px;
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--bg);
  border-radius: 28px 28px 0 0;
  padding: 22px;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
  animation: pop-in 0.3s ease;
}
.map-sheet { background: #fff; }
#map { height: 55dvh; border-radius: 20px; }

.sheet-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sheet-header h2 {
  font-size: 21px;
  font-weight: 800;
  background: var(--grad-main);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sheet-header button {
  border: 0;
  background: #fff;
  color: var(--violet);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}

.sheet section { margin-bottom: 22px; }
.sheet h3 { font-size: 15px; font-weight: 800; color: var(--ink); margin-bottom: 8px; }
.sheet h3.mt { margin-top: 22px; }
.hint { font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; font-weight: 600; }

#settings-members { list-style: none; display: flex; flex-direction: column; gap: 6px; padding: 0; }
#settings-members li {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 15px;
  box-shadow: var(--shadow-soft);
}
#settings-members .uname { color: var(--ink-soft); font-size: 12px; }
#settings-members .me-tag { margin-left: auto; color: var(--fuchsia); font-size: 12px; font-weight: 800; }

.invite-code {
  background: var(--grad-main);
  color: #fff;
  border-radius: 18px;
  text-align: center;
  padding: 15px;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0.3em;
  box-shadow: var(--shadow-pop);
}

.status-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.status-buttons button {
  border: 2px solid #eadcff;
  background: #fff;
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s;
}
.status-buttons button:active { transform: scale(0.92); }
.status-buttons button.active { background: var(--grad-main); color: #fff; border-color: transparent; box-shadow: var(--shadow-pop); }

/* Visionneuse photo */
.photo-viewer { align-items: center !important; background: rgba(20, 10, 35, 0.92) !important; }
.photo-viewer img { max-width: 96vw; max-height: 88dvh; border-radius: 12px; animation: pop-in 0.25s ease; }
.photo-viewer button {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  border: 0;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 18px;
  cursor: pointer;
}

/* ---- Missions & Agenda ---- */
.pane-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 12px;
  background: var(--grad-main);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.points-chip {
  display: inline-block;
  background: var(--grad-gold);
  color: #fff;
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 800;
  margin: 0 6px 12px 0;
  box-shadow: 0 6px 16px -4px rgba(251, 146, 60, 0.5);
}

.section-label {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 16px 0 8px;
}

.item-card {
  background: #fff;
  border-radius: 18px;
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-soft);
  border-left: 5px solid var(--violet);
  animation: pop-in 0.25s ease;
}
.item-card:nth-child(odd) { border-left-color: var(--fuchsia); }
.item-card.done { opacity: 0.7; border-left-color: var(--mint); }
.item-main { flex: 1; min-width: 0; }
.item-title { font-weight: 800; word-break: break-word; }
.item-sub { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.item-btn {
  border: 0;
  background: var(--grad-main);
  color: #fff;
  border-radius: 12px;
  padding: 9px 13px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s;
}
.item-btn:active { transform: scale(0.92); }
.item-btn.green { background: var(--grad-mint); }
.item-btn.ghost { background: #f3f0fa; color: var(--ink-soft); box-shadow: none; }

.add-form {
  background: #fff;
  border-radius: 20px;
  padding: 14px;
  margin: 10px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-soft);
}
.add-form .row { display: flex; gap: 8px; }
.add-form input, .add-form select { border-radius: 14px; padding: 10px 12px; font-size: 15px; }
.add-form .grow { flex: 1; }
.add-form button {
  border: 0;
  background: var(--grad-warm);
  color: #fff;
  border-radius: 14px;
  padding: 12px 16px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-pop);
  transition: transform 0.15s;
}
.add-form button:active { transform: scale(0.94); }

.day-label {
  display: inline-block;
  font-size: 13.5px;
  font-weight: 800;
  color: #fff;
  background: var(--grad-warm);
  border-radius: 999px;
  padding: 5px 14px;
  margin: 14px 0 8px;
  box-shadow: var(--shadow-soft);
}

#locmenu-items { display: flex; flex-direction: column; gap: 10px; }

/* ===== V3 : Jeux & activités ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.game-card {
  border: 0;
  background: #fff;
  border-radius: 20px;
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: var(--shadow-soft);
  transition: transform 0.15s;
  border-bottom: 4px solid var(--violet);
}
.game-card:nth-child(2n) { border-bottom-color: var(--fuchsia); }
.game-card:nth-child(3n) { border-bottom-color: var(--orange); }
.game-card:active { transform: scale(0.94); }
.game-emoji { font-size: 38px; }
.game-name { font-weight: 800; color: var(--ink); }
.game-sub { font-size: 12px; color: var(--ink-soft); font-weight: 600; }

.record-line {
  background: #fff;
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  box-shadow: var(--shadow-soft);
}
.record-line span { color: var(--ink-soft); font-weight: 600; text-align: right; }

.game-sheet { max-width: 480px; }
#game-body { display: flex; flex-direction: column; align-items: center; gap: 12px; }
#game-body canvas {
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  background: #fff;
  touch-action: none;
  max-width: 100%;
}
#s-canvas { touch-action: none; }
.game-send { width: 100%; }
.game-stat { font-weight: 700; color: var(--ink-soft); }

.palette { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }
.swatch {
  border: 2px solid rgba(0, 0, 0, 0.12);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: transform 0.12s;
}
.swatch.sel { transform: scale(1.25); border-color: var(--ink); }

.brush-row { display: flex; gap: 10px; align-items: center; }
.brush {
  border: 2px solid #eadcff;
  background: #fff;
  border-radius: 12px;
  width: 46px;
  height: 42px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink);
}
.brush.sel { border-color: var(--fuchsia); background: #ffe4f3; }
.tool-mini {
  border: 2px solid #eadcff;
  background: #fff;
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 380px;
}
.memory-card {
  border: 0;
  aspect-ratio: 1;
  border-radius: 16px;
  background: var(--grad-main);
  font-size: 30px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s;
}
.memory-card .face { visibility: hidden; }
.memory-card.open, .memory-card.matched { background: #fff; transform: rotateY(180deg); }
.memory-card.open .face, .memory-card.matched .face { visibility: visible; display: inline-block; transform: rotateY(180deg); }
.memory-card.matched { opacity: 0.6; }

.pad-row { display: flex; gap: 10px; justify-content: center; }
.pad-btn {
  border: 0;
  background: #fff;
  border-radius: 14px;
  width: 56px;
  height: 48px;
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}
.pad-btn:active { transform: scale(0.9); }

.simon-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  max-width: 320px;
}
.simon-pad {
  border: 0;
  aspect-ratio: 1;
  border-radius: 22px;
  opacity: 0.45;
  cursor: pointer;
  transition: opacity 0.1s, transform 0.1s;
}
.simon-pad.lit { opacity: 1; transform: scale(1.05); box-shadow: 0 0 24px rgba(0, 0, 0, 0.25); }
.simon-pad:active { opacity: 1; }

.quiz-levels { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.quiz-q {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  font-size: 19px;
  font-weight: 800;
  text-align: center;
  width: 100%;
  box-shadow: var(--shadow-soft);
}
.quiz-opts { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.quiz-opt {
  border: 2px solid #eadcff;
  background: #fff;
  border-radius: 16px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  color: var(--ink);
}
.quiz-opt.good { background: #dcfce7; border-color: #22c55e; }
.quiz-opt.bad { background: #fee2e2; border-color: #ef4444; }
.quiz-result { text-align: center; width: 100%; }
.quiz-score {
  font-size: 52px;
  font-weight: 800;
  background: var(--grad-main);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.react-del { background: #fee2e2 !important; }

/* ===== V4 : boutique + nouveaux jeux ===== */
.rate-hint { color: var(--ink-soft); font-weight: 700; text-transform: none; letter-spacing: 0; }
.points-chip small { font-weight: 700; opacity: 0.9; }

.reward-card {
  background: #fff;
  border-radius: 18px;
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-soft);
  animation: pop-in 0.25s ease;
}
.reward-card.done { opacity: 0.75; }
.reward-img {
  width: 72px;
  height: 72px;
  border-radius: 14px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f6efff;
}
.reward-img.ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.reward-actions { margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.reward-progress { width: 100%; max-width: 210px; }
.reward-bar {
  height: 8px;
  background: #f0e9fb;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 3px;
}
.reward-bar i { display: block; height: 100%; background: var(--grad-gold); border-radius: 999px; }
.order-link, .link-mini { text-decoration: none; }
.link-mini { color: var(--fuchsia); font-weight: 700; font-size: 13px; }
.cost-preview { align-self: center; font-weight: 800; color: var(--violet); white-space: nowrap; }

/* Pendu */
.pendu-face { font-size: 56px; }
.pendu-word { font-size: 26px; font-weight: 800; letter-spacing: 6px; text-align: center; word-break: break-all; }
.pendu-kb { display: flex; flex-direction: column; gap: 6px; align-items: center; width: 100%; }
.pendu-row { display: flex; gap: 5px; justify-content: center; }
.pendu-key {
  border: 0;
  background: #fff;
  border-radius: 10px;
  width: 34px;
  height: 40px;
  font-weight: 800;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  color: var(--ink);
}
.pendu-key:disabled { opacity: 0.45; }
.pendu-key.good { background: #dcfce7; }
.pendu-key.bad { background: #fee2e2; }

/* Puissance 4 */
.p4-board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  background: var(--grad-main);
  padding: 10px;
  border-radius: 18px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-pop);
}
.p4-cell {
  border: 0;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: background 0.15s;
}
.p4-cell.red { background: radial-gradient(circle at 35% 35%, #f87171, #dc2626); }
.p4-cell.yellow { background: radial-gradient(circle at 35% 35%, #fde047, #f59e0b); }
.sel-mode { border-color: var(--fuchsia) !important; background: #ffe4f3 !important; }

/* ===== V10 : correctifs issus de la critique design ===== */
@media (min-width: 700px) {
  .chat {
    max-width: 540px;
    margin: 0 auto;
    box-shadow: 0 0 50px rgba(139, 92, 246, 0.22);
  }
}

.bubble .time { font-size: 11px; }

.points-chip { color: #633806; }
.points-chip small { color: #633806; }

.react-trigger {
  opacity: 0.55;
  font-size: 18px;
  padding: 8px;
  min-width: 40px;
  min-height: 40px;
}
.react-chip { padding: 5px 10px; font-size: 14px; min-height: 30px; }
.game-sub { font-size: 12.5px; }

.empty-card {
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  text-align: center;
  color: var(--ink-soft);
  font-weight: 600;
  line-height: 1.6;
  box-shadow: var(--shadow-soft);
}

/* ===== V11 : exercices + 2048 + réflexe ===== */
.game-card[data-game="exos"] {
  grid-column: 1 / -1;
  border: 2px solid var(--gold);
  border-bottom-width: 4px;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
}
.game-stat small { font-weight: 600; color: var(--ink-soft); }

.g2048-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  background: var(--grad-main);
  padding: 10px;
  border-radius: 18px;
  width: 100%;
  max-width: 340px;
  box-shadow: var(--shadow-pop);
  touch-action: none;
}
.t2048 {
  aspect-ratio: 1;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 22px;
  color: var(--ink);
}
.t2048.v2 { background: #fff7ed; }
.t2048.v4 { background: #ffedd5; }
.t2048.v8 { background: #fed7aa; }
.t2048.v16 { background: #fdba74; color: #7c2d12; }
.t2048.v32 { background: #fb923c; color: #fff; }
.t2048.v64 { background: #f97316; color: #fff; }
.t2048.v128 { background: #ec4899; color: #fff; font-size: 19px; }
.t2048.v256 { background: #d946ef; color: #fff; font-size: 19px; }
.t2048.v512 { background: #a855f7; color: #fff; font-size: 19px; }
.t2048.v1024 { background: #8b5cf6; color: #fff; font-size: 16px; }
.t2048.v2048, .t2048.vmax { background: #fbbf24; color: #713f12; font-size: 16px; }

.reflex-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 320px;
}
.reflex-cell {
  border: 0;
  aspect-ratio: 1;
  border-radius: 18px;
  background: #fff;
  font-size: 36px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}
.reflex-cell:active { transform: scale(0.94); }

/* ===== V12 : Touché-Coulé + Sudoku ===== */
@keyframes boom-anim {
  0% { transform: scale(0.3); background: #fef08a; }
  40% { transform: scale(1.5) rotate(8deg); background: #f97316; }
  100% { transform: scale(1); }
}
@keyframes splash-anim {
  0% { transform: scale(0.4); background: #bae6fd; }
  50% { transform: scale(1.25); background: #7dd3fc; }
  100% { transform: scale(1); }
}
@keyframes wave {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}

.bs-status.my-turn { color: #16a34a; animation: heartbeat 1.6s infinite; }
.bs-label { font-size: 12.5px; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; }

.bs-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  padding: 6px;
  border-radius: 14px;
  width: 100%;
  box-shadow: var(--shadow-soft);
  animation: wave 3.5s ease-in-out infinite;
}
.bs-grid.bs-enemy { max-width: 380px; }
.bs-grid.bs-mine { max-width: 260px; opacity: 0.95; }
.bs-grid.bs-place { max-width: 340px; }
.bs-enemy.active { box-shadow: 0 0 0 3px #4ade80, var(--shadow-pop); }

.bs-cell {
  border: 0;
  aspect-ratio: 1;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  padding: 0;
}
.bs-enemy.active .bs-cell:not(.hit):not(.miss):active { background: rgba(255, 255, 255, 0.55); }
.bs-cell.ship { background: #475569; box-shadow: inset 0 0 0 2px #94a3b8; }
.bs-cell.hit { background: #dc2626; }
.bs-cell.ship.hit { background: #7f1d1d; }
.bs-cell.miss { background: rgba(255, 255, 255, 0.1); font-size: 18px; }
.bs-cell.boom { animation: boom-anim 0.6s ease; }
.bs-cell.splash { animation: splash-anim 0.6s ease; }

/* Sudoku */
.sk-grid {
  display: grid;
  gap: 2px;
  background: var(--ink);
  padding: 4px;
  border-radius: 12px;
  width: 100%;
  box-shadow: var(--shadow-soft);
}
.sk-grid.sk-9 { grid-template-columns: repeat(9, 1fr); max-width: 400px; }
.sk-grid.sk-4 { grid-template-columns: repeat(4, 1fr); max-width: 260px; }
.sk-cell {
  border: 0;
  aspect-ratio: 1;
  background: #fff;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  color: var(--violet);
  cursor: pointer;
  border-radius: 4px;
  padding: 0;
}
.sk-4 .sk-cell { font-size: 24px; }
.sk-cell.alt { background: #f6efff; }
.sk-cell.given { color: var(--ink); font-weight: 800; cursor: default; }
.sk-cell.sel { outline: 3px solid var(--fuchsia); outline-offset: -3px; }
.sk-cell.bad { background: #fee2e2; color: #dc2626; }

.sk-pad { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.sk-num {
  border: 0;
  background: #fff;
  border-radius: 12px;
  width: 42px;
  height: 46px;
  font-family: inherit;
  font-size: 19px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  box-shadow: var(--shadow-soft);
}
.sk-num:active { transform: scale(0.92); background: #f6efff; }
.sk-erase { color: #dc2626; }

/* ===== V13 : duels + liste de courses ===== */
.sub-tabs {
  display: flex;
  gap: 8px;
  background: #f6efff;
  border-radius: 16px;
  padding: 4px;
  margin-bottom: 14px;
}
.sub-tab {
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 10px;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  color: var(--violet);
  cursor: pointer;
}
.sub-tab.active { background: var(--grad-main); color: #fff; box-shadow: var(--shadow-pop); }

.shop-row {
  background: #fff;
  border-radius: 16px;
  padding: 8px 10px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-soft);
  animation: pop-in 0.2s ease;
}
.shop-row.done { opacity: 0.6; }
.shop-row.done .shop-label { text-decoration: line-through; }
.shop-check {
  border: 0;
  background: none;
  font-size: 24px;
  cursor: pointer;
  padding: 6px;
}
.shop-label { flex: 1; font-weight: 700; word-break: break-word; }

.ttt-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 320px;
}
.ttt-cell {
  border: 0;
  aspect-ratio: 1;
  border-radius: 20px;
  background: #fff;
  font-size: 44px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  transition: transform 0.12s;
}
.ttt-cell:active { transform: scale(0.93); }

/* ===== V14 : appels vidéo ===== */
.call-screen {
  position: fixed;
  inset: 0;
  background: #14101f;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
#call-remote {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #14101f;
}
#call-local {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  right: 14px;
  width: 110px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: #000;
  z-index: 2;
}
.call-top {
  position: absolute;
  top: max(20px, env(safe-area-inset-top));
  left: 0;
  right: 0;
  text-align: center;
  z-index: 2;
  pointer-events: none;
}
#call-status {
  display: inline-block;
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  padding: 8px 18px;
}
#call-status:empty { display: none; }
.call-actions {
  position: absolute;
  bottom: max(30px, env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 26px;
  z-index: 2;
}
.call-round {
  border: 0;
  width: 66px;
  height: 66px;
  border-radius: 50%;
  font-size: 26px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(8px);
  color: #fff;
  transition: transform 0.15s;
}
.call-round:active { transform: scale(0.88); }
.call-round.accept { background: #16a34a; animation: heartbeat 1.4s infinite; }
.call-round.hangup { background: #dc2626; }
#callpick-items { display: flex; flex-direction: column; gap: 10px; }

/* ===== V15-16 : album, visite guidée, découverte ===== */
.album-sheet { max-width: 560px; }
.album-month { margin-bottom: 18px; }
.album-month-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.album-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
}
.album-thumb {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  cursor: pointer;
  background: #f6efff;
  max-width: none;
  max-height: none;
  min-height: 0;
  min-width: 0;
}

.tour { align-items: center !important; }
.tour-card { text-align: center; max-width: 340px; }
.tour-emoji { font-size: 60px; animation: float 3s ease-in-out infinite; display: inline-block; }
.tour-title { font-size: 22px; font-weight: 800; color: var(--ink); margin: 8px 0 6px; }
.tour-text { color: var(--ink-soft); font-weight: 600; line-height: 1.5; margin-bottom: 14px; }
.tour-dots { display: flex; gap: 7px; justify-content: center; margin-bottom: 14px; }
.tour-dot { width: 9px; height: 9px; border-radius: 50%; background: #eadcff; }
.tour-dot.on { background: var(--fuchsia); }

.discover-link { max-width: 390px; text-align: center; display: block; }
.key-btn {
  border: 0;
  background: #f6efff;
  border-radius: 10px;
  padding: 6px 9px;
  font-size: 14px;
  cursor: pointer;
  margin-left: 6px;
}

/* ===== Avis ===== */
.mood-row { display: flex; gap: 8px; margin-bottom: 10px; }
.mood-btn {
  flex: 1;
  border: 2px solid #eadcff;
  background: #fff;
  border-radius: 14px;
  padding: 10px 4px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.mood-btn.sel-mood { border-color: var(--fuchsia); background: #ffe4f3; }

/* ===== V18 : reprise, navires, nouveaux duels ===== */
.resume-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 12px 0;
  animation: pop-in 0.3s ease;
}
.resume-btn {
  flex: 1;
  min-width: 46%;
  border: 0;
  border-radius: 16px;
  padding: 11px 12px;
  font-size: 13.5px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  background: #eef2ff;
  color: #3730a3;
  box-shadow: var(--shadow-soft);
}
.resume-btn.myturn { background: var(--grad-mint); color: #fff; animation: heartbeat 1.8s infinite; }

/* Navires « militaires » */
.bs-grid {
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.05) 0 10px, transparent 10px 20px),
    linear-gradient(160deg, #0ea5e9, #1d4ed8) !important;
}
.bs-cell.ship {
  background: linear-gradient(160deg, #9ca3af, #4b5563) !important;
  box-shadow: inset 0 2px 3px rgba(255,255,255,.35), inset 0 -2px 3px rgba(0,0,0,.3);
}
.bs-cell.sh-h.sh-bow { border-top-left-radius: 65%; border-bottom-left-radius: 65%; }
.bs-cell.sh-h.sh-stern { border-top-right-radius: 28%; border-bottom-right-radius: 28%; }
.bs-cell.sh-v.sh-bow { border-top-left-radius: 65%; border-top-right-radius: 65%; }
.bs-cell.sh-v.sh-stern { border-bottom-left-radius: 28%; border-bottom-right-radius: 28%; }
.bs-cell.sh-solo { border-radius: 45%; }
.bs-cell.sh-mid::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 42%; height: 42%;
  border-radius: 3px;
  background: #6b7280;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.4);
}
.bs-cell { position: relative; }
.bs-cell.ship.hit {
  background: linear-gradient(160deg, #f87171, #991b1b) !important;
  box-shadow: inset 0 0 8px rgba(0,0,0,.5);
}
.bs-cell.miss { color: rgba(255,255,255,.7); }

/* Duel de dés */
.dice-row { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 6px 0; min-height: 46px; }
.die { font-size: 40px; line-height: 1; }
.dice-who { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.dice-scores { display: flex; gap: 12px; justify-content: center; margin: 8px 0; }
.dice-score {
  background: #fff; border-radius: 16px; padding: 10px 18px; text-align: center;
  font-size: 22px; font-weight: 800; color: var(--violet); box-shadow: var(--shadow-soft);
}
.dice-score b { font-size: 13px; color: var(--ink); }
.dice-score small { font-size: 11px; color: var(--ink-soft); }
.p4-duel { max-width: 340px; }

/* ===== V19 : Cherche et trouve ===== */
.ho-top { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-bottom: 6px; }
.ho-lvl { font-weight: 800; color: var(--ink); font-size: 15px; }
.ho-timer { font-weight: 800; color: #dc2626; font-size: 18px; }
.ho-bar { width: 100%; height: 8px; background: #eadcff; border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.ho-bar i { display: block; height: 100%; background: var(--grad-warm); border-radius: 999px; transition: width 1s linear; }

.ho-scene {
  position: relative;
  width: 100%;
  height: 56dvh;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  touch-action: manipulation;
}
.theme-plage { background: linear-gradient(#7dd3fc 0%, #38bdf8 38%, #fde68a 60%, #fcd34d 100%); }
.theme-cuisine { background: linear-gradient(#fde68a, #fca5a5 55%, #f9a8d4); }
.theme-chambre { background: linear-gradient(#c4b5fd, #a5b4fc 55%, #bae6fd); }
.theme-jardin { background: linear-gradient(#bef264, #86efac 50%, #4ade80); }
.theme-ville { background: linear-gradient(#93c5fd, #cbd5e1 55%, #94a3b8); }
.theme-espace { background: radial-gradient(circle at 30% 20%, #4c1d95, #1e1b4b 60%, #0f0a2e); }
.theme-foret { background: linear-gradient(#86efac, #4d7c0f 60%, #365314); }
.theme-ferme { background: linear-gradient(#7dd3fc, #a3e635 55%, #84cc16); }
.theme-espace .ho-decor, .theme-foret .ho-decor { opacity: 0.3; }

.ho-decor {
  position: absolute;
  font-size: clamp(48px, 16vh, 120px);
  opacity: 0.22;
  pointer-events: none;
  user-select: none;
}

.ho-svg { width: 100%; height: 100%; display: block; }
.ho-front { pointer-events: none; }
.ho-obj { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.ho-obj text { paint-order: stroke; }
.ho-inner { transform-box: fill-box; transform-origin: center; }
.ho-obj.ho-found { pointer-events: none; }
.ho-obj.ho-found .ho-inner { animation: ho-pop-svg 0.55s ease forwards; }
@keyframes ho-pop-svg {
  0% { transform: scale(1); }
  35% { transform: scale(1.55); }
  100% { transform: scale(0); opacity: 0; }
}
.ho-obj.ho-wrong .ho-inner { animation: ho-shake-svg 0.42s; }
@keyframes ho-shake-svg {
  0%,100% { transform: rotate(0); }
  25% { transform: rotate(-12deg); }
  75% { transform: rotate(12deg); }
}
.ho-obj.ho-pulse .ho-inner { animation: ho-pulse-svg 0.62s ease-in-out 3; }
@keyframes ho-pulse-svg {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.4); }
}

.ho-list { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin: 10px 0; }
.ho-chip {
  background: #fff;
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  border: 2px solid transparent;
}
.ho-chip.done { background: #dcfce7; color: #15803d; border-color: #22c55e; text-decoration: line-through; }
.ho-hint-btn { width: 100%; }

.ho-end { text-align: center; padding: 10px; }
.ho-end-emo { font-size: 64px; animation: ho-pulse 1.4s ease-in-out infinite; }

/* ===== V19 : Touché-Coulé style « plan » (blueprint) ===== */
#game-body { position: relative; }
.bs-grid {
  background: linear-gradient(160deg, #0c3057, #081a35) !important;
  gap: 2px !important;
}
.bs-cell {
  background: rgba(13, 42, 74, 0.5) !important;
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.28);
  color: #e0f2fe;
}
.bs-grid.bs-enemy.active .bs-cell:not(.hit):not(.miss):not(.sunk):active {
  background: rgba(125, 211, 252, 0.4) !important;
}
/* Navires : trait blanc façon plan */
.bs-cell.ship {
  background: rgba(255, 255, 255, 0.14) !important;
  box-shadow: inset 0 0 0 1.6px rgba(255, 255, 255, 0.92), 0 0 6px rgba(125, 211, 252, 0.3) !important;
}
.bs-cell.sh-mid::after { background: rgba(255, 255, 255, 0.6) !important; box-shadow: none; }
/* Impact au touché */
.bs-cell.hit {
  background: radial-gradient(circle, #fecaca, #dc2626) !important;
  box-shadow: inset 0 0 8px #7f1d1d !important;
}
@keyframes bs-impact { 0% { transform: scale(0.4); } 50% { transform: scale(1.55); filter: brightness(2); } 100% { transform: scale(1); } }
.bs-cell.boom { animation: bs-impact 0.5s ease; z-index: 3; }
.bs-cell.boom::after {
  content: ''; position: absolute; inset: -5px;
  border: 2px solid #fca5a5; border-radius: 50%;
  animation: bs-ring 0.65s ease-out;
}
.bs-cell.splash::after {
  content: ''; position: absolute; inset: -3px;
  border: 2px solid #7dd3fc; border-radius: 50%;
  animation: bs-ring 0.6s ease-out;
}
@keyframes bs-ring { from { transform: scale(0.3); opacity: 0.9; } to { transform: scale(2.6); opacity: 0; } }
/* Navire coulé */
@keyframes bs-sink {
  0% { transform: translateY(0) rotate(0); }
  35% { transform: translateY(0) rotate(-7deg); }
  100% { transform: translateY(4px) rotate(5deg); filter: brightness(0.55) saturate(1.6); }
}
.bs-cell.sunk {
  background: radial-gradient(circle, #ef4444, #7f1d1d) !important;
  box-shadow: inset 0 0 10px #000, 0 0 10px rgba(239, 68, 68, 0.7) !important;
  animation: bs-sink 0.8s ease forwards;
  z-index: 2;
}
/* Bannière « coulé » */
.bs-toast {
  position: absolute; left: 50%; top: 38%;
  transform: translate(-50%, -50%);
  background: rgba(10, 25, 45, 0.93); color: #fff;
  font-weight: 800; font-size: 16px;
  padding: 12px 22px; border-radius: 16px;
  border: 2px solid #7dd3fc;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.5);
  z-index: 40; pointer-events: none;
  animation: bs-toast-in 0.3s ease, bs-toast-out 0.4s ease 2.1s forwards;
}
@keyframes bs-toast-in { from { opacity: 0; transform: translate(-50%, -35%) scale(0.8); } to { opacity: 1; } }
@keyframes bs-toast-out { to { opacity: 0; transform: translate(-50%, -62%); } }
.bs-status.my-turn { color: #16a34a; }
.bs-label { color: var(--ink-soft); }

/* ===== Arcade (runner, ninja, tetris, piano) ===== */
.arc-canvas {
  width: 100%;
  max-width: 340px;
  display: block;
  margin: 4px auto;
  border-radius: 16px;
  background: #0b1020;
  touch-action: none;
  box-shadow: var(--shadow-soft);
}
.candy-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  max-width: 360px;
  margin: 0 auto;
}
.candy-cell {
  border: 0;
  aspect-ratio: 1;
  border-radius: 10px;
  background: #fff;
  font-size: 22px;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  padding: 0;
}
.candy-cell:active { transform: scale(0.9); }

/* Chargement de l'historique du chat (défilement vers le haut) */
.history-loading {
  text-align: center;
  padding: 10px 0 14px;
  font-size: .85rem;
  color: var(--muted, #8b7a95);
  opacity: .85;
}

/* Bandeau de mise a jour (nouvelle version du site disponible) */
.update-bar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 24px);
  padding: 10px 12px 10px 16px;
  border-radius: 999px;
  background: var(--grad-main);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-pop);
  animation: pop-in 0.3s ease;
}
.update-bar button {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: #fff;
  color: #7c3aed;
  font-family: inherit;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}
