/* ════════════════════════════════════════════════
   KORENCE MATHS — MENU ENFANT v1.4.0
   ════════════════════════════════════════════════ */

.kmm-wrap {
	--bg1: #4facfe; --bg2: #b5ecff;
	--hill1: #86e3a0; --hill2: #43c777;
	--cloud: rgba(255,255,255,.95);
	--sunop: 1; --starop: 0;
	--shadow: rgba(20,40,120,.28);
	--ink: #fff;
	position: relative; isolation: isolate; overflow: hidden;
	min-height: 100vh; min-height: 100svh;
	padding: 22px 16px 150px;
	box-sizing: border-box; text-align: center; color: var(--ink);
	font-family: 'Fredoka','Baloo 2','Nunito','Segoe UI',ui-rounded,system-ui,sans-serif;
	background: linear-gradient(180deg, var(--bg1), var(--bg2));
	-webkit-tap-highlight-color: transparent;
}
.kmm-wrap *, .kmm-wrap *::before, .kmm-wrap *::after { box-sizing: border-box; }
.kmm-full {
	--kmm-top: 0px;
	position: fixed; top: var(--kmm-top); left: 0; right: 0; bottom: 0; z-index: 99990;
	width: auto; min-height: 0; max-width: none; margin: 0;
	overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
}
body.admin-bar .kmm-full { --kmm-top: 32px; }
@media (max-width: 782px) { body.admin-bar .kmm-full { --kmm-top: 46px; } }
/* le décor reste fixe pendant que le contenu défile */
.kmm-full .kmm-sky { position: fixed; top: var(--kmm-top); left: 0; right: 0; bottom: 0; }
html.kmm-fs, html.kmm-fs body { overflow: hidden !important; }

.kmm-wrap[data-theme="candy"]  { --bg1:#ff9a9e; --bg2:#fbc2eb; --hill1:#ffd6f0; --hill2:#ff9ccd; --shadow: rgba(160,30,90,.3); }
.kmm-wrap[data-theme="sunset"] { --bg1:#7b4397; --bg2:#feb47b; --hill1:#c0577a; --hill2:#7b2d6b; --shadow: rgba(80,20,60,.35); }
.kmm-wrap[data-theme="forest"] { --bg1:#3aa655; --bg2:#c9f27f; --hill1:#2e9b4f; --hill2:#1b6b37; --shadow: rgba(10,70,30,.32); }
.kmm-wrap[data-theme="night"]  { --bg1:#150f4f; --bg2:#6a4fc9; --hill1:#2b2a7a; --hill2:#191850; --cloud: rgba(255,255,255,.18); --sunop:.9; --starop:1; --shadow: rgba(0,0,30,.5); }

/* ─── DÉCOR ─────────────────────────────────── */
.kmm-sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }

.kmm-sun {
	position: absolute; top: -90px; right: -90px; width: 300px; height: 300px; border-radius: 50%;
	background: radial-gradient(circle at 50% 50%, #fff7b0 0 22%, #ffd93d 23% 32%, transparent 33%);
	opacity: var(--sunop);
}
.kmm-sun::before {
	content: ""; position: absolute; inset: -40px; border-radius: 50%;
	background: repeating-conic-gradient(rgba(255,240,150,.5) 0 9deg, transparent 9deg 18deg);
	-webkit-mask-image: radial-gradient(circle, #000 25%, transparent 68%);
	        mask-image: radial-gradient(circle, #000 25%, transparent 68%);
	animation: kmm-spin 50s linear infinite;
}
.kmm-wrap[data-theme="night"] .kmm-sun {
	top: 34px; right: 9%; width: 120px; height: 120px; background: none; border-radius: 50%;
	box-shadow: inset -30px -8px 0 0 #fff6c9;
	filter: drop-shadow(0 0 22px rgba(255,248,190,.75)) drop-shadow(0 0 60px rgba(255,248,190,.35));
	rotate: -18deg;
	animation: kmm-moon 6s ease-in-out infinite;
}
.kmm-wrap[data-theme="night"] .kmm-sun::before {
	inset: -70px; animation: none; -webkit-mask-image: none; mask-image: none;
	background: radial-gradient(circle, rgba(255,248,190,.22), transparent 62%);
	box-shadow: none;
}

.kmm-stars {
	position: absolute; inset: 0; opacity: var(--starop);
	background-image:
		radial-gradient(2px 2px at 20px 30px, #fff, transparent),
		radial-gradient(2px 2px at 90px 120px, #fff, transparent),
		radial-gradient(1.5px 1.5px at 160px 60px, #ffe, transparent),
		radial-gradient(2px 2px at 40px 170px, #fff, transparent),
		radial-gradient(1.5px 1.5px at 130px 190px, #fff, transparent);
	background-size: 200px 220px;
	animation: kmm-twinkle 3s ease-in-out infinite;
}

.kmm-cloud {
	position: absolute; left: 0; width: 130px; height: 42px; border-radius: 50px; background: var(--cloud);
	transform: translateX(-220px) scale(var(--sc, 1));
	animation: kmm-cloud var(--dur, 60s) linear var(--dl, 0s) infinite;
}
.kmm-cloud::before, .kmm-cloud::after { content: ""; position: absolute; background: inherit; border-radius: 50%; }
.kmm-cloud::before { width: 58px; height: 58px; top: -28px; left: 20px; }
.kmm-cloud::after  { width: 72px; height: 72px; top: -38px; left: 56px; }

.kmm-float {
	position: absolute; bottom: -12%; line-height: 1; opacity: 0;
	animation: kmm-rise 20s linear infinite;
	filter: drop-shadow(0 3px 4px rgba(0,0,0,.15));
}

.kmm-hills { position: absolute; left: 0; right: 0; bottom: 0; height: 150px; }
.kmm-hill { position: absolute; bottom: -60px; border-radius: 50%; display: block; }
.kmm-hill-a { left: -15%; width: 75%; height: 170px; background: var(--hill1); }
.kmm-hill-b { right: -20%; width: 90%; height: 150px; background: var(--hill2); }

/* ─── CONTENU ───────────────────────────────── */
.kmm-content { position: relative; z-index: 1; max-width: 1040px; margin: 0 auto; }
.kmm-top { display: flex; justify-content: flex-start; margin-bottom: 4px; }
.kmm-back-home {
	display: inline-block; padding: 10px 18px; border-radius: 999px; text-decoration: none;
	background: rgba(255,255,255,.28); color: #fff; font-weight: 600; backdrop-filter: blur(6px);
	box-shadow: 0 4px 0 rgba(0,0,0,.12); transition: transform .15s;
}
.kmm-back-home:hover { transform: translateY(-2px) scale(1.05); color: #fff; }

.kmm-title {
	margin: 8px 0 4px; font-size: clamp(2.1rem, 7vw, 4rem); line-height: 1.1; font-weight: 700; color: #fff;
	text-shadow: 0 4px 0 rgba(0,0,0,.16), 0 10px 22px rgba(0,0,0,.18);
	letter-spacing: .5px;
}
.kmm-word { display: inline-block; white-space: nowrap; }
.kmm-l { display: inline-block; animation: kmm-wave 2.6s ease-in-out infinite; animation-delay: var(--d); transform-origin: 50% 90%; }
.kmm-subtitle { margin: 0 0 6px; font-size: clamp(1.05rem, 3vw, 1.5rem); font-weight: 500; opacity: .95; text-shadow: 0 2px 0 rgba(0,0,0,.14); }

/* Mascotte */
.kmm-mascot { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 14px auto 6px; flex-wrap: nowrap; }
.kmm-mascot-face {
	background: none; border: 0; cursor: pointer; padding: 0; font-size: clamp(3.6rem, 12vw, 5.5rem); line-height: 1;
	filter: drop-shadow(0 8px 6px rgba(0,0,0,.25)); animation: kmm-bob 3s ease-in-out infinite; transform-origin: 50% 100%;
}
.kmm-mascot-face.kmm-jump { animation: kmm-jump .7s ease; }
.kmm-bubble {
	position: relative; background: #fff; color: #3b2f63; padding: 12px 18px; border-radius: 22px; max-width: 320px;
	font-weight: 600; font-size: clamp(.95rem, 2.6vw, 1.15rem); text-align: left;
	box-shadow: 0 6px 0 rgba(0,0,0,.12), 0 14px 24px var(--shadow);
}
.kmm-bubble::before {
	content: ""; position: absolute; left: -12px; top: 50%; margin-top: -10px;
	border: 10px solid transparent; border-right-color: #fff; border-left: 0;
}
.kmm-bubble-txt { display: inline-block; }
.kmm-bubble-txt.kmm-swap { animation: kmm-swap .5s cubic-bezier(.34,1.56,.64,1); }

/* Grille */
.kmm-grid {
	display: grid; gap: 26px; max-width: 1000px; margin: 30px auto 0; padding: 0 4px;
	grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr));
}

/* Carte */
.kmm-card {
	position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px;
	padding: 28px 18px 20px; border: 0; border-radius: 34px; overflow: hidden; cursor: pointer;
	color: #fff; text-decoration: none; font: inherit; text-align: center;
	background: linear-gradient(145deg, var(--c1), var(--c2));
	box-shadow: 0 10px 0 rgba(0,0,0,.2), 0 24px 32px var(--shadow);
	animation: kmm-pop .75s cubic-bezier(.34,1.56,.64,1) both, kmm-float 4.2s ease-in-out infinite;
	animation-delay: calc(var(--i) * .13s), calc(var(--i) * .13s + .9s);
	transition: scale .18s cubic-bezier(.34,1.56,.64,1), rotate .18s, box-shadow .18s;
}
.kmm-card:hover, .kmm-card:focus-visible { scale: 1.06; rotate: -1.5deg; color: #fff; outline: 0; box-shadow: 0 14px 0 rgba(0,0,0,.2), 0 30px 40px var(--shadow); }
.kmm-card:active { scale: .95; rotate: 0deg; box-shadow: 0 3px 0 rgba(0,0,0,.2), 0 8px 14px var(--shadow); }
.kmm-card::before { /* reflet brillant */
	content: ""; position: absolute; top: 0; left: 0; right: 0; height: 46%;
	background: linear-gradient(180deg, rgba(255,255,255,.35), rgba(255,255,255,0)); border-radius: 34px 34px 60% 60%;
	pointer-events: none;
}
.kmm-shine {
	position: absolute; top: 0; left: -120%; width: 55%; height: 100%; pointer-events: none;
	background: linear-gradient(100deg, transparent, rgba(255,255,255,.55), transparent); transform: skewX(-20deg);
	animation: kmm-shine 5s ease-in-out infinite; animation-delay: calc(var(--i) * .7s + 1.5s);
}

.kmm-ico {
	position: relative; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center;
	background: rgba(255,255,255,.95); box-shadow: inset 0 -6px 0 rgba(0,0,0,.08), 0 8px 14px rgba(0,0,0,.2);
	animation: kmm-bob 3.4s ease-in-out infinite; animation-delay: calc(var(--i) * -.6s);
}
.kmm-ico-in { display: grid; place-items: center; width: 100%; height: 100%; }
.kmm-emoji { font-size: 3.2rem; line-height: 1; }
.kmm-img { width: 66%; height: 66%; object-fit: contain; }
.kmm-card:hover .kmm-ico-in { animation: kmm-wiggle .6s ease; }

.kmm-card-title { font-size: 1.75rem; font-weight: 700; line-height: 1.1; margin-top: 6px; text-shadow: 0 3px 0 rgba(0,0,0,.18); }
.kmm-card-desc  { font-size: 1rem; font-weight: 500; opacity: .95; line-height: 1.25; }
.kmm-pill {
	margin-top: 6px; padding: 5px 14px; border-radius: 999px; font-size: .9rem; font-weight: 600;
	background: rgba(255,255,255,.3); box-shadow: inset 0 0 0 2px rgba(255,255,255,.35);
}
.kmm-pill b { display: inline-block; animation: kmm-nudge 1.2s ease-in-out infinite; }

.kmm-badge {
	position: absolute; top: 20px; right: -38px; width: 140px; padding: 4px 0; transform: rotate(35deg);
	font-size: .8rem; font-weight: 700; color: #5a3d00; background: #ffd93d; box-shadow: 0 3px 0 rgba(0,0,0,.15);
}
.kmm-badge-hot  { background: #ff4757; color: #fff; }
.kmm-badge-soon { background: #dfe4ea; color: #57606f; }

.kmm-card.kmm-locked { cursor: not-allowed; filter: saturate(.35) brightness(.98); animation: kmm-pop .75s cubic-bezier(.34,1.56,.64,1) both; animation-delay: calc(var(--i) * .13s); }
.kmm-card.kmm-locked:hover { scale: 1; rotate: 0deg; }
.kmm-card.kmm-shake { animation: kmm-shake .5s ease; }

.kmm-empty { margin-top: 40px; font-size: 1.4rem; font-weight: 600; }

/* ─── SOUS-MENU (feuille) ───────────────────── */
html.kmm-lock { overflow: hidden; }
.kmm-sheet { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 16px; }
.kmm-sheet[hidden] { display: none; }
.kmm-sheet-bg { position: absolute; inset: 0; background: rgba(20,10,60,.55); backdrop-filter: blur(6px); animation: kmm-fade .3s ease both; }
.kmm-sheet-panel {
	position: relative; width: 100%; max-width: 760px; max-height: calc(100vh - 32px); max-height: calc(100svh - 32px); overflow: auto;
	background: #fffaf0; color: #3b2f63; border-radius: 40px; padding: 0 0 22px;
	box-shadow: 0 16px 0 rgba(0,0,0,.18), 0 40px 60px rgba(0,0,0,.4);
	animation: kmm-sheet-in .6s cubic-bezier(.34,1.56,.64,1) both;
	font-family: inherit;
}
.kmm-sheet-head {
	position: relative; display: flex; align-items: center; gap: 14px; padding: 20px 76px 20px 24px; color: #fff;
	background: linear-gradient(120deg, var(--c1), var(--c2)); border-radius: 40px 40px 34px 34px / 40px 40px 34px 34px;
}
.kmm-sheet-head h2 { margin: 0; font-size: clamp(1.6rem, 5vw, 2.3rem); font-weight: 700; color: #fff; text-shadow: 0 3px 0 rgba(0,0,0,.18); }
.kmm-sheet-ico { width: 62px; height: 62px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 5px 0 rgba(0,0,0,.14); animation: kmm-bob 2.6s ease-in-out infinite; }
.kmm-sheet-ico .kmm-emoji { font-size: 2.1rem; }
.kmm-wrap .kmm-sheet-close {
	-webkit-appearance: none; appearance: none;
	position: absolute; top: 14px; right: 14px; z-index: 5;
	display: grid; place-items: center; width: 48px; height: 48px; min-width: 0; margin: 0; padding: 0;
	border: 3px solid #fff; border-radius: 50%; cursor: pointer; line-height: 1; text-transform: none;
	color: #ff4d6d; background: #fff;
	box-shadow: 0 5px 0 rgba(0,0,0,.22), 0 10px 16px rgba(0,0,0,.18);
	transition: transform .2s cubic-bezier(.34,1.56,.64,1), background .15s, color .15s;
}
.kmm-wrap .kmm-sheet-close svg { display: block; pointer-events: none; }
.kmm-wrap .kmm-sheet-close:hover, .kmm-wrap .kmm-sheet-close:focus-visible { transform: rotate(90deg) scale(1.12); background: #ff4d6d; color: #fff; outline: 0; }
.kmm-wrap .kmm-sheet-close:active { transform: scale(.9); box-shadow: 0 1px 0 rgba(0,0,0,.22); }

.kmm-sub-grid {
	display: grid; gap: 18px; padding: 22px 20px 6px;
	grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
}
.kmm-sub-grid .kmm-card { padding: 20px 12px 16px; border-radius: 28px; animation-delay: calc(var(--i) * .1s + .25s), calc(var(--i) * .1s + 1.2s); }
.kmm-sub-grid .kmm-card.kmm-locked { animation-delay: calc(var(--i) * .1s + .25s); }
.kmm-sub-grid .kmm-ico { width: 74px; height: 74px; }
.kmm-sub-grid .kmm-emoji { font-size: 2.4rem; }
.kmm-sub-grid .kmm-card-title { font-size: 1.35rem; }
.kmm-sub-grid .kmm-card-desc { font-size: .9rem; }
.kmm-sub-grid .kmm-badge { top: 14px; right: -42px; }

.kmm-wrap .kmm-back {
	display: block; margin: 16px auto 0; padding: 12px 26px; border: 0; border-radius: 999px; cursor: pointer;
	font: 700 1.05rem/1 inherit; font-family: inherit; color: #fff; background: linear-gradient(135deg, #7c5cff, #a55eea);
	box-shadow: 0 6px 0 rgba(0,0,0,.18); transition: transform .15s;
}
.kmm-wrap .kmm-back:hover { transform: translateY(-2px) scale(1.05); }
.kmm-wrap .kmm-back:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }

/* ─── RÉCOMPENSES ───────────────────────────── */
/* Bannière dorée sous la mascotte */
.kmm-wrap .kmm-rwd-banner {
	position: relative; display: flex; align-items: center; gap: 14px; width: min(560px, 100%); margin: 22px auto 0; padding: 14px 20px 14px 14px;
	border: 0; border-radius: 34px; overflow: hidden; cursor: pointer; text-align: left; font: inherit; color: #5a3300;
	background: linear-gradient(145deg, #ffe066, #ffb703 55%, #fb8500);
	box-shadow: 0 10px 0 rgba(0,0,0,.2), 0 24px 32px var(--shadow);
	animation: kmm-pop .75s cubic-bezier(.34,1.56,.64,1) .1s both, kmm-float 4.2s ease-in-out 1s infinite;
	transition: scale .18s cubic-bezier(.34,1.56,.64,1), box-shadow .18s;
}
.kmm-wrap .kmm-rwd-banner::before { /* reflet brillant */
	content: ""; position: absolute; top: 0; left: 0; right: 0; height: 46%; border-radius: 34px 34px 60% 60%;
	background: linear-gradient(180deg, rgba(255,255,255,.45), rgba(255,255,255,0)); pointer-events: none;
}
.kmm-wrap .kmm-rwd-banner:hover, .kmm-wrap .kmm-rwd-banner:focus-visible { scale: 1.04; color: #5a3300; outline: 0; box-shadow: 0 14px 0 rgba(0,0,0,.2), 0 30px 40px var(--shadow); }
.kmm-wrap .kmm-rwd-banner:active { scale: .96; box-shadow: 0 3px 0 rgba(0,0,0,.2), 0 8px 14px var(--shadow); }
.kmm-rwd-banner .kmm-shine { animation-delay: 2.2s; }
.kmm-rwd-ico {
	position: relative; flex: none; width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center;
	background: rgba(255,255,255,.96); box-shadow: inset 0 -6px 0 rgba(0,0,0,.08), 0 8px 14px rgba(0,0,0,.2);
}
.kmm-rwd-ico span { font-size: 2.6rem; line-height: 1; display: block; animation: kmm-wiggle 2.8s ease-in-out infinite; }
.kmm-rwd-txt { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.kmm-rwd-title { font-size: clamp(1.4rem, 4.6vw, 1.9rem); font-weight: 700; line-height: 1.1; color: #fff; text-shadow: 0 3px 0 rgba(120,50,0,.35); }
.kmm-rwd-sub { font-size: clamp(.9rem, 2.8vw, 1.05rem); font-weight: 600; line-height: 1.25; }
.kmm-rwd-mini[hidden] { display: none; }
.kmm-rwd-mini { display: flex; align-items: center; gap: 8px; margin-top: 3px; min-width: 0; }
.kmm-rwd-minibar { flex: none; width: 76px; height: 11px; border-radius: 99px; background: rgba(90,51,0,.22); overflow: hidden; box-shadow: inset 0 2px 3px rgba(0,0,0,.18); }
.kmm-rwd-minibar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #34d399, #10b981); transition: width .6s ease; }
.kmm-rwd-minitxt { min-width: 0; font-size: .82rem; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kmm-rwd-go { position: relative; flex: none; font-size: 1.7rem; font-weight: 700; color: #fff; text-shadow: 0 2px 0 rgba(120,50,0,.35); animation: kmm-nudge 1.2s ease-in-out infinite; }

/* Fenêtre « Mes récompenses » */
.kmm-rwd-body { padding: 18px 18px 4px; text-align: left; }
.kmm-rwd-kids { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0 0 14px; }
.kmm-wrap .kmm-rwd-kid {
	display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px 8px 10px; border: 3px solid #f1e3c0; border-radius: 999px; cursor: pointer;
	font-family: inherit; font-size: 1.05rem; font-weight: 700; line-height: 1; color: #6b4a00; background: #fff; box-shadow: 0 4px 0 rgba(0,0,0,.1); transition: transform .15s;
}
.kmm-wrap .kmm-rwd-kid:hover { transform: translateY(-2px); }
.kmm-wrap .kmm-rwd-kid.kmm-on { border-color: #fb8500; color: #fff; background: linear-gradient(135deg, #ffb703, #fb8500); text-shadow: 0 2px 0 rgba(120,50,0,.3); }
.kmm-rwd-kid-av { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; font-size: 1.3rem; line-height: 1; background: #fff; box-shadow: inset 0 -3px 0 rgba(0,0,0,.08); }
.kmm-rwd-pts { display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center; width: fit-content; max-width: 100%; margin: 0 auto 6px; padding: 6px 18px; border-radius: 999px; font-size: 1.15rem; font-weight: 700; color: #7a5200; background: #fff1c2; box-shadow: inset 0 0 0 2px #ffd966; }
.kmm-rwd-pts-av { display: grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%; font-size: 1.15rem; line-height: 1; background: #fff; }
.kmm-rwd-who-h { text-align: center; font-size: 1.4rem; }
.kmm-rwd-h { margin: 16px 0 10px; font-size: 1.25rem; font-weight: 700; color: #3b2f63; }
.kmm-rwd-list { display: grid; gap: 12px; }
.kmm-rwd-card { padding: 13px 15px 14px; border-radius: 22px; background: #fff; border: 2px solid #f1e7d0; box-shadow: 0 5px 0 rgba(0,0,0,.07); }
.kmm-rwd-card.kmm-rwd-won { background: #ecfdf3; border-color: #86efac; }
.kmm-rwd-card-top { display: flex; align-items: center; gap: 10px; }
.kmm-rwd-card-ico { flex: none; font-size: 1.7rem; line-height: 1; }
.kmm-rwd-card-name { flex: 1; min-width: 0; font-size: 1.2rem; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.kmm-rwd-times { flex: none; padding: 3px 10px; border-radius: 999px; font-size: .85rem; font-weight: 700; color: #7a5200; background: #fff1c2; }
.kmm-rwd-cond { margin: 5px 0 0 40px; font-size: .88rem; font-weight: 500; line-height: 1.3; color: #6b6488; }
.kmm-rwd-bar { height: 15px; margin: 10px 0 0; border-radius: 99px; background: #ece6d6; overflow: hidden; box-shadow: inset 0 2px 3px rgba(0,0,0,.12); }
.kmm-rwd-bar i { display: block; height: 100%; min-width: 8px; border-radius: 99px; background: linear-gradient(90deg, #ffd166, #fb8500); transition: width .6s ease; }
.kmm-rwd-won .kmm-rwd-bar i { background: linear-gradient(90deg, #34d399, #10b981); }
.kmm-rwd-prog { margin-top: 5px; font-size: .85rem; font-weight: 700; text-align: right; color: #7a5200; }
.kmm-rwd-won .kmm-rwd-prog { color: #047857; }
.kmm-rwd-empty { padding: 26px 10px 14px; text-align: center; }
.kmm-rwd-empty-ico { font-size: 3.6rem; animation: kmm-bob 3s ease-in-out infinite; }
.kmm-rwd-empty p { margin: 6px 0 0; font-size: 1.15rem; font-weight: 600; }
.kmm-rwd-empty .kmm-rwd-empty-sub { font-size: 1rem; font-weight: 500; color: #6b6488; }

/* Non connecté */
.kmm-login { position: relative; z-index: 1; max-width: 480px; margin: 12vh auto 0; padding: 30px; background: #fff; color: #3b2f63; border-radius: 32px; box-shadow: 0 12px 0 rgba(0,0,0,.15); }
.kmm-emoji-big { font-size: 4rem; animation: kmm-bob 2.5s ease-in-out infinite; }
.kmm-cta { display: inline-block; margin-top: 10px; padding: 14px 30px; border-radius: 999px; color: #fff; text-decoration: none; font-weight: 700; background: linear-gradient(135deg, #ff7eb3, #ff5c8a); box-shadow: 0 6px 0 rgba(0,0,0,.18); }

/* ─── ÉCRAN AVANT CONNEXION : logo, carte, installation, nom de l'app ─── */
.kmm-guest { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 28px 16px calc(34px + env(safe-area-inset-bottom, 0px)); }
.kmm-guest .kmm-login { width: 100%; margin: 0 auto; }
.kmm-guest-logo { position: relative; z-index: 1; flex: none; animation: kmm-pop .7s cubic-bezier(.34,1.56,.64,1) both, kmm-float 4.2s ease-in-out .9s infinite; }
.kmm-guest-logo img {
	display: block; width: clamp(96px, 28vw, 132px); height: auto; aspect-ratio: 1 / 1; object-fit: contain; padding: 10px;
	border-radius: 30%; background: #fff; box-shadow: 0 9px 0 rgba(0,0,0,.16), 0 20px 30px var(--shadow);
}
.kmm-guest-name {
	position: relative; z-index: 1; margin-top: 4px; font-size: clamp(2.6rem, 11vw, 4rem); font-weight: 700; line-height: 1.05; letter-spacing: .5px;
	font-family: 'Fredoka','Baloo 2','Nunito',ui-rounded,'Segoe UI',system-ui,sans-serif;
	background: linear-gradient(180deg, #fffbd0 10%, #ffd93d 55%, #ffb703 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
	filter: drop-shadow(0 4px 0 rgba(120,60,0,.35)) drop-shadow(0 10px 14px var(--shadow));
	animation: kmm-pop .7s cubic-bezier(.34,1.56,.64,1) .15s both;
}
.kmm-install[hidden] { display: none !important; }
.kmm-install {
	display: flex; align-items: center; justify-content: center; gap: 8px; width: fit-content; max-width: 100%; margin: 18px auto 0; padding: 13px 28px;
	border: 0; border-radius: 999px; cursor: pointer; font-family: inherit; font-size: 1.05rem; font-weight: 700; line-height: 1.2; color: #fff;
	background: linear-gradient(135deg, #36d1c4, #5b86e5); box-shadow: 0 6px 0 rgba(0,0,0,.18); transition: transform .1s, box-shadow .1s, filter .15s;
	-webkit-tap-highlight-color: transparent;
}
.kmm-install:hover, .kmm-install:focus-visible { filter: brightness(1.07); transform: translateY(-2px); box-shadow: 0 8px 0 rgba(0,0,0,.18); outline: 0; }
.kmm-install:focus-visible { outline: 4px solid rgba(91,134,229,.45); outline-offset: 3px; }
.kmm-install:active { transform: translateY(5px); box-shadow: 0 1px 0 rgba(0,0,0,.18); }

/* Explications d'installation (iPhone ou navigateur sans fenêtre native) */
.kmm-ins { position: fixed; inset: 0; z-index: 99995; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(30,20,70,.6); backdrop-filter: blur(3px);
	font-family: 'Fredoka','Baloo 2','Nunito',ui-rounded,'Segoe UI',system-ui,sans-serif; }
.kmm-ins-box { box-sizing: border-box; width: 100%; max-width: 420px; padding: 24px 22px 20px; border-radius: 28px; background: #fff; color: #3b2f63; box-shadow: 0 12px 0 rgba(0,0,0,.18); text-align: left; animation: kmm-pop .45s cubic-bezier(.34,1.56,.64,1) both; }
.kmm-ins-box h2 { margin: 0 0 12px; font-size: 1.5rem; line-height: 1.2; text-align: center; }
.kmm-ins-box ol { margin: 0 0 18px; padding-left: 1.4em; font-size: 1.05rem; font-weight: 500; line-height: 1.4; }
.kmm-ins-box li { margin: 0 0 10px; }
.kmm-ins-ok { display: block; width: 100%; padding: 14px; border: 0; border-radius: 18px; cursor: pointer; font-family: inherit; font-size: 1.1rem; font-weight: 700; color: #fff;
	background: linear-gradient(180deg, #4ade80, #16a34a); box-shadow: 0 6px 0 #166534; }
.kmm-ins-ok:active { transform: translateY(5px); box-shadow: 0 1px 0 #166534; }

/* ─── CLOCHE DES DEVOIRS ─── */
.kmm-hw-bell[hidden] { display: none !important; }
.kmm-wrap .kmm-hw-bell {
	position: absolute; top: -2px; right: 12px; z-index: 5; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 7px;
	height: 44px; padding: 0 16px 0 12px; border-radius: 999px; text-decoration: none; color: #7a4a00; background: linear-gradient(180deg, #fff, #ffe9a8);
	box-shadow: 0 5px 0 rgba(0,0,0,.18), 0 10px 16px var(--shadow); transition: transform .12s;
}
.kmm-wrap .kmm-hw-bell:hover, .kmm-wrap .kmm-hw-bell:focus-visible { transform: translateY(-2px); color: #7a4a00; outline: 0; }
.kmm-wrap .kmm-hw-bell:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.18); }
.kmm-hw-ico { font-size: 1.5rem; line-height: 1; display: block; }

/* ─── BOUTON SON ─── */
.kmm-snd[hidden] { display: none !important; }
.kmm-wrap .kmm-snd {
	position: absolute; top: -2px; right: 12px; z-index: 5; display: grid; place-items: center; width: 48px; height: 44px; padding: 0; margin: 0;
	border: 0; border-radius: 999px; cursor: pointer; font-family: inherit; color: #075985; background: linear-gradient(180deg, #fff, #d9f0ff);
	box-shadow: 0 5px 0 rgba(0,0,0,.18), 0 10px 16px var(--shadow); transition: transform .12s; -webkit-tap-highlight-color: transparent;
}
.kmm-wrap .kmm-snd:hover, .kmm-wrap .kmm-snd:focus-visible { transform: translateY(-2px); outline: 0; }
.kmm-wrap .kmm-snd:focus-visible { box-shadow: 0 5px 0 rgba(0,0,0,.18), 0 0 0 4px rgba(255,255,255,.9); }
.kmm-wrap .kmm-snd:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.18); }
.kmm-wrap .kmm-snd[aria-pressed="false"] { color: #6b7280; background: linear-gradient(180deg, #f3f4f6, #cfd4db); }
.kmm-snd-ico { font-size: 1.5rem; line-height: 1; display: block; }
.kmm-wrap.kmm-has-snd .kmm-hw-bell { right: 70px; }   /* le bouton son occupe le coin : la cloche passe à sa gauche */
@media (max-width: 349px) {   /* très petit écran : la cloche ne garde que son icône et sa pastille pour ne pas recouvrir « Jouer » */
	.kmm-wrap.kmm-has-snd .kmm-hw-lbl { display: none; }
	.kmm-wrap.kmm-has-snd .kmm-hw-bell { padding: 0 14px; }
}
.kmm-hw-on .kmm-hw-ico { animation: kmm-wiggle 2.4s ease-in-out infinite; transform-origin: 50% 10%; }
.kmm-hw-lbl { font-size: .95rem; font-weight: 700; line-height: 1; }
.kmm-hw-badge[hidden] { display: none; }
.kmm-hw-badge {
	position: absolute; top: -9px; right: -7px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 99px; display: grid; place-items: center;
	background: #ef4444; color: #fff; font-size: .9rem; font-weight: 700; line-height: 1; border: 3px solid #fff; box-shadow: 0 3px 0 rgba(0,0,0,.2);
}
.kmm-hw-on .kmm-hw-badge { animation: kmm-pop .5s cubic-bezier(.34,1.56,.64,1) both; }

/* Particules */
.kmm-spark { position: fixed; z-index: 100000; pointer-events: none; font-size: 1.6rem; line-height: 1; will-change: transform, opacity; }

/* Sortie de page */
.kmm-leaving .kmm-content { animation: kmm-leave .38s ease-in both; }

/* ─── KEYFRAMES ─────────────────────────────── */
@keyframes kmm-pop     { 0% { transform: scale(.2) rotate(-14deg); opacity: 0; } 60% { transform: scale(1.1) rotate(3deg); opacity: 1; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes kmm-float   { 0%,100% { translate: 0 0; } 50% { translate: 0 -9px; } }
@keyframes kmm-wave    { 0%,55%,100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-.16em) rotate(-5deg); } 40% { transform: translateY(.02em) rotate(3deg); } }
@keyframes kmm-bob     { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-7px) rotate(3deg); } }
@keyframes kmm-wiggle  { 0%,100% { transform: rotate(0) scale(1); } 25% { transform: rotate(-16deg) scale(1.2); } 60% { transform: rotate(12deg) scale(1.2); } }
@keyframes kmm-jump    { 0% { transform: translateY(0) scale(1,1); } 25% { transform: translateY(0) scale(1.15,.8); } 55% { transform: translateY(-36px) scale(.9,1.15) rotate(10deg); } 100% { transform: translateY(0) scale(1,1); } }
@keyframes kmm-swap    { from { transform: scale(.6) translateY(8px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
@keyframes kmm-shine   { 0% { left: -120%; } 30%,100% { left: 170%; } }
@keyframes kmm-nudge   { 0%,100% { transform: translateX(0); } 50% { transform: translateX(4px); } }
@keyframes kmm-shake   { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-9px) rotate(-2deg); } 40% { transform: translateX(9px) rotate(2deg); } 60% { transform: translateX(-6px); } 80% { transform: translateX(6px); } }
@keyframes kmm-cloud   { from { transform: translateX(-220px) scale(var(--sc,1)); } to { transform: translateX(calc(100vw + 220px)) scale(var(--sc,1)); } }
@keyframes kmm-rise    { 0% { transform: translateY(0) rotate(0); opacity: 0; } 10% { opacity: .95; } 90% { opacity: .9; } 100% { transform: translateY(-115vh) rotate(360deg); opacity: 0; } }
@keyframes kmm-moon   { 0%,100% { translate: 0 0; } 50% { translate: 0 10px; } }
@keyframes kmm-spin    { to { transform: rotate(360deg); } }
@keyframes kmm-twinkle { 0%,100% { opacity: calc(var(--starop) * .55); } 50% { opacity: var(--starop); } }
@keyframes kmm-fade    { from { opacity: 0; } to { opacity: 1; } }
@keyframes kmm-sheet-in{ 0% { transform: scale(.55) translateY(60px) rotate(-4deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes kmm-leave   { to { transform: scale(1.25); opacity: 0; filter: blur(4px); } }

/* ─── RESPONSIVE ────────────────────────────── */
@media (max-width: 600px) {
	.kmm-wrap { padding: 16px 12px 130px; }
	.kmm-grid { gap: 20px; }
	.kmm-mascot { gap: 8px; }
	.kmm-bubble { padding: 10px 14px; max-width: 220px; }
	.kmm-ico { width: 84px; height: 84px; }
	.kmm-emoji { font-size: 2.8rem; }
	.kmm-card-title { font-size: 1.55rem; }
	.kmm-sun { width: 220px; height: 220px; top: -70px; right: -70px; }
	.kmm-wrap[data-theme="night"] .kmm-sun { width: 84px; height: 84px; top: 22px; right: 8%; box-shadow: inset -21px -6px 0 0 #fff6c9; }
	.kmm-wrap .kmm-rwd-banner { margin-top: 18px; padding: 12px 16px 12px 12px; gap: 12px; }
	.kmm-rwd-ico { width: 62px; height: 62px; }
	.kmm-rwd-ico span { font-size: 2.1rem; }
	.kmm-rwd-minibar { width: 56px; }
	.kmm-rwd-body { padding: 14px 12px 2px; }
	.kmm-rwd-cond { margin-left: 0; }
	.kmm-sheet { padding: 10px; align-items: flex-end; }
	.kmm-sheet-panel { border-radius: 34px 34px 28px 28px; }
}

/* ─── ACCESSIBILITÉ : mouvement réduit ──────── */
@media (prefers-reduced-motion: reduce) {
	.kmm-wrap *, .kmm-wrap *::before, .kmm-wrap *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
	.kmm-float, .kmm-cloud { display: none; }
}
