/* public/css/home.css — trang chủ (banner, thao tác nhanh, Game Hot, thanh điều hướng dưới). */
.home-v2 {
  --h-blue: #2f7cf6;
  --h-green: #22b45a;
  --h-purple: #8a4df0;
  --h-orange: #ff8a1f;
}

/* ---- Đầu trang ---- */
.home-v2 .home-header {
  gap: 8px;
  padding: 8px 16px;
}
.ltk-logo {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
}
.ltk-logo .crown {
  width: 34px;
  height: 22px;
  margin-bottom: 4px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25));
}
.ltk-text {
  font-size: 30px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.5px;
  line-height: 1;
  background: linear-gradient(180deg, #ffe680 0%, #ffb400 55%, #e07800 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 1px #9a4c00;
  filter: drop-shadow(0 2px 0 rgba(120, 50, 0, 0.35));
}
.home-v2 .user-menu {
  gap: 8px;
}
.home-v2 .user-menu > .btn,
.home-v2 .user-menu > button:not(.theme-switch) {
  border-radius: 999px;
  padding: 7px 16px;
  font-weight: 600;
}
.home-v2 .user-menu > a.btn:not(.reg-btn)::before {
  content: '';
  width: 16px;
  height: 16px;
  margin-right: 6px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4.2'/%3E%3Cpath d='M3.5 21c.6-4.4 4-7 8.5-7s7.9 2.6 8.5 7z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4.2'/%3E%3Cpath d='M3.5 21c.6-4.4 4-7 8.5-7s7.9 2.6 8.5 7z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.home-v2 .user-menu > .reg-btn {
  background: var(--h-blue);
  border-color: var(--h-blue);
  color: #fff;
}

/* Công tắc sáng / tối */
.theme-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 64px;
  height: 32px;
  padding: 0 !important;
  border-radius: 999px;
  border: 1px solid var(--border, #d6dbe4);
  background: var(--card-2);
  font-size: 15px;
  overflow: hidden;
}
.theme-switch span {
  position: relative;
  z-index: 1;
  flex: 1;
  text-align: center;
  line-height: 30px;
  transition: color 0.2s;
}
.theme-switch::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 29px;
  height: 26px;
  border-radius: 999px;
  background: #ffc53d;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s, background 0.2s;
}
.theme-switch .ts-sun {
  color: #8a4b00;
}
.theme-switch .ts-moon {
  color: var(--muted);
}
.theme-switch.dark::before {
  transform: translateX(31px);
  background: #3b4a78;
}
.theme-switch.dark .ts-sun {
  color: var(--muted);
}
.theme-switch.dark .ts-moon {
  color: #ffe08a;
}

/* ---- Khung nội dung ---- */
.home2 {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 16px 24px;
}
.home2 > .card,
.home2 > .grid-2 {
  margin-top: 18px;
}

/* ---- Banner ---- */
.hero2 {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  min-height: 170px;
  aspect-ratio: 8 / 3;
  max-height: 300px;
  display: flex;
  align-items: center;
  box-shadow: 0 6px 18px rgba(106, 61, 240, 0.3);
}
.hero2-deco {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero2-text {
  position: relative;
  padding: 0 5%;
  max-width: 56%;
  text-align: center;
}
/* Baloo 2: chữ tròn vui nhộn, đủ dấu tiếng Việt; line-height + padding đủ cao để dấu (Ơ, Ù, Ạ, È) không bị cắt */
.hero2-l1,
.hero2-l2 {
  font-family: 'Baloo 2', var(--font);
  font-weight: 800;
  line-height: 1.3;
  padding: 0.08em 0.12em 0;
  letter-spacing: 0.5px;
  color: #fff;
  text-shadow: 0 3px 0 #4b1fb0, 0 0 3px #4b1fb0, 0 5px 10px rgba(0, 0, 0, 0.3);
}
.hero2-l1 {
  transform: rotate(-2deg);
}
.hero2-l2 {
  text-shadow: none;
  transform: rotate(-3deg);
  filter: drop-shadow(0 3px 0 #4b1fb0) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
  animation: hero2-bounce 2.4s ease-in-out infinite;
}
@keyframes hero2-bounce {
  0%,
  100% {
    transform: rotate(-3deg) translateY(0);
  }
  50% {
    transform: rotate(-3deg) translateY(-4px) scale(1.03);
  }
}
@media (prefers-reduced-motion: reduce) {
  .hero2-l2 {
    animation: none;
  }
}
.hero2-l1 {
  font-size: clamp(20px, 5.4vw, 44px);
}
.hero2-l2 {
  font-size: clamp(30px, 8.6vw, 52px);
  background: linear-gradient(180deg, #fff7c2 0%, #ffd23f 55%, #ff9d00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero2-ribbon {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 14px;
  border-radius: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, #6a3df0, #e2459c);
  border: 2px solid #ffe14d;
  color: #fff;
  font-weight: 800;
  font-size: clamp(10px, 2.6vw, 16px);
  letter-spacing: 0.3px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* ---- Thao tác nhanh ---- */
.quick4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 6px;
}
.q-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 4px 10px;
  border-radius: 14px;
  border: 1px solid var(--border, #e3e7ee);
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(20, 30, 60, 0.06);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s;
}
/* Mỗi nút một màu pastel theo màu icon, viền dưới đậm kiểu nút game */
.q-item:has(.q-ic.blue) {
  --q: #2f7cf6;
  --q-bg: #eaf2ff;
}
.q-item:has(.q-ic.teal) {
  --q: #1f9bb5;
  --q-bg: #e3f8fb;
}
.q-item:has(.q-ic.green) {
  --q: #1fa25a;
  --q-bg: #e6f8ee;
}
.q-item:has(.q-ic.purple) {
  --q: #7b4dff;
  --q-bg: #f1ebff;
}
.q-item:has(.q-ic.orange) {
  --q: #f08a1c;
  --q-bg: #fff2e2;
}
.q-item[class] {
  background: linear-gradient(180deg, var(--card) 35%, var(--q-bg, var(--card)));
  border-color: color-mix(in srgb, var(--q, #e3e7ee) 30%, transparent);
  border-bottom: 3px solid color-mix(in srgb, var(--q, #e3e7ee) 55%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .q-item[class] {
    background: linear-gradient(180deg, var(--card) 35%, color-mix(in srgb, var(--q, #888) 18%, var(--card)));
  }
}
:root[data-theme='dark'] .q-item[class] {
  background: linear-gradient(180deg, var(--card) 35%, color-mix(in srgb, var(--q, #888) 18%, var(--card)));
}
.q-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px color-mix(in srgb, var(--q, #141e3c) 25%, transparent);
}
.q-item:hover .q-ic {
  transform: rotate(-8deg) scale(1.08);
}
.q-item:active {
  transform: translateY(1px) scale(0.97);
}
.q-ic {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12), inset 0 2px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.q-ic svg {
  width: 26px;
  height: 26px;
}
.q-ic.blue {
  background: linear-gradient(160deg, #57a0ff, var(--h-blue));
}
.q-ic.green {
  background: linear-gradient(160deg, #4cd37e, var(--h-green));
}
.q-ic.purple {
  background: linear-gradient(160deg, #ad7bff, var(--h-purple));
}
.q-ic.orange {
  background: linear-gradient(160deg, #ffad55, var(--h-orange));
}
.q-ic.teal {
  background: linear-gradient(160deg, #3fd0e0, #1f9bb5);
}

/* ---- Tìm phòng: bộ lọc + lưới thẻ phòng (điện thoại 2 cột, máy tính 3–4 cột) ---- */
#findModal .box {
  max-width: 960px;
  width: min(960px, calc(100vw - 32px));
  min-height: min(520px, 80dvh);
}
.find-filters {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 0 0 12px;
}
.find-filters > * {
  margin: 0;
  min-width: 0;
}
.find-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.room-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 0 0 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 2px 8px rgba(20, 30, 60, 0.08);
  overflow: hidden;
}
.rc-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 10px;
  background: linear-gradient(90deg, var(--tile, #2f7cf6), var(--tile-dark, #1d5fcc));
  color: #fff;
}
.rc-ic {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: 20px;
  line-height: 1;
}
.rc-ic svg {
  width: 100%;
  height: 100%;
}
.rc-game {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: 14px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.rc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 10px;
}
.rc-code {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1.5px;
  font-variant-numeric: tabular-nums;
}
.rc-status {
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
.rc-status.waiting {
  background: rgba(34, 180, 90, 0.15);
  color: #168543;
}
.rc-status.playing {
  background: rgba(255, 138, 31, 0.18);
  color: #c25700;
}
/* Chế độ tối: chữ trạng thái sáng hơn cho dễ đọc */
:root[data-theme='dark'] .rc-status.waiting {
  color: #6fe09a;
}
:root[data-theme='dark'] .rc-status.playing {
  color: #ffb066;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .rc-status.waiting {
    color: #6fe09a;
  }
  :root:not([data-theme='light']) .rc-status.playing {
    color: #ffb066;
  }
}
.rc-names {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 24px;
  padding: 0 10px;
}
.rc-chip {
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--card-2);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rc-chip.host {
  background: rgba(255, 197, 61, 0.25);
  font-weight: 600;
}
.rc-chip.more {
  color: var(--muted);
  font-weight: 700;
}
.rc-btn {
  margin: auto 10px 0;
  min-height: 40px;
  font-weight: 700;
}
.find-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 36px 12px;
  text-align: center;
}
.find-empty p {
  margin: 0;
}
.find-empty-ic {
  font-size: 44px;
}
.find-empty .btn,
.find-empty button {
  margin-top: 8px;
  min-width: 160px;
}
.find-login-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.find-code-btn {
  flex-shrink: 0;
  white-space: nowrap;
  font-weight: 700;
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 12px;
}
.find-pager {
  justify-content: center;
}
/* Popup tạo phòng: "Cho người khác tìm thấy phòng" */
.listed-row {
  margin: 4px 0 0;
  font-size: 14px;
  align-items: center;
}
#createModal .created #listedRow {
  display: none !important;
}
@media (max-width: 760px) {
  #findModal .box {
    width: auto;
  }
  .find-filters {
    grid-template-columns: 1fr 1fr;
  }
  .find-filters input {
    grid-column: 1 / -1;
  }
  .find-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .rc-code {
    font-size: 17px;
    letter-spacing: 1px;
  }
  .rc-game {
    font-size: 13px;
  }
  .rc-status {
    font-size: 12px;
    padding: 2px 7px;
  }
  .rc-chip {
    font-size: 12px;
  }
}

/* ---- Game Hot ---- */
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 10px;
  scroll-margin-top: 64px;
}
.sec-head h2 {
  margin: 0;
  font-size: 20px;
}
.see-all {
  color: var(--h-blue);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
}
.hot-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}
.hot-tile {
  grid-column: span 2;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  min-height: 0;
  min-width: 0;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--tile, #2f7cf6);
  color: #fff;
  text-align: center;
  box-shadow: 0 3px 8px rgba(20, 30, 60, 0.15);
  transition: transform 0.12s, box-shadow 0.12s;
}
.hot-tile.wide {
  grid-column: span 3;
}
/* Game có thêm "Chơi một mình" (vd Sudoku): nút nhỏ nằm đè góc trên ô → mọi ô trong hàng cao bằng nhau */
.hot-session { grid-column: span 2; min-width: 0; position: relative; display: flex; }
.hot-session.wide { grid-column: span 3; }
.hot-session .hot-tile { width: 100%; flex: 1; }
.home-session-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-height: 0;
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #1f2a44;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.home-session-link:hover { background: #fff; }
@media(min-width:761px), (max-width:600px) { .hot-session, .hot-session.wide { grid-column: span 1; } }
.hot-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(20, 30, 60, 0.22);
}
.hot-tile.active {
  border-color: #ffc53d;
  box-shadow: 0 0 0 2px #ffc53d, 0 6px 14px rgba(20, 30, 60, 0.22);
}
.hot-art {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.hot-tile.wide .hot-art {
  aspect-ratio: 16 / 7;
}
.hot-art svg {
  display: block;
  width: 100%;
  height: 100%;
}
/* Game chưa có hình vẽ riêng: biểu tượng lớn trong "huy hiệu" sáng + 2 vòng tròn trang trí trên nền màu của game */
.hot-art .art-icon {
  position: relative;
  display: grid;
  place-items: center;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.38), transparent 58%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.18), rgba(0, 0, 0, 0.12));
}
.hot-art .art-emoji {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(58px, 46%, 92px);
  aspect-ratio: 1;
  border-radius: 28%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22), inset 0 -3px 0 rgba(0, 0, 0, 0.08);
  font-size: clamp(32px, 26cqw, 52px);
  line-height: 1;
  color: var(--tile-dark, #1f2a44); /* biểu tượng dạng ký tự (vd ▦ Sudoku) có màu của game, không trắng trên nền trắng */
  font-weight: 700;
  transform: rotate(-4deg);
  transition: transform 0.15s;
}
.hot-tile:hover .art-emoji {
  transform: rotate(0) scale(1.06);
}
.hot-art .art-ring {
  position: absolute;
  border-radius: 50%;
  border: 10px solid rgba(255, 255, 255, 0.12);
}
.hot-art .art-ring.r1 {
  width: 70%;
  aspect-ratio: 1;
  left: -22%;
  top: -30%;
}
.hot-art .art-ring.r2 {
  width: 55%;
  aspect-ratio: 1;
  right: -16%;
  bottom: -34%;
  border-width: 14px;
}
.hot-art {
  container-type: inline-size;
}
.hot-art .check {
  position: absolute;
  top: 6px;
  right: 6px;
  display: none;
  width: 22px;
  height: 22px;
  line-height: 22px;
  border-radius: 50%;
  background: #ffc53d;
  color: #5a3500;
  font-weight: 800;
  font-size: 13px;
}
.hot-tile.active .check {
  display: block;
}
.hot-name {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px 9px;
  font-weight: 800;
  font-size: 16px;
  line-height: 1.2;
  background: var(--tile-dark, rgba(0, 0, 0, 0.25));
  overflow-wrap: anywhere;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.hot-tile.soon .hot-art {
  filter: saturate(0.9);
}
.soon-badge {
  position: absolute;
  left: 50%;
  bottom: 8px;
  transform: translateX(-50%);
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.c-blue {
  --tile: #2f7cf6;
  --tile-dark: #1d5fcc;
}
.c-gold {
  --tile: #e0a21a;
  --tile-dark: #b97f05;
}
.c-red {
  --tile: #e0403a;
  --tile-dark: #b52520;
}
.c-green {
  --tile: #22a95a;
  --tile-dark: #168543;
}
.c-teal {
  --tile: #1f9bb5;
  --tile-dark: #137a90;
}
.c-pink {
  --tile: #d0457e;
  --tile-dark: #a72d60;
}
.c-purple {
  --tile: #8a4df0;
  --tile-dark: #6a30cf;
}
.c-orange {
  --tile: #ff8a1f;
  --tile-dark: #e06a00;
}
.c-brown {
  --tile: #b8642a;
  --tile-dark: #8c4517;
}
.c-emerald {
  --tile: #0f9d7a;
  --tile-dark: #0a7058;
}
.c-night {
  --tile: #3b3f8f;
  --tile-dark: #262a66;
}

/* ---- Popup tạo phòng, bảng xếp hạng ---- */
body.modal-open {
  overflow: hidden;
}
.modal.sheet .box {
  max-width: 640px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  margin: 0;
  padding: 20px 22px;
  animation: create-pop 0.16s ease-out;
}
@keyframes create-pop {
  from {
    transform: translateY(12px) scale(0.98);
    opacity: 0;
  }
}
.modal.sheet .create-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.modal.sheet .create-head > div {
  flex: 1;
  min-width: 0;
}
.modal.sheet .create-head p {
  margin: 0 0 12px;
}
#rankModal .box {
  max-width: 520px;
  min-height: min(480px, 70dvh);
}
/* ---- Luật chơi (popup) ---- */
#guideModal .box {
  max-width: 720px;
  display: flex;
  flex-direction: column;
}
.guide-body {
  min-height: 0;
}
.guide-head h3 {
  margin: 4px 0 4px;
  font-size: 18px;
}
.guide-head p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.5;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.guide-card {
  background: var(--card-2);
  border-radius: 12px;
  padding: 10px 14px 12px;
}
.guide-card h4 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--accent);
}
.guide-card ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.5;
}
.guide-card li + li {
  margin-top: 3px;
}
.guide-foot {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}
.guide-foot p {
  flex: 1;
  margin: 0;
}
.guide-foot button {
  flex: none;
  min-height: 42px;
}
@media (max-width: 640px) {
  .guide-grid {
    grid-template-columns: 1fr;
  }
  .guide-foot {
    flex-direction: column;
    align-items: stretch;
  }
}
#rankModal .leaderboard {
  margin: 0;
}
.create-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
}
.create-games {
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 0 14px;
  padding-bottom: 2px;
}
.create-games::-webkit-scrollbar {
  display: none;
}
.create-games {
  gap: 8px;
  border-bottom: 0;
  padding: 4px 2px 6px;
}
/* Chỉ icon game: ô bo tròn, game đang chọn có viền + nổi lên */
.create-games button {
  flex-shrink: 0;
  width: 54px;
  height: 54px;
  min-height: 0;
  padding: 3px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: transparent;
  transition: transform 0.12s, border-color 0.12s, opacity 0.12s;
  opacity: 0.72;
}
.create-games button .ic {
  display: block;
  width: 100%;
  height: 100%;
  font-size: 30px;
  line-height: 44px;
  text-align: center;
}
.create-games button .ic svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18));
}
.create-games button:hover {
  opacity: 1;
}
.create-games button.active {
  opacity: 1;
  border-color: var(--accent);
  transform: translateY(-1px) scale(1.04);
  background: var(--accent-soft);
}
#createModal .create-foot .msg-error:empty {
  display: none;
}
/* Đã tạo phòng: chỉ còn mã mời + nút vào phòng */
#createModal .created #createGames,
#createModal .created #loginNeeded,
#createModal .created #optionsForm,
#createModal .created .create-foot {
  display: none !important;
}
#createModal .created .invite {
  margin-top: 4px;
}
#createModal .create-foot {
  position: sticky;
  bottom: -20px;
  margin: 8px -22px -20px;
  padding: 14px 22px 16px;
  background: var(--card);
  gap: 10px;
  z-index: 1;
}
/* Máy tính: popup rộng hơn, nút phụ co giãn đều, nút chính nổi bật bên phải */
@media (min-width: 761px) {
  #createModal .box {
    max-width: 780px;
    padding: 22px 26px;
  }
  #createModal .create-foot {
    margin: 8px -26px -22px;
    padding: 14px 26px 18px;
    bottom: -22px;
  }
  #createModal .create-foot .big-btn {
    min-width: 0;
    flex: 0 1 190px;
    font-size: 15px;
  }
  #createModal .create-foot #createBtn,
  #createModal .create-foot #lobbyBtn {
    flex: 0 1 220px;
  }
  #createModal .create-foot .hidden {
    display: none;
  }
}

/* ---- Hộp nhập mã ---- */
#joinModal .box {
  width: min(360px, calc(100vw - 32px));
}
#joinModal .code-input {
  width: 100%;
  font-size: 22px;
  letter-spacing: 4px;
  text-align: center;
  text-transform: uppercase;
}

/* ---- Màn hình rộng: banner trải hết khung, 4 game / hàng ---- */
@media (min-width: 761px) {
  .hero2 {
    aspect-ratio: auto;
    height: 280px;
  }
  .hero2-l1 {
    white-space: nowrap;
  }
  .hot-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }
  .hot-tile,
  .hot-tile.wide {
    grid-column: span 1;
  }
  .hot-tile.wide .hot-art {
    aspect-ratio: 16 / 10;
  }
}

/* ---- Thanh điều hướng dưới (chỉ điện thoại) ---- */
.bottom-nav {
  display: none;
}
@media (max-width: 760px) {
  .home-v2 .home-header {
    padding: 6px 12px;
  }
  .ltk-text {
    font-size: 26px;
  }
  .home-v2 .user-menu {
    gap: 6px;
  }
  .home-v2 .user-menu > .btn,
  .home-v2 .user-menu > button:not(.theme-switch) {
    padding: 6px 11px;
    font-size: 13px;
    min-height: 34px;
  }
  .home-v2 .user-menu .reg-btn {
    display: inline-flex;
  }
  .theme-switch {
    width: 56px;
    height: 30px;
    min-width: 0 !important;
    min-height: 0 !important;
  }
  .theme-switch::before {
    width: 25px;
    height: 24px;
  }
  .theme-switch.dark::before {
    transform: translateX(27px);
  }
  .theme-switch span {
    line-height: 28px;
  }
  .home2 {
    padding: 10px 12px 20px;
  }
  /* Điện thoại: popup trượt lên từ dưới */
  .modal.sheet {
    align-items: flex-end;
    padding: 0;
    z-index: 70;
  }
  .modal.sheet .box,
  #rankModal .box {
    max-width: none;
    max-height: 92dvh;
    border-radius: 18px 18px 0 0;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    animation-name: create-sheet;
  }
  #createModal .create-foot {
    bottom: calc(-16px - env(safe-area-inset-bottom));
    margin: 8px -16px calc(-16px - env(safe-area-inset-bottom));
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  }
  @keyframes create-sheet {
    from {
      transform: translateY(40px);
      opacity: 0.4;
    }
  }
  .hero2 {
    border-radius: 14px;
    aspect-ratio: 16 / 8;
  }
  .hero2-text {
    max-width: 58%;
    padding: 0 3%;
  }
  .quick4 {
    gap: 8px;
  }
  .q-item {
    font-size: 13px;
    padding: 10px 2px 8px;
  }
  .q-ic {
    width: 42px;
    height: 42px;
  }
  .hot-grid {
    gap: 8px;
  }
  .hot-name {
    font-size: 14px;
  }
  .home-v2 .site-footer {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }
  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    background: var(--card);
    border-top: 1px solid var(--border, #e3e7ee);
    box-shadow: 0 -2px 10px rgba(20, 30, 60, 0.08);
  }
  .bottom-nav a,
  .bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 4px 0;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    min-height: 0;
  }
  .bottom-nav svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
  }
  .bottom-nav .active {
    color: var(--h-blue);
  }
}
@media (max-width: 380px) {
  .ltk-logo .crown {
    width: 28px;
  }
  .ltk-text {
    font-size: 22px;
  }
  .home-v2 .user-menu > .btn,
  .home-v2 .user-menu > button:not(.theme-switch) {
    padding: 6px 9px;
    font-size: 13px;
  }
  .home-v2 .user-menu > a.btn:not(.reg-btn)::before {
    display: none;
  }
  .home-v2 .user-menu .reg-btn {
    display: none;
  }
  .hot-name {
    font-size: 12.5px;
  }
  .q-item {
    font-size: 12px;
  }
  .bottom-nav a,
  .bottom-nav button {
    font-size: 10px;
    white-space: nowrap;
  }
}
