/* ===== Wireframe trắng đen — mobile-first ===== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --black: #000;
  --white: #fff;
  --gray: #ccc;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--white);
  color: var(--black);
  line-height: 1.5;
  /* căn giữa nội dung, giới hạn bề ngang để dễ đọc trên máy lớn */
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 18px 48px;
  min-height: 100vh;
}

a {
  color: var(--black);
  text-decoration: none;
}

/* ===== Thanh điều hướng trên cùng (link quay lại) ===== */
.topbar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  font-size: 16px;
}

.topbar a {
  border-bottom: 1px solid var(--black);
  padding-bottom: 2px;
}

/* ===== Trang Home ===== */
.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  gap: 36px;
}

/* Logo nhỏ căn giữa */
.logo {
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--black);
  border-radius: 50%;
  overflow: hidden;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Chữ "LOGO" dự phòng khi chưa có file ảnh */
.logo .logo-fallback {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 2px;
}

/* Nhóm 4 nút lớn */
.menu {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}

.menu .btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 22px 16px;
  border: 2px solid var(--black);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.5px;
  background: var(--white);
}

.menu .btn:active {
  background: var(--black);
  color: var(--white);
}

/* ===== Tiêu đề trang ===== */
.page-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 24px;
}

/* ===== Bảng giá: các thẻ xếp dọc ===== */
.cards {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.card {
  border: 2px solid var(--black);
}

/* Vùng hình nền màu xám (placeholder) */
.card-image {
  height: 150px;
  background: var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 13px;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--black);
}

.card-body {
  padding: 18px 16px;
}

.card-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.card-price {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
}

.card-price small {
  font-size: 14px;
  font-weight: 400;
}

.card .more {
  display: inline-block;
  padding: 12px 22px;
  border: 2px solid var(--black);
  font-size: 15px;
  font-weight: 600;
  background: var(--white);
}

.card .more:active {
  background: var(--black);
  color: var(--white);
}

/* ===== Trang trống (placeholder) ===== */
.placeholder-note {
  margin-top: 8px;
  color: #666;
  font-size: 16px;
}

/* ===== Trang List game ===== */
body.list-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 0;
}

/* Header + thanh bộ lọc: cố định trên cùng, không cuộn theo trang */
.list-header,
.filter-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  background: var(--white);
  z-index: 10;
}

.list-header {
  top: 0;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-bottom: 2px solid var(--black);
}

.filter-bar {
  top: 56px; /* nằm ngay dưới header */
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-bottom: 2px solid var(--black);
}

/* Nút icon (Home) */
.icon-btn {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border: 2px solid var(--black);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  color: var(--black);
}

.icon-btn:active {
  background: var(--black);
  color: var(--white);
}

.icon-btn svg {
  width: 22px;
  height: 22px;
}

/* Thanh tìm kiếm (dummy) */
.search-box {
  flex: 1;
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 2px solid var(--black);
  background: var(--white);
  color: var(--black);
  font: inherit;
  cursor: pointer;
}

.search-box svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.search-placeholder {
  color: #aaa; /* chữ "Tìm kiếm" màu xám nhạt */
  font-size: 15px;
}

/* Nút Bộ lọc */
.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: 2px solid var(--black);
  background: var(--white);
  color: var(--black);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.filter-btn:active {
  background: var(--black);
  color: var(--white);
}

.filter-btn svg {
  width: 18px;
  height: 18px;
}

/* Lưới game: 3 cột mỗi hàng */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 12px;
  padding-top: 118px; /* chừa chỗ cho header (56) + bộ lọc (50) cố định */
}

.game-item {
  display: flex;
  flex-direction: column;
}

/* Hình game (placeholder màu xám) */
.game-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--gray);
  border: 2px solid var(--black);
}

/* Tên game: tối đa 2 hàng, cắt đuôi bằng dấu ba chấm nếu quá dài */
.game-name {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  /* chừa sẵn chiều cao 2 hàng để các thẻ thẳng hàng nhau */
  min-height: calc(12px * 1.3 * 2);
}
