/* ============================================================
   mobile.css — Layout móvil: Growth City
   ============================================================ */

/* ── Joystick: solo en dispositivos táctiles ─────────────── */
#mobile-controls { display: none; }
@media (hover:none) and (pointer:coarse), (max-width:768px) {
    #mobile-controls { display: block; }
}

/* ══════════════════════════════════════════════════════════
   JOYSTICK VIRTUAL
══════════════════════════════════════════════════════════ */
#joystick-zone {
    position: fixed;
    bottom: 26px; left: 18px;
    width: 118px; height: 118px;
    z-index: 45;
    touch-action: none; user-select: none;
}
#joystick-base {
    width: 118px; height: 118px;
    border-radius: 50%;
    background: rgba(255,255,255,.055);
    border: 1.5px solid rgba(255,255,255,.13);
    position: absolute; top: 0; left: 0;
    box-shadow: 0 4px 18px rgba(0,0,0,.4);
}
#joystick-base::before, #joystick-base::after {
    content: ''; position: absolute;
    background: rgba(255,255,255,.07); border-radius: 1px;
}
#joystick-base::before { width:1px;height:50%;top:25%;left:50%;transform:translateX(-50%); }
#joystick-base::after  { height:1px;width:50%;left:25%;top:50%;transform:translateY(-50%); }
#joystick-thumb {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 35%,
        rgba(116,200,255,.9), rgba(56,189,248,.55));
    border: 1.5px solid rgba(255,255,255,.4);
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%,-50%);
    box-shadow: 0 3px 10px rgba(0,0,0,.4);
    pointer-events: none;
    will-change: transform;
}

/* ══════════════════════════════════════════════════════════
   BARRA SUPERIOR UNIFICADA — PORTRAIT MÓVIL (≤600px)
══════════════════════════════════════════════════════════ */
@media (max-width: 600px) {

    /* Ocultar paneles originales */
    #hud-container,
    #score-container,
    #inventory-container,
    #octalysis-wheel-hud { display: none !important; }

    /* Fondo de la barra */
    body::before {
        content: '';
        position: fixed; top: 0; left: 0; right: 0;
        height: 62px; z-index: 30;
        background: rgba(6,8,18,.9);
        border-bottom: 1px solid rgba(255,255,255,.07);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        pointer-events: none;
    }

    /* HUD unificado */
    #mobile-hud {
        position: fixed; top: 0; left: 0; right: 0;
        height: 62px; z-index: 31;
        display: flex; align-items: center;
        padding: 0 12px; gap: 8px;
        pointer-events: none;
    }
    #mhud-left {
        display: flex; flex-direction: column; gap: 2px;
        flex: 1; min-width: 0;
    }
    #mhud-drives {
        font-size: 13px; font-weight: 700;
        color: #74c8ff; white-space: nowrap;
    }
    #mhud-coins {
        font-size: 11px; color: rgba(255,255,255,.42);
    }
    #mhud-wheel {
        flex-shrink: 0; width: 50px; height: 50px;
    }
    #mhud-wheel svg { width: 50px; height: 50px; }
    #mhud-right {
        display: flex; flex-direction: column;
        align-items: flex-end; gap: 2px; flex: 1;
    }
    #mhud-score {
        font-size: 15px; font-weight: 800; color: #ffd93d;
    }
    #mhud-label {
        font-size: 9px; color: rgba(255,255,255,.3);
        text-transform: uppercase; letter-spacing: 1px;
    }

    /* Botón de mute */
    #audio-mute-btn {
        bottom: 154px !important; right: 14px !important;
        width: 42px !important; height: 42px !important;
        font-size: 15px !important;
    }
}

/* ══════════════════════════════════════════════════════════
   TABLET / LANDSCAPE (601–768px)
══════════════════════════════════════════════════════════ */
@media (min-width: 601px) and (max-width: 768px) {
    #info-panel { max-width: 175px; padding: 9px 11px; }
    #info-panel h3 { font-size: 11px; }
    #info-panel p  { font-size: 11px; }
    #player-position, #current-zone { display: none; }

    #score-container  { top: 10px; right: 10px; }
    #score-panel      { padding: 9px 12px; min-width: 115px; }
    #score-value      { font-size: 13px; }
    #coins-value      { font-size: 12px; }
    #shop-hud-btn     { font-size: 11px; padding: 5px 8px; }

    #inventory-container { right: 135px; top: 10px; }
    #inventory-panel  { width: 115px; padding: 7px; }

    #octalysis-wheel-hud {
        bottom: auto; top: 78px; left: 10px;
        transform: none;
    }
    #wheel-svg    { width: 70px; height: 70px; }
    #wheel-label  { display: none; }

    #audio-mute-btn {
        bottom: 145px !important; right: 14px !important;
    }
}

/* ══════════════════════════════════════════════════════════
   MODALES — bottom sheet en móvil pequeño
══════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
    #fb-overlay,
    #npc-v2-overlay,
    #shop-overlay,
    #diary-overlay {
        padding: 0;
        align-items: flex-end;
    }
    #fb-card,
    #npc-v2-card,
    #shop-card,
    #diary-panel {
        max-width: 100% !important;
        width: 100%;
        border-radius: 18px 18px 0 0 !important;
        max-height: 88vh;
    }
    #victory-overlay  { padding: 0; align-items: flex-start; }
    #victory-container { padding: 16px 12px 72px; }

    #onboarding-overlay { padding: 0; }
    #ob-container {
        height: 100dvh; max-width: 100%;
        border-radius: 0;
        padding: 18px 14px 26px;
        justify-content: space-between;
    }

    /* Botones táctiles ≥ 44px */
    .modal-btn, .ob-btn, .npc-v2-btn,
    .vbtn, .shop-buy-btn,
    .npc-v2-choice, .diary-tab,
    .diary-nav-btn {
        min-height: 44px;
    }

    /* Choices en columna */
    #npc-v2-choices { grid-template-columns: 1fr; }
    .ob-drives-grid { grid-template-columns: repeat(2,1fr); }
    .ob-controls-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════
   GLOBAL TOUCH
══════════════════════════════════════════════════════════ */
* { -webkit-tap-highlight-color: transparent; }
canvas { touch-action: none; }
button, [role="button"] { touch-action: manipulation; }
