:root {
  --red-deep: #340707;
  --red-lacquer: #5b0c0c;
  --red-crimson: #b91c1c;
  --red-bright: #dc2626;
  --gold-bright: #fbbf24;
  --gold-warm: #f59e0b;
  --gold-pale: #fde68a;
  --cream-paper: #fff8e7;
  --cream-warm: #fef3c7;
  --wood-dark: #2a110a;
  --jade-green: #059669;
  --night-indigo: #0f172a;
  --text-light: #fffbeb;
  --text-dark: #3b0d0c;
  --border-gold: rgba(251, 191, 36, 0.48);
  --shadow-lacquer: 0 14px 36px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 50% 10%, #7f1d1d 0%, #450a0a 48%, #220404 100%);
  color: var(--text-light);
  overflow-x: hidden;
}

#fx-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Đèn lồng & Câu đối Tết hai bên */
.tet-decor-left,
.tet-decor-right {
  position: fixed;
  top: 68px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  pointer-events: none;
}

.tet-decor-left { left: 14px; }
.tet-decor-right { right: 14px; }

@media (max-width: 1240px) {
  .tet-decor-left,
  .tet-decor-right {
    display: none;
  }
}

.lantern {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: lanternSway 4.2s ease-in-out infinite alternate;
  transform-origin: top center;
}

@keyframes lanternSway {
  from { transform: rotate(-4deg); }
  to { transform: rotate(4deg); }
}

.lantern-cap {
  width: 28px;
  height: 7px;
  background: var(--gold-bright);
  border-radius: 3px;
}

.lantern-body {
  width: 58px;
  height: 50px;
  background: radial-gradient(circle, #ff4d4d 10%, #b91c1c 75%, #7f1d1d 100%);
  border: 2px solid var(--gold-bright);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 22px rgba(251, 191, 36, 0.45);
}

.lantern-body span {
  font-family: 'Noto Serif', serif;
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--gold-pale);
  background: rgba(69, 10, 10, 0.6);
  padding: 2px 5px;
  border-radius: 4px;
  border: 1px solid var(--gold-bright);
}

.lantern-tassel {
  width: 6px;
  height: 24px;
  background: linear-gradient(to bottom, var(--gold-bright), #d97706);
  border-radius: 0 0 4px 4px;
}

.couplet {
  background: linear-gradient(180deg, #991b1b, #690b0b);
  border: 2px solid var(--gold-bright);
  border-radius: 8px;
  padding: 12px 10px;
  font-family: 'Noto Serif', serif;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.55;
  text-align: center;
  color: var(--gold-pale);
  box-shadow: var(--shadow-lacquer);
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(42, 6, 6, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--border-gold);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.brand-emblem {
  font-size: 1.75rem;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.6));
}

.brand-title {
  font-family: 'Noto Serif', serif;
  font-weight: 800;
  font-size: 1.12rem;
  color: var(--gold-bright);
  letter-spacing: 0.5px;
}

.brand-sub {
  font-size: 0.74rem;
  color: #fde68a;
  opacity: 0.9;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Buttons */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: transform 0.14s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

button:active:not(:disabled) {
  transform: scale(0.96);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary-gold {
  background: linear-gradient(135deg, #fde047 0%, #f59e0b 55%, #d97706 100%);
  color: #3b0707;
  font-weight: 800;
  padding: 11px 18px;
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4), inset 0 1px 0 rgba(255,255,255,0.65);
}

.btn-primary-gold:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn-large {
  width: 100%;
  font-size: 1.02rem;
  padding: 14px 20px;
}

.btn-crimson {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #fffbeb;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid rgba(253, 230, 138, 0.55);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-gold-outline {
  background: rgba(120, 20, 20, 0.7);
  color: var(--gold-pale);
  border: 1.5px solid var(--gold-bright);
  padding: 8px 13px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.86rem;
}

.btn-red-soft {
  background: rgba(185, 28, 28, 0.85);
  color: #fffbeb;
  border: 1px solid rgba(253, 230, 138, 0.45);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.85rem;
}

.btn-ghost-gold {
  width: 100%;
  background: rgba(251, 191, 36, 0.12);
  color: var(--gold-pale);
  border: 1px dashed rgba(251, 191, 36, 0.55);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.88rem;
}

.btn-mini-gold {
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #3b0707;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 6px 11px;
  border-radius: 8px;
}

.btn-mini-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold-pale);
  border: 1px solid rgba(251, 191, 36, 0.35);
  font-weight: 600;
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 8px;
}

.btn-icon {
  position: relative;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-light);
  border: 1px solid var(--border-gold);
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 1.05rem;
}

.btn-icon-sm {
  background: transparent;
  color: var(--gold-pale);
  font-size: 1.1rem;
  padding: 4px 8px;
}

.badge-dot {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #f59e0b;
  color: #3b0707;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 99px;
}

.hidden {
  display: none !important;
}

/* Screens */
.screen {
  display: none;
  position: relative;
  z-index: 5;
  max-width: 1120px;
  margin: 0 auto;
  padding: 18px 14px 64px;
}

.screen.active {
  display: block;
}

/* Welcome Screen */
.welcome-hero {
  text-align: center;
  padding-top: 8px;
}

.tet-seal {
  display: inline-block;
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid var(--gold-bright);
  color: var(--gold-pale);
  font-weight: 800;
  font-size: 0.76rem;
  letter-spacing: 1.4px;
  padding: 5px 14px;
  border-radius: 99px;
  margin-bottom: 10px;
}

.welcome-hero h1 {
  font-family: 'Noto Serif', serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--gold-bright);
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.55);
  margin-bottom: 8px;
}

.hero-desc {
  max-width: 680px;
  margin: 0 auto 24px;
  color: #fef3c7;
  font-size: 0.98rem;
  line-height: 1.55;
}

.welcome-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 18px;
  text-align: left;
  margin-bottom: 22px;
}

.lacquer-card {
  background: linear-gradient(160deg, rgba(95, 14, 14, 0.94), rgba(52, 7, 7, 0.96));
  border: 2px solid var(--border-gold);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow-lacquer);
}

.lacquer-card h2 {
  font-family: 'Noto Serif', serif;
  color: var(--gold-bright);
  font-size: 1.22rem;
  margin-bottom: 14px;
}

.field-label {
  display: block;
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--gold-pale);
  margin-bottom: 6px;
}

.tet-input {
  width: 100%;
  background: rgba(25, 4, 4, 0.72);
  border: 1.5px solid rgba(251, 191, 36, 0.45);
  color: #fffbeb;
  padding: 11px 13px;
  border-radius: 11px;
  font-size: 0.96rem;
  font-family: inherit;
  margin-bottom: 14px;
}

.tet-input:focus {
  outline: none;
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.22);
}

.code-input {
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 0;
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.avatar-item {
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 8px 4px;
  font-size: 1.45rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}

.avatar-item.selected {
  background: rgba(251, 191, 36, 0.25);
  border-color: var(--gold-bright);
  transform: translateY(-2px);
}

.divider-tet {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: rgba(253, 230, 138, 0.7);
  font-size: 0.75rem;
  font-weight: 700;
}

.divider-tet::before,
.divider-tet::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(251, 191, 36, 0.3);
}

.join-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.join-row .btn-crimson {
  white-space: nowrap;
}

.showcase-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.showcase-pill {
  background: rgba(69, 10, 10, 0.8);
  border: 1px solid rgba(251, 191, 36, 0.35);
  color: var(--gold-pale);
  padding: 6px 13px;
  border-radius: 99px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* Players Bar */
.players-bar-wrap {
  background: rgba(45, 7, 7, 0.9);
  border: 1.5px solid var(--border-gold);
  border-radius: 16px;
  padding: 10px 14px;
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.players-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.player-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(95, 16, 16, 0.85);
  border: 1.5px solid rgba(251, 191, 36, 0.35);
  padding: 5px 10px;
  border-radius: 99px;
  font-size: 0.83rem;
}

.player-chip.is-me {
  border-color: var(--gold-bright);
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.player-chip .p-loc {
  background: rgba(251, 191, 36, 0.2);
  color: var(--gold-bright);
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 0.76rem;
}

.room-host-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Reaction Strip */
.reaction-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.reaction-label {
  font-size: 0.78rem;
  color: var(--gold-pale);
  font-weight: 700;
  white-space: nowrap;
}

.react-btn {
  background: rgba(82, 14, 14, 0.78);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: #fffbeb;
  padding: 5px 10px;
  border-radius: 99px;
  font-size: 0.78rem;
  white-space: nowrap;
}

.react-btn:hover {
  border-color: var(--gold-bright);
}

/* Game Hub */
.hub-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.hub-tag {
  font-size: 0.73rem;
  font-weight: 800;
  color: var(--gold-bright);
  letter-spacing: 1px;
}

.hub-banner h2 {
  font-family: 'Noto Serif', serif;
  font-size: 1.5rem;
  color: #fffbeb;
}

.hub-banner p {
  font-size: 0.88rem;
  color: var(--cream-warm);
}

.featured-board-card {
  background: linear-gradient(135deg, #7f1d1d 0%, #450a0a 60%, #3b0764 100%);
  border: 2.5px solid var(--gold-bright);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
}

.featured-badge {
  display: inline-block;
  background: var(--gold-bright);
  color: #3b0707;
  font-weight: 800;
  font-size: 0.73rem;
  padding: 4px 10px;
  border-radius: 99px;
  margin-bottom: 10px;
}

.featured-content {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.featured-icon {
  font-size: 3.3rem;
}

.featured-info {
  flex: 1;
  min-width: 240px;
}

.featured-info h3 {
  font-family: 'Noto Serif', serif;
  font-size: 1.38rem;
  color: var(--gold-bright);
  margin-bottom: 6px;
}

.featured-info p {
  font-size: 0.92rem;
  line-height: 1.5;
  color: #fef3c7;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.game-tile {
  position: relative;
  background: linear-gradient(165deg, rgba(92, 15, 15, 0.95), rgba(45, 7, 7, 0.98));
  border: 1.8px solid var(--border-gold);
  border-radius: 18px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-lacquer);
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.game-tile:hover {
  transform: translateY(-3px);
  border-color: var(--gold-bright);
}

.tile-ribbon {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid var(--gold-bright);
  color: var(--gold-pale);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 99px;
}

.wolf-ribbon {
  background: rgba(99, 102, 241, 0.28);
  border-color: #a5b4fc;
  color: #e0e7ff;
}

.tile-icon {
  font-size: 2.5rem;
}

.game-tile h3 {
  font-family: 'Noto Serif', serif;
  font-size: 1.2rem;
  color: var(--gold-bright);
}

.game-tile p {
  font-size: 0.87rem;
  line-height: 1.5;
  color: #fef3c7;
  flex: 1;
}

.tile-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--gold-pale);
  opacity: 0.9;
  padding-top: 4px;
  border-top: 1px solid rgba(251, 191, 36, 0.2);
}

/* Stage Container & Shared Game Panels */
.stage-container {
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.game-panel {
  background: linear-gradient(165deg, rgba(78, 12, 12, 0.95), rgba(38, 5, 5, 0.98));
  border: 2px solid var(--gold-bright);
  border-radius: 20px;
  padding: 18px;
  box-shadow: var(--shadow-lacquer);
}

.game-header-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1.5px solid rgba(251, 191, 36, 0.3);
}

.game-header-bar h2 {
  font-family: 'Noto Serif', serif;
  color: var(--gold-bright);
  font-size: 1.35rem;
}

.status-banner {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.5);
  color: #fffbeb;
  padding: 10px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-weight: 600;
  font-size: 0.92rem;
  text-align: center;
}

/* ================= 1. BẦU CUA TÔM CÁ ================= */
.baucua-chips-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.bet-chip {
  padding: 8px 14px;
  border-radius: 99px;
  font-weight: 800;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--gold-pale);
  border: 2px solid rgba(251, 191, 36, 0.4);
}

.bet-chip.active {
  background: var(--gold-bright);
  color: #3b0707;
  border-color: #fffbeb;
  transform: scale(1.06);
}

.baucua-mat {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  background: #fff8e7;
  color: var(--text-dark);
  padding: 14px;
  border-radius: 18px;
  border: 4px solid #d97706;
  margin-bottom: 16px;
}

@media (max-width: 620px) {
  .baucua-mat {
    grid-template-columns: repeat(2, 1fr);
  }
}

.baucua-cell {
  background: linear-gradient(180deg, #fffbeb, #fef3c7);
  border: 2.5px solid #b91c1c;
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.12s, box-shadow 0.15s;
}

.baucua-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(185, 28, 28, 0.2);
}

.baucua-cell.winner {
  background: linear-gradient(180deg, #fde68a, #fbbf24);
  border-color: #059669;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.8);
  animation: pulseWin 0.8s ease infinite alternate;
}

@keyframes pulseWin {
  from { transform: scale(1); }
  to { transform: scale(1.03); }
}

.baucua-emoji {
  font-size: 2.7rem;
  line-height: 1.1;
}

.baucua-name {
  font-family: 'Noto Serif', serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: #991b1b;
  margin-top: 4px;
}

.baucua-bets-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  margin-top: 8px;
  min-height: 24px;
}

.bet-pill {
  background: #991b1b;
  color: #fffbeb;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
}

.bowl-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 16px;
}

.dice-plate {
  position: relative;
  width: 210px;
  height: 130px;
  background: radial-gradient(circle, #ffffff 55%, #e2e8f0 100%);
  border: 5px solid #cbd5e1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.45);
}

.baucua-die {
  width: 52px;
  height: 52px;
  background: #fffbeb;
  border: 2px solid #b91c1c;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.9rem;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.ceramic-bowl {
  position: absolute;
  inset: -8px;
  background: radial-gradient(circle at 40% 35%, #3b82f6 0%, #1d4ed8 65%, #1e3a8a 100%);
  border: 4px solid #eff6ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 12px 24px rgba(0,0,0,0.55);
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s;
}

.ceramic-bowl.shaking {
  animation: shakeBowl 0.13s infinite;
}

.ceramic-bowl.opened {
  transform: translateY(-135px) rotate(12deg);
  opacity: 0;
  pointer-events: none;
}

@keyframes shakeBowl {
  0% { transform: translate(-5px, -3px) rotate(-4deg); }
  50% { transform: translate(6px, 3px) rotate(4deg); }
  100% { transform: translate(-4px, 2px) rotate(-3deg); }
}

/* ================= 2. HÀNH TRÌNH DU XUÂN (BOARD GAME 20 Ô) ================= */
.duxuan-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(6, minmax(76px, auto));
  gap: 7px;
  margin-bottom: 16px;
}

@media (max-width: 760px) {
  .duxuan-board {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto;
  }
}

.duxuan-tile {
  background: linear-gradient(160deg, #fffbeb, #fde68a);
  color: #3b0707;
  border: 2px solid #d97706;
  border-radius: 12px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  min-height: 78px;
}

.duxuan-tile.special-tile {
  background: linear-gradient(160deg, #fee2e2, #fca5a5);
  border-color: #b91c1c;
}

.duxuan-tile-idx {
  font-size: 0.66rem;
  font-weight: 800;
  opacity: 0.65;
}

.duxuan-tile-title {
  font-size: 0.74rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.2;
}

.duxuan-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
  min-height: 20px;
}

.duxuan-token {
  font-size: 1.05rem;
  background: rgba(69, 10, 10, 0.85);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold-bright);
}

.duxuan-center {
  grid-column: 2 / 6;
  grid-row: 2 / 6;
  background: radial-gradient(circle, rgba(127, 29, 29, 0.95), rgba(52, 7, 7, 0.98));
  border: 2px dashed var(--gold-bright);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
}

@media (max-width: 760px) {
  .duxuan-center {
    grid-column: 1 / -1;
    grid-row: auto;
    order: -1;
  }
}

/* ================= 3. CỜ CÁ NGỰA XUÂN ================= */
.cangua-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  align-items: start;
}

@media (max-width: 880px) {
  .cangua-layout {
    grid-template-columns: 1fr;
  }
}

.cangua-svg-wrap {
  background: #fffbeb;
  border: 4px solid #d97706;
  border-radius: 18px;
  padding: 8px;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}

.cangua-svg {
  width: 100%;
  height: auto;
  display: block;
}

.horse-piece {
  cursor: pointer;
  transition: transform 0.2s;
}

.horse-piece.movable {
  filter: drop-shadow(0 0 6px #fbbf24);
}

/* ================= 4. LÔ TÔ NGÀY TẾT ================= */
.loto-layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 16px;
}

@media (max-width: 840px) {
  .loto-layout {
    grid-template-columns: 1fr;
  }
}

.loto-caller-box {
  background: rgba(35, 5, 5, 0.75);
  border: 1.5px solid var(--border-gold);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}

.loto-ball-big {
  width: 96px;
  height: 96px;
  margin: 10px auto;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fde047, #f59e0b 65%, #b45309);
  color: #3b0707;
  font-size: 2.3rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 4px solid #fffbeb;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.45);
}

.loto-chant {
  font-style: italic;
  color: var(--gold-pale);
  min-height: 44px;
  font-size: 0.9rem;
  margin: 8px 0;
}

.loto-history {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  max-height: 120px;
  overflow-y: auto;
  margin-top: 10px;
}

.loto-num-mini {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(251, 191, 36, 0.22);
  color: var(--gold-pale);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.loto-ticket {
  background: #fef08a;
  padding: 12px;
  border-radius: 14px;
  border: 4px double #b91c1c;
  color: #1e293b;
  overflow-x: auto;
}

.loto-ticket.theme-pink { background: #fbcfe8; }
.loto-ticket.theme-green { background: #bbf7d0; }
.loto-ticket.theme-blue { background: #bae6fd; }

.loto-grid {
  display: grid;
  grid-template-columns: repeat(9, minmax(34px, 1fr));
  gap: 4px;
  min-width: 320px;
}

.loto-cell {
  height: 42px;
  border: 1.5px solid #991b1b;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.85);
  position: relative;
}

.loto-cell.blank {
  background: rgba(185, 28, 28, 0.16);
}

.loto-cell.has-num {
  cursor: pointer;
}

.loto-cell.marked::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.82);
  border: 2px solid #fde047;
}

.loto-cell.marked span {
  position: relative;
  z-index: 2;
  color: #fff;
}

/* ================= 5. XÂM HƯỜNG & HÁI LỘC ================= */
.xam-bowl {
  max-width: 380px;
  margin: 0 auto 16px;
  padding: 24px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffbeb 0%, #fef3c7 68%, #cbd5e1 100%);
  border: 8px solid #1d4ed8;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  box-shadow: inset 0 8px 24px rgba(0,0,0,0.28), 0 12px 26px rgba(0,0,0,0.4);
}

.std-die {
  width: 52px;
  height: 52px;
  background: #ffffff;
  border-radius: 11px;
  border: 2px solid #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  font-weight: 900;
  color: #1e293b;
  box-shadow: 0 4px 10px rgba(0,0,0,0.22);
}

.std-die.red-pip {
  color: #dc2626;
  border-color: #dc2626;
  background: #fff5f5;
}

.lixi-tree-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.lixi-envelope {
  background: linear-gradient(155deg, #ef4444, #991b1b);
  border: 2px solid var(--gold-bright);
  border-radius: 12px;
  padding: 14px 8px;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0,0,0,0.35);
}

.lixi-envelope.opened {
  background: rgba(255,255,255,0.1);
  opacity: 0.65;
  cursor: default;
}

/* ================= 6. Ô ĂN QUAN ================= */
.oanquan-board {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 8px;
  background: #fef3c7;
  color: #3b0707;
  border: 4px solid #b45309;
  border-radius: 60px;
  padding: 16px;
  max-width: 760px;
  margin: 0 auto 16px;
  overflow-x: auto;
}

.quan-pit {
  width: 92px;
  min-width: 80px;
  background: #fde68a;
  border: 3px solid #92400e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 6px;
  font-weight: 800;
}

.quan-pit.left { border-radius: 50px 14px 14px 50px; }
.quan-pit.right { border-radius: 14px 50px 50px 14px; }

.dan-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.dan-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(56px, 1fr));
  gap: 8px;
}

.dan-pit {
  height: 76px;
  background: #fffbeb;
  border: 2.5px solid #b45309;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
}

.dan-pit.selectable:hover {
  background: #fde047;
  border-color: #dc2626;
}

.dan-pit.selected {
  background: #fbbf24;
  border-color: #991b1b;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.35);
}

/* ================= 7. BÀI MA SÓI WOLVESVILLE EDITION ================= */
.masoi-panel.night-mode {
  background: linear-gradient(165deg, #0b1120 0%, #1e1b4b 60%, #2a0e2e 100%);
  border-color: #818cf8;
}

.ww-main-split {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 16px;
  align-items: stretch;
}

@media (max-width: 900px) {
  .ww-main-split {
    grid-template-columns: 1fr;
  }
}

.ww-timer-strip {
  background: rgba(0, 0, 0, 0.38);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 12px;
  padding: 8px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ww-countdown-pill {
  background: #dc2626;
  color: #fff;
  font-weight: 900;
  font-size: 0.92rem;
  padding: 4px 12px;
  border-radius: 99px;
  min-width: 68px;
  text-align: center;
}

.masoi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}

@media (max-width: 580px) {
  .masoi-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.villager-seat {
  background: rgba(255, 255, 255, 0.09);
  border: 2px solid rgba(251, 191, 36, 0.35);
  border-radius: 14px;
  padding: 10px 6px;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
}

.villager-seat:hover:not(.dead) {
  transform: translateY(-2px);
  border-color: var(--gold-bright);
}

.villager-seat.my-seat {
  box-shadow: inset 0 0 0 1.5px #38bdf8;
}

.villager-seat.selected-target {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.24);
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.5);
}

.villager-seat.dead {
  opacity: 0.45;
  filter: grayscale(0.85);
  border-style: dashed;
  cursor: default;
}

.seat-num-tag {
  position: absolute;
  top: 5px;
  left: 6px;
  background: rgba(0, 0, 0, 0.58);
  color: var(--gold-bright);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 6px;
}

.vote-count-badge {
  position: absolute;
  top: 5px;
  right: 6px;
  background: #ef4444;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 99px;
}

.ww-chat-panel {
  background: rgba(12, 10, 24, 0.82);
  border: 1.8px solid rgba(251, 191, 36, 0.45);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  height: 490px;
}

.ww-chat-head {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(251, 191, 36, 0.28);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--gold-bright);
}

.ww-chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.84rem;
}

.ww-msg {
  padding: 6px 9px;
  border-radius: 9px;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.07);
  word-break: break-word;
}

.ww-msg.sys {
  background: rgba(251, 191, 36, 0.14);
  border-left: 3px solid var(--gold-bright);
  color: #fde68a;
  font-weight: 600;
}

.ww-msg.wolf {
  background: rgba(220, 38, 38, 0.22);
  border-left: 3px solid #ef4444;
  color: #fecaca;
}

.ww-msg.dead {
  background: rgba(148, 163, 184, 0.16);
  border-left: 3px solid #94a3b8;
  color: #cbd5e1;
  font-style: italic;
}

.ww-chat-input-bar {
  display: flex;
  gap: 6px;
  padding: 9px;
  border-top: 1px solid rgba(251, 191, 36, 0.28);
}

.ww-chat-input-bar .tet-input {
  margin-bottom: 0;
  padding: 9px 11px;
  font-size: 0.88rem;
}

/* Modal QR */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 2, 2, 0.8);
  backdrop-filter: blur(5px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-box {
  position: relative;
  width: 100%;
  max-width: 430px;
  background: linear-gradient(165deg, #690b0b, #360505);
  border: 2.5px solid var(--gold-bright);
  border-radius: 22px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.7);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: rgba(255,255,255,0.12);
  color: #fffbeb;
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

.tet-seal-sm {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--gold-bright);
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.modal-sub {
  font-size: 0.85rem;
  color: #fef3c7;
  margin: 6px 0 14px;
}

.qr-frame {
  background: #ffffff;
  padding: 14px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 4px solid var(--gold-bright);
  margin-bottom: 12px;
}

.room-code-big-wrap {
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.room-code-big-wrap strong {
  font-size: 1.65rem;
  color: var(--gold-bright);
  letter-spacing: 3px;
  margin-left: 6px;
}

.modal-btn-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Chat Drawer */
.chat-drawer {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: min(350px, calc(100vw - 28px));
  height: 430px;
  background: rgba(45, 7, 7, 0.97);
  border: 2px solid var(--gold-bright);
  border-radius: 18px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 40px rgba(0,0,0,0.65);
}

.chat-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-gold);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--gold-bright);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.86rem;
}

.chat-bubble {
  background: rgba(255,255,255,0.08);
  padding: 7px 10px;
  border-radius: 10px;
  line-height: 1.4;
}

.chat-bubble strong {
  color: var(--gold-bright);
}

.chat-form {
  display: flex;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid var(--border-gold);
}

.chat-form .tet-input {
  margin-bottom: 0;
  padding: 8px 10px;
}

/* Floating Reactions & Toasts */
.floating-reactions {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 70;
  overflow: hidden;
}

.float-emoji {
  position: absolute;
  bottom: 40px;
  font-size: 2.3rem;
  animation: floatUp 2.6s ease-out forwards;
}

@keyframes floatUp {
  0% { transform: translateY(0) scale(0.7); opacity: 1; }
  80% { opacity: 1; }
  100% { transform: translateY(-75vh) scale(1.3); opacity: 0; }
}

.toast-container {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast-item {
  background: rgba(30, 5, 5, 0.95);
  border: 1.5px solid var(--gold-bright);
  color: #fffbeb;
  padding: 9px 16px;
  border-radius: 99px;
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(0,0,0,0.45);
  white-space: nowrap;
}

/* ================= LOGIN GATE & MAIN LOBBY & ROOM STATUS ================= */
.user-pill-top {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(95, 16, 16, 0.85);
  border: 1.5px solid var(--border-gold);
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 0.85rem;
}

.btn-edit-inline {
  background: transparent;
  color: var(--gold-pale);
  font-size: 0.85rem;
  padding: 0 3px;
}

.login-gate-wrap {
  max-width: 500px;
  margin: 18px auto 0;
  text-align: center;
}

.hero-main-title {
  font-family: 'Noto Serif', serif;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--gold-bright);
  text-shadow: 0 4px 18px rgba(0,0,0,0.55);
  margin-bottom: 6px;
}

.login-gate-card {
  text-align: left;
  margin-top: 16px;
}

.login-hint {
  font-size: 0.86rem;
  color: #fef3c7;
  margin-bottom: 14px;
}

.login-error {
  color: #fca5a5;
  font-size: 0.82rem;
  font-weight: 700;
  margin: -8px 0 12px;
}

.lobby-welcome-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.lobby-welcome-bar h2 {
  font-family: 'Noto Serif', serif;
  font-size: 1.45rem;
}

.lobby-online-pill {
  background: rgba(5, 150, 105, 0.22);
  border: 1px solid #34d399;
  color: #d1fae5;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 99px;
}

.lobby-modes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
}

.mode-card {
  display: flex;
  flex-direction: column;
}

.quickplay-card {
  border-color: var(--gold-bright);
  background: linear-gradient(155deg, rgba(115, 22, 16, 0.96), rgba(52, 7, 7, 0.98));
}

.mode-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 99px;
  margin-bottom: 10px;
}

.mode-badge.gold {
  background: var(--gold-bright);
  color: #3b0707;
}

.mode-badge.crimson {
  background: rgba(239, 68, 68, 0.25);
  border: 1px solid #fca5a5;
  color: #fee2e2;
}

.mode-desc {
  font-size: 0.9rem;
  line-height: 1.5;
  color: #fef3c7;
  margin-bottom: 14px;
}

.tet-select {
  cursor: pointer;
}

.tet-select option {
  background: #3b0707;
  color: #fffbeb;
}

.lobby-section-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 14px;
}

.lobby-section-head h3 {
  font-family: 'Noto Serif', serif;
  color: var(--gold-bright);
  font-size: 1.25rem;
}

.lobby-section-head span {
  font-size: 0.84rem;
  color: var(--cream-warm);
}

.tile-btn-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 6px;
}

.room-status-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(90deg, rgba(88, 14, 14, 0.95), rgba(48, 7, 7, 0.95));
  border: 2px solid var(--gold-bright);
  border-radius: 16px;
  padding: 11px 16px;
  margin-bottom: 10px;
}

.room-code-display {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.room-code-display strong {
  font-size: 1.45rem;
  color: var(--gold-bright);
  letter-spacing: 3px;
  background: rgba(0, 0, 0, 0.35);
  padding: 2px 12px;
  border-radius: 8px;
  border: 1px dashed rgba(251, 191, 36, 0.55);
}

.room-open-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.open-status-pill {
  font-size: 0.82rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 99px;
}

.open-status-pill.open {
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid #34d399;
  color: #d1fae5;
}

.open-status-pill.closed {
  background: rgba(239, 68, 68, 0.22);
  border: 1px solid #f87171;
  color: #fee2e2;
}

.match-spinner {
  font-size: 3rem;
  margin-bottom: 8px;
  display: inline-block;
  animation: spinPulse 1.3s ease-in-out infinite;
}

@keyframes spinPulse {
  0% { transform: scale(0.92) rotate(-8deg); }
  50% { transform: scale(1.12) rotate(8deg); }
  100% { transform: scale(0.92) rotate(-8deg); }
}

/* === Cập nhật: nhạc nền ẩn hoàn toàn dưới nền, nhãn Bot, lớp hiệu ứng nền === */
#fx-canvas { opacity: 0.55; }
main.screen { position: relative; z-index: 2; }
.bot-tag { font-size: 0.62rem; font-weight: 800; padding: 1px 6px; border-radius: 99px; border: 1px solid rgba(251,191,36,.5); color: #fde68a; background: rgba(0,0,0,.35); }
#bgm-hidden-host { position: fixed; left: -9999px; top: -9999px; width: 2px; height: 2px; opacity: 0; pointer-events: none; overflow: hidden; z-index: -1; }
.room-status-header { padding-top: 8px; padding-bottom: 8px; }
.reaction-strip { flex-wrap: nowrap; overflow-x: auto; }

/* === Đếm ngược 8s Ghép Bàn & Đồng hồ Suy Nghĩ / Trả Lời Câu Hỏi === */
.match-countdown-wrap {
  margin: 12px auto 8px;
  max-width: 280px;
}

.match-countdown-circle {
  width: 68px;
  height: 68px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.25), rgba(127, 29, 29, 0.85));
  border: 3px solid var(--gold-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--gold-bright);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.35);
}

.match-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 99px;
  overflow: hidden;
}

.match-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #ef4444);
  border-radius: 99px;
  transition: width 0.95s linear;
}

.think-timer-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-radius: 12px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.think-timer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #fde68a;
}

.think-timer-badge {
  background: rgba(245, 158, 11, 0.25);
  border: 1px solid var(--gold-bright);
  color: #fffbeb;
  font-weight: 900;
  font-size: 0.84rem;
  padding: 2px 10px;
  border-radius: 99px;
  white-space: nowrap;
}

.think-timer-badge.urgent {
  background: #dc2626;
  border-color: #fca5a5;
  color: #ffffff;
  animation: urgentPulse 0.55s ease-in-out infinite alternate;
}

@keyframes urgentPulse {
  from { transform: scale(1); }
  to { transform: scale(1.08); }
}

.think-timer-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 99px;
  overflow: hidden;
}

.think-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, #34d399, #fbbf24);
  border-radius: 99px;
  transition: width 0.9s linear;
}

.think-timer-fill.urgent {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

/* === KHUNG ĐẾM NGƯỢC TẾT NGUYÊN ĐÁN & ICON BÁNH CHƯNG RẢI RÁC === */
.tet-countdown-frame {
  position: relative;
  background: linear-gradient(145deg, rgba(136, 19, 19, 0.96), rgba(68, 9, 9, 0.98));
  border: 2.5px solid var(--gold-bright);
  border-radius: 20px;
  padding: 16px 20px 18px;
  margin: 14px auto 18px;
  max-width: 680px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), inset 0 0 18px rgba(251, 191, 36, 0.16);
  overflow: visible;
}

.tet-countdown-frame.lobby-countdown {
  max-width: 100%;
  margin: 0 0 22px;
}

.tet-countdown-frame::before,
.tet-countdown-frame::after {
  content: "❖";
  position: absolute;
  top: 6px;
  color: var(--gold-bright);
  font-size: 0.85rem;
  opacity: 0.85;
}
.tet-countdown-frame::before { left: 10px; }
.tet-countdown-frame::after { right: 10px; }

.tet-cd-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Noto Serif', serif;
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--gold-pale);
  letter-spacing: 0.6px;
  margin-bottom: 12px;
  background: rgba(45, 5, 5, 0.6);
  padding: 4px 14px;
  border-radius: 99px;
  border: 1px solid rgba(251, 191, 36, 0.45);
}

.tet-cd-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(62px, 108px));
  justify-content: center;
  gap: 10px;
  position: relative;
  z-index: 2;
}

.tet-cd-box {
  background: linear-gradient(180deg, #3b0606 0%, #1f0303 100%);
  border: 1.8px solid var(--gold-bright);
  border-radius: 14px;
  padding: 10px 6px 8px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.tet-cd-num {
  font-family: 'Noto Serif', serif;
  font-size: clamp(1.35rem, 3.2vw, 1.95rem);
  font-weight: 900;
  color: var(--gold-bright);
  line-height: 1.1;
  text-shadow: 0 2px 10px rgba(251, 191, 36, 0.45);
}

.tet-cd-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: #fde68a;
  letter-spacing: 1px;
  margin-top: 4px;
  text-transform: uppercase;
}

.tet-cd-sub {
  font-size: 0.78rem;
  color: #fef3c7;
  margin-top: 10px;
  opacity: 0.92;
}

/* Các icon Bánh Chưng nhỏ rải rác xung quanh khung */
.banh-chung-deco {
  position: absolute;
  width: 26px;
  height: 26px;
  pointer-events: none;
  z-index: 3;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45));
  animation: banhChungFloat 3.6s ease-in-out infinite alternate;
}

.banh-chung-deco.bc-1 { top: -12px; left: 24px; transform: rotate(-12deg); animation-delay: 0s; }
.banh-chung-deco.bc-2 { top: -11px; right: 28px; width: 24px; height: 24px; transform: rotate(14deg); animation-delay: 0.6s; }
.banh-chung-deco.bc-3 { bottom: -12px; left: 38px; width: 23px; height: 23px; transform: rotate(9deg); animation-delay: 1.1s; }
.banh-chung-deco.bc-4 { bottom: -12px; right: 36px; width: 26px; height: 26px; transform: rotate(-15deg); animation-delay: 1.7s; }
.banh-chung-deco.bc-5 { top: 44%; left: -13px; width: 22px; height: 22px; transform: rotate(-20deg); animation-delay: 0.4s; }
.banh-chung-deco.bc-6 { top: 42%; right: -13px; width: 22px; height: 22px; transform: rotate(18deg); animation-delay: 1.3s; }
.banh-chung-deco.bc-7 { top: 18px; left: 10px; width: 17px; height: 17px; opacity: 0.88; transform: rotate(22deg); animation-delay: 0.9s; }
.banh-chung-deco.bc-8 { top: 18px; right: 10px; width: 17px; height: 17px; opacity: 0.88; transform: rotate(-18deg); animation-delay: 1.5s; }

@keyframes banhChungFloat {
  0% { margin-top: 0px; }
  100% { margin-top: -4px; }
}

/* ================= 8. GIẢI CHỮ XUÂN (WORDLE 6x6) ================= */
.gc-board-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 340px;
  margin: 0 auto 14px;
}

.gc-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.gc-tile {
  aspect-ratio: 1 / 1;
  min-height: 46px;
  border: 2px solid rgba(251, 191, 36, 0.45);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.32rem;
  font-weight: 900;
  color: #fffbeb;
  text-transform: uppercase;
  user-select: none;
}

@keyframes gcFlip {
  0% { transform: rotateX(0deg); }
  50% { transform: rotateX(90deg); }
  100% { transform: rotateX(0deg); }
}

.gc-shake {
  animation: gcShakeAnim 0.28s ease;
}

@keyframes gcShakeAnim {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-7px); }
  75% { transform: translateX(7px); }
}

.gc-keyboard {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 520px;
  margin: 0 auto;
}

.gc-kb-row {
  display: flex;
  justify-content: center;
  gap: 4px;
}

.gc-key {
  flex: 1;
  min-width: 28px;
  min-height: 46px;
  border-radius: 8px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fffbeb;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 0 4px;
}

.gc-key.gc-key-wide {
  flex: 1.55;
  font-size: 0.78rem;
}

/* ================= 9. BÀI LỘC XUÂN (108 LÁ) ================= */
.bl-seats-ring {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.bl-seat-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.32);
  border: 1.8px solid rgba(251, 191, 36, 0.35);
  border-radius: 14px;
  padding: 7px 11px;
}

.bl-seat-pill.active-turn {
  border-color: #fbbf24;
  background: rgba(245, 158, 11, 0.2);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.45);
}

.bl-center-table {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  background: radial-gradient(circle, rgba(120, 18, 18, 0.65), rgba(30, 5, 5, 0.82));
  border: 2px dashed rgba(251, 191, 36, 0.45);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 12px;
}

.bl-deck-pile {
  width: 88px;
  height: 126px;
  border-radius: 14px;
  background: linear-gradient(145deg, #7f1d1d, #450a0a);
  border: 2.5px solid var(--gold-bright);
  color: var(--gold-pale);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
}

.bl-deck-pile.can-draw {
  border-color: #fde047;
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.45);
  cursor: pointer;
}

.bl-top-card,
.bl-card {
  width: 88px;
  min-width: 82px;
  height: 126px;
  border-radius: 14px;
  border: 2.5px solid #fffbeb;
  color: #ffffff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 7px 8px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45);
  position: relative;
  user-select: none;
}

.bl-fly-in {
  animation: blFlyIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes blFlyIn {
  from { transform: translateY(22px) scale(0.88); opacity: 0.4; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.bl-card-corner {
  font-size: 0.85rem;
  text-align: left;
}

.bl-card-center {
  font-family: 'Noto Serif', serif;
  font-size: 1.35rem;
  font-weight: 900;
  text-align: center;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
}

.bl-card-foot {
  font-size: 0.64rem;
  font-weight: 800;
  text-align: right;
  opacity: 0.92;
  letter-spacing: 0.5px;
}

.bl-table-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.bl-color-indicator {
  padding: 6px 12px;
  border-radius: 99px;
  border: 1.5px solid #fffbeb;
  color: #fff;
  font-size: 0.82rem;
}

.bl-wild-picker {
  background: rgba(20, 4, 4, 0.92);
  border: 2px solid var(--gold-bright);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  margin-bottom: 10px;
}

.bl-hand-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 8px 8px;
  scroll-snap-type: x mandatory;
}

.bl-card {
  scroll-snap-align: center;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.bl-card.playable {
  cursor: pointer;
  transform: translateY(-6px);
  border-color: #fde047;
  box-shadow: 0 10px 20px rgba(251, 191, 36, 0.35);
}

.bl-card.playable:hover {
  transform: translateY(-11px) scale(1.03);
}

.bl-card.dimmed {
  opacity: 0.46;
  filter: saturate(0.65);
}

.bl-card.selected-wild {
  outline: 3px solid #fde047;
  transform: translateY(-12px);
}
