/* Stitch CSS for Tablet Input */
body {
    font-family: 'Inter', sans-serif;
    background-color: #071424;
    margin: 0;
    /* overflow-x caché pour éviter le scroll horizontal.
       overflow-y: auto permet le scroll vertical quand le
       clavier virtuel mobile pousse le contenu vers le bas.
       Sur desktop/tablette paysage le contenu tient dans le viewport. */
    overflow-x: hidden;
    overflow-y: auto;
}
.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}
.fade-out {
    animation: fadeOut 0.5s ease-in forwards;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
.input-focus-glow:focus {
    box-shadow: 0 0 25px rgba(0, 217, 140, 0.5), inset 0 0 10px rgba(0, 217, 140, 0.2);
    border-color: #00d98c;
    outline: none;
}
.bg-grid {
    background-size: 40px 40px;
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}
.text-glow {
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}
.btn-glow {
    box-shadow: 0 0 20px rgba(0, 217, 140, 0.4);
}
@keyframes pulse-slow {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.animate-pulse-slow {
    animation: pulse-slow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Grid Lasers (Tron Style) */
.grid-laser {
    position: absolute;
    z-index: 2;
    opacity: 0.8;
    pointer-events: none;
}
.laser-h {
    height: 1px;
    width: 100px;
    background: linear-gradient(90deg, transparent, rgba(69, 246, 166, 0.5), #45f6a6);
    box-shadow: 2px 0 5px #45f6a6, 5px 0 10px #45f6a6;
    animation: laser-move-h linear infinite;
    left: 0;
}
.laser-v {
    width: 1px;
    height: 100px;
    background: linear-gradient(180deg, transparent, rgba(69, 246, 166, 0.5), #45f6a6);
    box-shadow: 0 2px 5px #45f6a6, 0 5px 10px #45f6a6;
    animation: laser-move-v linear infinite;
    top: 0;
}
@keyframes laser-move-h {
    0% { transform: translateX(-150px); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateX(150vw); opacity: 0; }
}
@keyframes laser-move-v {
    0% { transform: translateY(-150px); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(150vh); opacity: 0; }
}

/* ============================================================
   RESPONSIVE — Tablette portrait (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
    body {
        /* Permettre le scroll quand le clavier virtuel s'ouvre */
        overflow-y: auto;
        overflow-x: hidden;
        /* dvh : tient compte de la barre de navigateur mobile */
        min-height: 100dvh;
    }

    /* Masquer les éléments HUD purement décoratifs */
    .hud-top-left,
    .hud-top-right,
    .hud-bottom-left,
    .hud-bottom-right {
        display: none !important;
    }

    /* Réduire les lasers (animation gourmande) */
    .grid-laser {
        opacity: 0.4;
    }
}

/* ============================================================
   RESPONSIVE — Mobile (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
    body {
        overflow-y: auto;
        overflow-x: hidden;
        min-height: 100dvh;
    }

    /* Masquer totalement les lasers sur mobile */
    .grid-laser {
        display: none !important;
    }

    /* Réduire les glows trop lourds sur GPU mobile */
    .btn-glow {
        box-shadow: 0 0 10px rgba(0, 217, 140, 0.3);
    }
    .input-focus-glow:focus {
        box-shadow: 0 0 15px rgba(0, 217, 140, 0.4);
    }
}
