/* =========================================================================
   CAMO — thème "party game" (Gartic Phone / skribbl.io vibe)
   PALETTE (5 couleurs tenues partout) :
     coral  #FF5C8A   grape #7C5CFF   sky #35B6FF   lime #37D9A0   sun #FFC24B
   Fond crème chaud, encre prune, cartes blanches, coins ronds, ombres douces.
   ========================================================================= */
:root {
  --coral: #FF5C8A;
  --grape: #7C5CFF;
  --sky:   #35B6FF;
  --lime:  #37D9A0;
  --sun:   #FFC24B;

  --ink:      #3B2E52;   /* texte principal */
  --ink-soft: #7C7191;   /* texte secondaire */
  --card:     #FFFFFF;
  --line:     #EFE7F5;

  --bg1: #FFF4E8;        /* crème */
  --bg2: #FFE7F1;        /* rose poudré */
  --bg3: #EAF3FF;        /* bleu très clair */

  --r-lg: 28px;
  --r-md: 18px;
  --r-sm: 13px;
  --shadow-card: 0 14px 34px rgba(93, 61, 120, 0.13);
  --shadow-soft: 0 6px 16px rgba(93, 61, 120, 0.14);
  --ease: cubic-bezier(.34, 1.36, .5, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 700px at 12% -8%, var(--bg2), transparent 60%),
    radial-gradient(1100px 800px at 100% 0%, var(--bg3), transparent 55%),
    linear-gradient(160deg, var(--bg1), #FFF9F0 60%, var(--bg2));
  background-attachment: fixed;
}

/* Bulles décoratives en fond */
.blobs { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(6px); opacity: .28; }
.b1 { width: 240px; height: 240px; background: var(--coral); top: 8%; right: 6%; }
.b2 { width: 180px; height: 180px; background: var(--sky);  bottom: 12%; left: 4%; }
.b3 { width: 140px; height: 140px; background: var(--sun);  top: 40%; left: 46%; opacity:.18; }
.b4 { width: 200px; height: 200px; background: var(--lime); bottom: 4%; right: 18%; opacity:.2; }

/* ---------------- HEADER ---------------- */
.hero {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 22px 34px 10px;
}
.hero-logo { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.hero-emoji {
  width: 56px; height: 56px; display: block;
  border-radius: 18px; box-shadow: var(--shadow-soft);
  transform: rotate(-6deg);
}
.hero-brand {
  font-family: "Fredoka", sans-serif; font-weight: 700;
  font-size: 30px; line-height: 1; letter-spacing: .3px;
  background: linear-gradient(100deg, var(--coral), var(--grape) 55%, var(--sky));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-tag {
  font-family: "Fredoka", sans-serif; font-weight: 500; font-size: 13px;
  color: var(--grape); background: #fff; padding: 8px 14px;
  border-radius: 999px; box-shadow: var(--shadow-soft);
}

/* ===================== LANDING (page d'accueil SEO) ===================== */
#overlay { display: none; }                       /* le jeu n'apparaît qu'une fois lancé */
body.playing #overlay { display: block; }
body.playing #landing { display: none; }
body:not(.playing) #app-paint { display: none !important; }
body:not(.playing) #chatDock { display: none !important; }   /* chat seulement en jeu */

.land-hero {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 36px; align-items: center;
  max-width: 1080px; margin: 0 auto; padding: 18px 34px 44px;
}
.land-hero-txt h1 {
  font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 44px; line-height: 1.04; margin: 0 0 14px;
  background: linear-gradient(100deg, var(--coral), var(--grape) 58%, var(--sky));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.land-lead { font-family: "Nunito", sans-serif; font-weight: 700; font-size: 17px; line-height: 1.5; color: var(--ink-soft); margin: 0 0 22px; max-width: 520px; }
.land-actions { display: flex; flex-direction: column; gap: 11px; max-width: 430px; }
.land-pseudo { display: flex; flex-direction: column; gap: 6px; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 13px; color: var(--ink-soft); }
.land-pseudo input, .land-join input {
  font-family: "Fredoka", sans-serif; font-weight: 500; font-size: 15px; color: var(--ink);
  padding: 12px 15px; border: 2px solid var(--line); border-radius: 13px; background: #fff; transition: border-color .14s;
}
.land-pseudo input:focus, .land-join input:focus { outline: none; border-color: var(--grape); }
.land-create { width: 100%; }
.land-join { display: flex; gap: 8px; }
.land-join input { flex: 1; text-align: center; font-weight: 700; font-size: 18px; letter-spacing: .16em; text-transform: uppercase; }
.land-join .candy { flex: 0 0 auto; }
.land-err { min-height: 18px; margin: 0; color: var(--coral); font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 13px; }
.land-noacc { margin: 2px 0 0; font-family: "Nunito", sans-serif; font-weight: 700; font-size: 12.5px; color: var(--ink-soft); }

.land-hero-visual { display: flex; justify-content: center; }
.lhv-frame { position: relative; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-card); border: 5px solid #fff; transform: rotate(2deg); max-width: 480px; }
.lhv-frame img { display: block; width: 100%; height: auto; }
.lhv-badge { position: absolute; left: 14px; bottom: 14px; background: rgba(20,16,36,.82); color: #fff; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px; padding: 8px 14px; border-radius: 999px; }

.land-sec { position: relative; z-index: 1; max-width: 940px; margin: 0 auto; padding: 44px 34px; }
.land-sec h2 { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 29px; color: var(--ink); text-align: center; margin: 0 0 26px; }

/* "Comment jouer" = parcours en 3 étapes dans un panneau blanc (numéros + flèches) */
.land-how { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow-card); margin: 30px auto; }
.land-steps { display: flex; gap: 4px; align-items: flex-start; }
.land-step { flex: 1; position: relative; text-align: center; padding: 6px 16px; }
.land-step:not(:last-child)::after { content: '→'; position: absolute; top: 28px; right: -8px; color: var(--grape); font-size: 22px; font-weight: 700; opacity: .4; }
.ls-num { width: 48px; height: 48px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 22px; color: #fff; background: linear-gradient(140deg, var(--grape), var(--sky)); box-shadow: var(--shadow-soft); }
.ls-emo { font-size: 27px; line-height: 1; display: block; margin-top: 12px; }
.land-step h3 { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 16.5px; color: var(--ink); margin: 8px 0 6px; }
.land-step p { font-family: "Nunito", sans-serif; font-weight: 600; font-size: 13.5px; color: var(--ink-soft); line-height: 1.45; margin: 0; }
.land-concept p { font-family: "Nunito", sans-serif; font-weight: 700; font-size: 16px; line-height: 1.6; color: var(--ink-soft); text-align: center; max-width: 720px; margin: 0 auto; }
.faq-list { display: flex; flex-direction: column; gap: 10px; max-width: 680px; margin: 0 auto; }
.faq-list details { background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow-soft); overflow: hidden; }
.faq-list summary { cursor: pointer; padding: 15px 18px; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 15.5px; color: var(--ink); list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; float: right; color: var(--grape); font-weight: 700; }
.faq-list details[open] summary::after { content: '−'; }
.faq-list details p { margin: 0; padding: 0 18px 16px; font-family: "Nunito", sans-serif; font-weight: 600; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }

.land-footer { position: relative; z-index: 1; text-align: center; padding: 30px 34px 40px; border-top: 1px solid var(--line); margin-top: 20px; }
.lf-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.lf-links a { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 13.5px; color: var(--grape); text-decoration: none; }
.lf-links a:hover { text-decoration: underline; }
.lf-copy { font-family: "Nunito", sans-serif; font-weight: 700; font-size: 12.5px; color: var(--ink-soft); }

/* ===== PAGE 404 ===== */
.notfound { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; padding: 46px 34px 90px; text-align: center; min-height: 46vh; }
.nf-code { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 96px; line-height: 1; background: linear-gradient(100deg, var(--coral), var(--grape) 55%, var(--sky)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.notfound h1 { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 28px; color: var(--ink); margin: 6px 0 10px; }
.nf-sub { font-family: "Nunito", sans-serif; font-weight: 700; font-size: 16px; color: var(--ink-soft); margin: 0 0 26px; }
.nf-actions { display: flex; flex-direction: column; gap: 12px; max-width: 400px; margin: 0 auto; }
.nf-actions .candy { width: 100%; box-sizing: border-box; }
.nf-hint { font-family: "Nunito", sans-serif; font-weight: 700; font-size: 13px; color: var(--ink-soft); margin: 26px 0 0; opacity: .85; }
#nfLio { position: fixed; opacity: .12; cursor: pointer; z-index: 5; transition: opacity .2s; }
#nfLio:hover { opacity: .22; }
.nf-found { position: fixed; top: 40%; left: 50%; transform: translate(-50%,-50%); z-index: 60; font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 30px; color: #fff; background: linear-gradient(100deg, var(--coral), var(--grape)); padding: 10px 24px; border-radius: 999px; box-shadow: var(--shadow-card); animation: missPop .5s var(--ease) both; }
.confetti { position: fixed; width: 9px; height: 9px; border-radius: 2px; z-index: 55; pointer-events: none; animation: confettiFly 1.5s ease-out forwards; }
@keyframes confettiFly { 0% { opacity: 1; transform: translate(0,0) rotate(0); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); } }

/* ===== "Le site qui vit" ===== */
/* micro-rebond des gros boutons au survol */
@keyframes candyBounce { 0%{transform:translateY(0)} 35%{transform:translateY(-4px)} 70%{transform:translateY(-1px)} 100%{transform:translateY(-2px)} }
.candy.big:hover { animation: candyBounce .32s var(--ease); }

/* ===== BANNIÈRE COOKIES ===== */
.cookie-banner {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  z-index: 100; width: min(720px, calc(100% - 24px));
  background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-card);
  padding: 14px 18px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  animation: tipIn .3s var(--ease);
}
.ck-txt { flex: 1; min-width: 220px; font-family: "Nunito", sans-serif; font-weight: 700; font-size: 13.5px; color: var(--ink); line-height: 1.4; }
.ck-txt b { color: var(--grape); }
.ck-btns { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.ck-link { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 13px; color: var(--ink-soft); text-decoration: none; }
.ck-link:hover { color: var(--grape); text-decoration: underline; }
.ck-b { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 13.5px; padding: 9px 16px; border-radius: 999px; cursor: pointer; border: none; }
.ck-refuse { background: #fff; color: var(--ink-soft); border: 2px solid var(--line); }
.ck-accept { background: var(--lime); color: #08402e; box-shadow: 0 3px 0 #21b585; }
.ck-accept:hover { filter: brightness(1.03); }
@media (max-width: 560px) { .ck-btns { width: 100%; justify-content: flex-end; margin-left: 0; } }

/* ===== PAGES LÉGALES ===== */
.legal { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; padding: 14px 34px 60px; }
.legal-back { display: inline-block; margin-bottom: 6px; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px; color: var(--grape); text-decoration: none; }
.legal-back:hover { text-decoration: underline; }
.legal h1 { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 34px; color: var(--ink); margin: 8px 0 4px; }
.legal-upd { font-family: "Nunito", sans-serif; font-weight: 700; font-size: 13px; color: var(--ink-soft); margin: 0 0 22px; }
.legal h2 { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 20px; color: var(--ink); margin: 28px 0 10px; }
.legal p, .legal li { font-family: "Nunito", sans-serif; font-weight: 600; font-size: 15px; line-height: 1.6; color: var(--ink); }
.legal ul { padding-left: 20px; }
.legal a { color: var(--grape); }
.legal .todo { background: #FFF7E6; border-radius: 8px; padding: 2px 8px; color: #7a4d00; font-weight: 800; }
.legal .btn-cookies { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 14px; padding: 10px 18px; border-radius: 999px; border: 2px solid var(--grape); background: #fff; color: var(--grape); cursor: pointer; }
.legal .btn-cookies:hover { background: var(--grape); color: #fff; }

/* nav du header */
.hero-nav { display: flex; align-items: center; gap: 20px; }
.hero-nav a { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px; color: var(--ink-soft); text-decoration: none; transition: color .14s; }
.hero-nav a:hover { color: var(--grape); }
body.playing .hero-nav a[href^="#"] { display: none; }   /* ancres inutiles en jeu */

/* badges de confiance sous le hero */
.land-badges { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 0; padding: 0; }
.land-badges li {
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 12.5px; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 12px; box-shadow: var(--shadow-soft);
}

/* visuel du hero (canvas Lio camouflé) */
.lhv-frame canvas { display: block; width: 100%; height: auto; }

/* atouts : icônes colorées (pas de carte pleine → visuellement distinct des étapes) */
.feat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.feat { text-align: center; padding: 4px; }
.feat-emo { width: 66px; height: 66px; margin: 0 auto 12px; border-radius: 20px; display: grid; place-items: center; font-size: 30px; box-shadow: var(--shadow-soft); }
.feat:nth-child(1) .feat-emo { background: #FFE1EC; }
.feat:nth-child(2) .feat-emo { background: #EDE7FF; }
.feat:nth-child(3) .feat-emo { background: #E1F0FF; }
.feat:nth-child(4) .feat-emo { background: #DFF7EE; }
.feat h3 { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 16px; color: var(--ink); margin: 0 0 5px; }
.feat p { font-family: "Nunito", sans-serif; font-weight: 600; font-size: 13px; color: var(--ink-soft); line-height: 1.45; margin: 0; }

.land-concept p { margin-bottom: 12px; }
.land-concept strong { color: var(--ink); }

/* CTA final : bande colorée qui pop */
.land-cta { position: relative; z-index: 1; text-align: center; max-width: 940px; margin: 30px auto 10px; padding: 48px 34px; border-radius: var(--r-lg); background: linear-gradient(120deg, var(--grape), var(--coral)); box-shadow: var(--shadow-card); }
.land-cta h2 { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 31px; color: #fff; margin: 0 0 8px; }
.land-cta p { font-family: "Nunito", sans-serif; font-weight: 700; font-size: 16px; color: rgba(255,255,255,.92); margin: 0 0 22px; }

@media (max-width: 820px) {
  .land-hero { grid-template-columns: 1fr; gap: 24px; padding-top: 8px; }
  .land-hero-visual { order: -1; }
  .land-steps { flex-direction: column; gap: 22px; }
  .land-step:not(:last-child)::after { content: '↓'; top: auto; bottom: -16px; right: 50%; transform: translateX(50%); }
  .feat-grid { grid-template-columns: 1fr 1fr; }
  .land-hero-txt h1 { font-size: 33px; }
  .hero-nav a[href^="#"] { display: none; }   /* nav ancres cachée sur mobile */
}

/* ---------------- LAYOUT ---------------- */
.board {
  position: relative; z-index: 1;
  display: flex; gap: 26px; align-items: flex-start;
  padding: 14px 34px 40px;
}
.dock { width: 320px; flex: 0 0 320px; display: flex; flex-direction: column; gap: 18px; }
.stage { flex: 1; min-width: 0; position: sticky; top: 14px; }

/* ---------------- ONGLETS DU DOCK ---------------- */
.dock-tabs {
  display: flex; gap: 6px;
  background: var(--card); padding: 6px; border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}
.dock-tab {
  flex: 1; border: none; cursor: pointer;
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 15px;
  padding: 11px 8px; border-radius: 14px;
  background: transparent; color: var(--ink-soft);
  transition: background .15s, color .15s, transform .1s;
}
.dock-tab:hover:not(:disabled):not(.active) { background: rgba(124,92,255,.09); color: var(--ink); }
.dock-tab.active { background: linear-gradient(100deg, var(--grape), var(--sky)); color: #fff; box-shadow: var(--shadow-soft); }
.dock-tab:disabled { opacity: .45; cursor: not-allowed; }
.tab-panel { display: flex; flex-direction: column; gap: 18px; }
.tab-panel[hidden] { display: none; }   /* l'attribut hidden doit primer sur display:flex */

/* Bouton d'export centré SOUS le canvas */
.stage-actions { display: flex; justify-content: center; margin-top: 14px; }

/* ---------------- CARTES ---------------- */
.card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 18px 18px 20px;
  box-shadow: var(--shadow-card);
}
.card h2 {
  font-family: "Fredoka", sans-serif; font-weight: 600;
  font-size: 18px; margin: 0 0 6px;
  display: flex; align-items: center; gap: 8px;
}
.card h2 .ic { font-size: 20px; }
.hint { margin: 0 0 14px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.45; font-weight: 600; }
.lock-card { padding: 14px; }
.paint-card { padding: 18px; }

/* ---------------- BOUTONS "BONBON" ---------------- */
.candy {
  font-family: "Fredoka", sans-serif; font-weight: 600;
  font-size: 15px; color: #fff;
  border: none; border-radius: var(--r-md);
  padding: 13px 18px; cursor: pointer;
  box-shadow: 0 5px 0 rgba(0,0,0,.14), var(--shadow-soft);
  transition: transform .14s ease-out, box-shadow .14s ease-out, filter .14s ease-out;
  position: relative;
}
.candy::before {   /* reflet du dessus */
  content: ""; position: absolute; inset: 3px 3px auto 3px; height: 42%;
  border-radius: 14px 14px 20px 20px;
  background: linear-gradient(#ffffff70, #ffffff00);
  pointer-events: none;
}
.candy:hover { filter: brightness(1.05); transform: translateY(-1px); }
.candy:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.14), var(--shadow-soft); }
.candy:disabled { filter: grayscale(.5) brightness(1.05); opacity: .55; cursor: not-allowed; box-shadow: 0 5px 0 rgba(0,0,0,.1); }
.candy.full { width: 100%; }
.candy.big { font-size: 17px; padding: 16px 18px; }

.candy-coral { background: var(--coral); box-shadow: 0 5px 0 #d63e6c, var(--shadow-soft); }
.candy-grape { background: var(--grape); box-shadow: 0 5px 0 #5b3fd6, var(--shadow-soft); }
.candy-sky   { background: var(--sky);   box-shadow: 0 5px 0 #1f92d6, var(--shadow-soft); }
.candy-lime  { background: var(--lime);  box-shadow: 0 5px 0 #21b585, var(--shadow-soft); color: #08402e; }
.candy-sun   { background: var(--sun);   box-shadow: 0 5px 0 #e0a01f, var(--shadow-soft); color: #5b3d00; }
.candy-ghost {
  background: #fff; color: var(--ink);
  box-shadow: 0 3px 0 var(--line), var(--shadow-soft);
  border: 2px solid var(--line);
}
.candy-ghost:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--line), var(--shadow-soft); }
.kbd {
  font-family: "Fredoka", sans-serif; font-size: 11px; font-weight: 600;
  background: var(--line); color: var(--ink-soft);
  padding: 2px 7px; border-radius: 7px; margin-left: 4px;
}

/* ---------------- CHAMPS + SLIDERS CUSTOM ---------------- */
.field { margin: 12px 0; }
.field label {
  display: block; font-family: "Fredoka", sans-serif; font-weight: 500;
  font-size: 13.5px; color: var(--ink-soft); margin-bottom: 7px;
}
.field label b { color: var(--coral); font-weight: 700; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 14px; border-radius: 999px;
  background: linear-gradient(90deg, var(--coral), var(--grape));
  outline: none; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: #fff; border: 4px solid var(--grape);
  box-shadow: var(--shadow-soft);
  transition: transform .12s ease-out;
}
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; border: 4px solid var(--grape); box-shadow: var(--shadow-soft);
}
input[type="range"]:disabled { filter: grayscale(.6); opacity: .5; }

/* ---------------- PASTILLE DE COULEUR (élément central) ---------------- */
.swatch-wrap {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #FFF7FB, #F4F0FF);
  border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 14px;
}
.swatch {
  width: 58px; height: 58px; border-radius: 18px;
  background: #000; flex: 0 0 auto;
  border: 4px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.18), 0 0 0 2px var(--line);
  transition: transform .16s var(--ease);
}
.swatch-info { display: flex; flex-direction: column; gap: 2px; }
.swatch-title { font-family: "Fredoka", sans-serif; font-weight: 500; font-size: 12px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.swatch-label { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 19px; color: var(--ink); letter-spacing: .5px; }

/* ---------------- GRILLE D'OUTILS ---------------- */
.tool-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 6px; }
.tool {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px 7px;
  background: #fff; color: var(--ink-soft);
  border: 2px solid var(--line); border-radius: 15px;
  cursor: pointer;
  transition: transform .14s ease-out, border-color .14s, color .14s, background .14s, box-shadow .14s;
}
.tool .ico { width: 24px; height: 24px; }
.tool small { font-family: "Fredoka", sans-serif; font-weight: 500; font-size: 9.5px; }
.tool:hover { transform: translateY(-2px); border-color: var(--grape); color: var(--grape); box-shadow: var(--shadow-soft); }
.tool.active {
  background: linear-gradient(160deg, var(--grape), var(--coral));
  color: #fff; border-color: transparent;
  box-shadow: 0 6px 14px rgba(124, 92, 255, .38);
  transform: scale(1.06);
  animation: toolBounce .32s var(--ease);
}
.tool.active small { color: #fff; }

/* tooltip au survol */
.tool::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%) scale(.9);
  background: var(--ink); color: #fff; font-family: "Fredoka", sans-serif; font-weight: 500;
  font-size: 11px; white-space: nowrap; padding: 5px 9px; border-radius: 8px;
  opacity: 0; pointer-events: none; transition: opacity .14s ease, transform .14s ease; z-index: 5;
}
.tool:hover::after { opacity: 1; transform: translateX(-50%) scale(1); }

/* ---------------- VIGNETTES DE POSES ---------------- */
.pose-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-bottom: 14px; }
.pose-thumb {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 3px 5px;
  background: linear-gradient(180deg, #FFFDF8, #FFF2F7);
  border: 2px solid var(--line); border-radius: 15px;
  cursor: pointer;
  transition: transform .16s var(--ease), border-color .14s, box-shadow .14s;
}
.pose-thumb canvas { width: 46px; height: auto; display: block; }
.pose-thumb span { font-family: "Fredoka", sans-serif; font-weight: 500; font-size: 9.5px; color: var(--ink-soft); }
.pose-thumb:hover { transform: scale(1.08); border-color: var(--sky); box-shadow: var(--shadow-soft); }
.pose-thumb.active {
  border-color: var(--coral);
  background: linear-gradient(180deg, #FFF, #FFE9F1);
  box-shadow: 0 6px 14px rgba(255, 92, 138, .3);
  animation: poseBounce .34s var(--ease);
}
.pose-thumb.active span { color: var(--coral); font-weight: 700; }

/* ---------------- SCÈNE / CANVAS ---------------- */
.stage-frame {
  position: relative;
  background: linear-gradient(135deg, #fff, #FFF3F8);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-card), 0 2px 0 #fff inset;
}
.zoom-badge {
  position: absolute; top: 26px; right: 26px; z-index: 4;
  font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 13px;
  background: rgba(15, 18, 26, .65); color: #fff; border: none; cursor: pointer;
  padding: 7px 13px; border-radius: 999px; box-shadow: var(--shadow-soft);
  transition: background .14s;
}
.zoom-badge:hover { background: rgba(15, 18, 26, .82); }
.stage-inner {
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: inset 0 0 0 4px #fff, 0 10px 26px rgba(93, 61, 120, .22);
  background: #10131a;
  line-height: 0;
}
#scene {
  display: block; width: 100%; height: auto;
  touch-action: none; cursor: default;
  transform-origin: center center;
}
.stage-frame.flash { animation: lockFlash .6s ease-out; }
.stage-frame.flash #scene { animation: canvasPulse .6s ease-out; }
#scene.pop { animation: posePop .42s var(--ease); }

.status {
  margin: 14px auto 0; text-align: center;
  font-family: "Fredoka", sans-serif; font-weight: 500; font-size: 13.5px;
  color: var(--ink-soft);
  background: #fff; display: inline-block;
  padding: 7px 16px; border-radius: 999px; box-shadow: var(--shadow-soft);
}
.stage { text-align: center; }

/* ---------------- PIPETTE VOLANTE ---------------- */
.fly-dot {
  position: fixed; width: 24px; height: 24px; margin: -12px 0 0 -12px;
  border-radius: 50%; border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,.28);
  z-index: 9999; pointer-events: none;
  transition: transform .46s var(--ease), opacity .46s ease;
}

.swatch.swatch-pop { animation: swatchPop .26s var(--ease); }

/* ---------------- PANNEAU PEINTURE : apparition ---------------- */
#paintPanel.panel-in { animation: panelIn .34s var(--ease); }

/* ---------------- KEYFRAMES ---------------- */
@keyframes toolBounce { 0%{transform:scale(.9)} 60%{transform:scale(1.12)} 100%{transform:scale(1.06)} }
@keyframes poseBounce { 0%{transform:scale(.9)} 60%{transform:scale(1.12)} 100%{transform:scale(1)} }
@keyframes posePop    { 0%{transform:scale(.86)} 55%{transform:scale(1.04)} 100%{transform:scale(1)} }
@keyframes panelIn    { 0%{opacity:0; transform:translateY(14px) scale(.98)} 100%{opacity:1; transform:none} }
@keyframes lockFlash {
  0%   { box-shadow: var(--shadow-card), 0 0 0 0 rgba(55,217,160,0); }
  30%  { box-shadow: var(--shadow-card), 0 0 0 6px rgba(55,217,160,.55); }
  100% { box-shadow: var(--shadow-card), 0 0 0 0 rgba(55,217,160,0); }
}
@keyframes canvasPulse { 0%{transform:scale(1)} 40%{transform:scale(1.012)} 100%{transform:scale(1)} }
@keyframes swatchPop { 0%{transform:scale(1)} 45%{transform:scale(1.22) rotate(-4deg)} 100%{transform:scale(1)} }

/* Respecte les préférences de mouvement réduit */
@media (prefers-reduced-motion: reduce) {
  .tool.active, .pose-thumb.active, #scene.pop, .stage-frame.flash,
  .stage-frame.flash #scene, #paintPanel.panel-in { animation: none !important; }
}

/* =========================================================================
   FLOW DE PARTIE — overlay + écrans (machine à états)
   ========================================================================= */
#app-paint { display: none; }   /* la scène de peinture n'est visible qu'en phase PEINTURE */

.overlay {
  position: relative; z-index: 1;
  min-height: calc(100vh - 150px);
  padding: 8px 34px 50px;
}
.screen {
  position: absolute; inset: 0;
  padding: 4px 34px 40px;
  display: flex; justify-content: center; align-items: flex-start;
  overflow: auto;
  transition: opacity .32s ease, transform .34s var(--ease);
}
.screen-in  { opacity: 0; transform: translateY(20px) scale(.985); }
.screen-out { opacity: 0; transform: translateY(-14px); pointer-events: none; }
.screen-content { width: 100%; max-width: 720px; }

/* --- Carte du salon --- */
.home-card, .ready-card { padding: 26px 26px 24px; }
.home-title { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 27px; margin: 0 0 6px; }

.players { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 8px; }
.prow { display: flex; align-items: center; gap: 11px; }
.pdot { width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.pinput {
  flex: 1; font-family: "Fredoka", sans-serif; font-weight: 500; font-size: 15px; color: var(--ink);
  padding: 12px 15px; border: 2px solid var(--line); border-radius: 13px; background: #fff;
  transition: border-color .14s;
}
.pinput:focus { outline: none; border-color: var(--grape); }
.pdel {
  width: 34px; height: 34px; flex: 0 0 auto; border: none; cursor: pointer;
  border-radius: 10px; background: #FFEDF2; color: var(--coral); font-weight: 700; font-size: 14px;
  transition: filter .14s;
}
.pdel:hover { filter: brightness(.95); }
.padd {
  margin-top: 2px; padding: 11px; border: 2px dashed var(--line); border-radius: 13px;
  background: #fff; color: var(--ink-soft); cursor: pointer;
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px; transition: all .14s;
}
.padd:hover { border-color: var(--lime); color: var(--lime); }

/* --- Réglages segmentés --- */
.set-h { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 16px; margin: 20px 0 6px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
.set-label { font-family: "Fredoka", sans-serif; font-weight: 500; font-size: 14px; color: var(--ink-soft); }
.seg { display: inline-flex; background: var(--line); border-radius: 13px; padding: 4px; gap: 4px; }
.seg-b {
  border: none; background: transparent; cursor: pointer;
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px; color: var(--ink-soft);
  padding: 8px 15px; border-radius: 10px; transition: all .14s ease-out;
}
.seg-b:hover { color: var(--ink); }
.seg-b.on { background: #fff; color: var(--grape); box-shadow: var(--shadow-soft); transform: scale(1.02); }

.launch { margin-top: 20px; }
.filebtn {
  display: block; text-align: center; margin-top: 12px; cursor: pointer;
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px; color: var(--ink-soft);
  background: #fff; border: 2px dashed var(--line); border-radius: 14px; padding: 13px; transition: all .14s;
}
.filebtn:hover { border-color: var(--sky); color: var(--sky); }
.home-err { min-height: 20px; margin: 12px 0 0; color: var(--coral); font-weight: 700; font-size: 13.5px; text-align: center; }

/* --- Écran d'accueil (créer / rejoindre) --- */
.home-landing { padding: 28px 26px; text-align: center; }
.home-landing .candy { margin-top: 10px; }
.join-row { display: flex; gap: 8px; margin-top: 10px; }
.code-input { flex: 1; text-align: center; font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 20px; letter-spacing: .18em; text-transform: uppercase; }
.go-btn { flex: 0 0 auto; }

/* --- Écran rejoindre + réglages en lecture seule --- */
.join-card { padding: 26px; text-align: center; }
.join-input { width: 100%; text-align: center; font-size: 18px; }
.join-card .pseudo-field span { text-align: left; }
.join-status { min-height: 20px; margin: 12px 0 0; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 13.5px; color: var(--ink-soft); }
.settings-view { margin: 4px 0 10px; }
.settings-line { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 15px; color: var(--ink); background: linear-gradient(120deg, #FFF7FB, #F4F0FF); border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; text-align: center; }

/* --- Salon en ligne --- */
.salon-card { padding: 24px 26px 22px; }
.salon-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.room-badge {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: linear-gradient(150deg, var(--grape), var(--coral));
  color: #fff; padding: 8px 16px; border-radius: 14px; box-shadow: var(--shadow-soft);
  flex: 0 0 auto;
}
.room-label { font-family: "Fredoka", sans-serif; font-weight: 500; font-size: 10px; letter-spacing: .12em; opacity: .85; }
.room-code { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 20px; letter-spacing: .06em; }

.pseudo-field { display: block; margin: 16px 0 6px; }
.pseudo-field span { display: block; font-family: "Fredoka", sans-serif; font-weight: 500; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.pinput.pseudo { width: 100%; }

.plr-head { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 8px; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px; color: var(--ink-soft); }
.plr-count { color: var(--grape); }
.plr-list { display: flex; flex-direction: column; gap: 8px; }
.plr {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 14px;
  background: linear-gradient(180deg, #FFFDF8, #FFF3F8);
  border: 2px solid var(--line);
}
.plr-av {
  width: 34px; height: 34px; flex: 0 0 auto; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 15px;
  box-shadow: 0 2px 6px rgba(0,0,0,.16);
}
.plr-av.dots { background: var(--line); color: var(--ink-soft); }
.plr-name { flex: 1; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 15px; color: var(--ink); }
.plr-tag {
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 11.5px;
  padding: 4px 10px; border-radius: 999px;
}
.plr-tag.me  { background: #EAF8F2; color: #1f9e73; }
.plr-tag.bot { background: #EEF4FF; color: var(--sky); }
/* cumul de session dans le salon */
.plr-score {
  font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 12.5px;
  color: var(--ink-soft); padding: 4px 9px; border-radius: 999px;
  background: #F3EEFF; white-space: nowrap;
}
.plr-score.lead { background: linear-gradient(120deg, var(--sun), #ffb02e); color: #5b3d00; }
.plr.ghost { opacity: .5; border-style: dashed; background: #fff; }
.plr.ghost .plr-name { color: var(--ink-soft); font-weight: 500; font-style: italic; }
.plr.self { border-color: var(--grape); box-shadow: 0 4px 12px rgba(124,92,255,.18); }
.plr-kick {
  width: 30px; height: 30px; flex: 0 0 auto; border: none; cursor: pointer;
  border-radius: 9px; background: #FFEDF2; color: var(--coral); font-weight: 700; font-size: 13px;
  transition: filter .12s;
}
.plr-kick:hover { filter: brightness(.94); }
.room-badge { cursor: pointer; }
.mini-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 12px);
  background: var(--ink); color: #fff; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px;
  padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow-card); z-index: 9999;
  opacity: 0; transition: opacity .25s, transform .25s var(--ease); pointer-events: none;
}
.mini-toast.show { opacity: 1; transform: translate(-50%, 0); }
.plr.just-joined { animation: plrJoin .42s var(--ease); }
@keyframes plrJoin {
  0% { opacity: 0; transform: translateX(-14px) scale(.96); }
  60% { transform: translateX(2px) scale(1.02); }
  100% { opacity: 1; transform: none; }
}

/* --- HUD de la phase peinture (barre de jeu flottante) --- */
.phud {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 60; display: flex; align-items: center; gap: 18px;
  background: #fff; border-radius: 20px; padding: 10px 14px 10px 12px;
  box-shadow: var(--shadow-card);
  animation: panelIn .34s var(--ease);
}
.phud-left { display: flex; align-items: center; gap: 10px; }
.phud-badge {
  width: 44px; height: 44px; display: grid; place-items: center; font-size: 22px;
  background: linear-gradient(150deg, var(--grape), var(--coral)); border-radius: 14px;
}
.phud-title { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 16px; color: var(--ink); }
.phud-sub { font-family: "Fredoka", sans-serif; font-weight: 500; font-size: 12px; color: var(--ink-soft); }
.phud-mid { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0 8px; border-left: 2px solid var(--line); border-right: 2px solid var(--line); }
.phud-chrono { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 26px; color: var(--grape); line-height: 1; }
.phud-chrono.low { color: var(--coral); animation: chronoPulse .5s infinite alternate; }
@keyframes chronoPulse { from { transform: scale(1); } to { transform: scale(1.12); } }
.phud-prog { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 12px; color: var(--ink-soft); }
.phud-finish { flex: 0 0 auto; }

/* attente des autres peintres */
.phud-wait {
  position: fixed; inset: 0; z-index: 70;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: rgba(255, 247, 240, .82); backdrop-filter: blur(4px);
  animation: panelIn .3s var(--ease);
}
.phud-wait-txt { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 22px; color: var(--ink); }
.phud-wait-cnt { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 30px; color: var(--grape); }
.spinner {
  width: 54px; height: 54px; border-radius: 50%;
  border: 6px solid var(--line); border-top-color: var(--coral);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Galerie des tableaux (vérif) --- */
.screen-content.wide { max-width: 1040px; }
.tab-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 14px 0; }
.tab-card { background: #FFF7FB; border: 2px solid var(--line); border-radius: var(--r-md); padding: 8px; }
.tab-img { width: 100%; border-radius: 12px; display: block; box-shadow: var(--shadow-soft); }
.tab-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px; color: var(--ink); }
.tab-dot { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; }

/* --- Phase recherche --- */
.search-card { padding: 16px; }
.search-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.search-title { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 18px; color: var(--ink); }
.search-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chrono-pill, .clicks-pill {
  font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 17px;
  padding: 6px 14px; border-radius: 999px; box-shadow: var(--shadow-soft);
}
.chrono-pill { background: linear-gradient(150deg, var(--grape), var(--sky)); color: #fff; }
.chrono-pill.low { background: linear-gradient(150deg, var(--coral), #ff3d6e); animation: chronoPulse .5s infinite alternate; }
.clicks-pill { background: #fff; color: var(--ink); border: 2px solid var(--line); }
.clicks-pill b { color: var(--coral); }
.loupe-btn {
  font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 14px;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  background: #fff; color: var(--ink); border: 2px solid var(--sun);
  box-shadow: var(--shadow-soft); transition: all .14s;
}
.loupe-btn:hover { filter: brightness(1.03); }
.loupe-btn.on { background: linear-gradient(150deg, var(--sun), #ffb02e); color: #5b3d00; border-color: transparent; }
.loupe-btn.empty { opacity: .5; cursor: not-allowed; border-color: var(--line); }

/* Bouton INDICE (mêmes proportions que la loupe) */
.hint-btn {
  font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 14px;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  background: #fff; color: var(--ink-soft); border: 2px solid var(--line);
  box-shadow: var(--shadow-soft); transition: all .14s; white-space: nowrap;
}
.hint-btn:disabled { cursor: not-allowed; }
.hint-btn.ready { color: #7a4d00; border-color: var(--sun); background: linear-gradient(150deg, #fff, #fff7e6); }
.hint-btn.ready:hover { filter: brightness(1.02); transform: translateY(-1px); }
.hint-btn.used { opacity: .5; border-color: var(--line); }
.hint-btn.pulse { animation: hintPulse .9s var(--ease) 2; }
@keyframes hintPulse { 0%,100%{box-shadow:0 0 0 0 rgba(255,176,46,.5), var(--shadow-soft)} 50%{box-shadow:0 0 0 8px rgba(255,176,46,0), var(--shadow-soft)} }

/* ===== RÉACTIONS EMOJI ===== */
.react-bar { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.react-b {
  font-size: 22px; line-height: 1; padding: 6px 11px; border-radius: 14px;
  background: #fff; border: 2px solid var(--line); cursor: pointer;
  transition: transform .12s, border-color .12s, background .12s;
}
.react-b:hover { transform: translateY(-2px) scale(1.08); }
.react-b.on { border-color: var(--coral); background: #fff0f5; transform: translateY(-1px); }
/* emojis montants : TOUJOURS depuis le bord bas (jamais localisés → pas d'indice de position) */
.react-floaters { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 6; }
.react-float {
  position: absolute; bottom: 6px; font-size: 30px; line-height: 1;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.35));
  animation: reactRise 2.5s ease-out forwards;
}
@keyframes reactRise {
  0%   { opacity: 0; transform: translate(0, 0) scale(.6); }
  14%  { opacity: 1; transform: translate(0, -40px) scale(1.15); }
  100% { opacity: 0; transform: translate(var(--drift, 0), -300px) scale(.9); }
}

/* ===== AWARDS de fin de partie ===== */
.awards { margin-top: 18px; }
.awards-h { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 16px; text-align: center; color: var(--ink); margin-bottom: 10px; }
.awards-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.aw-card {
  width: 134px; background: #faf8ff; border-radius: 16px; padding: 12px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  box-shadow: var(--shadow-soft);
}
.aw-emo { font-size: 26px; line-height: 1; }
.aw-thumb { width: 62px; height: 62px; border-radius: 12px; border: 3px solid var(--line); overflow: hidden; display: grid; place-items: center; background: #fff; }
.aw-thumb img { width: 100%; height: 100%; object-fit: contain; }
.aw-label { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 12.5px; color: var(--ink); text-align: center; line-height: 1.15; }
.aw-winner { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 13px; }
.aw-count { font-size: 11.5px; color: var(--ink-soft); font-weight: 600; }

/* ===== ONBOARDING (astuces, tooltips, Comment jouer) ===== */
.salon-tools { display: flex; align-items: center; gap: 10px; margin: 8px 0 14px; }
.howto-btn {
  flex: 0 0 auto; font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 13px;
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  background: #fff; color: var(--grape); border: 2px solid var(--grape); transition: all .14s;
}
.howto-btn:hover { background: var(--grape); color: #fff; }
.salon-tip {
  flex: 1; min-width: 0; font-family: "Nunito", sans-serif; font-weight: 700; font-size: 13px;
  color: #7a4d00; background: #FFF7E6; border-radius: 12px; padding: 9px 12px; line-height: 1.3;
}
/* tooltip "première fois" dans la scène de recherche */
.first-tip {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 9; max-width: 90%; display: flex; align-items: center; gap: 10px;
  background: rgba(20,16,36,.92); color: #fff; padding: 11px 14px; border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: tipIn .35s var(--ease);
}
.ft-emo { font-size: 22px; flex: 0 0 auto; }
.ft-txt { font-family: "Nunito", sans-serif; font-weight: 700; font-size: 13.5px; line-height: 1.3; }
.ft-close { background: rgba(255,255,255,.2); color: #fff; border: none; width: 22px; height: 22px; border-radius: 50%; cursor: pointer; flex: 0 0 auto; font-size: 12px; }
@keyframes tipIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
/* écran "Comment jouer" */
.howto-modal { position: fixed; inset: 0; z-index: 50; background: rgba(20,16,36,.55); display: grid; place-items: center; padding: 20px; animation: tipIn .2s var(--ease); }
.howto-box { width: min(560px, 96%); background: var(--card); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-card); }
.howto-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.howto-card { position: relative; background: #faf8ff; border-radius: 14px; padding: 16px 14px 14px; text-align: center; }
.howto-n { position: absolute; top: 8px; left: 11px; font-family: "Fredoka", sans-serif; font-weight: 700; color: var(--grape); opacity: .45; }
.howto-emo { font-size: 30px; line-height: 1; }
.howto-t { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 15px; color: var(--ink); margin-top: 5px; }
.howto-d { font-family: "Nunito", sans-serif; font-weight: 600; font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; line-height: 1.3; }
@media (max-width: 520px) { .howto-grid { grid-template-columns: 1fr; } }

.search-stagebox { position: relative; border-radius: var(--r-md); overflow: hidden; box-shadow: inset 0 0 0 4px #fff, 0 10px 26px rgba(93,61,120,.22); line-height: 0; }
.search-canvas { display: block; width: 100%; height: auto; }

/* toasts (pression) */
.toasts { position: absolute; top: 10px; right: 10px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; z-index: 5; }
.toast {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-radius: 12px; padding: 8px 12px;
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 13px; color: var(--ink);
  box-shadow: var(--shadow-card); animation: toastIn .3s var(--ease); transition: opacity .35s, transform .35s;
}
.toast.out { opacity: 0; transform: translateX(20px); }
.toast.good { border-left: 4px solid var(--lime); }
.toast.bad { border-left: 4px solid var(--ink-soft); }
.toast-dot { width: 12px; height: 12px; border-radius: 50%; flex: 0 0 auto; }
@keyframes toastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* feedback central */
.bigtoast {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(1);
  font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 34px; color: #fff;
  padding: 16px 30px; border-radius: 20px; z-index: 6; white-space: nowrap;
  box-shadow: var(--shadow-card); animation: bigIn .35s var(--ease); transition: opacity .4s, transform .4s;
}
.bigtoast.good { background: linear-gradient(150deg, var(--lime), var(--sky)); }
.bigtoast.bad { background: linear-gradient(150deg, var(--ink-soft), #5b5170); }
.bigtoast.out { opacity: 0; transform: translate(-50%, -70%) scale(.9); }
@keyframes bigIn { from { opacity: 0; transform: translate(-50%,-50%) scale(.7); } to { opacity: 1; transform: translate(-50%,-50%) scale(1); } }

/* révélation */
.reveal-layer { position: absolute; inset: 0; z-index: 7; display: flex; align-items: flex-end; justify-content: center; padding: 16px; pointer-events: none; opacity: 0; transition: opacity .3s; }
.reveal-layer.on { opacity: 1; pointer-events: auto; }
/* Personne n'a trouvé : "Il était là 😱" — au centre du tableau, moment fort */
.reveal-miss {
  position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  pointer-events: none; z-index: 8;
  animation: missPop .5s var(--ease) both, missFloat 2.6s ease-in-out .5s infinite;
}
.reveal-miss span { font-size: 62px; line-height: 1; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }
.reveal-miss b {
  font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 30px; color: #fff;
  padding: 6px 18px; border-radius: 999px;
  background: linear-gradient(100deg, var(--coral), var(--grape));
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
@keyframes missPop { 0%{opacity:0; transform:translate(-50%,-50%) scale(.5) rotate(-6deg)} 60%{opacity:1; transform:translate(-50%,-50%) scale(1.12)} 100%{transform:translate(-50%,-50%) scale(1)} }
@keyframes missFloat { 0%,100%{margin-top:0} 50%{margin-top:-8px} }
.reveal-panel {
  width: min(440px, 92%); background: #fff; border-radius: var(--r-md); padding: 16px;
  box-shadow: var(--shadow-card); animation: panelIn .34s var(--ease); line-height: normal;
}
.reveal-h { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 17px; color: var(--ink); margin-bottom: 10px; text-align: center; }
.reveal-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.reveal-row { display: flex; align-items: center; gap: 10px; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px; }
.rr-dot { width: 16px; height: 16px; border-radius: 50%; flex: 0 0 auto; }
.rr-name { flex: 1; color: var(--ink); }
.rr-res.ok { color: #1f9e73; }
.rr-res.ko { color: var(--ink-soft); }
.reveal-wait { text-align: center; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 15px; color: var(--ink-soft); padding: 12px; }

/* --- Scores + podium --- */
.scores-card { padding: 24px 26px; text-align: center; }
.home-title.center { text-align: center; }
.scores-sub { font-family: "Fredoka", sans-serif; font-weight: 500; font-size: 14px; color: var(--ink-soft); margin: 2px 0 18px; }

.podium { display: flex; align-items: flex-end; justify-content: center; gap: 14px; margin: 8px 0 18px; min-height: 220px; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 30%; max-width: 150px; }
.pod-medal { font-size: 26px; }
.pod-av {
  width: 74px; height: 74px; border-radius: 18px; display: grid; place-items: center;
  color: #fff; font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 24px;
  background: linear-gradient(180deg, #fff, #FFF3F8);
  box-shadow: 0 4px 12px rgba(0,0,0,.16); border: 3px solid #fff; overflow: hidden;
}
.pod-mannequin { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.pod-0 .pod-av { width: 92px; height: 92px; }   /* le 1er un peu plus grand */
.score-av {
  width: 40px; height: 40px; flex: 0 0 auto; border-radius: 11px; overflow: hidden;
  border: 2px solid #fff; background: linear-gradient(180deg, #fff, #FFF3F8);
  display: grid; place-items: center;
}
.score-av img { width: 100%; height: 100%; object-fit: contain; padding: 2px; }
.pod-name { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px; color: var(--ink); }
.pod-pts { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 13px; color: var(--grape); margin-bottom: 4px; }
.pod-bar {
  width: 100%; height: var(--h);
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 85%, #fff), var(--c));
  border-radius: 12px 12px 0 0; box-shadow: var(--shadow-soft);
  display: grid; place-items: start center; padding-top: 8px;
  transform-origin: bottom; animation: podiumRise .5s var(--ease) both;
}
.pod-0 .pod-bar { animation-delay: .1s; }
.pod-1 .pod-bar { animation-delay: 0s; }
.pod-2 .pod-bar { animation-delay: .2s; }
.pod-rankn { font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 18px; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,.2); }
@keyframes podiumRise { from { transform: scaleY(0); opacity: .4; } to { transform: scaleY(1); opacity: 1; } }

.score-list { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 16px; text-align: left; }
.score-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; background: #FFF7FB; border: 2px solid var(--line); font-family: "Fredoka", sans-serif; font-weight: 600; }
.score-rank { font-size: 15px; color: var(--ink-soft); width: 30px; }
.score-name { flex: 1; color: var(--ink); }
.score-round { font-size: 13px; color: var(--lime); font-weight: 700; }
.score-pts { color: var(--grape); font-weight: 700; min-width: 62px; text-align: right; }
/* indice utilisé : score barré (sans indice) → score réel (÷2) */
.pts-wrap { display: inline-flex; align-items: center; gap: 5px; justify-content: flex-end; }
.pts-hint { font-size: .95em; line-height: 1; }
.pts-was { text-decoration: line-through; opacity: .5; font-weight: 600; font-size: .88em; color: var(--ink-soft); }
.score-pts .pts-real { color: var(--grape); }
.pod-pts .pts-real { color: var(--grape); }

/* --- Vote du fond --- */
.vote-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 16px 0; }
.vote-opt {
  position: relative; padding: 0; border: 3px solid var(--line); border-radius: var(--r-md);
  background: #fff; cursor: pointer; overflow: hidden; transition: transform .16s var(--ease), border-color .14s, box-shadow .14s;
}
.vote-opt:hover { transform: translateY(-3px) scale(1.02); border-color: var(--sky); box-shadow: var(--shadow-card); }
.vote-opt.mine { border-color: var(--coral); box-shadow: 0 6px 16px rgba(255,92,138,.32); }
.vote-opt.winner { border-color: var(--lime); box-shadow: 0 8px 22px rgba(55,217,160,.45); animation: poseBounce .5s var(--ease); }
.vote-thumb { width: 100%; height: auto; display: block; }
.vote-cap { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px; color: var(--ink); padding: 8px; }
.vote-count { position: absolute; top: 8px; right: 8px; background: #fff; color: var(--coral); font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 13px; padding: 3px 9px; border-radius: 999px; box-shadow: var(--shadow-soft); }
.vote-voters { position: absolute; top: 8px; left: 8px; display: flex; gap: 3px; }
.vote-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.vote-hint { text-align: center; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 15px; color: var(--ink-soft); margin: 6px 0 0; }

/* --- Chat persistant --- */
.chat-dock {
  position: fixed; right: 18px; bottom: 18px; width: 288px; z-index: 90;
  background: #fff; border-radius: 18px; box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; overflow: hidden; max-height: 360px;
}
.chat-head {
  display: flex; align-items: center; justify-content: space-between; cursor: pointer;
  background: linear-gradient(150deg, var(--grape), var(--coral)); color: #fff;
  font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 14px; padding: 10px 14px;
}
.chat-min { transition: transform .2s; }
.chat-dock.mini .chat-min { transform: rotate(180deg); }
.chat-dock.mini .chat-msgs, .chat-dock.mini .chat-form { display: none; }
.chat-dock.unread .chat-head { animation: chatBlink .8s infinite alternate; }
@keyframes chatBlink { from { filter: brightness(1); } to { filter: brightness(1.22); } }
.chat-msgs { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 150px; }
.chat-msg { display: flex; gap: 8px; align-items: flex-start; }
.chat-msg.mine { flex-direction: row-reverse; }
.chat-av { width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; color: #fff; font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 12px; }
.chat-body { background: #F4F0FF; border-radius: 12px; padding: 6px 10px; max-width: 200px; }
.chat-msg.mine .chat-body { background: #FFEDF3; }
.chat-name { display: block; font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 11px; }
.chat-text { font-family: "Nunito", sans-serif; font-weight: 600; font-size: 13px; color: var(--ink); word-break: break-word; }
.chat-sys { align-self: center; font-family: "Fredoka", sans-serif; font-weight: 500; font-size: 11.5px; color: var(--ink-soft); background: var(--line); padding: 4px 12px; border-radius: 999px; }
.chat-form { display: flex; gap: 6px; padding: 8px; border-top: 2px solid var(--line); }
.chat-input { flex: 1; border: 2px solid var(--line); border-radius: 10px; padding: 8px 10px; font-family: "Nunito", sans-serif; font-weight: 600; font-size: 13px; }
.chat-input:focus { outline: none; border-color: var(--grape); }
.chat-send { flex: 0 0 auto; border: none; background: var(--grape); color: #fff; border-radius: 10px; width: 38px; cursor: pointer; font-size: 15px; }
.chat-send:hover { filter: brightness(1.08); }

/* --- Scores : MVP + footer --- */
.mvp { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 15px; color: var(--ink); background: linear-gradient(120deg, #FFF6D8, #FFE5F0); border: 2px solid var(--sun); border-radius: 14px; padding: 10px 14px; margin-bottom: 14px; }
.scores-footer { display: flex; gap: 10px; margin-top: 8px; }
.rejouer-btn { flex: 2; }
.quit-btn { flex: 1; }

/* --- Écran de confirmation --- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.chip {
  display: inline-block; font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 15px; color: #fff;
  background: var(--c); padding: 8px 16px; border-radius: 999px; box-shadow: var(--shadow-soft);
}
.recap { font-family: "Fredoka", sans-serif; font-weight: 600; font-size: 15px; color: var(--ink); margin: 6px 0 12px; }
.ready-preview { width: 100%; border-radius: var(--r-md); margin: 12px 0; box-shadow: var(--shadow-soft); }

@keyframes shakeX {
  10%,90%{transform:translateX(-1px)} 20%,80%{transform:translateX(2px)}
  30%,50%,70%{transform:translateX(-5px)} 40%,60%{transform:translateX(5px)}
}
.shake { animation: shakeX .4s; }

/* Desktop d'abord : mise en page propre dès 1280px assurée par dock 320 + stage fluide */
@media (max-width: 1180px) {
  .board { flex-direction: column; }
  .dock { width: 100%; flex: none; flex-direction: column; }
  /* onglets en pleine largeur en haut ; les cartes du panneau actif s'étalent */
  .tab-panel { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .dock .card { flex: 1 1 300px; }
  .stage { position: static; width: 100%; }
}
