@charset "UTF-8";
/* =====================================================================
   MagiK : version mobile (téléphones, ≤ 760px)
   Tout est dans des media queries : la version ordinateur ne change pas.
   Chargé par shop.html et index.html, après leurs styles.
   ===================================================================== */

@keyframes mPopIn {
    0%   { opacity: 0; transform: translateY(18px) scale(.94); }
    100% { opacity: 1; transform: none; }
}
@keyframes mNavPop {
    0%   { transform: translateY(-2px) scale(1.18); }
    35%  { transform: translateY(-7px) scale(1.42) rotate(-8deg); }
    65%  { transform: translateY(-1px) scale(1.08) rotate(5deg); }
    100% { transform: translateY(-2px) scale(1.18); }
}
@keyframes mTwinkle {
    0%, 100% { opacity: .45; transform: scale(.8) rotate(0deg); }
    50%      { opacity: 1;   transform: scale(1.15) rotate(45deg); }
}
@keyframes mBob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}
@keyframes mSheetUp {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
@keyframes mStarBurst {
    0%   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0) rotate(90deg); opacity: 0; }
}
@keyframes mToastIn {
    0%   { opacity: 0; transform: translate(-50%, 12px) scale(.9); }
    100% { opacity: 1; transform: translate(-50%, 0) scale(1); }
}
@keyframes mHandSwipe {
    0%, 100% { transform: translateX(-10px) rotate(-10deg); }
    50%      { transform: translateX(10px) rotate(10deg); }
}

@keyframes mVeilIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes mVeilArrow {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(7px); }
}
@keyframes mNavGlow {
    0%, 100% { filter: brightness(1); }
    50%      { filter: brightness(1.35); }
}

/* Étoiles qui jaillissent au toucher (créées par mobile.js) */
.m-tap-star {
    position: fixed;
    width: 7px;
    height: 7px;
    pointer-events: none;
    z-index: 99999;
    background: var(--c, #ffd700);
    clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
    animation: mStarBurst .55s ease-out forwards;
}

@media (max-width: 760px) {
    :root {
        --m-banner-h: 56px;
        --m-nav-h: calc(64px + env(safe-area-inset-bottom, 0px));
        --m-accent: #9b59b6;
    }

    html { -webkit-text-size-adjust: 100%; }
    body {
        -webkit-tap-highlight-color: transparent;
        overscroll-behavior: none;
    }
    /* fond.png étiré à 100% x 100% est déformé en portrait, et "fixed" bug sur iOS */
    body:not(.homePage) {
        height: 100vh;
        height: 100dvh;
        background-size: cover;
        background-attachment: scroll;
    }

    /* ---------- Bandeau du haut ---------- */
    .banner {
        height: var(--m-banner-h);
        position: relative;
        z-index: 8600;
    }
    .banner-text {
        font-size: 20px;
        letter-spacing: 1.5px;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    .banner-text .bt-deco { display: none; }
    .banner-text::before,
    .banner-text::after {
        content: '\2726';
        font-size: 13px;
        color: #ffe680;
        animation: mTwinkle 2.4s ease-in-out infinite;
    }
    .banner-text::after { animation-delay: -1.2s; }

    .social-fixed-buttons {
        top: 50%;
        left: 10px;
        gap: 6px;
        transform: translateY(-50%);
    }
    .social-fixed-btn {
        width: 34px;
        height: 34px;
    }
    .theme-toggle {
        top: 50%;
        margin-top: -18px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 17px;
    }
    /* Switch jour/nuit (50px de large) centré verticalement comme le bouton compte, qui passe à sa gauche */
    .theme-switch.theme-switch-fixed {
        top: 50%;
        margin-top: -13px;
        right: 10px;
    }
    .account-toggle { right: 68px; }
    .theme-toggle:active { transform: scale(.88); }

    /* ---------- Catégories : barre d'onglets en bas, façon appli ---------- */
    .top-nav {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: var(--m-nav-h);
        box-sizing: border-box;
        padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
        justify-content: space-around;
        align-items: stretch;
        gap: 2px;
        background: rgba(12, 8, 22, 0.94);
        -webkit-backdrop-filter: blur(14px);
        backdrop-filter: blur(14px);
        border-top: 1px solid rgba(155, 89, 182, 0.35);
        border-bottom: 0;
        box-shadow: 0 -8px 26px rgba(0, 0, 0, 0.55);
        z-index: 8500;
    }
    .top-nav-item {
        flex: 1 1 0;
        min-width: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        font-size: 9.5px;
        letter-spacing: .6px;
        border-radius: 14px;
        color: rgba(255, 255, 255, 0.5);
        white-space: nowrap;
        overflow: hidden;
        transition: color .2s ease, background .3s ease;
    }
    .top-nav-item::before {
        content: attr(data-icon);
        font-size: 21px;
        line-height: 1;
        letter-spacing: 0;
        filter: grayscale(1) brightness(1.4);
        opacity: .55;
        transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), filter .25s, opacity .25s;
    }
    .top-nav-item.active {
        color: #fff;
        background: radial-gradient(ellipse at 50% 120%, rgba(155, 89, 182, 0.55), rgba(155, 89, 182, 0.08) 70%);
        box-shadow: inset 0 0 0 1px rgba(155, 89, 182, 0.35);
    }
    .top-nav-item.active::before {
        filter: none;
        opacity: 1;
        transform: translateY(-2px) scale(1.18);
    }
    .top-nav-item.m-pop::before { animation: mNavPop .5s ease; }
    /* Onglet Cape : petite image à la place de l'emoji */
    .top-nav-item.m-icon-cape::before {
        content: '';
        width: 13px;
        height: 21px;
        background: url('../icon%20cape.png') center / contain no-repeat;
        image-rendering: pixelated;
        border-radius: 2px;
    }
    .top-nav-item:active { background: rgba(255, 255, 255, 0.08); }
    /* 8 onglets : "Patch Notes" devient "Patch" pour tenir dans la barre */
    .nav-label-long { display: none; }
    /* Patch notes : box plus compactes sur petit écran */
    .patchnote-changes li { gap: 10px; }
    .patchnote-tag { width: 30px; }
    .patchnote-meta { font-size: 11px; }

    /* La barre noire et la mention en bas laissent la place aux onglets */
    .bottom-bar,
    .reserved-notice { display: none; }
    .m-reserved {
        margin: 26px 0 6px;
        text-align: center;
        font-family: 'Courier New', monospace;
        font-size: 11px;
        color: rgba(255, 255, 255, 0.55);
    }

    body.noel-mode .banner::after { height: 24px; }
    body.noel-mode .banner-text { padding-top: 18px; }

    .halloween-bg,
    .noel-bg {
        top: var(--m-banner-h);
        bottom: var(--m-nav-h);
    }
    .candy-basket { bottom: calc(var(--m-nav-h) + 4px); }

    /* ---------- Zone des pages ---------- */
    .slides-viewport {
        height: calc(100vh - var(--m-banner-h) - var(--m-nav-h));
        height: calc(100dvh - var(--m-banner-h) - var(--m-nav-h));
        touch-action: pan-y;
    }
    .slide {
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }
    /* Espace en bas pour que le bouton Chat ne cache pas la fin des pages */
    .slide::after {
        content: '';
        display: block;
        height: 88px;
    }
    .container { padding: 22px 16px; }

    /* Apparition en cascade quand on arrive sur une page */
    .slide.m-enter .feature-card,
    .slide.m-enter .enderman-container,
    .slide.m-enter .faq-item,
    .slide.m-enter .team-member,
    .slide.m-enter .compat-table-wrapper {
        animation: mPopIn .5s cubic-bezier(.22, 1, .36, 1) backwards;
    }
    .slide.m-enter :is(.feature-card, .enderman-container, .faq-item, .team-member):nth-child(2) { animation-delay: .07s; }
    .slide.m-enter :is(.feature-card, .enderman-container, .faq-item, .team-member):nth-child(3) { animation-delay: .14s; }
    .slide.m-enter :is(.feature-card, .enderman-container, .faq-item, .team-member):nth-child(4) { animation-delay: .21s; }
    .slide.m-enter :is(.feature-card, .enderman-container, .faq-item, .team-member):nth-child(5) { animation-delay: .28s; }
    .slide.m-enter :is(.feature-card, .enderman-container, .faq-item, .team-member):nth-child(n+6) { animation-delay: .35s; }

    /* ---------- Accueil ---------- */
    .slide .platforms-section { margin-top: 64px; }
    .slide .platforms-icons { gap: 14px 18px; }
    .slide .platform-icon { opacity: .75; }
    .slide .platform-icon svg { width: 26px; height: 26px; }
    .feature-cards { gap: 16px; margin-top: 28px; }
    .feature-card { border-radius: 16px; }
    .feature-card:active { transform: scale(.98); }
    .feature-card-title { font-size: 16px; }
    .feature-card-body p { font-size: 14px; }
    .feature-more { font-size: 18px; }
    .reviews-section { margin-top: 44px; padding: 0 4px; }

    /* ---------- Boutique : grosses cartes faciles à toucher ---------- */
    .shop-title { margin-top: 4px; }
    .enderman-section {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        margin-top: 22px;
    }
    .enderman-container {
        width: auto;
        align-items: stretch;
    }
    .enderman-head-link {
        flex-direction: row;
        align-items: center;
        gap: 16px;
        min-height: 88px;
        padding: 12px 16px 12px 12px;
        background: rgba(10, 6, 20, 0.78);
        border: 1px solid rgba(155, 89, 182, 0.5);
        border-radius: 20px;
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
        transition: transform .15s ease, border-color .2s, box-shadow .2s;
    }
    .enderman-head-link:active {
        transform: scale(.96);
        border-color: #c08ae6;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 26px rgba(155, 89, 182, 0.5);
    }
    .enderman-head-link::after {
        content: '\203A';
        flex-shrink: 0;
        width: 34px;
        height: 34px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: linear-gradient(45deg, #4a00e0, #8e2de2);
        color: #fff;
        font-size: 24px;
        line-height: 1;
        padding-bottom: 3px;
        box-sizing: border-box;
        box-shadow: 0 3px 10px rgba(142, 45, 226, 0.5);
    }
    .enderman-head {
        width: 64px;
        height: 64px;
        flex-shrink: 0;
        border-radius: 14px;
    }
    .enderman-label {
        flex: 1;
        width: auto;
        margin-top: 0;
        text-align: left;
        font-size: 15px;
        letter-spacing: .5px;
    }

    .enderman-desc { font-size: 12.5px; }

    /* ---------- Capes communautaires ---------- */
    .cape-nsfw-toggle-wrap {
        position: static;
        display: flex;
        justify-content: flex-end;
        padding: 8px 14px 6px;
    }
    .cape-type-tabs {
        flex-wrap: wrap;
        gap: 8px;
        padding: 0 12px;
    }
    .cape-type-tab {
        padding: 9px 14px;
        font-size: 11.5px;
    }
    .cape-search { font-size: 16px; padding: 10px 16px; }
    .cape-card:active { transform: scale(.96); }
    .cape-section-title { margin-top: 18px; }

    /* ---------- Tableau de compatibilité : défile sur le côté ---------- */
    .compat-table-wrapper {
        margin-top: 26px;
        padding: 0 12px 20px;
    }
    .m-compat-scroll {
        position: relative;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 14px;
        border: 1px solid rgba(255, 255, 255, 0.08);
    }
    .m-compat-scroll .compat-table {
        min-width: 560px;
        border: 0;
        border-radius: 0;
        overflow: visible;
    }
    .m-compat-scroll .compat-table th:first-child,
    .m-compat-scroll .compat-table td:first-child {
        position: sticky;
        left: 0;
        z-index: 2;
        min-width: 112px;
        max-width: 130px;
        padding-left: 12px;
        box-shadow: 4px 0 10px rgba(0, 0, 0, 0.35);
    }
    .m-compat-scroll .compat-table th:first-child { background: rgb(19, 91, 135); }
    .m-swipe-hint {
        text-align: center;
        margin: -8px 0 12px;
        font-family: 'VT323', 'Courier New', monospace;
        font-size: 17px;
        color: rgba(255, 255, 255, 0.7);
        transition: opacity .3s;
    }
    .m-swipe-hint span {
        display: inline-block;
        animation: mHandSwipe 1.4s ease-in-out infinite;
    }
    .m-swipe-hint.is-done { opacity: 0; }

    /* ---------- FAQ / Crédits ---------- */
    .faq-section { padding-left: 12px; padding-right: 12px; }
    .faq-question { min-height: 44px; }

    /* ---------- Bouton et fenêtre de chat ---------- */
    .chat-beta-btn {
        bottom: calc(var(--m-nav-h) + 14px);
        right: 14px;
        padding: 12px 18px;
        font-size: 15px;
        z-index: 8400;
        animation: mBob 3s ease-in-out infinite;
    }
    .chat-beta-btn:active { transform: scale(.92); }
    .chat-window {
        top: calc(var(--m-banner-h) + 8px);
        bottom: calc(var(--m-nav-h) + 8px);
        left: 8px;
        right: 8px;
        width: auto;
        height: auto;
        max-height: none;
        z-index: 8700;
        border-radius: 18px;
    }
    .chat-window.visible { animation: mSheetUp .3s ease; }
    .chat-input input,
    .username-change input,
    #chatGifSearch { font-size: 16px; }

    .scroll-hint { bottom: calc(var(--m-nav-h) + 74px); }

    /* ---------- Compte : panneau qui monte du bas ---------- */
    .account-modal-overlay {
        align-items: flex-end;
        padding: 0;
    }
    .account-modal {
        max-width: none;
        border-radius: 22px 22px 0 0;
        border-bottom: 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        transform: translateY(100%);
        transition: transform .38s cubic-bezier(.22, 1, .36, 1);
    }
    .account-modal::before {
        content: '';
        display: block;
        width: 42px;
        height: 5px;
        margin: 8px auto 0;
        border-radius: 5px;
        background: rgba(255, 255, 255, 0.3);
    }
    .account-modal-overlay.open .account-modal { transform: none; }
    .account-modal-row input { font-size: 16px; padding: 11px 12px; }
    .account-modal-row button { padding: 11px 16px; }

    /* ---------- Licence Mc Skin Loader : cartes empilées, à la bonne taille ---------- */
    .licence-modal-overlay {
        padding: 12px 12px calc(30px + env(safe-area-inset-bottom, 0px));
    }
    .licence-modal-inner,
    .licence-modal-overlay.open .licence-modal-inner {
        transform: none;
        width: 100%;
        gap: 14px;
    }
    .licence-modal-overlay.open .licence-modal-inner { animation: mSheetUp .35s ease; }
    .licence-modal-close {
        position: fixed;
        top: 12px;
        right: 12px;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    .licence-cards {
        flex-direction: column !important;
        align-items: center !important;
        gap: 18px !important;
    }
    .licence-cards .card-hover-wrap {
        zoom: var(--m-lic-zoom, .72);
        background: rgba(255, 255, 255, 0.1);
    }
    .licence-cards .card-hover-wrap:active { background: rgba(130, 70, 220, 0.35); }
    .licence-modal-overlay.open .card-hover-wrap { animation: mPopIn .5s cubic-bezier(.22, 1, .36, 1) backwards; }
    .licence-modal-overlay.open .card-hover-wrap:nth-child(2) { animation-delay: .08s; }
    .licence-modal-overlay.open .card-hover-wrap:nth-child(3) { animation-delay: .16s; }

    /* ---------- Petit message "glisse pour changer de page" ---------- */
    .m-toast {
        position: fixed;
        left: 50%;
        bottom: calc(var(--m-nav-h) + 84px);
        z-index: 8800;
        max-width: calc(100vw - 32px);
        padding: 10px 18px;
        border-radius: 999px;
        background: rgba(0, 0, 0, 0.88);
        border: 1px solid rgba(155, 89, 182, 0.6);
        color: #fff;
        font-family: 'VT323', 'Courier New', monospace;
        font-size: 18px;
        white-space: nowrap;
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
        animation: mToastIn .35s cubic-bezier(.34, 1.56, .64, 1) both;
        transition: opacity .3s;
    }
    .m-toast span {
        display: inline-block;
        animation: mHandSwipe 1.2s ease-in-out infinite;
    }
    .m-toast.is-out { opacity: 0; }

    /* ---------- Voile noir à l'arrivée : montre la barre des catégories ---------- */
    .m-nav-veil {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: var(--m-nav-h);           /* la barre du bas reste visible */
        z-index: 9000;
        background: rgba(0, 0, 0, 0.78);
        display: flex;
        align-items: flex-end;
        justify-content: center;
        padding-bottom: 26px;
        animation: mVeilIn .35s ease both;
        transition: opacity .35s ease;
    }
    .m-nav-veil.is-out { opacity: 0; pointer-events: none; } /* ne bloque plus les touchers pendant le fondu */
    /* Même style que la bulle "Scroll to see the reviews", en plus grand */
    .m-nav-veil-bubble {
        position: relative;
        padding: 9px 22px;
        background: #000;
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 999px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5), 0 0 22px rgba(155, 89, 182, 0.45);
        font-family: 'VT323', 'Courier New', monospace;
        font-size: 20px;
        line-height: 1;
        color: #fff;
        white-space: nowrap;
        animation: mVeilArrow 1s ease-in-out infinite;
    }
    .m-nav-veil-bubble::after {
        content: '';
        position: absolute;
        left: 50%;
        top: calc(100% - 1px);
        width: 28px;
        height: 18px;
        transform: translateX(-50%);
        background: #000;
        clip-path: polygon(0 0, 100% 0, 100% 45%, 50% 100%, 0 45%);
    }
    /* La barre ressort au-dessus du voile */
    body.m-veil-on .top-nav {
        box-shadow: 0 -2px 0 rgba(192, 138, 230, 0.9), 0 -10px 34px rgba(155, 89, 182, 0.75);
        animation: mNavGlow 1s ease-in-out infinite;
    }
    body.m-veil-on .scroll-hint { opacity: 0; }

    /* ---------- Page d'accueil (index.html) ---------- */
    .homePage { padding: 24px 16px; }
    .homePage .magik-title { font-size: 30px !important; line-height: 1.3; }
    .homePage .homeContainer p { font-size: 15px; }
    .homePage .enterBtn {
        padding: 16px 52px;
        font-size: 20px;
        margin: 26px 0 30px;
        animation: mBob 2.4s ease-in-out infinite;
    }
    .homePage .enterBtn:active { transform: scale(.94); }
    .homePage .platforms-icons { gap: 14px 20px; }
    /* Fumée et brume : le flou (blur 45-55px) sur de grands calques animés est très lourd pour
       un téléphone et retardait les premiers touchers. Les dégradés radiaux suffisent ici. */
    .homePage .smoke-puff,
    .homePage .mist-layer { filter: none; }
    /* Sans le flou, le dégradé d'origine laissait voir le bord des nuages (des ronds) :
       ici l'opacité décroît progressivement jusqu'à 0 au bord, comme une tache floutée. */
    .homePage .smoke-puff {
        background: radial-gradient(circle closest-side,
            rgba(255,255,255,0.50) 0%,
            rgba(255,255,255,0.40) 18%,
            rgba(255,255,255,0.27) 36%,
            rgba(255,255,255,0.15) 54%,
            rgba(255,255,255,0.06) 72%,
            rgba(255,255,255,0.015) 88%,
            rgba(255,255,255,0) 100%);
    }
    .homePage .mist-layer {
        background: radial-gradient(closest-side,
            rgba(255,255,255,0.14) 0%,
            rgba(255,255,255,0.09) 35%,
            rgba(255,255,255,0.04) 65%,
            rgba(255,255,255,0.01) 85%,
            rgba(255,255,255,0) 100%);
    }
}

@media (max-width: 380px) {
    .top-nav-item { font-size: 8.5px; letter-spacing: .3px; }
    .top-nav-item::before { font-size: 19px; }
    .banner-text { font-size: 17px; }
    .enderman-label { font-size: 14px; }
    .enderman-desc { font-size: 12px; }
}

@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
    .chat-beta-btn,
    .homePage .enterBtn,
    .banner-text::before,
    .banner-text::after,
    .m-swipe-hint span,
    .m-toast span,
    .m-nav-veil-bubble,
    body.m-veil-on .top-nav { animation: none; }
    .m-toast span { animation: none; }
    .slide.m-enter * { animation: none !important; }
}
