/* =========================================================
   mielmielmiel — styles
   ========================================================= */
:root {
  --cream: #fff7ee;
  --honey: #f6b73c;
  --honey-2: #ffd47a;
  --honey-deep: #d9821e;
  --rose: #f0936f;
  --rose-2: #f8c6a8;
  --rose-deep: #d86c4a;
  --plum: #7a4a32;
  --ink: #4a3226;
  --muted: #94786a;
  --glass: rgba(255, 255, 255, .62);
  --glass-border: rgba(255, 255, 255, .8);
  --surface: #ffffff;
  --surface-2: #fff4ea;
  --soft: rgba(255, 255, 255, .75);
  --tint: #6e462d;          /* fonds et bordures légers */
  --shade: #6e462d;         /* ombres */
  --bg-1: #ffe0b8; --bg-2: #fbd3bc; --bg-3: #fff6ea; --bg-4: #fdf0e6;
  --blob-1: #ffc56b; --blob-2: #fbb994; --blob-3: #ffd9a8;
  --art-1: #ffe6bd; --art-2: #ffd0dc;
  --table-1: #fdeedd; --table-2: #f9dfd6; --table-glow: rgba(255, 255, 255, .85);
  --toast-bg: #4a3226; --toast-ink: #ffffff;
  --scheme: light;
  --shadow: 0 14px 34px -14px color-mix(in srgb, var(--shade) 38%, transparent), 0 2px 6px color-mix(in srgb, var(--shade) 8%, transparent);
  --shadow-lg: 0 30px 60px -22px color-mix(in srgb, var(--shade) 50%, transparent), 0 4px 12px color-mix(in srgb, var(--shade) 10%, transparent);
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-back: cubic-bezier(.34, 1.4, .64, 1);
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---------- Thèmes ---------- */
:root[data-theme="menthe"] {
  --honey: #4fbf9a; --honey-2: #a3e3c9; --honey-deep: #2b8f6e;
  --rose: #5fb8cc; --rose-2: #bfe6ee; --rose-deep: #2f8aa3;
  --plum: #245e4f; --ink: #22362f; --muted: #6f8a80; --cream: #f2fbf7;
  --surface-2: #f0faf6; --tint: #2b5a4c; --shade: #2b5a4c;
  --bg-1: #d5f3e6; --bg-2: #d3ecf3; --bg-3: #f2fbf7; --bg-4: #eef7f8;
  --blob-1: #9fe3c6; --blob-2: #a9dbe8; --blob-3: #c9f0dd;
  --art-1: #d4f3e5; --art-2: #d3ebf3;
  --table-1: #e9f6f0; --table-2: #dfeff2;
  --toast-bg: #22362f;
}
:root[data-theme="lavande"] {
  --honey: #b48be8; --honey-2: #dcc8f7; --honey-deep: #7d55c7;
  --rose: #e48bc0; --rose-2: #f5c9e2; --rose-deep: #c0569a;
  --plum: #5a3d84; --ink: #352a45; --muted: #85789a; --cream: #faf6ff;
  --surface-2: #f8f2ff; --tint: #4a3570; --shade: #4a3570;
  --bg-1: #ece0fb; --bg-2: #f9dcec; --bg-3: #faf6ff; --bg-4: #f8f1fb;
  --blob-1: #cfb2f5; --blob-2: #f3b6d8; --blob-3: #e2d0fa;
  --art-1: #ebdffc; --art-2: #f9daea;
  --table-1: #f3ecfb; --table-2: #f6e6f1;
  --toast-bg: #352a45;
}
:root[data-theme="nuit"] {
  --honey: #f2b443; --honey-2: #f7cf7e; --honey-deep: #e09a35;
  --rose: #ef9a78; --rose-2: #7a4d3c; --rose-deep: #e07a55;
  --plum: #f0c9a8; --ink: #f3e6dc; --muted: #b5a094; --cream: #2a2220;
  --glass: rgba(42, 34, 32, .66); --glass-border: rgba(255, 255, 255, .08);
  --surface: #2d2523; --surface-2: #241d1b; --soft: rgba(255, 255, 255, .08);
  --tint: #ffffff; --shade: #000000;
  --bg-1: #3a2a1a; --bg-2: #3a2230; --bg-3: #1c1716; --bg-4: #151110;
  --blob-1: #6b4310; --blob-2: #5c2738; --blob-3: #3f2f16;
  --art-1: #3d2e22; --art-2: #3b2730;
  --table-1: #2a2220; --table-2: #201918; --table-glow: rgba(255, 255, 255, .05);
  --toast-bg: #f3e6dc; --toast-ink: #231c1a;
  --scheme: dark;
}
:root[data-theme="nuit"] .blob { opacity: .35; }
:root[data-theme="nuit"] .honeycomb { opacity: .05; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body.custom-cursor,
body.custom-cursor #stage-wrap,
body.custom-cursor #stage-wrap.can-grab,
body.custom-cursor #stage-wrap.grabbing { cursor: var(--my-cursor), auto; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 800px at 8% -10%, var(--bg-1) 0%, transparent 60%),
    radial-gradient(1000px 700px at 110% 110%, var(--bg-2) 0%, transparent 55%),
    linear-gradient(160deg, var(--bg-3), var(--bg-4));
  background-attachment: fixed;
  color-scheme: var(--scheme);
  transition: background-color .4s, color .4s;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; }
svg { display: block; }

/* ---------------------------------------------------------
   Décor de fond
   --------------------------------------------------------- */
.bg { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }

.honeycomb {
  position: absolute; inset: -50px;
  opacity: .07;
  background-color: var(--honey-deep);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 56 98'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 98M28 66L56 82M28 66L0 82' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='98' viewBox='0 0 56 98'%3E%3Cpath d='M28 66L0 50L0 16L28 0L56 16L56 50L28 66L28 98M28 66L56 82M28 66L0 82' fill='none' stroke='%23000' stroke-width='2'/%3E%3C/svg%3E");
  animation: comb 60s linear infinite;
}
@keyframes comb { to { transform: translate(56px, 98px); } }

.blob {
  position: absolute; border-radius: 50%;
  filter: blur(70px); opacity: .5;
  animation: drift 22s ease-in-out infinite alternate;
}
.b1 { width: 460px; height: 460px; background: var(--blob-1); left: -120px; top: 10%; }
.b2 { width: 520px; height: 520px; background: var(--blob-2); right: -160px; top: -120px; animation-duration: 28s; }
.b3 { width: 380px; height: 380px; background: var(--blob-3); left: 40%; bottom: -160px; animation-duration: 25s; }
@keyframes drift {
  0%   { transform: translate(0, 0) scale(1); }
  50%  { transform: translate(60px, -40px) scale(1.08); }
  100% { transform: translate(-40px, 50px) scale(.95); }
}

/* ---------------------------------------------------------
   Écrans
   --------------------------------------------------------- */
main { position: fixed; inset: 0; }

.screen {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  opacity: 0; visibility: hidden;
  transform: translateY(20px) scale(.985);
  transition: opacity .45s ease, transform .55s var(--ease-out), visibility 0s .55s;
}
.screen.active {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .55s ease .1s, transform .65s var(--ease-out) .1s, visibility 0s;
}

/* ---------------------------------------------------------
   Accueil
   --------------------------------------------------------- */
.home-inner {
  min-height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 44px; padding: 48px 16px 32px;
}

.hero { text-align: center; }
.logo {
  width: 54px; height: 54px; margin: 0 auto 10px;
  fill: var(--honey);
  filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--honey-deep) 40%, transparent));
  animation: floaty 4s ease-in-out infinite;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(52px, 10vw, 118px);
  letter-spacing: -.03em;
  line-height: 1;
  margin: 0;
}
.hero h1 > * {
  display: inline-block;
  background: linear-gradient(100deg, var(--honey-deep), var(--rose-deep) 45%, var(--honey) 70%, var(--honey-deep));
  background-size: 250% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: wordIn .9s var(--ease-back) both, shimmer 7s linear infinite;
  padding: 0 .02em .08em;
}
.hero h1 em { font-style: italic; font-weight: 500; animation-delay: .12s, 0s; }
.hero h1 > :last-child { animation-delay: .24s, 0s; }
@keyframes wordIn {
  from { opacity: 0; transform: translateY(30px) rotate(4deg) scale(.9); }
  to   { opacity: 1; transform: none; }
}
@keyframes shimmer { to { background-position: 250% center; } }

.tagline {
  margin: 14px 0 0; font-size: clamp(16px, 2.2vw, 20px); color: var(--muted); font-weight: 600;
  animation: fadeUp .8s var(--ease-out) .45s both;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.cards {
  width: 100%; max-width: 960px;
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  position: relative; text-align: left;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-radius: 28px; padding: 22px 22px 24px;
  box-shadow: var(--shadow);
  transition: transform .5s var(--ease-back), box-shadow .5s ease;
  animation: fadeUp .8s var(--ease-out) both;
}
.card:nth-child(1) { animation-delay: .5s; }
.card:nth-child(2) { animation-delay: .6s; }
.card:nth-child(3) { animation-delay: .7s; }
.card h2 { font-family: var(--font-display); font-weight: 600; font-size: 28px; margin: 0 0 6px; }
.card p { margin: 0; color: var(--muted); line-height: 1.5; }

.card .art {
  height: 140px; margin-bottom: 18px; border-radius: 20px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--art-1), var(--art-2));
  overflow: hidden;
}
.card .art svg { width: 120px; height: 120px; }

.card-puzzle { cursor: pointer; }
.card-puzzle:hover, .card-puzzle:focus-visible {
  transform: translateY(-8px) rotate(-.6deg);
  box-shadow: var(--shadow-lg);
  outline: none;
}

.puzzle-art .pp { transition: transform .6s var(--ease-back); }
.pp1 { fill: var(--rose); }
.pp2 { fill: var(--honey); }
.pp3 { fill: var(--honey-2); }
.pp4 { fill: var(--rose-2); }
.pp1 { transform: translate(-7px, -7px) rotate(-6deg); transform-origin: 40px 40px; }
.pp2 { transform: translate(7px, -6px) rotate(5deg); transform-origin: 80px 40px; }
.pp3 { transform: translate(-6px, 7px) rotate(4deg); transform-origin: 40px 80px; }
.pp4 { transform: translate(7px, 7px) rotate(-5deg); transform-origin: 80px 80px; }
.puzzle-art { animation: floaty 4s ease-in-out infinite; }
.card-puzzle:hover .pp { transform: none; }
@keyframes floaty { 50% { transform: translateY(-6px) rotate(2deg); } }

.cta {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 18px; padding: 10px 18px;
  border-radius: 999px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--rose-deep), var(--rose) 55%, var(--honey));
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--rose-deep) 70%, transparent);
}
.cta svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ease-back); }
.card-puzzle:hover .cta svg { transform: translateX(4px); }

.card.locked { opacity: .78; }
.card.locked .art { filter: saturate(.55); }
.mem-art rect { fill: var(--surface); stroke: var(--rose-2); stroke-width: 3; }
.mem-art circle { fill: var(--honey); }
.quiz-art path { fill: var(--surface); stroke: var(--honey); stroke-width: 3; }
.quiz-art text { font-family: var(--font-display); font-weight: 600; font-size: 34px; fill: var(--honey-deep); }
.badge {
  position: absolute; top: 34px; right: 34px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--soft); color: var(--plum);
  font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  box-shadow: var(--shadow);
}

.foot { color: var(--muted); font-weight: 600; font-size: 14px; opacity: .7; animation: fadeUp .8s ease .9s both; }

/* ---------------------------------------------------------
   Boutons communs
   --------------------------------------------------------- */
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; cursor: pointer;
  padding: 10px 16px; border-radius: 999px;
  background: var(--soft); font-weight: 700;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--shade) 8%, transparent);
  transition: background .2s, transform .3s var(--ease-back);
}
.btn-ghost:hover { background: var(--surface); transform: translateY(-2px); }
.btn-ghost svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.btn-primary {
  position: relative; overflow: hidden;
  width: 100%; border: 0; cursor: pointer;
  padding: 17px 22px; border-radius: 18px;
  font-size: 18px; font-weight: 800; color: #fff;
  background: linear-gradient(120deg, var(--rose-deep), var(--rose) 45%, var(--honey) 100%);
  background-size: 200% 100%;
  box-shadow: 0 14px 28px -12px color-mix(in srgb, var(--rose-deep) 70%, transparent);
  transition: transform .35s var(--ease-back), background-position .6s ease, box-shadow .3s, opacity .3s;
}
.btn-primary::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg);
}
.btn-primary:not(:disabled):hover { transform: translateY(-3px); background-position: 100% 0; box-shadow: 0 18px 32px -12px color-mix(in srgb, var(--rose-deep) 80%, transparent); }
.btn-primary:not(:disabled):hover::after { animation: sweep .9s ease; }
.btn-primary:not(:disabled):active { transform: translateY(0) scale(.98); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; filter: saturate(.6); }
.btn-primary span { position: relative; }
@keyframes sweep { to { left: 130%; } }

/* ---------------------------------------------------------
   Préparation
   --------------------------------------------------------- */
.topbar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  max-width: 1120px; margin: 0 auto; padding: 24px 24px 18px;
}
.topbar h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(26px, 4vw, 36px); margin: 0; }

.setup-grid {
  display: grid; grid-template-columns: 1.45fr 1fr; gap: 22px;
  max-width: 1120px; margin: 0 auto; padding: 0 24px 40px;
}
.panel {
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 28px; padding: 22px;
  box-shadow: var(--shadow);
}
.screen.active .panel { animation: fadeUp .7s var(--ease-out) both; }
.screen.active .panel + .panel { animation-delay: .12s; }

.panel h3 {
  margin: 4px 0 12px;
  font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--plum); opacity: .8;
}

.dropzone {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  min-height: 360px; padding: 20px;
  border: 2px dashed color-mix(in srgb, var(--rose-deep) 35%, transparent); border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 45%, transparent);
  cursor: pointer; text-align: center;
  transition: border-color .3s, background .3s, transform .4s var(--ease-back);
}
.dropzone:hover, .dropzone.over { border-color: var(--rose); background: color-mix(in srgb, var(--rose) 8%, transparent); }
.dropzone.over { transform: scale(1.015); }

.dz-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dz-empty strong { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.dz-empty span { color: var(--muted); }
.dz-icon {
  width: 76px; height: 76px; margin-bottom: 8px; border-radius: 24px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, var(--rose), var(--honey));
  box-shadow: 0 12px 24px -10px color-mix(in srgb, var(--rose-deep) 70%, transparent);
  animation: bob 2.4s ease-in-out infinite;
}
.dz-icon svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes bob { 50% { transform: translateY(-8px); } }

.dz-preview { display: none; flex-direction: column; align-items: center; gap: 12px; }
.dropzone.has-image { border-style: solid; border-color: transparent; background: color-mix(in srgb, var(--surface) 35%, transparent); }
.dropzone.has-image .dz-empty { display: none; }
.dropzone.has-image .dz-preview { display: flex; }

.preview-frame {
  position: relative; display: inline-block; line-height: 0;
  border-radius: 14px; overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: photoIn .6s var(--ease-back);
}
.preview-frame img { display: block; max-width: 100%; max-height: min(52vh, 440px); }
.preview-frame canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#pv-cuts.anim { animation: cutsIn .7s var(--ease-out); }
@keyframes photoIn { from { opacity: 0; transform: scale(.92) rotate(-2deg); } to { opacity: 1; transform: none; } }
@keyframes cutsIn { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
.dz-change { color: var(--muted); font-size: 14px; font-weight: 600; }

.dz-loading {
  position: absolute; inset: 0; display: none; place-items: center;
  background: color-mix(in srgb, var(--surface) 70%, transparent); border-radius: 20px;
}
.dropzone.loading .dz-loading { display: grid; }
.spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 4px solid color-mix(in srgb, var(--rose-deep) 20%, transparent); border-top-color: var(--rose);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.recent { margin-top: 20px; }
.recent-list { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; }
.thumb {
  position: relative; flex: none;
  width: 76px; height: 76px; padding: 0;
  border-radius: 16px; overflow: hidden; cursor: pointer;
  border: 3px solid transparent; background: var(--surface);
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--shade) 35%, transparent);
  transition: transform .35s var(--ease-back), border-color .2s;
  animation: fadeUp .5s var(--ease-out) both;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:hover { transform: translateY(-3px) rotate(-2deg); }
.thumb.active { border-color: var(--rose); }
.thumb .del {
  position: absolute; top: 3px; right: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(74, 50, 38, .7); color: #fff; font-size: 15px; line-height: 1;
  opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s var(--ease-back);
}
.thumb:hover .del { opacity: 1; transform: none; }
@media (hover: none) { .thumb .del { opacity: 1; transform: scale(.85); } }

.options { display: flex; flex-direction: column; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  border: 1px solid color-mix(in srgb, var(--rose-deep) 20%, transparent); background: var(--soft);
  padding: 9px 15px; border-radius: 999px;
  font-weight: 800; cursor: pointer;
  transition: transform .3s var(--ease-back), background .25s, color .25s, box-shadow .25s;
}
.chip:hover { transform: translateY(-2px); }
.chip.active {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--rose-deep), var(--rose) 50%, var(--honey));
  box-shadow: 0 8px 16px -8px color-mix(in srgb, var(--rose-deep) 80%, transparent);
  transform: scale(1.06);
}

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 10px; border-radius: 99px; outline: none; cursor: pointer;
  background: linear-gradient(90deg, var(--rose), var(--honey)) 0 / var(--p, 15%) 100% no-repeat, color-mix(in srgb, var(--rose-deep) 14%, transparent);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface); border: 4px solid var(--rose);
  box-shadow: 0 4px 10px color-mix(in srgb, var(--rose-deep) 45%, transparent);
  transition: transform .2s var(--ease-back);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }
input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); border: 4px solid var(--rose);
  box-shadow: 0 4px 10px color-mix(in srgb, var(--rose-deep) 45%, transparent);
}

.count-info { display: flex; align-items: center; gap: 12px; margin: 16px 0 22px; }
.count-info strong {
  font-family: var(--font-display); font-weight: 600; font-size: 56px; line-height: 1;
  background: linear-gradient(135deg, var(--rose-deep), var(--honey-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  display: inline-block;
}
.count-info strong.bump { animation: bump .45s var(--ease-back); }
@keyframes bump { 0% { transform: scale(.8); } 60% { transform: scale(1.12); } 100% { transform: none; } }
.count-info span { font-weight: 800; font-size: 18px; line-height: 1.2; }
.count-info small { color: var(--muted); font-weight: 700; font-size: 14px; }

.toggle { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-weight: 700; cursor: pointer; user-select: none; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle .sw {
  position: relative; flex: none; width: 46px; height: 26px; border-radius: 99px;
  background: color-mix(in srgb, var(--tint) 18%, transparent); transition: background .3s;
}
.toggle .sw::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .18);
  transition: transform .35s var(--ease-back);
}
.toggle input:checked + .sw { background: linear-gradient(135deg, var(--rose), var(--honey)); }
.toggle input:checked + .sw::after { transform: translateX(20px); }
.toggle input:focus-visible + .sw { outline: 2px solid var(--rose); outline-offset: 2px; }

.options .btn-primary { margin-top: auto; }
.options .toggle:last-of-type { margin-bottom: 26px; }
.hint { text-align: center; color: var(--muted); font-weight: 600; font-size: 14px; margin: 10px 0 0; transition: opacity .3s; }
.hint.hide { opacity: 0; }

/* ---------------------------------------------------------
   Jeu
   --------------------------------------------------------- */
#screen-game { display: flex; flex-direction: column; overflow: hidden; }

.game-bar {
  position: relative; z-index: 5;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 12px 12px 0; padding: 10px 12px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px; box-shadow: var(--shadow);
}
.stats { flex: 1; display: flex; align-items: center; gap: 22px; min-width: 220px; }
.stat { display: flex; flex-direction: column; line-height: 1.1; }
.stat small { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.stat b { font-family: var(--font-display); font-weight: 600; font-size: 22px; font-variant-numeric: tabular-nums; }
.progress { flex: 1; min-width: 60px; height: 10px; border-radius: 99px; background: color-mix(in srgb, var(--rose-deep) 13%, transparent); overflow: hidden; }
.progress i {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--rose), var(--honey));
  transition: width .6s var(--ease-out);
}

.tools { display: flex; gap: 8px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center;
  border: 0; cursor: pointer;
  background: var(--soft);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--shade) 8%, transparent);
  transition: transform .3s var(--ease-back), background .2s, color .2s;
}
.icon-btn:hover { transform: translateY(-2px); background: var(--surface); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.active { color: #fff; background: linear-gradient(135deg, var(--rose), var(--honey)); }
#btn-sound .off, #btn-sound.muted .on { display: none; }
#btn-sound.muted .off { display: block; }
#btn-shuffle:active svg { animation: spin .5s var(--ease-out); }

#stage-wrap {
  position: relative; flex: 1; margin: 12px;
  border-radius: 26px; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none;
  background:
    radial-gradient(circle at 50% 35%, var(--table-glow), transparent 65%),
    linear-gradient(160deg, var(--table-1), var(--table-2));
  box-shadow: inset 0 2px 24px color-mix(in srgb, var(--shade) 14%, transparent), inset 0 0 0 1px rgba(255, 255, 255, .7);
}
#stage-wrap.can-grab { cursor: grab; }
#stage-wrap.grabbing { cursor: grabbing; }
#stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }

#board {
  position: absolute; border-radius: 4px;
  background: color-mix(in srgb, var(--tint) 6%, transparent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--rose-deep) 20%, transparent), inset 0 8px 26px color-mix(in srgb, var(--shade) 14%, transparent);
  transition: box-shadow .8s ease;
}
#ghost {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: .2; filter: grayscale(.35) sepia(.2);
  transition: opacity .5s ease;
  border-radius: inherit;
}
#board.no-ghost #ghost { opacity: 0; }
#board.complete {
  animation: glow 2.2s ease-in-out infinite alternate;
}
@keyframes glow {
  from { box-shadow: 0 0 0 4px rgba(255, 255, 255, .95), 0 0 40px 6px rgba(255, 190, 100, .55); }
  to   { box-shadow: 0 0 0 6px rgba(255, 255, 255, .95), 0 0 80px 18px color-mix(in srgb, var(--rose) 55%, transparent); }
}

#pieces { position: absolute; inset: 0; }
#pieces.intro { animation: introIn .8s var(--ease-out); }
@keyframes introIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

.piece {
  position: absolute; left: 0; top: 0;
  pointer-events: none;
  will-change: translate;
  transition: translate .25s var(--ease-out), scale .2s var(--ease-back), filter .2s;
}
.piece.flying { transition: translate .95s cubic-bezier(.3, 1.25, .5, 1), scale .2s; }
.piece.dragging {
  transition: scale .18s var(--ease-back), filter .18s;
  scale: 1.07;
  filter: drop-shadow(0 14px 14px rgba(70, 25, 20, .28));
}
.piece.snapping { transition: translate .22s cubic-bezier(.3, 1.5, .5, 1); }
.piece.placed { animation: placedFlash .7s ease; }
@keyframes placedFlash {
  0%   { filter: brightness(1.45) saturate(1.2); }
  100% { filter: none; }
}

#reveal {
  position: absolute; z-index: 100000; pointer-events: none;
  opacity: 0; border-radius: 4px; overflow: hidden;
  transition: opacity 1s ease;
}
#reveal canvas { display: block; width: 100%; height: 100%; }
#reveal.show { opacity: 1; }
#reveal::after {
  content: ""; position: absolute; top: -20%; bottom: -20%; width: 35%; left: -50%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .6), transparent);
  transform: skewX(-18deg);
}
#reveal.show::after { animation: sweepBig 1.4s ease .5s; }
@keyframes sweepBig { to { left: 130%; } }

.spark {
  position: absolute; z-index: 100001; pointer-events: none;
  border-radius: 50%; translate: -50% -50%;
  animation: spark .9s var(--ease-out) forwards;
}
@keyframes spark {
  from { transform: translate(0, 0) scale(.3) rotate(0); opacity: 1; }
  70%  { opacity: 1; }
  to   { transform: translate(var(--dx), var(--dy)) scale(1) rotate(var(--rot)); opacity: 0; }
}
.ring {
  position: absolute; z-index: 100001; pointer-events: none;
  border-radius: 50%; translate: -50% -50%;
  border: 3px solid var(--honey-2);
  animation: ring .7s var(--ease-out) forwards;
}
@keyframes ring { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.3); opacity: 0; } }

#game-hint {
  position: absolute; left: 50%; top: 18px; z-index: 3;
  padding: 10px 18px; border-radius: 999px;
  background: rgba(74, 50, 38, .82); color: #fff; font-weight: 700;
  pointer-events: none; white-space: nowrap;
  opacity: 0; translate: -50% -10px;
  transition: opacity .4s, translate .5s var(--ease-back);
}
#game-hint.show { opacity: 1; translate: -50% 0; }

#preview-pop {
  position: absolute; right: 28px; bottom: 28px; z-index: 10;
  width: min(320px, 42vw); padding: 8px;
  background: var(--surface); border-radius: 18px;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  opacity: 0; transform: translateY(24px) scale(.88) rotate(4deg);
  transition: opacity .35s, transform .5s var(--ease-back);
}
#preview-pop.show { opacity: 1; transform: rotate(-2deg); }
#preview-pop img { display: block; width: 100%; border-radius: 12px; }

/* ---------------------------------------------------------
   Victoire
   --------------------------------------------------------- */
.modal {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 16px;
  background: rgba(74, 50, 38, .35);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden;
  transition: opacity .4s ease, visibility 0s .4s;
}
.modal.show { opacity: 1; visibility: visible; transition: opacity .4s ease; }
.modal-card {
  position: relative; width: 100%; max-width: 440px;
  padding: 0 28px 26px; margin-top: 70px;
  text-align: center;
  background: linear-gradient(170deg, var(--surface), var(--surface-2));
  border-radius: 30px;
  box-shadow: 0 40px 90px -25px color-mix(in srgb, var(--shade) 60%, transparent);
  transform: translateY(40px) scale(.9);
  transition: transform .7s var(--ease-back);
}
.modal.show .modal-card { transform: none; }

.win-photo {
  width: 150px; margin: -70px auto 0; padding: 6px;
  background: var(--surface); border-radius: 16px;
  box-shadow: var(--shadow-lg);
  transform: rotate(-4deg);
}
.modal.show .win-photo { animation: photoDrop .9s var(--ease-back) .15s both; }
@keyframes photoDrop { from { opacity: 0; transform: translateY(-30px) rotate(-14deg) scale(.8); } to { opacity: 1; transform: rotate(-4deg); } }
.win-photo img { display: block; width: 100%; border-radius: 11px; }
.modal-card h2 { font-family: var(--font-display); font-weight: 600; font-size: 34px; margin: 18px 0 4px; }
.win-sub { margin: 0 0 20px; color: var(--muted); font-weight: 600; }

.win-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.win-stats div {
  padding: 12px 6px; border-radius: 16px;
  background: color-mix(in srgb, var(--rose) 8%, transparent);
  display: flex; flex-direction: column; gap: 2px;
}
.win-stats b { font-family: var(--font-display); font-weight: 600; font-size: 24px; }
.win-stats small { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.modal.show .win-stats div { animation: fadeUp .5s var(--ease-out) both; }
.modal.show .win-stats div:nth-child(1) { animation-delay: .35s; }
.modal.show .win-stats div:nth-child(2) { animation-delay: .45s; }
.modal.show .win-stats div:nth-child(3) { animation-delay: .55s; }

.record { margin: 16px 0 18px; font-weight: 800; color: var(--plum); min-height: 1.3em; }
.record.new {
  display: inline-block; padding: 6px 14px; border-radius: 999px;
  color: #fff; background: linear-gradient(135deg, var(--honey-deep), var(--honey));
  box-shadow: 0 8px 18px -8px color-mix(in srgb, var(--honey-deep) 80%, transparent);
}
.modal.show .record.new { animation: bump .6s var(--ease-back) .8s both; }

.win-actions { display: flex; flex-direction: column; gap: 10px; }
.win-actions .row { display: flex; gap: 10px; }
.win-actions .row .btn-ghost { flex: 1; justify-content: center; background: color-mix(in srgb, var(--tint) 7%, transparent); }

.win-players { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.win-players:empty { display: none; }
.win-players span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--tint) 6%, transparent); font-weight: 700; font-size: 14px;
}
.win-players i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }

/* ---------------------------------------------------------
   En ligne : pseudo, joueurs, curseurs, invitation
   --------------------------------------------------------- */
.name-card { margin-top: 0; padding: 30px 28px 26px; }
.name-card h2 { margin-top: 0; }
#name-input {
  width: 100%; margin-bottom: 14px; padding: 14px 16px;
  border: 2px solid color-mix(in srgb, var(--rose-deep) 20%, transparent); border-radius: 14px;
  font: inherit; font-size: 18px; font-weight: 700; color: var(--ink);
  background: var(--surface); outline: none; text-align: center;
  transition: border-color .2s, box-shadow .2s;
}
#name-input:focus { border-color: var(--honey); box-shadow: 0 0 0 4px color-mix(in srgb, var(--honey) 20%, transparent); }
#name-input.shake { animation: shake .4s ease; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.btn-small {
  border: 0; cursor: pointer; white-space: nowrap;
  padding: 7px 12px; border-radius: 10px;
  font-weight: 800; font-size: 13px;
  background: color-mix(in srgb, var(--tint) 8%, transparent);
  transition: background .2s, transform .3s var(--ease-back);
}
.btn-small:hover { background: color-mix(in srgb, var(--tint) 14%, transparent); transform: translateY(-1px); }
.btn-small.accent { color: #fff; background: linear-gradient(135deg, var(--rose-deep), var(--honey)); }

.live-dot {
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: #2f9e6e; box-shadow: 0 0 0 0 rgba(47, 158, 110, .5);
  animation: live 1.8s ease-out infinite;
}
.live-dot.off { background: #c9a227; animation: none; }
@keyframes live { to { box-shadow: 0 0 0 8px rgba(47, 158, 110, 0); } }

.room-pill {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 6px 6px 6px 14px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--glass-border);
  box-shadow: var(--shadow); font-weight: 700; font-size: 14px;
  animation: fadeUp .5s var(--ease-out);
}
.room-pill[hidden] { display: none; }

.players { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pchip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px 5px 5px; border-radius: 999px;
  background: var(--soft); font-weight: 800; font-size: 13px;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--shade) 8%, transparent);
  animation: chipIn .45s var(--ease-back);
}
.pchip b {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--c); color: #fff; font-size: 11px;
}
.pchip small { color: var(--muted); font-weight: 700; }
@keyframes chipIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }

.cursor {
  position: absolute; left: 0; top: 0; z-index: 100002;
  pointer-events: none;
  transform-origin: 0 0; scale: var(--inv, 1);
  transition: translate .08s linear, opacity .3s;
}
.cursor.hidden { opacity: 0; }
.cursor svg { overflow: visible; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25)); }
.cursor path { fill: var(--c); stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; }
.cursor span {
  position: absolute; left: var(--lx, 18px); top: var(--ly, 20px);
  padding: 3px 9px; border-radius: 999px;
  background: var(--c); color: #fff;
  font-weight: 800; font-size: 13px; white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .18);
}

.piece.held {
  scale: 1.05;
  filter: drop-shadow(0 0 3px var(--hold)) drop-shadow(0 10px 12px rgba(70, 25, 20, .25));
  transition: translate .08s linear, scale .2s var(--ease-back), filter .2s;
}

.pop {
  position: absolute; right: 16px; top: 80px; z-index: 12;
  width: min(380px, calc(100% - 32px)); padding: 18px;
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg);
  opacity: 0; visibility: hidden; transform: translateY(-10px) scale(.96);
  transform-origin: top right;
  transition: opacity .25s, transform .4s var(--ease-back), visibility 0s .4s;
}
.pop.show { opacity: 1; visibility: visible; transform: none; transition: opacity .25s, transform .4s var(--ease-back); }
.pop strong { font-family: var(--font-display); font-size: 20px; font-weight: 600; }
.pop p { margin: 6px 0 12px; color: var(--muted); font-weight: 600; font-size: 14px; }
.pop .pop-note { margin: 10px 0 0; font-size: 13px; }
.pop .pop-note:empty { display: none; }
.copy-row { display: flex; gap: 8px; }
.copy-row input {
  flex: 1; min-width: 0; padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--tint) 15%, transparent); border-radius: 10px;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--ink); background: var(--cream);
}

@media (max-width: 560px) {
  .players { order: 4; flex-basis: 100%; }
  .room-pill { margin-left: 0; }
}

/* ---------------------------------------------------------
   Paramètres
   --------------------------------------------------------- */
.settings-fab {
  position: fixed; top: 16px; right: 16px; z-index: 6;
  transition: opacity .3s, transform .3s var(--ease-back);
}
body:not([data-screen="home"]) .settings-fab { opacity: 0; pointer-events: none; transform: scale(.8); }
.settings-fab svg, #btn-settings svg, #setup-settings svg { transition: transform .6s var(--ease-back); }
.settings-fab:hover svg, #btn-settings:hover svg, #setup-settings:hover svg { transform: rotate(60deg); }

.drawer { position: fixed; inset: 0; z-index: 55; visibility: hidden; transition: visibility 0s .45s; }
.drawer.show { visibility: visible; transition: none; }
.drawer-backdrop {
  position: absolute; inset: 0;
  background: rgba(30, 20, 15, .3);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .35s;
}
.drawer.show .drawer-backdrop { opacity: 1; }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(420px, 100%);
  display: flex; flex-direction: column;
  background: var(--surface-2);
  box-shadow: -20px 0 60px -20px color-mix(in srgb, var(--shade) 50%, transparent);
  transform: translateX(105%);
  transition: transform .45s var(--ease-out);
}
.drawer.show .drawer-panel { transform: none; }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 10px 24px;
}
.drawer-head h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 28px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 24px 28px; }
.drawer-body section {
  padding: 16px; margin-bottom: 14px; border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--shade) 6%, transparent);
}
.drawer.show .drawer-body section { animation: fadeUp .45s var(--ease-out) both; }
.drawer.show .drawer-body section:nth-child(2) { animation-delay: .05s; }
.drawer.show .drawer-body section:nth-child(3) { animation-delay: .1s; }
.drawer.show .drawer-body section:nth-child(4) { animation-delay: .15s; }
.drawer-body h3 {
  margin: 0 0 12px;
  font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--plum); opacity: .8;
}
.drawer-body .toggle:last-child { margin-bottom: 0; }
.field-note { margin: 8px 0 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.drawer-foot { text-align: center; }

.text-input {
  width: 100%; padding: 12px 14px;
  border: 2px solid color-mix(in srgb, var(--tint) 12%, transparent); border-radius: 12px;
  font: inherit; font-size: 16px; font-weight: 700; color: var(--ink);
  background: var(--surface-2); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.text-input:focus { border-color: var(--honey); box-shadow: 0 0 0 4px color-mix(in srgb, var(--honey) 20%, transparent); }
.saved-tick { color: #2f9e6e; font-weight: 800; opacity: 0; transition: opacity .3s; margin-left: 6px; }
.saved-tick.show { opacity: 1; }

.cursor-preview {
  position: relative; height: 92px; margin-bottom: 14px; border-radius: 16px; overflow: hidden;
  background:
    radial-gradient(circle at 50% 40%, var(--table-glow), transparent 70%),
    linear-gradient(160deg, var(--table-1), var(--table-2));
}
.cursor-preview .cursor { scale: 1; left: 38%; top: 30%; animation: wander 6s ease-in-out infinite; transition: none; }
@keyframes wander {
  0%, 100% { translate: 0 0; }
  30% { translate: 46px 14px; }
  60% { translate: -30px 22px; }
}

.shape-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 14px; }
.shape-btn {
  aspect-ratio: 1; border-radius: 12px; cursor: pointer;
  display: grid; place-items: center;
  border: 2px solid transparent; background: var(--surface-2);
  transition: transform .3s var(--ease-back), border-color .2s;
}
.shape-btn:hover { transform: translateY(-2px); }
.shape-btn.active { border-color: var(--honey); }
.shape-btn svg { width: 24px; height: 24px; overflow: visible; }
.shape-btn path { fill: var(--c); stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; }

.swatches { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.swatch {
  width: 32px; height: 32px; border-radius: 50%; cursor: pointer;
  border: 3px solid var(--surface); background: var(--c);
  box-shadow: 0 0 0 2px transparent;
  transition: transform .3s var(--ease-back), box-shadow .2s;
}
.swatch:hover { transform: scale(1.12); }
.swatch.active { box-shadow: 0 0 0 2px var(--c); }
.swatch.custom {
  position: relative; overflow: hidden;
  background: conic-gradient(#f66, #fc6, #6c6, #6cf, #96f, #f6c, #f66);
}
.swatch.custom input { position: absolute; inset: -8px; width: 200%; height: 200%; opacity: 0; cursor: pointer; }

.seg { display: flex; padding: 4px; gap: 4px; border-radius: 12px; background: var(--surface-2); margin-bottom: 14px; }
.seg button {
  flex: 1; border: 0; cursor: pointer; padding: 8px; border-radius: 9px;
  background: transparent; font-weight: 800; font-size: 13px; color: var(--muted);
  transition: background .2s, color .2s;
}
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: 0 2px 6px color-mix(in srgb, var(--shade) 12%, transparent); }

.themes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.theme-card {
  position: relative; cursor: pointer; text-align: left;
  padding: 10px; border-radius: 14px;
  border: 2px solid transparent; background: var(--surface-2);
  font-weight: 800; font-size: 14px;
  transition: transform .3s var(--ease-back), border-color .2s;
}
.theme-card:hover { transform: translateY(-2px); }
.theme-card.active { border-color: var(--honey); }
.theme-card .sw3 {
  display: flex; height: 38px; margin-bottom: 8px; border-radius: 9px; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06);
}
.theme-card .sw3 i { flex: 1; }

/* ---------------------------------------------------------
   Confettis & toast
   --------------------------------------------------------- */
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 60; }

#toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 70;
  max-width: calc(100% - 32px);
  padding: 12px 18px; border-radius: 14px;
  background: var(--toast-bg); color: var(--toast-ink); font-weight: 700;
  box-shadow: var(--shadow-lg);
  opacity: 0; translate: -50% 20px; pointer-events: none;
  transition: opacity .3s, translate .45s var(--ease-back);
}
#toast.show { opacity: 1; translate: -50% 0; }

/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 860px) {
  .setup-grid { grid-template-columns: 1fr; padding: 0 16px 32px; }
  .topbar { padding: 18px 16px 14px; }
  .dropzone { min-height: 280px; }
}
@media (max-width: 560px) {
  .game-bar { margin: 8px 8px 0; gap: 10px; }
  .stats { order: 3; flex-basis: 100%; gap: 16px; }
  .tools { margin-left: auto; }
  .icon-btn { width: 38px; height: 38px; }
  #stage-wrap { margin: 8px; border-radius: 20px; }
  .modal-card h2 { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .blob, .honeycomb { display: none; }
}
