:root {
  /* Màu thương hiệu */
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-tint: #DBEAFE;
  --primary-soft: #EFF6FF;

  /* Nền & chữ */
  --bg: #F7F8FC;
  --backdrop: #EDEFF7;
  --surface: #FFFFFF;
  --text: #14162B;
  --text-muted: #767A93;
  --border: #ECEEF5;

  /* Trạng thái */
  --success: #16A34A;
  --success-bg: #DCFCE7;
  --success-fg: #14532D;
  --danger: #EF4444;
  --danger-bg: #FEE2E2;
  --danger-fg: #991B1B;
  --warning-bg: #FEF3C7;
  --warning-fg: #92400E;
  --info-bg: #DBEAFE;
  --info-fg: #1E40AF;
  --star: #FFB800;

  /* Bo góc */
  --radius-card: 20px;
  --radius-btn: 12px;
  --radius-input: 12px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  /* Kích thước */
  --btn-h: 48px;
  --input-h: 48px;
  --header-h: 56px;
  --nav-h: 68px;
  --app-max: 400px;
  --gutter: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Đổ bóng — nhẹ, không tạo cảm giác nặng */
  --shadow-card: 0 2px 12px rgba(20, 22, 43, 0.05);
  --shadow-raised: 0 6px 24px rgba(20, 22, 43, 0.08);
  --shadow-primary: 0 6px 18px rgba(37, 99, 235, 0.32);

  /* Chuyển động */
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 0.15s;
  --t-base: 0.25s;

  --font: 'Be Vietnam Pro', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

/* ---------- 02. Reset & base ---------- */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--backdrop);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.5;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

a { color: inherit; }

/* Icon Lucide — dựng từ app.js qua thuộc tính data-lucide */
.lucide {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  flex-shrink: 0;
}

/* Chặn nhảy layout trước khi Lucide thay thẻ giữ chỗ bằng <svg> */
[data-lucide] {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ---------- 03. Khung app ---------- */

.app-shell {
  width: 100%;
  max-width: var(--app-max);
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Viền mềm hai bên chỉ xuất hiện khi màn hình rộng hơn khung app,
   để trên điện thoại không tốn thêm lớp vẽ nào. */
@media (min-width: 420px) {
  .app-shell { box-shadow: 0 0 60px rgba(20, 22, 43, 0.1); }
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-h);
  background: #DC2626;
  padding: 8px var(--gutter);
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.app-header__back {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-btn);
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  cursor: pointer;
  font-family: var(--font);
  text-decoration: none;
  transition: transform var(--t-fast) var(--ease-out), background var(--t-fast);
}

.app-header__back:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.3);
}

.app-header__title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand {
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.search-bar {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-pill);
  padding: 9px 14px;
}

.search-bar .lucide { color: #fff; width: 18px; height: 18px; }

.search-bar input {
  border: none;
  background: transparent;
  outline: none;
  width: 100%;
  font-family: var(--font);
  font-size: 0.875rem;
  color: #fff;
}

.search-bar input::placeholder { color: rgba(255, 255, 255, 0.75); }

.app-main {
  flex: 1;
  padding: var(--gutter) var(--gutter) calc(var(--nav-h) + var(--safe-bottom) + var(--gutter));
  animation: fadeUp 0.35s var(--ease-out);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.94); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- 04. Bottom navigation ---------- */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-max);
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  justify-content: space-around;
  z-index: 100;
  box-shadow: 0 -4px 24px rgba(20, 22, 43, 0.06);
}

.nav-item {
  flex: 1;
  height: var(--nav-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 500;
  transition: color var(--t-base);
}

.nav-item .lucide { width: 22px; height: 22px; }

.nav-item.active { color: var(--primary); font-weight: 600; }

.nav-fab {
  position: relative;
  top: -20px;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-primary);
  border: 4px solid var(--surface);
  text-decoration: none;
  transition: transform var(--t-base) var(--ease-spring);
}

.nav-fab:active { transform: scale(0.92); }
.nav-fab .lucide { width: 24px; height: 24px; }

/* Ảnh thay cho icon — object-fit:cover để ảnh không méo dù không vuông,
   bo tròn theo đúng khung nút. */
.nav-fab img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* ---------- 05. Button ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: var(--btn-h);
  padding: 0 20px;
  border: none;
  border-radius: var(--radius-btn);
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast),
              background var(--t-base);
}

.btn:active { transform: scale(0.97); }
.btn .lucide { width: 18px; height: 18px; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-outline {
  background: var(--surface);
  color: var(--primary);
  box-shadow: inset 0 0 0 1.5px var(--primary);
}

.btn-outline:hover { background: var(--primary-soft); }

.btn-ghost {
  background: var(--primary-soft);
  color: var(--primary);
}

.btn-danger { background: var(--danger); color: #fff; }

.btn-sm {
  width: auto;
  min-height: 36px;
  padding: 0 14px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* Nút gói gọn theo nội dung, dùng cho hành động đơn lẻ giữa trang.
   display:flex (không phải inline-flex) để .mx-auto căn giữa được. */
.btn-auto {
  display: flex;
  width: fit-content;
  min-width: 200px;
  max-width: 100%;
}

/* ---------- 06. Form ---------- */

.form-group { margin-bottom: 16px; }
.form-group:last-of-type { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.form-control {
  width: 100%;
  min-height: var(--input-h);
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-input);
  font-family: var(--font);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--surface);
  outline: none;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}

.form-control::placeholder { color: var(--text-muted); }

/* Focus rõ ràng: đổi viền + vòng sáng, đủ tương phản cho cả bàn phím */
.form-control:focus,
.form-control:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 77, 122, 0.18);
}

textarea.form-control { min-height: 96px; resize: vertical; }

select.form-control {
  appearance: none;
  -webkit-appearance: none;
  /* Mũi tên vẽ bằng gradient để không cần thêm file ảnh */
  background-image:
    linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: right 20px center, right 15px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 40px;
}

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}

.form-check input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
  cursor: pointer;
}

/* Ô nhập mã mời: hiển thị chữ hoa cho khớp mã được cấp */
.input-upper { text-transform: uppercase; }

/* ---------- 07. Card & list ---------- */
/* ========== CARD + MENU + TABLE - DARK ========== */
.card {
  background: #1a1a1a !important;
  border-radius: var(--radius-card);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid #2c2c2c;
  color: #e0e0e0;
}

.card:last-child {
  margin-bottom: 0;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: #ffffff !important;
}

.card-text {
  font-size: 0.9rem;
  color: #aaaaaa !important;
  line-height: 1.6;
}

.withdraw-bank {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #333;
  border-radius: var(--radius-sm);
  background: #111;
}

.withdraw-bank__row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 6px 0;
  font-size: 0.85rem;
}

.withdraw-bank__row span { color: #aaa; }

.withdraw-bank__row strong {
  max-width: 65%;
  color: #fff;
  overflow-wrap: anywhere;
  text-align: right;
}

.withdraw-note {
  margin-top: 12px;
  padding: 12px 14px 12px 32px;
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--info-bg);
  color: var(--info-fg);
  font-size: 0.8rem;
  line-height: 1.6;
}

/* Alias giữ cho các trang chưa refactor; sẽ gỡ ở bước dọn dẹp */
.info-card {
  background: #1a1a1a !important;
  border-radius: var(--radius-card);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  padding: 20px;
  margin-bottom: 16px;
  border: 1px solid #2c2c2c;
  color: #e0e0e0;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed #333;
}

.info-row:first-child {
  padding-top: 0;
}

.info-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-row .label {
  font-size: 0.8rem;
  color: #999 !important;
  flex-shrink: 0;
}

.info-row .value {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
  color: #e8e8e8 !important;
}

/* ===== MENU LIST ===== */
.menu-list {
  background: #1a1a1a !important;
  border-radius: var(--radius-card);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  border: 1px solid #2c2c2c;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-bottom: 1px solid #2a2a2a;
  background: #1e1e1e !important;
  color: #e8e8e8 !important;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
}

.menu-item:last-child {
  border-bottom: none;
}

.menu-item:active,
.menu-item:hover {
  background: #2a2a2a !important;
}

.menu-item__icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-btn);
  background: rgba(144, 202, 249, 0.15);
  color: #90caf9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-item__label {
  flex: 1;
  min-width: 0;
  color: #e8e8e8 !important;
}

.menu-item__arrow {
  color: #666 !important;
}

/* Đăng xuất là <form> nên phải bỏ margin để không phá nhịp danh sách */
.menu-form {
  margin: 0;
}

/* ===== TABLE / LỊCH SỬ ===== */
.table-card {
  background: #1a1a1a !important;
  border-radius: var(--radius-card);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  border: 1px solid #2c2c2c;
}

.table-card__title {
  padding: 16px 16px 4px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff !important;
}

.table-row {
  padding: 14px 16px;
  border-bottom: 1px solid #2a2a2a;
  font-size: 0.85rem;
  color: #e0e0e0;
}

.table-row:last-child {
  border-bottom: none;
}

.table-row .row-title {
  font-weight: 700;
  margin-bottom: 4px;
  color: #ffffff;
}

.table-row .row-meta {
  color: #999 !important;
  font-size: 0.75rem;
  margin-bottom: 6px;
}

/* ---------- 08. Badge / status / chip ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.25);
}

.badge .lucide { width: 13px; height: 13px; }

/* Hạng VIP: màu nền do admin cấu hình, view truyền vào qua --vip-color */
.badge--vip { background: var(--vip-color, var(--primary)); }

.status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
}

.status-pending { background: var(--warning-bg); color: var(--warning-fg); }
.status-processing { background: var(--info-bg); color: var(--info-fg); }
.status-rejected,
.status-cancelled { background: var(--danger-bg); color: var(--danger-fg); }
.status-approved,
.status-success,
.status-verified,
.status-completed,
.status-available { background: var(--success-bg); color: var(--success-fg); }

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--success);
  font-weight: 600;
  font-size: 0.85rem;
}

.verified-badge .lucide { width: 18px; height: 18px; }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 calc(var(--gutter) * -1) 12px;
  padding: 0 var(--gutter) 4px;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background var(--t-base), color var(--t-base), border-color var(--t-base);
}

.chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---------- 09. Trang chủ ---------- */

.home-cover {
  display: block;
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
  text-decoration: none;
  color: #fff;
  background: var(--primary-tint);
}

.home-cover__frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7;
  min-height: 120px;
  max-height: 38vh;
  overflow: hidden;
}

.home-cover__frame img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-cover__overlay {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  padding: 28px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.62) 100%);
  pointer-events: none;
}

.home-cover__title {
  font-size: clamp(0.9rem, 4.2vw, 1.05rem);
  font-weight: 800;
  line-height: 1.25;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-cover__sub {
  font-size: clamp(0.7rem, 3.2vw, 0.78rem);
  font-weight: 500;
  opacity: 0.92;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticker {
  --ticker-gap: 8px;
  --ticker-pad-l: 12px;
  --ticker-pad-r: 6px;
  --ticker-icon-w: 20px;
  --ticker-btn-w: 26px;
  --ticker-fade: 14px;

  display: flex;
  align-items: center;
  gap: var(--ticker-gap);
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1.5px solid var(--primary-tint);
  border-radius: var(--radius-pill);
  padding: 8px var(--ticker-pad-r) 8px var(--ticker-pad-l);
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.ticker__icon {
  flex: 0 0 var(--ticker-icon-w);
  color: var(--primary);
  display: flex;
  align-items: center;
}

.ticker__viewport { flex: 1; min-width: 0; overflow: hidden; }

/* Vệt mờ hai đầu để chữ không bị cắt cụt đột ngột */
.ticker::before,
.ticker::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--ticker-fade);
  z-index: 2;
  pointer-events: none;
}

.ticker::before {
  left: calc(var(--ticker-pad-l) + var(--ticker-icon-w) + var(--ticker-gap));
  background: linear-gradient(90deg, var(--surface), rgba(255, 255, 255, 0));
}

.ticker::after {
  right: calc(var(--ticker-pad-r) + var(--ticker-btn-w) + var(--ticker-gap));
  background: linear-gradient(270deg, var(--surface), rgba(255, 255, 255, 0));
}

.ticker__track {
  display: flex;
  width: max-content;
  animation: ticker-scroll var(--ticker-duration, 18s) linear infinite;
  will-change: transform;
}

.ticker__track.is-paused { animation-play-state: paused; }

.ticker__group {
  flex: 0 0 auto;
  padding-right: 32px;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 600;
}

@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.ticker__pause {
  flex: 0 0 var(--ticker-btn-w);
  width: var(--ticker-btn-w);
  height: 26px;
  position: relative;
  z-index: 3;
  border: none;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ticker__pause:active { background: var(--primary-tint); }
.ticker__pause .lucide { width: 13px; height: 13px; }

.pet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.pet-card {
  display: block;
  background: var(--surface);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  text-decoration: none;
  color: inherit;
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base);
  animation: scaleIn 0.4s var(--ease-out) backwards;
}

.pet-card:nth-child(1) { animation-delay: 0.04s; }
.pet-card:nth-child(2) { animation-delay: 0.08s; }
.pet-card:nth-child(3) { animation-delay: 0.12s; }
.pet-card:nth-child(4) { animation-delay: 0.16s; }

.pet-card:active { transform: scale(0.97); }
.pet-card:hover { box-shadow: var(--shadow-raised); }

.pet-card__img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--primary-soft);
}

.pet-card__body { padding: 10px 12px 14px; }

.pet-card__name {
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.pet-card__loc {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pet-card__loc .lucide { width: 12px; height: 12px; }

.pet-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.pet-card__price {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--primary);
}

.pet-card__stats {
  display: flex;
  gap: 8px;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.pet-card__stat { display: inline-flex; align-items: center; gap: 3px; }
.pet-card__stat .lucide { width: 12px; height: 12px; }

/* ---------- 10. Chi tiết sản phẩm ---------- */

.pet-detail { min-height: 200px; }

.gallery-cover,
.gallery-empty {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-card);
  overflow: hidden;
  margin-bottom: 12px;
}

.gallery-cover { background: #000; }

.gallery-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
}

.gallery-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-soft);
}

.gallery-empty img { width: 55%; opacity: 0.85; }

.pet-header-info {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-bottom: 12px;
}

.pet-header-info__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.pet-header-info__name {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.pet-header-info__loc {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.pet-header-info__loc .lucide { width: 14px; height: 14px; color: var(--primary); }

.pet-header-info__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.pet-header-info__price {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--primary-dark);
  letter-spacing: -0.01em;
}

.pet-header-info__views {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.pet-header-info__views .lucide { width: 14px; height: 14px; }

.btn-like {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--primary-tint);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--primary-dark);
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t-fast), transform var(--t-fast) var(--ease-out);
}

.btn-like:active { transform: scale(0.94); background: var(--primary-soft); }
.btn-like .lucide { width: 16px; height: 16px; color: var(--primary); }
.btn-like.liked .lucide { fill: var(--primary); }

/* Tab: radio ẩn làm công tắc, hiện/ẩn panel thuần CSS */
.pet-tab-input { display: none; }

.pet-tabs {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  display: flex;
  margin: 0 calc(var(--gutter) * -1) 12px;
  padding: 0 var(--gutter);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}

.pet-tabs::-webkit-scrollbar { display: none; }

.pet-tab {
  flex: 1;
  min-width: max-content;
  padding: 14px 16px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--t-base), border-color var(--t-base);
}

#pet-tab-info:checked ~ .pet-tabs [data-tab="info"],
#pet-tab-gallery:checked ~ .pet-tabs [data-tab="gallery"],
#pet-tab-reviews:checked ~ .pet-tabs [data-tab="reviews"] {
  color: var(--primary-dark);
  border-bottom-color: var(--primary-dark);
}

.pet-tab-panel { display: none; }

#pet-tab-info:checked ~ .pet-tab-panel[data-panel="info"],
#pet-tab-gallery:checked ~ .pet-tab-panel[data-panel="gallery"],
#pet-tab-reviews:checked ~ .pet-tab-panel[data-panel="reviews"] {
  display: block;
  animation: fadeUp 0.3s var(--ease-out);
}

.info-list {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 8px 16px;
  margin-bottom: 12px;
}

.pet-desc {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-bottom: 12px;
}

.pet-desc h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 8px; }

.pet-desc p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  white-space: pre-line;
}

.gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.gallery-grid__item {
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--primary-soft);
}

.gallery-grid__item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  transition: transform var(--t-fast) var(--ease-out);
}

.gallery-grid__item img:active { transform: scale(0.95); }

.review-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
}

.review-summary__score {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.review-list {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 0 16px;
  margin-bottom: 12px;
}

.review-item {
  display: flex;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.review-item:last-child { border-bottom: none; }

.review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.review-item__body { flex: 1; min-width: 0; }

.review-item__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.review-item__name { font-size: 0.875rem; font-weight: 700; }
.review-item__date { font-size: 0.7rem; color: var(--text-muted); }
.review-item__text { font-size: 0.85rem; margin-top: 4px; }

.stars { display: inline-flex; gap: 2px; }
.stars .star { color: #DDD; font-size: 1.05rem; line-height: 1.2; }
.stars .star.filled { color: var(--star); }

/* ---------- 11. Tài khoản ---------- */
.profile-hero {
  position: relative;
  border-radius: var(--radius-card);
  overflow: hidden;
  padding: 28px 20px;
  margin-bottom: 16px;
  color: #fff;
  text-align: center;
  background: #1a1a1a; /* dark nền dự phòng nếu ảnh load chậm */
}

.profile-hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: brightness(0.55); /* làm tối ảnh nền cho dễ đọc chữ */
}

/* Không phủ màu lên ảnh — dùng text-shadow để chữ trắng vẫn đọc được
   trên nền ảnh bất kỳ, giữ nguyên màu thật của ảnh. */
.profile-avatar,
.profile-name,
.profile-id,
.profile-badges {
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid #fff;
  object-fit: cover;
  margin-bottom: 10px;
  text-shadow: none;
}

.profile-name {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
}

.profile-id {
  font-size: 0.8rem;
  opacity: 0.9;
  color: #e0e0e0;
}

.profile-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* ===== Balance Box - Dark ===== */
.balance-box {
  background: #1e1e1e; /* dark surface */
  border-radius: var(--radius-card);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  padding: 20px;
  margin-bottom: 16px;
  text-align: center;
  border: 1px solid #2c2c2c;
}

.balance-label {
  font-size: 0.8rem;
  color: #aaaaaa;
}

.balance-amount {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 4px 0 16px;
  color: #4caf50; /* xanh số dư nổi bật */
}

.balance-box--plain .balance-amount {
  margin-bottom: 0;
}

.balance-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ===== Nút Nạp số dư - Màu đỏ ===== */
.balance-actions .btn-primary {
  background-color: #e53935 !important;
  border-color: #e53935 !important;
  color: #ffffff !important;
}

.balance-actions .btn-primary:hover {
  background-color: #c62828 !important;
  border-color: #c62828 !important;
}

/* ===== Nút Rút số dư - Dark (hết viền xanh) ===== */
.balance-actions .btn-outline,
.balance-actions a.btn-outline {
  background: transparent !important;
  border: 1.5px solid #555 !important;
  color: #e0e0e0 !important;
  box-shadow: none !important;
}

.balance-actions .btn-outline:hover,
.balance-actions a.btn-outline:hover {
  background: #2a2a2a !important;
  border-color: #777 !important;
  color: #ffffff !important;
}

.balance-actions .btn-outline i,
.balance-actions .btn-outline .lucide {
  color: #e0e0e0 !important;
}

/* ===== Các class phụ ===== */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: rgba(229, 57, 53, 0.15);
  color: #e53935;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.copy-btn .lucide {
  width: 13px;
  height: 13px;
}

.qr-box {
  text-align: center;
}

.qr-box img {
  width: 180px;
  height: 180px;
  border-radius: var(--radius-btn);
  background: #fff;
  margin-top: 12px;
}

/* ---------- 12. Phản hồi ---------- */

.page-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.section-title { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }

.alert {
  padding: 12px 16px;
  border-radius: var(--radius-input);
  font-size: 0.85rem;
  margin-bottom: 16px;
  animation: fadeUp 0.3s var(--ease-out);
  transition: opacity 0.4s;
}

.alert-success { background: var(--success-bg); color: var(--success-fg); }
.alert-error { background: var(--danger-bg); color: var(--danger-fg); }

/* app.js gắn class này trước khi gỡ alert khỏi DOM */
.is-fading { opacity: 0; }

.auth-page {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100dvh - var(--header-h) - var(--nav-h) - var(--gutter) * 2);
  padding: 24px 0;
}

.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo h1 { font-size: 2rem; font-weight: 800; color: var(--primary); }
.auth-logo p { color: var(--text-muted); font-size: 0.9rem; margin-top: 4px; }

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-raised);
  padding: 28px 20px;
}

.auth-link {
  text-align: center;
  margin-top: 20px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.auth-link a { color: var(--primary); font-weight: 600; text-decoration: none; }

.empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty .lucide {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty--full { grid-column: 1 / -1; }

.skeleton {
  background: linear-gradient(90deg, #EFEFF4 25%, #E6E7EE 50%, #EFEFF4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: var(--radius-card);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card { height: 220px; }

.pagination {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.pagination a,
.pagination span {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-card);
}

.pagination .current { background: var(--primary); color: #fff; }

.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox.open { display: flex; animation: fadeUp 0.2s var(--ease-out); }
.lightbox img { max-width: 100%; max-height: 90vh; border-radius: var(--radius-btn); }

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  cursor: pointer;
}

.lightbox-close .lucide { width: 22px; height: 22px; }

.chat-placeholder {
  background: var(--primary-soft);
  border-radius: var(--radius-input);
  padding: 32px 20px;
  text-align: center;
}

.error-code {
  font-size: 4rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 8px;
}

/* ---------- 13. Game dự đoán ---------- */

/* Thẻ số dư — nổi bật vì là con số user nhìn đầu tiên mỗi phiên */
.game-balance {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-radius: var(--radius-card);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-primary);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.game-balance__label { font-size: 0.78rem; opacity: 0.85; }

.game-balance__value {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

/* Nút nạp trên nền hồng: viền trắng thay vì viền primary vốn chìm mất */
.game-balance .btn-outline {
  margin-top: 6px;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.55);
  color: #fff;
}

.game-balance .btn-outline:hover { background: rgba(255, 255, 255, 0.26); }

/* Banner đầu trang game.

   Khung có tỉ lệ cố định + bo góc, ảnh bên trong phủ kín bằng object-fit.
   Nhờ vậy ảnh tải lên cỡ nào (dọc, ngang, quá to) cũng không méo, không tràn
   và không đẩy vỡ bố cục — kích thước ảnh gốc không còn ảnh hưởng gì. */
.game-banner {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7;
  min-height: 110px;
  max-height: 34vh;
  margin-bottom: 12px;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--primary-tint);
  box-shadow: var(--shadow-card);
}

.game-banner img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Màn chọn server — mỗi server một ô riêng biệt, bấm vào mới mở panel chơi.
   Hai ô luôn cạnh nhau để so sánh nhanh phiên nào đang mở. */
.game-servers__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.server-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--text);
  font-family: inherit;
  text-align: center;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out);
}

.server-card:hover,
.server-card:focus-visible {
  border-color: var(--primary);
  box-shadow: var(--shadow-raised);
}

.server-card:active { transform: scale(0.98); }

.server-card__icon {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 8px;
  border-radius: var(--radius-btn);
  overflow: hidden;
  color: var(--primary);
}

.server-card__icon .lucide { width: 22px; height: 22px; }

/* Ảnh riêng cho từng server — khung ngang cố định theo tỉ lệ, ảnh tự
   crop vừa khung (object-fit: cover) nên không bao giờ tràn xuống đè
   lên tên/trạng thái server bên dưới. */
.server-card__icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.server-card__name { font-size: 0.95rem; font-weight: 700; }

.server-card__round {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Trạng thái phiên: xám khi chờ/khoá, xanh khi đang nhận lượt */
.server-card__status {
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  background: var(--backdrop);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
}

.server-card__status--open {
  background: var(--success-bg);
  color: var(--success-fg);
}

.server-card__enter {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-top: 6px;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 600;
}

.server-card__enter .lucide { width: 14px; height: 14px; }

/* Chấm báo "đang có lượt ở server này". User đặt được trên cả hai server
   cùng lúc, nên phải thấy được ngay ở màn chọn mà không cần mở từng bên. */
.server-card__dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: transparent;
}

.server-card__dot--on { background: var(--success); }

/* Thanh đầu panel: quay lại màn chọn + tên server đang chơi. Header của
   layout không có nút quay lại ở /xac-thuc (mục gốc của thanh điều hướng)
   nên lối ra phải nằm ngay trong panel. */
.game-panel__head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.game-panel__back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 6px 12px 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.game-panel__back .lucide { width: 16px; height: 16px; }

.game-panel__name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
}

/* Panel bị ẩn dùng .hidden (display:none), nên chỉ cần hiệu ứng lúc hiện */
.game-panel { animation: game-panel-in var(--t-base) var(--ease-out); }

@keyframes game-panel-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* Phiên + đếm ngược */
.game-session { text-align: center; }

.game-session__head {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.game-session__label { font-size: 0.8rem; color: var(--text-muted); }

.game-session__id {
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.game-countdown {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}

/* Đã khoá: chuyển xám để user thôi bấm, không cần đọc chữ mới biết */
.game-countdown--locked { color: var(--text-muted); }

.game-session__phase {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Kết quả phiên trước */
.game-prev { text-align: center; }

.game-prev__circles {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 2px 0 6px;
}

.result-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--backdrop);
  color: var(--text-muted);
  border: 2px solid var(--border);
}

.result-circle--filled {
  background: var(--primary-soft);
  color: var(--primary);
  border-color: var(--primary-tint);
}

.result-circle--reveal { animation: result-pop var(--t-base) var(--ease-spring); }

@keyframes result-pop {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.game-prev__meta { font-size: 0.78rem; color: var(--text-muted); }

/* Đặt lượt */
.game-rule {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Bảng mức khớp, chỉ hiện với luật 'tiered' */
.game-tiers {
  list-style: none;
  margin: -6px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  background: var(--bg);
}

.game-tier {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  padding: 3px 0;
}

.game-tier__level { color: var(--text-muted); }

.game-tier__mult {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
}

.game-tier--zero .game-tier__mult {
  color: var(--text-muted);
  font-weight: 500;
}

.game-stakes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.stake {
  flex: 1 1 calc(33.333% - 8px);
  min-width: 88px;
  height: 40px;
  border-radius: var(--radius-btn);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
}

.stake--selected {
  border-color: #e53935;
  background: rgba(229, 57, 53, 0.12);
  color: #e53935;
}

.stake:disabled { opacity: 0.45; cursor: not-allowed; }

/* "Tất cả" và "Tự nhập" là hành động, không phải một con số — viền đứt để
   phân biệt ngay với dãy mức cố định bên trên mà không cần đọc chữ. */
.stake--all,
.stake--custom { border-style: dashed; }

.game-stake-custom { margin-bottom: 4px; }

.game-stakes__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 14px 0 8px;
}

.game-stake-custom__label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.game-stake-custom__field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-btn);
  border: 1.5px solid var(--border);
  background: var(--surface);
}

.game-stake-custom__field:focus-within { border-color: var(--primary); }

.game-stake-custom__input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  outline: none;
}

.game-stake-custom__input:disabled { opacity: 0.45; cursor: not-allowed; }

.game-stake-custom__unit {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-weight: 600;
}

.game-stake-custom__note {
  margin: 6px 0 0;
  min-height: 1em;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.game-stake-custom__note--error { color: var(--danger); }

.game-stake-custom__confirm { margin-top: 10px; }

/* Nút "Xác nhận đặt cược" — đỏ, chỉ trong khu vực đặt cược, không đụng
   .btn-primary dùng chung toàn site. */
.game-bet .btn-primary {
  background: #e53935;
  box-shadow: 0 6px 18px rgba(229, 57, 53, 0.35);
}

.game-bet .btn-primary:hover { background: #c62828; }

/* Dòng "Đã chọn: X ô | Tổng tiền: Y" — luôn phản chiếu đúng số ô + tổng
   tiền hiện tại (app.js điền nội dung, tự ẩn khi chưa chọn ô nào). */
.game-selected-info {
  margin: -6px 0 14px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(229, 57, 53, 0.1);
  color: #e53935;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.game-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

/* Panel mức tiền — chỉ xuất hiện sau khi đã chọn bên (xem script trong
   fragment game-bet). Dùng .hidden có sẵn của hệ thống để ẩn/hiện. */
.game-stake-panel { animation: fadeUp var(--t-base) var(--ease-out); }

.option {
  position: relative;
  height: 84px;
  border-radius: var(--radius-card);
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
}

.option:active:not(:disabled) { transform: scale(0.97); }

.option__symbol { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.option__label { font-size: 0.75rem; color: var(--text-muted); }

/* Hai bên khác màu để phân biệt bằng hình dạng lẫn màu, không chỉ chữ */
.option--q { border-color: var(--primary-tint); }
.option--q .option__symbol { color: var(--primary); }
.option--r { border-color: var(--info-bg); }
.option--r .option__symbol { color: var(--info-fg); }

.option--selected {
  border-color: #e53935;
  background: rgba(229, 57, 53, 0.12);
  box-shadow: 0 6px 18px rgba(229, 57, 53, 0.32);
}

.option--selected .option__symbol { color: #e53935; }
.option--selected .option__label { color: #e53935; font-weight: 600; }

.option:disabled { opacity: 0.5; cursor: not-allowed; }

/* Ô đã có lượt: vẫn khoá (mỗi ô một lượt mỗi phiên) nhưng KHÔNG mờ đi —
   user cần thấy rõ mình đang giữ ô nào, mờ như ô hết hạn thì đọc ngược ý. */
.option--placed:disabled { opacity: 1; cursor: default; }

.option--placed::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  color: #e53935;
}

.game-options__note {
  margin: -6px 0 14px;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--text-muted);
  text-align: center;
}

/* Tổng tiền khi chọn 2 ô — chỉ hiện lúc thật sự nhân lên (app.js gỡ .hidden) */
.game-stake-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--primary-soft);
  font-size: 0.8rem;
}

.game-stake-total__label { color: var(--text-muted); }

.game-stake-total__value {
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
}

.game-hint {
  margin-top: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
}

.game-limit {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* Lịch sử phiên */
.game-history__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.game-history__row:last-child { border-bottom: none; }

.game-history__id {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  min-width: 52px;
}

.game-history__results { display: flex; gap: 6px; flex: 1; }

.result-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
}

.game-history__time {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Toast — nổi trên thanh điều hướng dưới */
.game-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + var(--safe-bottom) + 16px);
  transform: translate(-50%, 16px);
  max-width: calc(var(--app-max) - 32px);
  width: max-content;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--text);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  z-index: 60;
  transition: opacity var(--t-base) var(--ease-out), transform var(--t-base) var(--ease-out);
}

.game-toast--show { opacity: 1; transform: translate(-50%, 0); }
.game-toast--win { background: var(--success); }
.game-toast--lose { background: var(--danger); }

/* ---------- 13b. Auth — biến thể nền ảnh tối (login/register) ---------- */

/* Ảnh nền: đổi đường dẫn url() bên dưới sang file ảnh thật trên server.
   Lớp gradient phủ lên ảnh để chữ/khung trắng luôn đủ tương phản dù
   ảnh sáng hay tối. */
.auth-page--photo {
  min-height: calc(100dvh - var(--header-h));
  margin: calc(var(--gutter) * -1) calc(var(--gutter) * -1) 0;
  padding: 56px 24px 40px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  background:
    linear-gradient(180deg, rgba(10, 10, 16, 0.35) 0%, rgba(10, 10, 16, 0.55) 45%, rgba(10, 10, 16, 0.9) 100%),
    url("/assets/img/auth-bg.jpg") center top / cover no-repeat;
  background-color: #1a1a1a; /* dark nền dự phòng nếu ảnh load chậm */
  color: #fff;
}

.auth-page--photo .auth-logo h1 {
  color: #fff;
  font-size: 1.5rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.auth-page--photo .auth-logo p { color: rgba(255, 255, 255, 0.72); }

/* Bỏ khung thẻ trắng — các input nổi trực tiếp trên ảnh, giống bản gốc */
.auth-page--photo .auth-card {
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.auth-page--photo .form-group label { display: none; }

/* Ô nhập dạng viên thuốc, icon bên trái, không viền — theo đúng mockup */
.form-icon-group { position: relative; margin-bottom: 16px; }

.form-icon-group > .lucide,
.form-icon-group > [data-lucide] {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  z-index: 1;
}

.form-icon-group .form-control {
  height: 52px;
  min-height: 52px;
  padding-left: 46px;
  padding-right: 46px;
  border: none;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.96);
}

.form-icon-group .form-control:focus,
.form-icon-group .form-control:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45);
}

.password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  padding: 0;
  display: flex;
  color: var(--text-muted);
  cursor: pointer;
}

.auth-page--photo .btn-primary {
  height: 52px;
  min-height: 52px;
  border-radius: var(--radius-pill);
  background: linear-gradient(180deg, #d9534f 0%, #a3272a 100%);
  box-shadow: 0 10px 22px rgba(163, 39, 42, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.auth-page--photo .btn-primary:hover { background: linear-gradient(180deg, #c94743 0%, #8f2224 100%); }

.auth-page--photo .auth-link { color: rgba(255, 255, 255, 0.85); }
.auth-page--photo .auth-link a { color: #fff; }

.auth-page--photo .form-check { color: rgba(255, 255, 255, 0.85); }
.auth-page--photo .form-hint { color: rgba(255, 255, 255, 0.65); }

/* ---------- 14. Utilities ---------- */

.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.78rem; }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mx-auto { margin-left: auto; margin-right: auto; }
.hidden { display: none !important; }

/* Tôn trọng thiết lập giảm chuyển động của hệ điều hành */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  /* Dòng chạy: tắt animation, cho phép người dùng tự kéo ngang.
     Bấm nút phát sẽ thêm .is-playing để chạy lại nếu muốn. */
  .ticker__track { animation: none; }

  .ticker__track.is-playing {
    animation: ticker-scroll var(--ticker-duration, 18s) linear infinite !important;
  }

  .ticker__viewport { overflow-x: auto; scrollbar-width: none; }
  .ticker__viewport::-webkit-scrollbar { display: none; }
}
/* ========== CHỈ DARK TRANG TÀI KHOẢN ========== */
.page-account {
  background-color: #0f0f0f !important;
  min-height: 100vh;
  padding-bottom: 20px;
  color: #e0e0e0;
}

/* Nếu muốn header cũng đen khi vào trang này (cần class body) */
body:has(.page-account) .header,
body:has(.page-account) .topbar,
body:has(.page-account) .app-header {
  background-color: #1a1a1a !important;
  border-bottom: 1px solid #2c2c2c !important;
}
body:has(.page-account) .container,
body:has(.page-account) main {
  background: #0f0f0f !important;
  box-shadow: none !important;
}
