
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Comic Neue', cursive, sans-serif;
}

/* Prevent text size adjustment on orientation change */
html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* Prevent zoom on double-tap */
* {
    touch-action: manipulation;
}

/* Prevent highlight on tap */
.game-card, .nav-btn, .menu-btn, .character-option, .login-btn {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Prevent pull-to-refresh on mobile */
body {
    overscroll-behavior: none;
    /* For older browsers */
    -webkit-overflow-scrolling: touch;
}

/* Prevent zoom on input focus on iOS */
@media (max-width: 992px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

body {
    background: #000;
    color: #fff;
    min-height: 100vh;
    overflow-x: hidden;
}
.container {
    display: flex;
    min-height: 100vh;
}
/* Game List Column */
.game-column {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Changed from center to flex-start */
    position: relative;
    padding-top: 80px; /* Added to push content down */
}

.game-column h1 {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 28px;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
#hmb-game-over h1.hmb-title {
    margin-bottom: 20px;    /* khoảng cách xuống dưới */
    text-align: center;
}

.back-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: 1px solid #333;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    display: none;
    z-index: 100;
}

.back-btn:hover {
    background: rgba(51, 51, 51, 0.7);
}

.game-list {
   
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 40px; /* Increased margin */
    width: 100%;
    max-width: 800px;
}

.game-card {
    background: #111;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
    border: 2px solid #333;
}

.game-card:hover {
    transform: translateY(-5px);
    border-color: #fff;
}

.game-thumb {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
}

.game-info {
    padding: 15px;
    text-align: center;
}


/* Info Column */
.info-column {
    width: 300px;
    background: #111;
    padding: 20px;
    border-left: 1px solid #333;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-section {
    margin-bottom: 20px;
    flex-shrink: 0;
}

.panel-title {
    font-size: 16px;
    color: #fff;
    margin-bottom: 12px;
    padding-bottom: 5px;
    border-bottom: 1px solid #333;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.leaderboard-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 10px;
}

.leaderboard-list::-webkit-scrollbar {
    width: 5px;
}

.leaderboard-list::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.leaderboard-list::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 5px;
}

.leaderboard-item {
    padding: 10px;
    margin-bottom: 0px;
    background: #1a1a1a;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #333;
    border-left: 1px solid #333;
    border-right: 1px solid #333;
    border-bottom: 0px;
    font-size: 14px;
}

.leaderboard-item:last-child {
    margin-bottom: 0;
}

.rank {
    display: flex;
    align-items: center;
    margin-right: 5px; /* Reduced margin */
    min-width: 40px; /* Added fixed width */
}

.rank i {
    margin-right: 5px;
    font-size: 16px;
}

.rank-1 i { color: gold; }
.rank-2 i { color: silver; }
.rank-3 i { color: #cd7f32; }

.country-flag {
    margin-right: 8px;
    font-size: 16px;
}

.leaderboard-item span:nth-child(2) {
    flex: 1;
    margin-right: 5px; /* Reduced space */
    text-align: left;
    min-width: 60px; /* Added fixed width for score */
}

.leaderboard-item span:nth-child(3) {
    min-width: 60px; /* Added fixed width for score */
    text-align: left;
}

.user-info {
    background: #1a1a1a;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.user-name {
    font-size: 18px;
    margin-bottom: 10px;
    color: #fff;
}

.user-stats {
    margin-bottom: 15px;
}

.stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 14px;
    color: #ccc;
}

.login-btn {
    background: #1a73e8;
    color: white;
    border: 1px solid #333;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.login-btn:hover {
    background: #333;
}

.login-btn i {
    margin-right: 8px;
}

/* Character Selection */
.character-selection {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

.character-options {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 20px 0;
}

.character-option {
    cursor: pointer;
    text-align: center;
    border: 2px solid #333;
    padding: 10px;
    border-radius: 10px;
    transition: all 0.3s;
    width: 120px;
}

.character-option.selected {
    border-color: #fff;
    background: #1a1a1a;
}

.character-img {
    width: 80px;
    height: 80px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    margin: 0 ;
}

/* Game Screen */
#game-wrapper {
    position: relative;
    width: 100%;
    max-width: 360px;
    height: 640px;
    background: #222;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    margin: 0 auto;
    display: none;
    background: linear-gradient(to bottom, #87CEEB, #98FB98);
}

#game-screen {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#score-display {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 20px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 10px;
    z-index: 10;
}

#level-display {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 10px;
    border-radius: 10px;
    z-index: 10;
}

#player {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 5;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
}

.bullet {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    z-index: 4;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
}

#game-over {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 20;
}

.explosion {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #fff 0%, #ccc 50%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: explode 0.5s forwards;
}

@keyframes explode {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(2); opacity: 0; }
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #111;
    border-top: 1px solid #333;
    z-index: 1000;
}

.nav-btn {
    flex: 1;
    padding: 12px;
    text-align: center;
    color: #ccc;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-btn.active {
    color: #fff;
    background: #333;
}

.nav-btn i {
    display: block;
    font-size: 20px;
  
}

/* Mobile Views */
.mobile-view {
    display: none;
    padding: 20px;
}

.mobile-view.active {
    display: block;
}

/* Responsive */
@media (max-width: 992px) {
    .container {
        flex-direction: column;
    }
    .game-column {
        padding-bottom: 70px; /* Space for mobile nav */
    }
    
    .info-column {
        
    }
    
    .mobile-nav {
        display: flex;
    }
    
    /* Show mobile views when active */
    #mobile-games.active,
    #mobile-ranking.active,
    #mobile-stats.active {
        display: block;
    }
    
    #game-wrapper {
        width: 100%;
        height: 70vh;
    }
}

/* Game Menu Styles */
.game-menu {
    text-align: center;
    padding: 20px;
}

.menu-btn {
    background: #000;
    color: white;
    border: 1px solid #333;
    padding: 12px 24px;
    margin: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
}

.menu-btn:hover {
    background: #333;
}
/* Sửa media query trong styles.css hoặc trong thẻ style */
@media (max-width: 992px) {
    .game-card {
        cursor: pointer;
    }
    
    /* Chỉ ẩn info-column và mobile-view, không ẩn mobile-nav */
    .info-column,
    .mobile-view {
        display: none ;
    }
    
    /* Hiển thị mobile-nav */
    .mobile-nav {
        display: flex !important;
    }
    
    .game-column {
        padding-bottom: 70px; /* Tạo khoảng trống cho nav bottom */
    }
}
        /* Các style hiện tại giữ nguyên */
        /* Additional styles to prevent zoom and scaling */
html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
}

/* Cải thiện độ nhạy cảm ứng */
.game-card, .nav-btn, .menu-btn, .character-option, .login-btn, 
.back-btn, #player, .bubble, .bullet {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* Đảm bảo game wrapper chiếm toàn màn hình trên mobile */
@media (max-width: 992px) {
    #game-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-width: none;
        border-radius: 0;
    }
    
    .container {
        overflow: hidden;
    }
    
    /* Ẩn cột thông tin trên mobile */
    .info-column {
        display: none;
    }
    
    /* Hiển thị mobile views */
    .mobile-view {
        display: none;
        width: 100%;
        height: calc(100% - 60px);
        overflow-y: auto;
        padding: 15px;
        position: absolute;
        left:0;
        background: #000;
    }
    
    .mobile-view.active {
        display: block;
    }
    
    /* Điều chỉnh game list để có thể ẩn/hiện */
    .game-list, .character-selection {
        transition: opacity 0.3s ease;
    }
    
    .mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        display: flex;
        background: #000;
        z-index: 1000;
        border-top:1px solid rgb(41, 40, 40);
    }
    
    .nav-btn {
        flex: 1;
        padding: 12px;
        background: none;
        border: none;
        color: #8a8a8a;
        font-size: 12px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    .nav-btn.active {
        color: #ffd700;
    }
    
    .nav-btn i {
        font-size: 20px;
        margin-bottom: 4px;
    }
}

.character-selection {
    width: 100%;
    text-align: center;
}

.character-selection h2 {
    margin-bottom: 20px;
    font-size: 24px;
}

.character-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.character 
{
    padding: 10px;
    border-radius: 50%;
    margin:5px;
    background-color: #000;
    border: 2px solid #fff

}
.character.selected {
    border-color: #ffd900;
    background: #ffd900;
}
.character-img {
    width: 60px;
    height: 60px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    
}
.start-button {
    background: #1a73e8;
    color: white;
    border: none;
    padding: 15px 30px;
    margin-top: 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
    font-weight: bold;
}

.start-button:hover {
    background: #0d5bba;
}

.logo-header {
    display: block;            /* tách ra thành block riêng */
    text-align: left !important; /* ép căn trái */
    width: 100%;               /* chiếm hết chiều ngang container */
    margin: 0 0 20px 0;
}

.logo-header h1 {
    margin: 0;
    font-size: 32px;
}

.logo-header .slogan {
    font-size: 16px;
    color: #aaa;
    margin: -20px 0 0 0;
    font-style: italic;
    display: block;
    text-align: left !important; /* ép slogan về trái */
}
.hmb-score-instructions {
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 12px;
    margin: 10px 0;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    text-align: left; /* căn trái */
}

.hmb-score-instructions h3 {
    margin-top: 0;
    margin-bottom: 6px;
    font-size: 16px;
    text-align: left;
}

.hmb-score-instructions ul {
    margin: 0;
    padding-left: 0px;
}

.hmb-score-instructions li {
    margin-bottom: 4px;
    list-style: none; /* bỏ dấu chấm mặc định */
}

.hmb-score-instructions li i.fa-hand-point-right {
    margin-right: 6px;
    color: #FFD700; /* màu vàng cho icon nổi bật */
}

/* Social icons */
.social-icons {
    margin-top: 30px; /* Cách phần game 30px trên mobile */
    display: flex;
    gap: 20px;
    justify-content: center; /* Căn giữa trên mobile */
    align-items: center; /* Căn giữa theo chiều dọc */
    z-index: 1000;
}
/* Ẩn social-icons khi ở chế độ Ranking hoặc Stats trên mobile */
@media (max-width: 992px) {
    .social-icons.hidden {
        display: none; /* Ẩn khi có class hidden */
    }
}
/* Điều chỉnh cho desktop */
@media (min-width: 993px) {
    .social-icons {
        position: absolute; /* Đặt vị trí tuyệt đối để cố định ở bottom */
        bottom: 50px; /* Cách bottom 30px */
        left: 50%; /* Căn giữa khung game-list */
        transform: translateX(-50%); /* Dịch chuyển để căn giữa */
        margin-top: 0; /* Bỏ margin-top trên desktop */
        justify-content: center; /* Căn giữa các icon trong khung */
    }
}
.social-icons a {
    font-size: 22px;            /* kích thước icon */
    color: #fff;             /* icon đen */
    border: 2px solid #000000;  /* viền đen */
    background: #000;        /* nền trắng */
    width: 50px;                /* chiều rộng */
    height: 50px;               /* chiều cao */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;         /* hình tròn */
    transition: all 0.3s ease;
    text-decoration: none;  
}

.social-icons a:hover {
    background: #000000;        /* hover nền đen */
    color: #ffffff;             /* icon trắng khi hover */
    transform: scale(1.2);
}