/* Dernières finitions : mini-lecteur, en-tête et barre du bas, fenêtre de publication, emotes,
   photos plein écran, recadrage, historique des versions, Nouveautés, annonces, écrans de QVGDK. */

/* ---------- Mini-lecteur : verre teinté à la couleur de la pochette ---------- */
#hubMiniPlayer { --mini: var(--hub-track-accent, #ff6a3d); overflow: hidden; border: 1px solid color-mix(in srgb, var(--mini) 40%, rgba(255, 255, 255, .1)); border-radius: 18px; background: linear-gradient(100deg, color-mix(in srgb, var(--mini) 26%, rgba(18, 18, 24, .96)), rgba(18, 18, 24, .96) 62%); box-shadow: 0 18px 44px -12px rgba(0, 0, 0, .75), 0 0 30px -12px var(--mini); }
#hubMiniPlayer .hub-mini-art { position: relative; }
#hubMiniPlayer .hub-mini-art img { border-radius: 12px; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .8); }
#hubMiniPlayer.is-playing .hub-mini-art img { animation: finish-mini-breathe 3s ease-in-out infinite; }
#hubMiniPlayer .hub-mini-art i b { background: var(--mini); }
#hubMiniPlayer strong { color: #fff; }
#hubMiniPlayer small { color: color-mix(in srgb, var(--mini) 55%, #ccc); }
#hubMiniPlayer #hubMiniToggle { border-radius: 50%; background: var(--mini); color: #120700; box-shadow: 0 6px 16px -6px var(--mini); }
#hubMiniPlayer > i { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: rgba(255, 255, 255, .08); }
#hubMiniPlayer > i > span { display: block; height: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--mini) 60%, #fff), var(--mini)); box-shadow: 0 0 10px var(--mini); }

/* ---------- En-tête et barre du bas ---------- */
.app-header { box-shadow: 0 1px 0 rgba(255, 255, 255, .05), 0 10px 26px -18px rgba(0, 0, 0, .9); }
.app-header .app-brand img { box-shadow: 0 0 0 1px rgba(255, 211, 46, .35), 0 4px 12px -4px rgba(255, 180, 60, .5); }
.app-header .app-v2-badge { border-color: rgba(255, 180, 60, .5); background: linear-gradient(90deg, rgba(255, 106, 61, .18), rgba(255, 179, 71, .18)); }
.app-header .kafpoints-balance { border-radius: 999px; }
.app-bottom-nav { border-top: 1px solid rgba(255, 255, 255, .06); }
.app-bottom-nav button.is-active .app-nav-icon { filter: drop-shadow(0 0 8px rgba(255, 106, 61, .7)); }

/* ---------- Fenêtre de publication : la zone où l'on écrit ---------- */
#appComposeSheet .app-compose-author { display: flex; align-items: center; gap: 10px; }
#appComposeSheet .app-compose-avatar-wrap img:first-child { box-shadow: 0 0 0 2px #15161b, 0 0 0 4px #ff6a3d; }
#appComposeSheet #appComposeUsername { font-weight: 900; }
#appComposeSheet .compose-writing { position: relative; padding: 4px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 20px; background: rgba(255, 255, 255, .03); transition: border-color .2s ease, box-shadow .2s ease; }
#appComposeSheet .compose-writing:focus-within { border-color: rgba(255, 106, 61, .55); box-shadow: 0 0 0 4px rgba(255, 106, 61, .12); }
#appComposeSheet #appComposeBody { min-height: 140px; padding: 12px 14px; border: 0; background: transparent; box-shadow: none; font-size: 1.05rem; line-height: 1.45; resize: none; }
#appComposeSheet #appComposeBody:focus { outline: 0; box-shadow: none; }
#appComposeSheet .compose-writing-meta { display: flex; align-items: center; justify-content: space-between; padding: 0 10px 8px; color: rgba(255, 255, 255, .45); font-size: .66rem; }
#appComposeSheet #appComposeCount { --fill: 0; display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
#appComposeSheet #appComposeCount::before { width: 18px; height: 18px; content: ""; border-radius: 50%; background: conic-gradient(var(--count-color, #ff6a3d) calc(var(--fill) * 360deg), rgba(255, 255, 255, .12) 0); -webkit-mask: radial-gradient(circle, transparent 5px, #000 6px); mask: radial-gradient(circle, transparent 5px, #000 6px); }
#appComposeSheet #appComposeCount.is-near { --count-color: #ffb347; color: #ffb347; }
#appComposeSheet #appComposeCount.is-full { --count-color: #ff4d5e; color: #ff4d5e; }
#appComposeSheet .app-compose-tools > * { border-color: rgba(255, 255, 255, .1); background: rgba(255, 255, 255, .04); font-weight: 800; transition: transform .15s ease, border-color .2s ease; }
#appComposeSheet .app-compose-tools > *:active { transform: scale(.95); }
#appComposeSheet .app-compose-footer { border-top-color: rgba(255, 255, 255, .06); }
#appComposeSheet #appComposeSubmit { padding: 0 22px; border-radius: 999px; background: linear-gradient(90deg, #ff6a3d, #ffb347); color: #1d0a00; font-weight: 900; box-shadow: 0 10px 24px -10px #ff6a3d; }
#appComposeSheet .compose-live-preview { display: grid; gap: 6px; padding: 12px; border: 1px dashed rgba(255, 255, 255, .14); border-radius: 16px; background: rgba(255, 255, 255, .02); }
#appComposeSheet .compose-live-preview[hidden] { display: none; }
#appComposeSheet .compose-live-preview > small { color: rgba(255, 255, 255, .45); font-size: .6rem; font-weight: 900; letter-spacing: .14em; }
#appComposeSheet .compose-live-preview header { display: flex; align-items: center; gap: 8px; }
#appComposeSheet .compose-live-preview header img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
#appComposeSheet .compose-live-preview header strong { font-size: .82rem; }
#appComposeSheet .compose-live-preview header span { color: rgba(255, 255, 255, .45); font-size: .7rem; }
#appComposeSheet .compose-live-preview p { margin: 0; font-size: .9rem; line-height: 1.45; overflow-wrap: anywhere; }
#appComposeSheet .compose-live-preview p .app-inline-emote { width: 22px; height: 22px; vertical-align: middle; }
#appComposeSheet .compose-live-preview p b { color: #ff6a3d; }
#appComposeSheet .compose-live-preview p i { color: #8fd0ff; font-style: normal; font-weight: 800; }
#appComposeSheet .compose-live-preview em { color: rgba(255, 255, 255, .5); font-size: .7rem; font-style: normal; }

/* Réponses sous un post. */
.app-comment-form { padding: 6px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 18px; background: rgba(255, 255, 255, .03); }
.app-comment-form:focus-within { border-color: rgba(255, 106, 61, .45); }
.app-comment-form > input[name="body"] { border: 0 !important; background: transparent !important; }
.app-comment-form > button[type="submit"] { border-radius: 999px; background: linear-gradient(90deg, #ff6a3d, #ffb347); color: #1d0a00; font-weight: 900; }

/* ---------- Emotes ---------- */
.app-emote-picker-panel { border: 1px solid rgba(255, 255, 255, .1); border-radius: 22px; background: radial-gradient(ellipse at 50% 0%, rgba(255, 179, 71, .14), transparent 50%), #15151b; box-shadow: 0 30px 80px rgba(0, 0, 0, .7); }
.app-emote-tabs button { border-radius: 999px; }
.app-emote-tabs button.is-active { background: linear-gradient(90deg, #ff6a3d, #ffb347); color: #1d0a00; }
.app-emote-search { border-radius: 999px; }
.app-emote-item { border-radius: 14px; transition: transform .12s ease, background .15s ease; }
.app-emote-item:hover, .app-emote-item:active { background: rgba(255, 179, 71, .12); transform: scale(1.08); }

/* ---------- Photos en plein écran ---------- */
.app-media-lightbox-backdrop { background: rgba(4, 4, 8, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.app-media-lightbox-content :is(img, video) { border-radius: 14px; box-shadow: 0 30px 80px rgba(0, 0, 0, .7); animation: finish-zoom-in .25s cubic-bezier(.2, .9, .3, 1); }
.app-media-lightbox .app-icon-button { border-radius: 50%; background: rgba(255, 255, 255, .12); backdrop-filter: blur(8px); }

/* ---------- Recadrage ---------- */
.image-cropper-panel { border: 1px solid rgba(255, 255, 255, .1); border-radius: 22px; background: radial-gradient(ellipse at 50% 0%, rgba(255, 106, 61, .14), transparent 50%), #15151b; }
.image-cropper-frame { border-radius: 16px; box-shadow: 0 0 0 2px rgba(255, 106, 61, .6), 0 14px 40px rgba(0, 0, 0, .6); }
.image-cropper-zoom input { accent-color: #ff6a3d; }
.image-cropper-actions button { border-radius: 999px; }
.image-cropper-actions .is-primary { border: 0; background: linear-gradient(90deg, #ff6a3d, #ffb347); color: #1d0a00; font-weight: 900; }

/* ---------- Historique des versions et Nouveautés ---------- */
.app-version-timeline > * { position: relative; border-radius: 16px; }
.app-version-timeline > .is-current { border-color: rgba(255, 106, 61, .5); background: linear-gradient(90deg, rgba(255, 106, 61, .12), transparent); box-shadow: inset 3px 0 0 #ff6a3d; }
.hub-upgrade-card { border: 1px solid rgba(255, 211, 46, .35); border-radius: 24px; background: radial-gradient(circle at 50% 0%, rgba(255, 179, 71, .25), transparent 55%), linear-gradient(180deg, #1c1622, #111016); box-shadow: 0 30px 80px rgba(0, 0, 0, .7), 0 0 60px -20px rgba(255, 179, 71, .6); animation: finish-pop .45s cubic-bezier(.2, 1.3, .4, 1); }
.hub-upgrade-notes li { border-radius: 12px; }
.hub-upgrade .app-button { border: 0; border-radius: 999px; background: linear-gradient(90deg, #ff6a3d, #ffb347); color: #1d0a00; font-weight: 900; }

/* ---------- Annonces envoyées depuis la console ---------- */
.immigre-announcement-card { border: 1px solid rgba(255, 106, 61, .4); border-radius: 22px; background: radial-gradient(circle at 100% 0%, rgba(139, 61, 255, .3), transparent 55%), linear-gradient(135deg, rgba(255, 106, 61, .22), #121018 70%); box-shadow: 0 30px 80px rgba(0, 0, 0, .7); animation: finish-pop .4s cubic-bezier(.2, 1.3, .4, 1); }
.immigre-announcement-cta { border: 0; border-radius: 999px; background: linear-gradient(90deg, #ff6a3d, #ffb347); color: #1d0a00; font-weight: 900; }
.immigre-announcement-close { border-radius: 50%; }
.immigre-active-event-icon { border-radius: 14px; background: linear-gradient(135deg, #ff6a3d, #ffb347); }

/* ---------- QVGDK : choix du son, générique, fin de partie ---------- */
.kqm-sound-prompt-card { border-radius: 26px; box-shadow: 0 0 80px -20px rgba(43, 110, 255, .6); }
.kqm-sound-prompt-card > div button { transition: transform .15s ease; }
.kqm-sound-prompt-card > div button:active { transform: scale(.97); }
.kqm-sound-prompt-logo { animation: finish-logo-spin 8s linear infinite; }
#kqmGame .kqm-intro-skip { border-radius: 999px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(8px); }
#kqmGame .kqm-intro-emblem img { filter: drop-shadow(0 0 30px rgba(80, 140, 255, .7)); }
#kqmGame .kqm-finish { position: relative; }
#kqmGame .kqm-finish-emblem img { filter: drop-shadow(0 0 30px rgba(255, 200, 80, .55)); animation: finish-float 4s ease-in-out infinite; }
#kqmGame .kqm-finish h2 { background: linear-gradient(180deg, #fff, #ffd46a); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: clamp(1.8rem, 8vw, 2.6rem); }
#kqmGame .kqm-finish-actions .kqm-primary { border-color: #ffe3a0; background: linear-gradient(180deg, #ffbf4a, #e3860f 50%, #c66b04 51%, #f0a030); color: #1d0f00; }
#kqmGame .kqm-final-achievement { border-radius: 18px; box-shadow: 0 0 40px -10px rgba(255, 200, 80, .7); }

@keyframes finish-mini-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
@keyframes finish-zoom-in { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes finish-pop { from { opacity: 0; transform: translateY(16px) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes finish-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@keyframes finish-logo-spin { 0%, 80% { transform: rotateY(0); } 100% { transform: rotateY(360deg); } }
@media (prefers-reduced-motion: reduce) {
  #hubMiniPlayer .hub-mini-art img, .app-media-lightbox-content :is(img, video), .hub-upgrade-card, .immigre-announcement-card, .kqm-sound-prompt-logo, #kqmGame .kqm-finish-emblem img { animation: none; }
}

/* Fluidité tactile partout : pas de délai de double tap, pas de flash gris au toucher, pas de rebond du cadre en app installée. */
button, a, summary, label, [role="button"], [data-app-view], .app-tabbar * { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
@media (display-mode: standalone) { html, body { overscroll-behavior-y: none; } }
.app-main, .hub-player-screen, .v3w-cards { overscroll-behavior: contain; }
img { -webkit-user-drag: none; }

/* Changement d'onglet : un seul mouvement, l'écran glisse et c'est tout (plus de cartes qui réapparaissent une à une). */
body.app-v2-identity .app-view.is-active { animation: app-fx-view-forward 240ms cubic-bezier(.2, .8, .25, 1) both; }
body.app-v2-identity[data-nav-direction="back"] .app-view.is-active { animation-name: app-fx-view-back; }
body.app-v2-identity .app-view.is-active :is(.hub-preview-program, .hub-preview-games, .hub-track-card, .hub-community-playlist-card, .app-post):nth-child(-n+5) { animation: none; }
@media (prefers-reduced-motion: reduce) { body.app-v2-identity .app-view.is-active { animation: none; } }
