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

:root {
  --pink: #ff6fa5;
  --purple: #9b59b6;
  --blue: #4aa8e8;
  --yellow: #ffd166;
  --mint: #6fd8b2;
  --card: #ffffff;
  --text: #4a3b5c;
  --shadow: 0 6px 18px rgba(120, 80, 160, .18);
}

body {
  font-family: 'Fredoka', 'Comic Sans MS', sans-serif;
  color: var(--text);
  min-height: 100vh;
  background: linear-gradient(160deg, #ffe3f0 0%, #e8e0ff 45%, #d8f3ff 100%);
  background-attachment: fixed;
}

/* ---------- Header ---------- */
header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, .65);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(120, 80, 160, .12);
}

header h1 {
  font-size: clamp(1.15rem, 3.5vw, 1.7rem);
  background: linear-gradient(90deg, var(--pink), var(--purple), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  padding: 9px 18px;
  margin-left: 8px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform .15s;
}
.nav-btn:hover { transform: scale(1.06); }
.nav-btn.active { background: linear-gradient(90deg, var(--pink), var(--purple)); color: #fff; }

.badge {
  display: inline-block;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--yellow);
  color: #6b5200;
  font-size: .85rem;
}

/* ---------- Layout ---------- */
main { padding: 18px; max-width: 1200px; margin: 0 auto; }
.hidden { display: none !important; }

.creator-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 18px;
  align-items: start;
}

/* ---------- Preview ---------- */
.preview-pane { position: sticky; top: 84px; }

.preview-card {
  background: var(--card);
  border-radius: 24px;
  padding: 12px;
  box-shadow: var(--shadow);
}

#preview svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
  animation: floaty 3.5s ease-in-out infinite;
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

.preview-name {
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  padding: 8px 4px 4px;
  color: var(--purple);
}

.preview-actions { display: flex; gap: 10px; margin-top: 12px; }

.big-btn {
  flex: 1;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 12px 16px;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  color: #fff;
  box-shadow: var(--shadow);
  transition: transform .15s;
}
.big-btn:hover { transform: scale(1.05); }
.big-btn:active { transform: scale(.96); }
.btn-random { background: linear-gradient(135deg, #ffd166, #ff9a5a); }
.btn-save { background: linear-gradient(135deg, #6fd8b2, #4aa8e8); }
.btn-cancel { background: #c2b8d6; }

/* ---------- Panel & tabs ---------- */
.panel {
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  background: linear-gradient(90deg, #fff0f7, #f0ecff);
}

.tab-btn {
  font-family: inherit;
  font-size: .95rem;
  font-weight: 600;
  padding: 8px 14px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: #fff;
  color: var(--text);
  transition: transform .12s;
}
.tab-btn:hover { transform: scale(1.06); }
.tab-btn.active { background: linear-gradient(90deg, var(--pink), var(--purple)); color: #fff; }

.tab-content { padding: 16px 18px 24px; }

.group-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 18px 0 10px;
  color: var(--purple);
}
.group-title:first-child { margin-top: 0; }

/* ---------- Option grids ---------- */
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 10px;
}

.option-btn {
  font-family: inherit;
  border: 3px solid transparent;
  border-radius: 16px;
  background: #f6f2fc;
  cursor: pointer;
  padding: 6px 4px 4px;
  transition: transform .12s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.option-btn:hover { transform: scale(1.06); }
.option-btn.selected { border-color: var(--pink); background: #fff0f7; box-shadow: 0 0 0 3px rgba(255, 111, 165, .25); }
.option-btn svg { width: 100%; height: auto; border-radius: 10px; background: #fff; pointer-events: none; }
.option-btn .opt-label { font-size: .78rem; font-weight: 600; color: var(--text); pointer-events: none; }

/* toggle (accessoires multi) */
.option-btn.toggled { border-color: var(--mint); background: #eafaf3; box-shadow: 0 0 0 3px rgba(111, 216, 178, .3); }

/* ---------- Swatches ---------- */
.swatch-row { display: flex; flex-wrap: wrap; gap: 9px; }

.swatch {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid #fff;
  outline: 2px solid rgba(0, 0, 0, .1);
  cursor: pointer;
  transition: transform .12s;
}
.swatch:hover { transform: scale(1.18); }
.swatch.selected { outline: 4px solid var(--pink); transform: scale(1.12); }
.swatch.rainbow { background: conic-gradient(red, orange, yellow, green, deepskyblue, blueviolet, red); }
.swatch-auto {
  background: repeating-linear-gradient(45deg, #fff, #fff 5px, #f0ecff 5px, #f0ecff 10px);
  font-size: .95rem;
  line-height: 1;
  padding: 0;
}

/* ---------- Gallery ---------- */
#viewGallery h2 { font-size: 1.5rem; margin-bottom: 16px; color: var(--purple); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}

.gallery-card {
  background: var(--card);
  border-radius: 20px;
  padding: 10px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform .15s;
}
.gallery-card:hover { transform: translateY(-4px); }
.gallery-card svg { width: 100%; height: auto; border-radius: 14px; }
.gallery-card .g-name { font-size: 1.1rem; font-weight: 700; margin: 6px 0; color: var(--purple); }

.g-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.g-actions button {
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  padding: 6px 9px;
  cursor: pointer;
  background: #f0ecff;
  color: var(--text);
  transition: transform .12s;
}
.g-actions button:hover { transform: scale(1.08); }
.g-actions .g-del { background: #ffe0e6; }

.gallery-empty {
  text-align: center;
  padding: 50px 20px;
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  font-size: 1.15rem;
}
.gallery-empty p { margin-bottom: 12px; }
.gallery-empty .big-btn { flex: none; margin-top: 8px; }

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(80, 50, 120, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

.modal-box {
  background: #fff;
  border-radius: 24px;
  padding: 26px;
  width: min(420px, 100%);
  box-shadow: 0 12px 40px rgba(60, 30, 100, .35);
  animation: pop .25s ease;
}
@keyframes pop {
  from { transform: scale(.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-box h3 { margin-bottom: 16px; color: var(--purple); }

#nameInput {
  width: 100%;
  font-family: inherit;
  font-size: 1.2rem;
  font-weight: 600;
  padding: 12px 16px;
  border: 3px solid #e8e0ff;
  border-radius: 14px;
  outline: none;
  margin-bottom: 16px;
}
#nameInput:focus { border-color: var(--pink); }

.modal-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.modal-actions .big-btn { font-size: .95rem; padding: 10px 12px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, var(--mint), var(--blue));
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 14px 26px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(40, 120, 160, .4);
  z-index: 200;
  animation: toastIn .3s ease;
}
@keyframes toastIn {
  from { transform: translate(-50%, 30px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* ---------- Mode switch (personnage / animal) ---------- */
.mode-switch {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.mode-btn {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 10px 24px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform .15s;
}
.mode-btn:hover { transform: scale(1.06); }
.mode-btn.active { background: linear-gradient(90deg, var(--mint), var(--blue)); color: #fff; }

/* Gros emoji dans les options (rôles famille) */
.opt-emoji {
  font-size: 2.4rem;
  padding: 12px 0 4px;
  pointer-events: none;
}

.hint {
  background: #fff7fb;
  border-radius: 14px;
  padding: 16px;
  font-size: 1.05rem;
  line-height: 1.5;
}

/* ---------- Maison ---------- */
#housePreview svg {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 16px;
}

.houses-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.houses-header h2 { color: var(--purple); font-size: 1.5rem; }
.houses-header .big-btn { flex: none; }

.houses-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.house-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.house-header .nav-btn { margin-left: 0; }

.house-name {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--purple);
  flex: 1;
  text-align: center;
}

/* ---------- Habitants ---------- */
.hab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 6px;
}
.add-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.add-actions .big-btn { flex: none; }

.house-card { cursor: pointer; }

/* ---------- Mode Jeu ---------- */
.btn-play {
  flex: none;
  background: linear-gradient(135deg, #ff6fa5, #9b59b6);
  padding: 11px 26px;
}

.play-hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.play-hud .nav-btn { margin-left: 0; }

.play-room {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--purple);
  flex: 1;
  text-align: center;
}
.play-room.pop { animation: roomPop .4s ease; }
@keyframes roomPop {
  0% { transform: scale(.6); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.play-stars {
  font-size: 1.15rem;
  font-weight: 700;
  background: #fff;
  padding: 7px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow);
  color: #b8860b;
}

.race-timer {
  color: var(--purple);
  font-variant-numeric: tabular-nums;
  min-width: 118px;
  text-align: center;
}

#playStage {
  position: relative;
  overflow: hidden;
  height: min(64vh, 540px);
  border-radius: 22px;
  box-shadow: var(--shadow);
  background: #cdeefd;
  touch-action: none;
  user-select: none;
}

#playWorld {
  position: absolute;
  top: 0;
  left: 0;
  width: 2880px;
  height: 360px;
  transform-origin: 0 0;
}
#playWorld svg.bg { position: absolute; top: 0; left: 0; }

.ent { position: absolute; will-change: transform; }
.ent .flip { transform-origin: 50% 90%; }
.ent .flip svg { display: block; }
.walking .flip svg { animation: walkBob .32s infinite; transform-origin: 50% 95%; }
@keyframes walkBob {
  0%, 100% { transform: rotate(-3.5deg); }
  50% { transform: rotate(3.5deg) translateY(-4px); }
}

.star {
  font-size: 30px;
  transform: translate(-50%, -50%);
  animation: starFloat 1.6s ease-in-out infinite;
  text-shadow: 0 2px 6px rgba(180, 130, 0, .4);
}
@keyframes starFloat {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -62%) scale(1.12); }
}
.star.got { animation: starGot .35s forwards; }
@keyframes starGot {
  to { transform: translate(-50%, -160%) scale(2); opacity: 0; }
}

.spark {
  font-size: 26px;
  transform: translate(-50%, -50%);
  animation: sparkUp .6s forwards;
  pointer-events: none;
}
@keyframes sparkUp {
  to { transform: translate(-50%, -180%) scale(1.6); opacity: 0; }
}

.play-bubble {
  position: absolute;
  background: #fff;
  border: 2px solid #e8def5;
  border-radius: 14px;
  padding: 7px 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  transform: translate(-50%, -100%);
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(120, 80, 160, .25);
  display: none;
  z-index: 5;
}
.play-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -9px;
  margin-left: -7px;
  border: 8px solid transparent;
  border-top-color: #fff;
  border-bottom: none;
}

.play-controls {
  position: absolute;
  inset: auto 0 14px 0;
  display: flex;
  justify-content: space-between;
  padding: 0 16px;
  pointer-events: none;
}
.pad-group { display: flex; gap: 12px; }
.pad-btn {
  pointer-events: auto;
  width: 62px;
  height: 62px;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  background: rgba(255, 255, 255, .75);
  color: var(--purple);
  box-shadow: var(--shadow);
  cursor: pointer;
  touch-action: none;
}
.pad-btn:active { transform: scale(.92); background: #fff; }
.pad-jump { background: rgba(255, 209, 102, .85); }

/* Bulle d'action */
.action-hint {
  position: absolute;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  background: #fff;
  padding: 11px 22px;
  border-radius: 999px;
  box-shadow: 0 6px 18px rgba(120, 80, 160, .35);
  z-index: 12;
  animation: hintBounce 1s ease-in-out infinite;
}
@keyframes hintBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-7px); }
}
.action-hint::after {
  content: ' — E';
  opacity: .45;
  font-size: .9rem;
}

/* Panneau d'activité (cuisine, savons, exploits) */
.play-panel {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(80, 50, 120, .35);
  z-index: 25;
  padding: 14px;
}
.panel-box {
  background: #fff;
  border-radius: 22px;
  padding: 20px;
  max-width: 560px;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(60, 30, 100, .35);
  animation: pop .25s ease;
  text-align: center;
}
.panel-box h3 { color: var(--purple); margin-bottom: 6px; }
.panel-sub { font-size: .95rem; margin-bottom: 12px; color: #8a7ba3; }

.ing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.ing-btn {
  font-family: inherit;
  border: 3px solid transparent;
  border-radius: 14px;
  background: #f6f2fc;
  cursor: pointer;
  padding: 8px 4px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text);
  transition: transform .12s;
}
.ing-btn:hover { transform: scale(1.07); }
.ing-btn.selected { border-color: var(--pink); background: #fff0f7; }
.ing-btn .big { display: block; font-size: 1.9rem; }

.dish-result { font-size: 3.2rem; margin: 8px 0 2px; }
.dish-name { font-size: 1.3rem; font-weight: 700; color: var(--purple); margin-bottom: 14px; }

.soap-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.soap-btn {
  font-family: inherit;
  border: 3px solid transparent;
  border-radius: 16px;
  cursor: pointer;
  padding: 12px 14px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  transition: transform .12s;
}
.soap-btn:hover { transform: scale(1.08); }
.soap-btn .big { display: block; font-size: 1.8rem; }

/* ---------- L'école ---------- */
.school-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.school-btn {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  background: #f6f2fc;
  border: 3px solid transparent;
  border-radius: 16px;
  padding: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: transform .12s;
}
.school-btn:hover { transform: scale(1.03); border-color: var(--pink); }
.school-btn .big { font-size: 1.7rem; }
.school-score { margin-left: auto; font-size: .85rem; color: #8a7ba3; font-weight: 600; }

.dots { display: flex; justify-content: center; gap: 7px; margin: 6px 0 12px; }
.dot { width: 13px; height: 13px; border-radius: 50%; background: #e8e0f4; }
.dot.done { background: var(--mint); }
.dot.now { background: var(--yellow); animation: starFloat 1.2s infinite; }

.school-question {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--purple);
  margin: 10px 0;
}
.school-emoji { font-size: 3.4rem; margin: 6px 0; }
.school-model { font-size: 1.7rem; font-weight: 700; letter-spacing: 6px; color: var(--blue); margin-bottom: 6px; }
.school-clock { margin: 6px 0; }

.ans-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}
.ans-btn {
  font-family: inherit;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  background: #f0ecff;
  border: 3px solid transparent;
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  transition: transform .12s;
}
.ans-btn:hover { transform: scale(1.05); }
.ans-btn.good { background: #d9f5e8; border-color: var(--mint); }
.ans-btn.wrong { background: #ffe0e6; border-color: #f0a0b0; opacity: .55; animation: shake .35s; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}

.slot-row { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
.slot {
  width: 38px;
  height: 46px;
  border-radius: 10px;
  background: #f0ecff;
  border: 3px dashed #d4c8ee;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--purple);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.slot.now { border-color: var(--yellow); background: #fff8e1; }

.bank-row { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.bank-btn {
  font-family: inherit;
  width: 46px;
  height: 50px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #6fd8b2, #4aa8e8);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(60, 120, 160, .3);
  transition: transform .12s;
}
.bank-btn:hover { transform: scale(1.1); }
.bank-btn.used { opacity: .15; pointer-events: none; }
.bank-btn.wrong { background: #e0526e; animation: shake .35s; }

.badge-list { text-align: left; margin-bottom: 14px; }
.badge-line { padding: 5px 8px; border-radius: 10px; font-weight: 600; font-size: .98rem; }
.badge-line.done { background: #eafaf3; }
.badge-line.todo { opacity: .5; }

.night-veil {
  position: absolute;
  top: 0; left: 0;
  width: 2880px;
  height: 360px;
  background: linear-gradient(180deg, rgba(20, 24, 78, .5), rgba(30, 30, 90, .32));
  opacity: 0;
  transition: opacity 1.2s;
  pointer-events: none;
}
.night .night-veil { opacity: 1; }

.mow-strip {
  position: absolute;
  top: 302px;
  height: 54px;
  background: repeating-linear-gradient(90deg, #8fca70 0 6px, #9ed682 6px 12px);
  opacity: .95;
}

/* ---------- Le Grand Parc ---------- */
.houses-header-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.houses-header-btns .big-btn { flex: none; }

.play-name {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -100%);
  margin-left: -0px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: rgba(74, 59, 92, .75);
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 4;
}
.play-name, .emote-bubble { will-change: transform; }
.play-name { margin-left: 0; }

.emote-bubble {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 26px;
  background: #fff;
  border: 2px solid #e8def5;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 40px;
  box-shadow: 0 4px 10px rgba(120, 80, 160, .3);
  margin-left: -22px;
  pointer-events: none;
  z-index: 6;
  animation: pop .25s ease;
}

.play-name { margin-left: 0; transform-origin: 0 0; }

.emote-row {
  position: absolute;
  right: 14px;
  top: 14px;
  display: flex;
  gap: 8px;
  z-index: 12;
}
.emote-btn {
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  font-size: 1.35rem;
  background: rgba(255, 255, 255, .8);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform .12s;
}
.emote-btn:hover { transform: scale(1.15); }

.play-win {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(80, 50, 120, .35);
  z-index: 20;
}
.play-win-box {
  background: #fff;
  border-radius: 24px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(60, 30, 100, .35);
  animation: pop .3s ease;
}
.play-win-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 18px;
}

.confetti-mini {
  position: absolute;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  z-index: 30;
  pointer-events: none;
  animation: confMini .95s ease-out forwards;
}
@keyframes confMini {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
  30% { transform: translate(calc(var(--dx) * .5), -34px) rotate(180deg); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) rotate(540deg); opacity: 0; }
}

.confetti {
  position: absolute;
  width: 10px;
  height: 16px;
  border-radius: 3px;
  top: -20px;
  animation: confFall 2.8s linear forwards;
  z-index: 15;
}
@keyframes confFall {
  to { transform: translateY(620px) rotate(720deg); opacity: .3; }
}

.play-help {
  margin-top: 12px;
  background: #fff;
  border-radius: 16px;
  padding: 12px 18px;
  box-shadow: var(--shadow);
  font-size: 1rem;
  line-height: 1.5;
}

/* ---------- Landing page ---------- */
.landing { max-width: 1100px; }

.hero {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 26px;
  align-items: start;
  margin-top: 10px;
}

.hero-text h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.15;
  margin-bottom: 16px;
  background: linear-gradient(90deg, var(--pink), var(--purple), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-points {
  list-style: none;
  margin-bottom: 18px;
}
.hero-points li {
  background: #fff;
  border-radius: 14px;
  padding: 10px 16px;
  margin-bottom: 8px;
  font-weight: 600;
  box-shadow: var(--shadow);
}

.hero-img {
  width: 100%;
  border-radius: 22px;
  box-shadow: var(--shadow);
  display: block;
}

.auth-card {
  background: #fff;
  border-radius: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: sticky;
  top: 90px;
}

.auth-tabs { display: flex; }
.auth-tab {
  flex: 1;
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 700;
  padding: 15px 6px;
  border: none;
  cursor: pointer;
  background: #f0ecff;
  color: var(--text);
}
.auth-tab.active { background: linear-gradient(90deg, var(--pink), var(--purple)); color: #fff; }

.auth-body { padding: 22px; display: flex; flex-direction: column; gap: 8px; }
.auth-body label { font-weight: 700; color: var(--purple); font-size: .95rem; }
.auth-body input {
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 12px 15px;
  border: 3px solid #e8e0ff;
  border-radius: 14px;
  outline: none;
  margin-bottom: 6px;
}
.auth-body input:focus { border-color: var(--pink); }
.auth-body .big-btn { margin-top: 8px; }

.auth-hint {
  font-size: .88rem;
  background: #fff8e1;
  border-radius: 10px;
  padding: 9px 12px;
  color: #7a6520;
}
.captcha-box {
  background: #f6f2fc;
  border-radius: 14px;
  padding: 12px 14px;
}
.captcha-box label { display: block; margin-bottom: 6px; }
.captcha-seq {
  font-size: 1.7rem;
  letter-spacing: 6px;
  text-align: center;
  background: #fff;
  border-radius: 10px;
  padding: 8px 6px;
  margin-bottom: 8px;
  user-select: none;
}
.captcha-box input {
  width: 100%;
  font-family: inherit;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 9px 13px;
  border: 3px solid #e8e0ff;
  border-radius: 12px;
  outline: none;
}
.captcha-box input:focus { border-color: var(--pink); }
.captcha-reload {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1rem;
}

.auth-error {
  font-size: .95rem;
  font-weight: 700;
  background: #ffe0e6;
  border-radius: 10px;
  padding: 10px 12px;
  color: #b83b55;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-top: 28px;
}
.stat-card {
  background: linear-gradient(135deg, #fff, #fdf6ff);
  border-radius: 20px;
  padding: 20px 16px;
  box-shadow: var(--shadow);
  text-align: center;
}
.stat-num {
  display: block;
  font-size: 2.4rem;
  font-weight: 700;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-weight: 600; font-size: .98rem; }

.live-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2ecc71;
  margin-right: 7px;
  animation: livePulse 1.6s infinite;
  vertical-align: middle;
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, .5); }
  50% { box-shadow: 0 0 0 7px rgba(46, 204, 113, 0); }
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 28px;
}
.feature-card {
  background: #fff;
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow);
  font-size: .95rem;
  line-height: 1.45;
}
.feature-card b { display: block; margin-bottom: 6px; color: var(--purple); font-size: 1.05rem; }
.feature-card .f-emoji { display: block; font-size: 2rem; margin-bottom: 8px; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .auth-card { position: static; order: -1; }
}

/* ---------- Sauvegarde en ligne ---------- */
.cloud-state { font-size: 1.2rem; margin-right: 2px; }
.cloud-state.off { filter: grayscale(1); opacity: .5; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .creator-layout { grid-template-columns: 1fr; }
  .preview-pane { position: static; }
  .preview-card { max-width: 320px; margin: 0 auto; }
  .preview-actions { max-width: 320px; margin: 12px auto 0; }
  main { padding: 12px; }
}
