html, body {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
    -webkit-overflow-scrolling: touch;
    background-color: #0f172a;
    /* MOBILE: chặn cuộn/zoom/bôi chọn/menu giữ-lâu của iOS (vô hại trên desktop) */
    overscroll-behavior: none;
    touch-action: manipulation;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}
body {
    box-sizing: border-box;
    height: 100vh;       /* fallback */
    height: 100dvh;      /* trừ thanh địa chỉ động trên mobile */
    /* né tai thỏ / Dynamic Island / home indicator (env = 0 trên desktop -> không đổi gì) */
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
/* KHUNG GAME: khóa tỉ lệ thiết kế 844:390 (kích thước do JS fitGameFrame đặt px — scale-to-fit vùng an
   toàn, letterbox, KHÔNG biến dạng, KHÔNG dùng CSS transform nên joystick real-px vẫn chuẩn). Cap 844. */
#game-frame {
    touch-action: none;  /* trong sân: tự xử lý chạm, chặn mọi cử chỉ trình duyệt */
}
/* NHẮC XOAY NGANG: chỉ thiết bị cảm ứng + đang dọc (desktop pointer mịn -> không bao giờ hiện) */
#rotate-notice { display: none; }
@media (orientation: portrait) and (pointer: coarse) {
    #rotate-notice {
        display: flex; position: fixed; inset: 0; z-index: 9999;
        flex-direction: column; align-items: center; justify-content: center; gap: 20px;
        background: #0f172a; color: #e2e8f0; font-family: monospace; text-align: center; padding: 24px;
    }
    #rotate-notice p { font-size: 18px; font-weight: 800; letter-spacing: 1px; }
    .rotate-phone {
        width: 52px; height: 92px; border: 4px solid #22d3ee; border-radius: 12px;
        animation: rotateHint 1.8s ease-in-out infinite;
    }
}
@keyframes rotateHint {
    0%, 45% { transform: rotate(0deg); }
    65%, 100% { transform: rotate(-90deg); }
}
.game-grid {
    background-color: #2a2a35; 
    background-image: radial-gradient(#1c1c24 1.5px, transparent 1.5px);
    background-size: 16px 16px;
}
.tank-container {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 40px;
    height: 32px;
    margin-top: -16px; 
    margin-left: -20px;
}
.tank-rotater {
    width: 100%;
    height: 100%;
    transform-origin: center center;
}
.tank-body {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.flipped {
    transform: scale(1.15) rotateX(180deg) rotateZ(10deg) !important;
}
.flipped .tank-part-top { opacity: 0 !important; }
.flipped .tank-belly { opacity: 1 !important; }
/* Màn hình chọn skill: option đã được chọn ở ô khác -> bôi đen, không chọn được */
select option:disabled {
    color: #475569;
    background-color: #020617;
}

/* ===== [2026-06-26] TƯƠNG THÍCH EMOJI ĐA TRÌNH DUYỆT =====
   Triệu chứng: vài trình duyệt (Firefox, một số WebView) hiện icon emoji thành "?" / ô vuông.
   Gốc: font-family (mặc định + Tailwind `.font-mono` của menu game) KHÔNG liệt kê font EMOJI -> các trình
   duyệt khắt khe KHÔNG tự mượn font emoji của HỆ ĐIỀU HÀNH. Vá: THÊM font emoji vào CUỐI cascade cho cả
   sans LẪN mono (chỉ APPEND -> chữ Việt vẫn font cũ; emoji mượn Segoe UI Emoji / Apple Color Emoji / Noto
   Color Emoji... theo OS). !important để thắng style Tailwind Play (inject lúc chạy). */
body,
.font-sans {
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
        "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "Twemoji Mozilla", "Android Emoji" !important;
}
.font-mono,
code, kbd, samp, pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace,
        "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "Twemoji Mozilla", "Android Emoji" !important;
}
