/* ====== Base ====== */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-image: url('../images/bg.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-position: center;
    color: #333;
}

header {
    background-color: #333;
    color: white;
    padding: 10px 20px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-right {
    display: flex;
    align-items: center;
}

.header-content h1 {
    margin: 0;
}

.header-content input {
    width: 60%;
    padding: 10px;
    border-radius: 5px;
    border: none;
}

.banner img {
    width: 100%;
    height: auto;
}

/* ====== Game list / cards ====== */
.game-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
    background: #00000042;
}

.game-list-duongdan {
    justify-content: center;
    padding: 20px;
    width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
    background: black;
}

.game-list-duongdan h1 {
    font-size: 28px;
    text-align: center;
    margin-bottom: 10px;
    color: white;
}

.date {
    display: flex;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
    color: #8f8f8f;
}

.game:hover {
    transform: scale(1.05);
}

.game img,
.game video {
    max-width: 100%;
    max-height: 100%;
    display: block;
    margin: 0 auto;
    transition: opacity 0.3s;
}

.game video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    z-index: 1;
}

.game:hover video {
    opacity: 1;
}

.game button {
    background-color: #00c4ff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.5s, opacity 0.5s ease-in-out;
}

.game button:hover {
    background-color: #008fcc;
}

/* Ẩn document khi hover theo hiệu ứng bạn đặt */
.game:hover .document-btn {
    opacity: 0;
    transition: opacity 5.0s ease-in-out;
}

/* ====== Language ====== */
.language-selector {
    margin-right: 10px;
}

#language-btn {
    background-color: #333;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 5px;
    display: flex;
    align-items: center;
}

.language-menu {
    display: none;
    position: absolute;
    background-color: #333;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 99;
    border-radius: 5px;
}

.language-menu a {
    color: white;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.language-menu a:hover {
    background-color: #575757;
}

/* ====== Contact button ====== */
#contact-btn {
    background-color: #00c4ff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 10px;
    transition: background-color 0.3s;
}

#contact-btn:hover {
    background-color: #008fcc;
}

/* ====== Popups ====== */
.contact-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.popup-content {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    width: 300px;
    position: relative;
}

/* FIXED: thêm ; giữa min-height và position */
.popup-news {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    width: 1000px;
    min-height: 600px;
    position: relative;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 20px;
    cursor: pointer;
}

.popup-content img {
    width: 100%;
    height: auto;
}

.popup-content p {
    margin: 10px 0;
}

.popup-news img {
    width: 100%;
    height: auto;
}

.popup-news p {
    margin: 10px 0;
}

/* ====== Categories ====== */
.category {
    margin: 20px 0;
}

.category-title {
    font-size: 24px;
    margin-bottom: 10px;
    color: white;
    text-align: center;
    padding-left: 20px;
}

.buttons {
    text-align: center;
    margin-top: 20px;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.category-btn {
    background: linear-gradient(135deg, #00c4ff, #0096ff);
    color: white;
    width: 142px;
    height: 40px;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    border: none;
    font-size: 14px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: background 0.3s ease, box-shadow 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: normal;
}

.category-btn:hover {
    background: linear-gradient(135deg, #0096ff, #007acc);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.category-btn:active {
    background: linear-gradient(135deg, #007acc, #005f99);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: scale(0.98);
}

/* ====== Labels ====== */
.label {
    position: absolute;
    top: 0;
    left: 0;
    background-color: red;
    color: white;
    padding: 5px 10px;
    border-radius: 0 0 10px 0;
    font-size: 12px;
    font-weight: bold;
}

.label.hot { background-color: #ff4500; }
.label.new { background-color: #32cd32; }
.label.khuyen_mai { background-color: #cb00ff; }

/* ====== Game card (đã có trùng lặp – giữ nguyên để không phá layout hiện tại) ====== */
.game {
    border: 1px solid #6b6b6b;
    background: linear-gradient(135deg, #071546, #000000);
    border-radius: 10px;
    text-align: center;
    color: white;
    width: 220px; /* rộng hơn chút để cân */
    height: 420px; /* cố định chiều cao */
    margin: 20px;
    padding: 15px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    box-sizing: border-box;
}

.contact-popup {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center; align-items: center;
    z-index: 2; margin-top: 10px;
}

.search-container { position: relative; display: flex; align-items: center; }

/* ====== Language flags in menu ====== */
.language-selector button img,
.language-menu a img {
    width: 16px;
    height: auto;
    margin-right: 8px;
    vertical-align: middle;
}

.language-selector #language-btn { display: flex; align-items: center; }

.language-selector button {
    background-color: #333;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    border-radius: 5px;
    display: flex;
    align-items: center;
}

.language-menu a { display: flex; align-items: center; }
.language-menu a img { margin-right: 8px; }

/* ====== Header center search ====== */
.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#search-container {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
}

#search-input {
    width: 40%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin: 0 auto;
    display: block;
}

#search-btn {
    position: absolute;
    right: calc(50% + 5px);
    background: none; border: none; cursor: pointer;
}

#search-btn img { width: 20px; height: 20px; }

/* ====== Banner slider ====== */
.banner-container {
    position: relative;
    max-width: 100%;
    height: 300px;
    overflow: hidden;
}

.banner-slide {
    display: none;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: opacity 1.5s ease-in-out;
}

.banner-slide.active { display: block; opacity: 1; }

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.prev, .next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto; padding: 16px; margin-top: -22px;
    color: white; font-weight: bold; font-size: 18px;
    transition: 0.6s ease; border-radius: 0 3px 3px 0;
    user-select: none;
}

.next { right: 0; border-radius: 3px 0 0 3px; }

.prev:hover, .next:hover { background-color: rgba(0, 0, 0, 0.8); }

.banner-indicators {
    position: absolute; bottom: 10px; left: 50%;
    transform: translateX(-50%);
    display: flex; justify-content: center; align-items: center;
    z-index: 2; width: 100%; box-sizing: border-box;
}

.dot {
    cursor: pointer; height: 15px; width: 15px;
    margin: 0 5px; background-color: #bbb;
    border-radius: 50%; display: inline-block;
    transition: background-color 0.6s ease;
}

.dot.active, .dot:hover { background-color: #717171; }

.dots-container {
    max-width: 1200px;
    bottom: 120px; margin: 0 auto; padding: 0 555px; box-sizing: border-box;
}

.banner-container {
    position: relative; max-width: 1200px; margin: 0 auto; overflow: hidden;
}

/* ====== Footer ====== */
.logo { width: 50px; height: auto; margin-right: 10px; display: inline-block; vertical-align: middle; }

footer {
    background-color: #333; color: white; text-align: center;
    padding: 20px 0; width: 100%;
}

.footer-content {
    display: flex; align-items: center; justify-content: center; flex-direction: column;
}

.footer-logo { width: 150px; height: auto; margin-bottom: 10px; }

/* ====== Update popup ====== */
.update-popup {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center; align-items: center;
    z-index: 3;
}

.update-popup .popup-content {
    background-color: white; border-radius: 10px; padding: 30px;
    text-align: left; width: 800px; position: relative;
}

.update-popup .close-btn {
    position: absolute; top: 10px; right: 10px; font-size: 20px; cursor: pointer;
}

/* ====== Sound effect grid ====== */
#sound-effect-list {
    display: flex; flex-wrap: wrap; justify-content: space-between;
    padding: 20px; gap: 10px; max-width: 1200px; margin: 0 auto;
}

.sound-effect {
    background-color: #333; color: white; padding: 10px 20px; border-radius: 5px;
    text-align: center; cursor: pointer; transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
    flex: 1 1 150px; max-width: 200px;
}

.sound-effect:hover { background-color: #008fcc; transform: scale(1.05); }

.sound-effect button {
    background-color: #444; color: #fff; border: none; padding: 10px; border-radius: 5px;
    font-size: 14px; font-weight: bold; width: 100%;
}
.sound-effect button:hover { background-color: #005c99; }

/* ====== Announcement popup ====== */
.close-announcement-btn {
    position: absolute; top: 10px; right: 10px; padding: 5px 10px;
    background-color: #e74c3c; color: white; border: none; border-radius: 3px; cursor: pointer;
}
.close-announcement-btn:hover { background-color: #c0392b; }

.popup-content h2 { margin-top: 0; text-align: center; }
.announcement-date { float: right; font-size: 12px; color: #888; margin-left: 10px; }

.news-item { border-radius: 5px; }
.news-item h3 { color: #2c3e50; font-size: 18px; }
.news-item p { color: #34495e; margin: 5px 0; }

/* ====== Modal ====== */
#NewModal {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.5); justify-content: center; align-items: center; z-index: 1000;
}

.popup-news {
    background-color: white; width: 80%; max-width: 800px; max-height: 80%;
    overflow-y: auto; padding: 20px; border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); position: relative;
}

.popup-news img { max-width: 100%; height: auto; }

.close-btn-news {
    position: absolute; top: 10px; right: 10px; background-color: #f0f0f0; border: none;
    font-size: 20px; cursor: pointer; padding: 5px 10px; border-radius: 50%; z-index: 1001;
}
.close-btn-news:hover { background-color: #ccc; }

#modal-text { max-height: 100%; overflow-y: auto; padding-right: 10px; }

/* ====== News categories ====== */
.event-category { background-color: green; color: white; padding: 5px 10px; margin-right: 10px; width: 90px; text-align: center; }
.announcement-category { background-color: blue; color: white; padding: 5px 10px; margin-right: 10px; width: 90px; text-align: center; }
.feature-category { background-color: purple; color: white; padding: 5px 10px; margin-right: 10px; width: 90px; text-align: center; }
.guide-category { background-color: orange; color: white; padding: 5px 10px; margin-right: 10px; width: 90px; text-align: center; }
.character-category { background-color: brown; color: white; padding: 5px 10px; margin-right: 10px; width: 90px; text-align: center; }
.general-category { background-color: gray; color: white; padding: 5px 10px; border-radius: 5px; margin-right: 10px; width: 90px; text-align: center; }

.news-container { display: flex; flex-direction: column; gap: 10px; margin: 20px 0; }
.news-item { display: flex; align-items: center; }
.news-item h3 { margin: 0; flex-grow: 1; }
.news-item p.date { margin: 0; white-space: nowrap; margin-left: 15px; }

/* ====== Share icon (FIXED: opacity 0..1 + z-index) ====== */
.relative-container { position: relative; width: 100%; }

.share-icon{
    position: absolute;
    top: 10px; right: 10px;
    font-size: 20px;
    color: white;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 5px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity .2s ease;
    z-index: 3;
}
.game:hover .share-icon { opacity: 1; }
.share-icon:hover { color: #f1f1f1; }

/* ====== Announcement list ====== */
.announcement-content { display: flex; flex-direction: column; }
.announcement-item {
    display: flex; align-items: center; cursor: pointer;
    padding: 10px; border-bottom: 1px solid #ccc;
}
.announcement-item:hover { background-color: #f0f0f0; }

.col-md-2.text-right p {
    text-align: right; margin-left: auto; margin-right: 0; padding-left: 10px;
}

/* ====== Language selector (header) ====== */
.language-selector { position: relative; margin-left: 10px; }
.language-selector #language-btn {
    background-color: #333; color: white; border: none; padding: 6px 12px;
    border-radius: 5px; cursor: pointer; display: flex; align-items: center;
}
.language-selector #language-btn img {
    width: 18px; height: auto; margin-right: 6px;
}
.language-menu {
    display: none; position: absolute; top: 100%; right: 0;
    background-color: #333; border-radius: 5px; box-shadow: 0 4px 8px rgba(0,0,0,0.2); z-index: 99;
}
.language-menu a {
    color: white; padding: 10px 15px; display: flex; align-items: center; text-decoration: none;
}
.language-menu a:hover { background-color: #575757; }
.language-menu a img { width: 16px; margin-right: 8px; }

/* ====== Game card variants (giữ nguyên) ====== */
.game img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
}
.game-title {
    font-size: 16px;
    font-weight: bold;
    margin: 10px 0 6px;
    min-height: 40px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: auto;
    margin-bottom: 10px;
}

.download-btn {
    background-color: #e74c3c !important;
    color: white !important;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    flex: 1;
}

.document-btn {
    background-color: #2ecc71 !important;
    color: white !important;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    flex: 1;
}

/* (trùng – giữ) */
.game {
  border: 1px solid #6b6b6b;
  background: linear-gradient(135deg, #071546, #000000);
  border-radius: 10px;
  text-align: center;
  color: white;
  width: 220px;
  height: auto;
  margin: 20px;
  padding: 15px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-sizing: border-box;
}

.game-title {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 10px;
  min-height: 40px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.game img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
}

.game-description {
  font-size: 13px;
  color: #ccc;
  margin: 10px 0 16px;
  min-height: 50px;
  line-height: 1.4;
}

.button-group {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: auto;
  margin-bottom: 5px;
}

.download-btn { background-color: #e74c3c; color: white; border: none; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: bold; flex: 1; transition: background-color 0.3s ease; }
.download-btn:hover { background-color: #c0392b; }

.document-btn { background-color: #2ecc71; color: white; border: none; padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: bold; flex: 1; transition: background-color 0.3s ease; }
.document-btn:hover { background-color: #27ae60; }

.game { display: flex; flex-direction: column; align-items: center; padding: 15px; height: auto; width: 220px; background: linear-gradient(135deg, #071546, #000000); border: 1px solid #6b6b6b; border-radius: 10px; color: white; position: relative; }

.game-title { font-size: 18px; font-weight: bold; margin-bottom: 10px; text-align: center; min-height: 48px; }

.game-description { font-size: 14px; color: #ccc; margin: 10px 0; text-align: center; min-height: 40px; }

.game-desc {
  font-size: 14px; color: #ccc; margin: 8px 0; min-height: 40px; text-align: center;
}

.show-more {
  margin: 15px auto; display: block; padding: 8px 20px; background-color: #444; color: white; border: none; border-radius: 5px; cursor: pointer;
}

.game-footer {
    display: flex; justify-content: space-between; align-items: center; padding-top: 5px; font-size: 14px;
}

.button-group { display: flex; gap: 8px; }

.game-description { font-size: 14px; color: #ccc; margin: 8px 0 4px 0; text-align: center; }

.download-count {
    font-size: 12px; color: #aaa; margin: 6px 0 6px; text-align: center;
}

.game-desc {
    color: #ccc; font-size: 13px; margin-top: 4px; margin-bottom: 8px; text-align: center; line-height: 1.4;
}

.button-group {
    display: flex; justify-content: center; gap: 8px; margin-top: 10px; position: relative; z-index: 2;
}

.document-btn, .download-btn {
    padding: 10px 15px; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; font-size: 14px; text-decoration: none !important; display: inline-block;
}

.download-btn { background-color: #e74c3c; color: white; }
.document-btn { background-color: #27ae60; color: white; }

.game img {
    width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 30px;
}
.game:hover .download-btn { opacity: 0; transition: opacity 5s ease-in-out; }

/* Nút category dùng hình nền */
.category-btn {
    background-image: url('../images/button-bg.png');
    background-size: contain; background-repeat: no-repeat; background-position: center;
    width: 180px; height: 90px; border: none; color: white; font-weight: bold; font-size: 16px;
    cursor: pointer; text-align: center; line-height: 60px;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s;
}
.category-btn:hover { transform: scale(1.05); opacity: 0.9; }

/* ====== Responsive (đÃ ĐÓNG COMMENT) ====== */
/* thêm cuối file */
@media screen and (max-width: 768px) {
  .header-content { flex-direction: column; align-items: flex-start; }
  #search-input { width: 100%; margin: 10px 0; }
  .header-right { flex-direction: column; align-items: flex-start; width: 100%; }
  .header-right a,
  .header-right .language-selector,
  #contact-btn { margin: 5px 0; }
  .game-list { flex-direction: column; align-items: center; }
  .game { width: 90%; max-width: 350px; margin: 10px auto; }
  .banner-container { height: auto; }
  .category-btn {
    width: 90%; height: auto; padding: 10px; font-size: 14px;
    background-size: contain; background-position: center; background-repeat: no-repeat; line-height: 1.2;
  }
  .banner-slide img { height: auto; max-height: 200px; }
  .button-group { flex-direction: column; gap: 5px; }
  .download-btn, .document-btn { width: 100%; }
}

/* ===================== CHAT POPUP (Telegram / WhatsApp) ===================== */
.chat-fab{
  position:fixed; right:18px; bottom:18px; z-index:9999;
  width:56px; height:56px; border-radius:50%;
  background:#1e293b; color:#fff; display:flex; align-items:center; justify-content:center;
  font-size:22px; box-shadow:0 8px 24px rgba(0,0,0,.25); cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease, opacity .2s;
}
.chat-fab:hover{ transform:translateY(-1px); }

.chat-modal{
  position:fixed; inset:0; background:rgba(0,0,0,.55);
  display:none; align-items:center; justify-content:center; z-index:9998;
}
.chat-modal.active{ display:flex; }

.chat-card{
  width:min(520px, 92vw); background:#0f172a; color:#e2e8f0; border-radius:14px;
  box-shadow:0 16px 48px rgba(0,0,0,.45); padding:18px 18px 16px; position:relative;
  border:1px solid rgba(148,163,184,.2);
}
.chat-close{
  position:absolute; top:8px; right:10px; background:transparent; border:none;
  color:#94a3b8; font-size:28px; cursor:pointer; line-height:1;
}

.chat-title{ margin:0 0 4px; font-size:20px; font-weight:700; }
.chat-hint{ margin:0 0 12px; color:#94a3b8; font-size:14px; }
.chat-label{ display:block; margin:6px 0 6px; font-size:13px; color:#cbd5e1; }
.chat-input{
  width:100%; background:#111827; color:#e5e7eb; border:1px solid #334155;
  border-radius:10px; padding:10px 12px; outline:none;
}
.chat-input:focus{ border-color:#60a5fa; }

.chat-actions{ display:flex; gap:12px; margin-top:14px; flex-wrap:wrap; }
.chat-btn{ display:inline-flex; align-items:center; gap:8px; text-decoration:none; padding:10px 14px; border-radius:10px; font-weight:700; border:none; }
.chat-btn:focus{ outline:none; }
.chat-tg{ background:#229ED9; color:#fff; }
.chat-wa{ background:#25D366; color:#0b2b18; }
.chat-note{ margin-top:12px; color:#93a3b8; font-size:12px; }

.chat-mini{
  background:#1f2937; color:#fff; border:none; padding:8px 12px; border-radius:8px;
  cursor:pointer; font-weight:600;
}
.chat-mini:hover{ filter:brightness(1.1); }

/* ===================== Mobile sidebar & hamburger ===================== */
#hamburger-menu{
  position: fixed;
  left: 12px; top: 12px;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: #333; color:#fff; border-radius: 8px; cursor: pointer;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  z-index: 10010;
}
@media (min-width: 992px){
  #hamburger-menu{ display: none; }
}

#mobile-sidebar{
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: 280px;
  background: #111; color: #fff;
  padding: 14px 12px;
  transform: translateX(-100%);
  transition: transform .25s ease;
  z-index: 10009;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
#mobile-sidebar.active{ transform: translateX(0); }

#sidebar-overlay{
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  opacity: 0; visibility: hidden;
  transition: opacity .2s ease, visibility .2s ease;
  z-index: 10008;
}
#sidebar-overlay.active{ opacity: 1; visibility: visible; }

#mobile-sidebar .menu-title{ margin: 4px 0 12px; font-weight: 700; }
#mobile-sidebar ul{ list-style: none; padding: 0; margin: 8px 0; }
#mobile-sidebar li a{
  display:block; padding: 10px 12px; color:#fff; text-decoration: none; border-radius: 8px;
}
#mobile-sidebar li a:hover{ background: rgba(255,255,255,.08); }

.sidebar-search-bar input{
  width: 100%; border: 1px solid #444; background: #222; color: #fff;
  border-radius: 8px; padding: 10px 12px;
}

.sidebar-open{ overflow:hidden; } /* khóa cuộn khi mở menu */
/* Ẩn chấm chỉ thị dưới banner */
.dots-container,
.banner-indicators,
.dot { display:none !important; }
/* === CHAT (floating) === */
#chat-fab{
  position:fixed; right:16px; bottom:16px; width:56px; height:56px;
  border-radius:50%; background:#00c4ff; color:#fff; border:none;
  font-size:22px; box-shadow:0 10px 30px rgba(0,0,0,.25); cursor:pointer;
  z-index:11000;  /* cao hơn #sidebar-overlay */
}
#webchat{
  position:fixed; right:16px; bottom:80px; z-index:11000; display:none;
}
#webchat .zn-card{
  width:min(340px, 92vw); max-height:60vh; background:#fff; border-radius:12px;
  box-shadow:0 14px 48px rgba(0,0,0,.35); display:flex; flex-direction:column; overflow:hidden;
}
#webchat .zn-head{
  background:#00c4ff; color:#fff; padding:10px 12px;
  display:flex; justify-content:space-between; align-items:center;
}
#chat-close{ background:transparent; border:0; color:#fff; font-size:20px; cursor:pointer; }
#chat-messages{ padding:10px; overflow:auto; flex:1; background:#f8fafc; }
#chat-form{ display:flex; gap:8px; padding:10px; border-top:1px solid #e5e7eb; }
#chat-input{ flex:1; padding:10px; border:1px solid #cbd5e1; border-radius:8px; }
#chat-form button{ background:#00c4ff; color:#fff; border:0; border-radius:8px; padding:0 14px; cursor:pointer; }

/* Bubbles */
.zn-msg{ margin:8px 0; display:flex; }
.zn-me{ justify-content:flex-end; }
.zn-bubble{ max-width:78%; padding:8px 10px; border-radius:10px; white-space:pre-wrap; word-break:break-word; }
.zn-me .zn-bubble{ background:#00c4ff; color:#fff; }
.zn-bot .zn-bubble{ background:#e9ecef; color:#333; }

/* Overlay không chặn click khi ẩn */
#sidebar-overlay{ pointer-events:none; }
#sidebar-overlay.active{ pointer-events:auto; }
/* ==== Hàng nút danh mục (desktop) ==== */
.button-wrapper{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
  gap:14px;
  margin:12px auto 6px;
  max-width: 1100px; /* tùy thích */
}

/* Nút vẫn giữ bg như bạn, nhưng để inline-flex để không làm block xếp cột */
.category-btn{
  display:inline-flex;              /* <— đổi từ display:flex thành inline-flex */
  align-items:center;
  justify-content:center;
  /* các thông số sẵn có của bạn giữ nguyên:
     width: 180px; height: 90px; background-image: url('../images/button-bg.png'); ... */
}

/* Dropdown chỉ hiện trên mobile, còn hàng nút ẩn đi */
.category-select-wrapper{ display:none; }
@media (max-width: 768px){
  .button-wrapper{ display:none; }
  .category-select-wrapper{ display:block; text-align:center; margin:8px auto; }
}
/* ===== Header layout fixed ===== */
.site-header { background:#333; color:#fff; position:sticky; top:0; z-index:9999; }
.site-header .header-wrap{
  max-width:1200px; margin:0 auto; padding:10px 16px;
  display:flex; align-items:center; gap:16px;
}
.brand img{ height:28px; display:block; }

/* Search */
.search-bar{ flex:1; display:flex; align-items:center; gap:8px; min-width:240px; }
.search-bar input{
  flex:1; min-width:0;
  height:38px; padding:0 12px; border-radius:8px;
  border:1px solid #444; background:#222; color:#fff;
}
.search-btn{
  width:40px; height:38px; border-radius:8px; border:0; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  background:#00c4ff; color:#fff; font-size:18px;
}

/* Menu phải */
.header-right{ display:flex; align-items:center; gap:14px; margin-left:auto; }
.header-right a{ color:#fff; text-decoration:none; display:inline-flex; align-items:center; gap:6px; }

/* Contact button */
.btn-contact{
  background:#00c4ff; color:#fff; border:0; height:38px; padding:0 14px;
  border-radius:8px; cursor:pointer; font-weight:600;
}

/* Language dropdown */
.language-selector{ position:relative; }
#language-btn{
  background:#333; color:#fff; border:1px solid #444; border-radius:8px;
  height:38px; display:inline-flex; align-items:center; gap:8px; padding:0 10px;
}
#language-btn img{ width:18px; height:auto; }
.language-menu{
  display:none; position:absolute; right:0; top:calc(100% + 8px);
  background:#333; border-radius:8px; box-shadow:0 8px 20px rgba(0,0,0,.25);
  overflow:hidden; min-width:160px; z-index:10000;
}
.language-menu a{
  display:flex; align-items:center; gap:8px; color:#fff; padding:10px 12px; text-decoration:none;
}
.language-menu a:hover{ background:#444; }

/* Ghi đè rule cũ gây lệch (nếu còn tồn tại) */
.header-content{ justify-content:space-between !important; }
#search-btn{ position:static !important; right:auto !important; }

/* Mobile */
@media (max-width: 768px){
  .site-header .header-wrap{ flex-wrap:wrap; gap:10px; }
  .brand{ order:1; }
  .header-right{ order:2; width:auto; gap:10px; }
  .search-bar{ order:3; width:100%; }
  .btn-contact{ height:36px; }
}
/* === Mobile: ẩn thanh tìm kiếm & toàn bộ nút danh mục vì đã có trong menu 3 vạch === */
@media (max-width: 768px){
  /* Ẩn ô tìm kiếm ở header */
  .search-bar{ 
    display: none !important; 
  }

  /* Ẩn khu vực nút danh mục (hàng nút + dropdown) */
  .buttons,
  .button-wrapper,
  .category-select-wrapper{
    display: none !important;
  }

  /* Duy trì layout gọn cho phần bên phải header */
  .header-right{ gap:10px; width:auto; }
}
/* === Mobile: ẩn Forum, Quà tặng, Ngôn ngữ, Search; chỉ giữ lại nút All === */
@media (max-width: 768px){
  /* Ẩn các link ở đầu trang vì đã có trong menu 3 gạch */
  .header-right a[href*="/forum"],
  .header-right a[href*="/gift"],
  .language-selector{
    display: none !important;
  }

  /* Ẩn thanh tìm kiếm ở header (đã có trong sidebar) */
  .search-bar{
    display: none !important;
  }

  /* Hiển thị khu nút danh mục nhưng chỉ giữ lại nút đầu tiên (All) */
  .buttons{
    display: block !important;
    margin-top: 10px;
  }
  .button-wrapper{
    display: flex !important;
    justify-content: center;
    gap: 10px;
  }
  /* Ẩn toàn bộ… */
  .button-wrapper .category-btn{
    display: none !important;
  }
  /* …chỉ hiện nút đầu tiên (thường là All) */
  .button-wrapper .category-btn:first-child{
    display: inline-flex !important;
  }
  /* Nếu bạn có gắn class riêng cho All, mở thêm rule này (không bắt buộc): */
  .button-wrapper .category-btn.category-btn--all{
    display: inline-flex !important;
  }

  /* Ẩn dropdown danh mục trên mobile */
  .category-select-wrapper{
    display: none !important;
  }
}
/* === MOBILE TWEAKS: dùng dropdown thay cho nút, ẩn Contact === */
@media (max-width: 768px){
  /* Ẩn các mục đã có trong menu 3 gạch */
  .search-bar,
  .header-right a[href*="/forum"],
  .header-right a[href*="/gift"],
  .language-selector,
  #contact-btn,
  .btn-contact{
    display: none !important;
  }

  /* Ẩn hàng nút category; chỉ dùng dropdown */
  .button-wrapper{
    display: none !important;
  }

  /* Hiện dropdown chọn danh mục */
  .category-select-wrapper{
    display: block !important;
    text-align: center;
    margin: 10px auto 0;
  }
  #category-select{
    width: min(340px, 92vw);
    height: 40px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #111827;
    font-size: 14px;
    outline: none;
    appearance: none;               /* gọn hơn trên iOS */
    -webkit-appearance: none;
  }
}

/* === DESKTOP: giữ nguyên — dropdown ẩn, nút hiện ngang === */
@media (min-width: 769px){
  .category-select-wrapper{ display: none !important; }
  .button-wrapper{ display: flex !important; }
}
/* ===== MOBILE CLEANUP – chỉ giữ dropdown danh mục, ẩn logo + header items ===== */
@media (max-width: 768px){
  /* Ẩn logo ở header (thẻ <strong> chứa logo hiện tại) */
  header .header-content > strong{ display:none !important; }

  /* Ẩn ô tìm kiếm ở header + toàn bộ cụm phải (Forum, Gift, Language, Contact) */
  .search-bar,
  .header-right,
  #contact-btn{ display:none !important; }

  /* Ẩn hàng nút danh mục kiểu hình nền */
  .button-wrapper{ display:none !important; }

  /* Chỉ hiển thị dropdown danh mục */
  .category-select-wrapper{ display:block !important; text-align:center; margin:10px auto 0; }
  .category-select-wrapper select{
    width:92%; max-width:420px; height:44px;
    border-radius:10px; border:1px solid #444;
    background:#111; color:#fff; padding:0 12px; outline:none;
  }
}

/* ===== Sửa cỡ cờ trong menu 3 gạch ===== */
.mobile-language-selector a{
  display:flex; align-items:center; gap:8px; padding:6px 8px;
}
.mobile-language-selector a img{
  width:22px; height:auto; border-radius:2px; /* không phóng to */
}

/* (Giữ nguyên hiển thị nút danh mục theo hàng trên desktop) */
@media (min-width: 769px){
  .button-wrapper{ display:flex !important; }
  .category-select-wrapper{ display:none !important; }
}
/* --- Clamp 3 dòng cho mô tả và 2 dòng cho tiêu đề --- */
.game-title{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  text-overflow:ellipsis;
  min-height:calc(1.3em * 2); /* giữ chiều cao cố định */
}

.game-desc,
.game-description{
  line-height:1.4;
  display:-webkit-box;
  -webkit-line-clamp:3;        /* <-- 3 dòng */
  -webkit-box-orient:vertical;
  overflow:hidden;
  text-overflow:ellipsis;
  min-height:calc(1.4em * 3);  /* đảm bảo mọi card cao như nhau */
  margin:8px 0;
}

/* Đảm bảo nút luôn dính đáy card */
.game{
  display:flex;
  flex-direction:column;
}
.button-group{
  margin-top:auto;             /* đẩy nút xuống đáy */
  display:flex;
  gap:10px;
}
