/* ===================== Splash, accueil, fenêtres (parcours inspiré de la référence) ===================== */
#screen-splash, #screen-name, #screen-signin { justify-content: center; }
#screen-splash { background: radial-gradient(circle at 50% 42%, #5a4bff 0%, #2a1f9f 45%, #0a0838 100%); }
#screen-splash .logo.big { margin-top: 0; width: 360px; }
.loader { margin-top: 46px; width: 260px; height: 20px; border: 4px solid var(--gold); border-radius: 12px; background: rgba(59, 10, 110, .8); overflow: hidden; }
.loader i { display: block; height: 100%; width: 0; background: linear-gradient(#ffe46b, #f59a00); animation: load 1.6s ease-out forwards; }
@keyframes load { to { width: 100%; } }
#screen-name .logo.big, #screen-signin .logo.big { margin-top: 0; width: 300px; }

.btn.big { font-size: 44px; padding: 12px 84px; border-radius: 30px; }
.btn.wide { display: block; width: 100%; text-align: center; text-decoration: none; margin: 10px 0; font-size: 26px; }
.btn[disabled] { filter: grayscale(.7) brightness(.85); cursor: default; }
.btn.small-round { width: 54px; height: 54px; font-size: 22px; }

/* --- accueil --- */
#screen-home { justify-content: flex-start; }
.home-bg { position: absolute !important; inset: 0; z-index: 0 !important; overflow: hidden; background: linear-gradient(#1f7bff 0%, #6cc3ff 38%, #d9f2ff 58%); }
.home-bg i { position: absolute; display: block; }
.home-bg .sun { left: 56px; top: 150px; width: 110px; height: 110px; border-radius: 50%; background: radial-gradient(circle, #fffbd0, #ffe066 60%, rgba(255, 224, 102, 0) 72%); box-shadow: 0 0 44px 9px rgba(255, 240, 160, 0.1); animation: pulse 4s ease-in-out infinite; }
.home-bg .cloud { height: 54px; border-radius: 40px; background: #fff; opacity: .95; }
.home-bg .cloud::before, .home-bg .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.home-bg .cloud::before { width: 60px; height: 60px; left: 22px; top: -28px; }
.home-bg .cloud::after { width: 44px; height: 44px; left: 70px; top: -18px; }
.home-bg .c1 { width: 130px; top: 110px; left: -140px; animation: drift 38s linear infinite; }
.home-bg .c2 { width: 100px; top: 250px; left: -140px; animation: drift 52s linear infinite 8s; opacity: .8; }
.home-bg .c3 { width: 150px; top: 60px; left: -170px; animation: drift 64s linear infinite 20s; opacity: .7; }
@keyframes drift { to { transform: translateX(1800px); } }
.home-bg .hill { border-radius: 50%; }
.home-bg .h1 { left: -120px; bottom: 250px; width: 620px; height: 300px; background: #5fcf62; }
.home-bg .h2 { right: -160px; bottom: 230px; width: 640px; height: 280px; background: #43b250; }
.home-bg .ground { left: 0; right: 0; bottom: 0; height: 46%; background: linear-gradient(#46b84a, #2f9b3f 55%, #1f6d2c); border-top: 5px solid #9df08a; }

.topbar { position: absolute !important; top: calc(14px + env(safe-area-inset-top, 0px)); left: 14px; right: 14px; z-index: 5 !important; display: flex; align-items: center; gap: 10px; }
.topbar .btn.round { margin-left: auto; width: 56px; height: 56px; }
.avatar-btn { width: 66px; height: 66px; border-radius: 18px; border: 4px solid var(--gold); background: linear-gradient(#9fe6ff, #3a6bff); box-shadow: 0 5px 0 var(--purple), 0 0 10px rgba(255, 210, 63, 0.22); font-size: 40px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform .1s; }
.avatar-btn:active { transform: translateY(3px); }
.pill.coin { font-size: 28px; padding: 4px 22px 4px 8px; }
.coin-icon { width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6b0, #ffc21a 55%, #d98a00); border: 3px solid #a86a00; box-shadow: 0 0 6px rgba(255, 210, 63, 0.32); }
.topbar .lvl-pill { margin-top: 0; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.home-center { position: relative; z-index: 2; flex: 1; width: 100%; display: flex; align-items: center; justify-content: center; margin-top: 70px; }
.podium { position: relative; width: 300px; height: 440px; }
.podium-top { position: absolute; left: 20px; right: 20px; top: 214px; height: 26px; border-radius: 8px 8px 16px 16px; background: linear-gradient(#fff3a0, #ffd23f 40%, #c97900); border: 3px solid var(--purple); box-shadow: 0 6px 0 rgba(59, 10, 110, .5); }
.podium-pole { position: absolute; left: 124px; width: 52px; top: 240px; height: 120px; background: linear-gradient(90deg, #5a2bd8, #a56bff 50%, #3a1590); }
.podium-base { position: absolute; left: 74px; width: 152px; top: 350px; height: 50px; border-radius: 50%; background: radial-gradient(ellipse at 50% 30%, #ffe46b, #ffd23f 50%, #c97900); border: 3px solid var(--purple); box-shadow: 0 16px 20px rgba(0, 0, 0, .3); }
.plate { position: absolute; left: 50%; top: 270px; transform: translateX(-50%); min-width: 190px; padding: 6px 22px 8px; text-align: center; border-radius: 14px; border: 4px solid var(--gold); background: linear-gradient(#ff6a6a, #c0141e); box-shadow: 0 6px 0 var(--purple), 0 0 11px rgba(255, 63, 90, 0.2); text-shadow: var(--ink); animation: bobx 3s ease-in-out infinite; }
@keyframes bobx { 50% { transform: translateX(-50%) translateY(-8px); } }
.plate small { display: block; font-size: 20px; font-weight: 800; letter-spacing: 3px; }
.plate b { font-size: 54px; line-height: .9; }
.mini-stack { position: absolute; left: 0; right: 0; bottom: 226px; display: flex; flex-direction: column; align-items: center; gap: 0; }
.mini-stack .mr { display: flex; }
.mc { width: 58px; height: 58px; margin: 0 1px; padding: 8px; border-radius: 14px; border: 3px solid var(--purple); background: #fffbea; box-shadow: 0 4px 0 var(--purple), 0 0 6px var(--c, #ffd23f), inset 0 0 0 3px var(--c, #ffd23f); animation: bob 3.2s ease-in-out infinite; animation-delay: var(--d, 0s); }
.mc img { width: 100%; height: 100%; display: block; }
.floaters { position: absolute; left: 50%; top: 50%; width: 300px; height: 440px; margin: -220px 0 0 -150px; pointer-events: none; }
.floaters .fl { position: absolute; width: 54px; height: 54px; padding: 8px; background: #fffbea; border: 3px solid var(--purple); border-radius: 16px; box-shadow: 0 5px 0 var(--purple), 0 0 10px rgba(255, 210, 63, 0.28); animation: float 5s ease-in-out infinite; animation-delay: var(--d, 0s); opacity: .96; }
.floaters .fl img { width: 100%; height: 100%; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-22px) rotate(6deg); } }

.home-actions { position: absolute !important; left: 0; right: 0; bottom: 70px; z-index: 5 !important; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.home-actions .btn.big { animation: pulse 1.8s ease-in-out infinite; }
.home-actions .row { display: flex; gap: 14px; }
#stage.short .podium { transform: scale(.7); }
#stage.short .home-center { margin-top: 30px; }
#stage.short .home-actions { bottom: 24px; }
#stage.short .home-actions .btn.big { font-size: 34px; padding: 8px 60px; }

/* --- menu des niveaux --- */
.menu-head { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 10px 14px 0; }
.menu-head .logo.small { margin-top: 0; }

/* --- fenêtres --- */
.modal { z-index: 30; }
.modal .panel { width: 440px; max-width: calc(100% - 30px); padding: 56px 20px 22px; }
.ribbon { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); min-width: 250px; padding: 6px 34px 8px; font-size: 34px; font-weight: 800; letter-spacing: 1px; color: #fff; text-shadow: var(--ink); background: linear-gradient(#ffc24a, #f08a00); border: 4px solid var(--purple); border-radius: 14px 14px 22px 22px; box-shadow: 0 5px 0 var(--purple); white-space: nowrap; }
.close { position: absolute; top: -18px; right: -10px; width: 52px; height: 52px; border-radius: 50%; border: 4px solid var(--purple); background: linear-gradient(#ff8ad0, var(--magenta) 55%, var(--magenta-dark)); color: #fff; font-size: 24px; font-weight: 800; cursor: pointer; box-shadow: 0 4px 0 var(--purple); }
.panel-inner { background: linear-gradient(#fff8e6, #ffe9b8); color: #5a2a00; border: 4px solid #fff; outline: 4px solid rgba(59, 10, 110, .45); border-radius: 20px; padding: 18px 16px; margin-bottom: 18px; text-align: center; font-weight: 700; text-shadow: none; }
.panel-inner h3 { margin: 0 0 6px; font-size: 32px; color: var(--purple); }
.panel-inner p { color: #5a2a00; }
.lv-theme { display: inline-block; padding: 4px 18px; border-radius: 20px; font-size: 22px; font-weight: 800; color: #fff; text-shadow: var(--ink); background: linear-gradient(var(--violet), var(--purple)); margin-bottom: 10px; }
.lv-info { list-style: none; margin: 8px 0; padding: 0; font-size: 22px; }
.lv-info li { display: flex; justify-content: space-between; padding: 6px 8px; border-bottom: 2px dashed rgba(90, 42, 0, .25); }
.lv-tech { margin-top: 10px; font-size: 20px; color: var(--purple); display: flex; align-items: center; justify-content: center; gap: 10px; }
.lv-tech img { width: 44px; height: 44px; background: #fff; border-radius: 12px; padding: 5px; border: 3px solid var(--purple); }
.toggles { display: flex; justify-content: space-around; gap: 6px; }
.toggles label { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 18px; color: var(--purple); }
.toggles .btn.round { width: 64px; height: 64px; font-size: 28px; }
hr { border: 0; border-top: 2px solid rgba(90, 42, 0, .25); margin: 14px 0; }
.legal { display: inline-block; margin-top: 8px; color: #7a4a00; font-size: 18px; text-decoration: underline; }
.version { display: block; margin-top: 6px; color: #a8843f; }
.in-game-actions { display: flex; gap: 10px; justify-content: center; margin: 8px 0; }
.prof-top { display: flex; align-items: center; gap: 14px; justify-content: center; }
.avatar.big { width: 92px; height: 92px; font-size: 56px; border-radius: 22px; border: 5px solid var(--gold); background: linear-gradient(#9fe6ff, #3a6bff); display: flex; align-items: center; justify-content: center; box-shadow: 0 5px 0 var(--purple); }
#rename-form { display: flex; gap: 8px; align-items: center; }
#rename-input { width: 190px; font-size: 24px; text-align: center; padding: 10px; border-radius: 14px; border: 4px solid #c9a24a; background: #fff; color: var(--purple); font-weight: 800; font-family: inherit; outline: none; user-select: text; }
.prof-stats { display: flex; justify-content: space-around; margin: 14px 0; font-size: 20px; }
.avatars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.avatars button { height: 74px; font-size: 42px; border-radius: 18px; border: 4px solid #c9a24a; background: #fff; cursor: pointer; transition: transform .1s; }
.avatars button:hover { transform: scale(1.08); }
.avatars button.sel { border-color: #2fc92b; box-shadow: 0 0 0 3px #b8f5a8, 0 0 9px rgba(60, 255, 90, 0.24); }
.terms-logo { position: absolute; top: -70px; left: 50%; transform: translateX(-50%); width: 120px; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .5)); }
.terms-box { font-size: 22px; line-height: 1.35; margin-top: 8px; }
.terms-box a { color: #1b9a2a; font-weight: 800; }
#terms-detail { text-align: left; font-size: 17px; max-height: 280px; overflow-y: auto; }
#terms-detail h4 { margin: 10px 0 4px; color: var(--purple); }
#leaderboard-list { text-align: left; font-size: 24px; font-weight: 800; padding-left: 36px; margin: 0; min-height: 90px; color: var(--purple); }
#leaderboard-list li span { float: right; color: #b06a00; }

/* --- jeu : power-ups et tutoriel --- */
.pw { position: absolute; bottom: 118px; z-index: 6; width: 86px; height: 86px; border-radius: 50%; border: 5px solid var(--gold); background: radial-gradient(circle at 35% 30%, #6b8bff, #2a3fd8 70%); color: #fff; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 6px 0 var(--purple), 0 0 12px rgba(95, 140, 255, 0.28); font-family: inherit; transition: transform .12s; }
.pw-left { left: 16px; }
.pw-right { right: 16px; }
.pw em { position: absolute; bottom: -14px; font-style: normal; font-size: 16px; font-weight: 800; padding: 1px 12px; border-radius: 12px; background: linear-gradient(#6be83a, #2fb21f); border: 3px solid var(--gold); text-shadow: var(--ink); white-space: nowrap; }
.pw-ico { font-size: 38px; line-height: 1; display: flex; gap: 2px; }
.pw-ico.triple i { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #ff9ad6 40%, var(--magenta)); border: 2px solid var(--gold); }
.pw-ico.super { color: var(--gold); text-shadow: 0 0 14px #ff3fa4, 0 3px 0 var(--purple); font-size: 50px; }
.pw.armed { animation: armed .7s ease-in-out infinite; border-color: #fff; }
@keyframes armed { 50% { transform: scale(1.12); box-shadow: 0 6px 0 var(--purple), 0 0 22px 4px rgba(255, 210, 63, 0.14); } }
.pw.locked, .pw.used { filter: grayscale(.9) brightness(.7); cursor: default; }
.pw.locked em, .pw.used em { background: linear-gradient(#8a8fc0, #4a4f80); }
#tuto { position: absolute; inset: 0; z-index: 7; pointer-events: none; }
#tuto .bubble { position: absolute; left: 50%; top: 190px; transform: translateX(-50%); width: min(420px, 86%); padding: 14px 20px; font-size: 26px; line-height: 1.25; font-weight: 800; text-align: center; color: #1c2a6e; background: #fff6df; border: 5px solid #2aa0ff; border-radius: 20px; box-shadow: 0 6px 0 rgba(0, 0, 0, .25); }
#tuto .hand { position: absolute; left: 50%; top: 47%; font-size: 84px; filter: drop-shadow(0 6px 4px rgba(0, 0, 0, .4)); animation: tap 1.1s ease-in-out infinite; }
@keyframes tap { 0%, 100% { transform: translate(-10px, 0) rotate(-8deg); } 50% { transform: translate(-10px, -26px) rotate(-8deg) scale(.92); } }

/* --- résultat : « Bien Joué » + « Réessaie » --- */
.panel.win { background: none; border: 0; box-shadow: none; animation: none; padding: 0; width: 460px; }
.win-title { font-size: 84px !important; margin: 0 0 4px; color: #fff6df !important; -webkit-text-stroke: 8px #e8801a; paint-order: stroke fill; text-shadow: 0 8px 0 #b3560a, 0 0 16px rgba(255, 180, 60, 0.32) !important; animation: pop .5s cubic-bezier(.3, 1.6, .5, 1); }
.coins { position: relative; display: inline-block; filter: drop-shadow(0 0 16px rgba(255, 210, 63, 0.36)); animation: bob 2.4s ease-in-out infinite; }
.coin-gain { font-size: 60px; font-weight: 800; color: #fff; text-shadow: 0 5px 0 #a86a00, 0 0 18px #ffd23f; margin-top: -14px; }
.progress { display: flex; align-items: center; justify-content: center; gap: 0; margin: 14px 0 4px; }
.bar { position: relative; width: 300px; height: 40px; border: 4px solid var(--gold); border-radius: 20px; background: #14226b; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(#8bff6a, #2fc92b); transition: width 1s ease-out .4s; }
.bar span { position: absolute; inset: 0; text-align: center; line-height: 32px; font-size: 24px; font-weight: 800; text-shadow: var(--ink); }
.chest { margin-left: -6px; font-size: 44px; width: 84px; height: 76px; border-radius: 18px; background: linear-gradient(#ffe46b, #f59a00); border: 4px solid var(--gold-light); display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 0 5px 0 var(--purple); }
.chest small { font-size: 10.5px; font-weight: 800; color: var(--purple); margin-top: -4px; letter-spacing: -.4px; }
.tap-continue { font-size: 30px !important; font-weight: 800; color: #fff6df; text-shadow: 0 4px 0 #b3560a, 0 0 14px #ffd23f; animation: blink 1.4s ease-in-out infinite; cursor: pointer; margin: 14px 0 4px !important; }
@keyframes blink { 50% { opacity: .35; } }
.panel.win .row { margin-top: 6px; }
.panel.lose { padding-bottom: 28px; }
#btn-lose-menu { margin-top: 14px; }
@media (hover: none) { .avatars button:hover { transform: none; } }
