/* ==============================================================================
   THỬ THÁCH BÀN NHẬU - FULL-SCREEN TABBED 120 FPS MOBILE APP
   ============================================================================== */
:root {
  --primary: #ff007a;
  --primary-glow: rgba(255, 0, 122, 0.4);
  --secondary: #00f0ff;
  --secondary-glow: rgba(0, 240, 255, 0.4);
  --accent-gold: #ffd700;
  --accent-purple: #7928ca;
  --accent-green: #00ff88;
  --bg-dark: #070913;
  --card-bg: rgba(18, 22, 42, 0.85);
  --card-border: rgba(255, 255, 255, 0.12);
  --text-main: #ffffff;
  --text-dim: #94a3b8;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Oswald', sans-serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  user-select: none;
  -webkit-user-select: none;
  position: fixed;
}

/* BACKGROUND LIGHT EFFECTS */
.bg-glow-top {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  filter: blur(50px);
  pointer-events: none;
  z-index: 0;
}
.bg-glow-bottom {
  position: absolute;
  bottom: -100px;
  right: -50px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, var(--secondary-glow) 0%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
  z-index: 0;
}

/* MAIN APP SHELL */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
  padding-top: max(8px, var(--safe-top));
  padding-bottom: max(10px, var(--safe-bottom));
  padding-left: 12px;
  padding-right: 12px;
  position: relative;
  z-index: 1;
  max-width: 500px;
  margin: 0 auto;
}

/* TOP HEADER */
.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  flex-shrink: 0;
}
.brand-logo {
  display: flex;
  align-items: center;
  gap: 6px;
}
.brand-icon {
  font-size: 20px;
}
.brand-text h1 {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #fff 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-text p {
  font-size: 9px;
  color: var(--text-dim);
  font-weight: 600;
}

.header-buttons {
  display: flex;
  gap: 6px;
}
.icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  color: #fff;
  padding: 5px 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  gap: 4px;
}

/* UNIFIED PLAYERS ROW */
.players-row {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.players-row::-webkit-scrollbar { display: none; }

.player-avatar-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.player-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}
.player-badge.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25) 0%, rgba(0, 119, 255, 0.35) 100%);
  color: #fff;
  border-color: var(--secondary);
  box-shadow: 0 4px 15px var(--secondary-glow);
  transform: scale(1.05);
}
.player-score {
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 5px;
  border-radius: 8px;
  font-size: 10px;
  color: var(--accent-gold);
}
.btn-edit-players {
  background: rgba(0, 240, 255, 0.12);
  border: 1px dashed var(--secondary);
  color: var(--secondary);
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==============================================================================
   FULL-SCREEN TAB VIEWS
   ============================================================================== */
.tab-view-container {
  flex: 1;
  position: relative;
  width: 100%;
  overflow: hidden;
  margin-bottom: 8px;
}

.tab-view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  flex-direction: column;
  justify-content: space-between;
}
.tab-view.active-tab {
  display: flex;
  animation: fadeInTab 0.25s ease-out;
}
@keyframes fadeInTab {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

/* ----------------- TAB 1: RÚT THẺ ----------------- */
.mode-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 6px;
  flex-shrink: 0;
}
.mode-pills::-webkit-scrollbar { display: none; }
.mode-pill {
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  color: var(--text-dim);
  white-space: nowrap;
  cursor: pointer;
}
.mode-pill.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.deck-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  perspective: 1200px;
  margin: 6px 0;
}

.swipe-card {
  width: 100%;
  height: 100%;
  border-radius: 24px;
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px 18px;
  background: linear-gradient(145deg, rgba(25, 30, 58, 0.95), rgba(12, 15, 32, 0.98));
  border: 2px solid rgba(0, 240, 255, 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 240, 255, 0.2);
  backdrop-filter: blur(20px);
  cursor: pointer;
  touch-action: none;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
}

.card-back-stack {
  width: 94%;
  height: 96%;
  border-radius: 24px;
  position: absolute;
  background: rgba(15, 18, 38, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transform: translateY(10px) scale(0.96);
  z-index: -1;
  pointer-events: none;
}

.card-header-tag {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.mode-tag {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(255, 0, 122, 0.15);
  color: var(--primary);
  border: 1px solid rgba(255, 0, 122, 0.3);
  text-transform: uppercase;
}
.drink-punish-tag {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  gap: 4px;
}

.card-target-player {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--accent-gold);
  text-align: center;
  letter-spacing: 1px;
  text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.card-body-text {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  color: #ffffff;
  margin: auto 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.card-footer-tip {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
}

/* ----------------- TAB 2: VÒNG QUAY ----------------- */
.wheel-tab-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.wheel-turn-card {
  width: 100%;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 0, 122, 0.2));
  border: 1px solid var(--accent-gold);
  border-radius: 14px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--accent-gold);
  font-weight: 700;
  flex-shrink: 0;
}
.wheel-wrapper {
  position: relative;
  width: 270px;
  height: 270px;
  margin: auto 0;
}
.wheel-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 40px rgba(0, 240, 255, 0.3);
}
.wheel-pin {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 22px solid var(--accent-gold);
  z-index: 10;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.8));
}
.wheel-center-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #ffffff;
  color: #000;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
  cursor: pointer;
}

/* ----------------- TAB 3: XÚC XẮC FULL SCREEN ----------------- */
.dice-tab-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}
.dice-turn-banner {
  width: 100%;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 0, 122, 0.2));
  border: 1px solid var(--accent-gold);
  border-radius: 14px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dice-turn-text {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--accent-gold);
  font-weight: 700;
}

.dice-rules-legend {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  width: 100%;
  margin: 4px 0;
  flex-shrink: 0;
}
.rule-item {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 4px;
  text-align: center;
  font-size: 10px;
  color: var(--text-dim);
}
.rule-item b {
  color: #fff;
  display: block;
  font-size: 11px;
}

.dice-stage-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  margin: auto 0;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.beer-glass-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.beer-glass {
  width: 68px;
  height: 90px;
  border: 3px solid rgba(255, 255, 255, 0.7);
  border-top: none;
  border-radius: 0 0 16px 16px;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}
.beer-liquid {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 50%;
  background: linear-gradient(180deg, #ffe600 0%, #ff9900 100%);
  transition: height 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.beer-foam {
  position: absolute;
  top: -6px;
  left: 0;
  width: 100%;
  height: 8px;
  background: #ffffff;
  border-radius: 4px;
}
.beer-level-badge {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-gold);
  margin-top: 6px;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 8px;
  border-radius: 99px;
}

/* FLOATING CHANGE INDICATOR OVER GLASS */
.beer-floating-change {
  position: absolute;
  top: -14px;
  right: -10px;
  background: #ff007a;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 99px;
  box-shadow: 0 0 10px rgba(255,0,122,0.8);
  display: none;
  animation: popBadge 0.4s ease-out;
}
@keyframes popBadge {
  0% { transform: scale(0); }
  70% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.dice-duo {
  display: flex;
  gap: 12px;
  perspective: 600px;
}
.dice {
  width: 66px;
  height: 66px;
  background: linear-gradient(145deg, #ffffff, #e2e8f0);
  color: #0f172a;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(0,0,0,0.5), inset 0 2px 4px rgba(255,255,255,0.8);
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.dice.rolling {
  animation: diceRoll 0.6s ease-in-out;
}
@keyframes diceRoll {
  0% { transform: rotate(0deg) scale(0.8); }
  50% { transform: rotate(360deg) scale(1.2); }
  100% { transform: rotate(720deg) scale(1); }
}

/* 3-STEP VISUAL METRIC STRIP (TRƯỚC -> THAY ĐỔI -> CÒN LẠI) */
.beer-metric-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 6px 0 2px;
}
.metric-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 4px 10px;
  border-radius: 10px;
}
.metric-label {
  font-size: 9px;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 700;
}
.metric-value {
  font-size: 14px;
  font-weight: 900;
}
.metric-arrow {
  font-size: 14px;
  color: var(--text-dim);
}

.dice-action-card {
  width: 100%;
  background: linear-gradient(145deg, rgba(25, 30, 58, 0.95), rgba(15, 18, 38, 0.98));
  border: 1.5px solid var(--secondary);
  border-radius: 16px;
  padding: 10px 12px;
  text-align: center;
  margin-bottom: 6px;
  box-shadow: 0 4px 15px var(--secondary-glow);
  flex-shrink: 0;
}
.dice-action-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 2px;
}
.dice-action-desc {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.35;
}

.inline-assign-box {
  width: 100%;
  background: rgba(255, 0, 122, 0.1);
  border: 1px dashed var(--primary);
  border-radius: 14px;
  padding: 8px 10px;
  margin-bottom: 6px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.inline-assign-box.show { display: flex; }
.inline-assign-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
}
.inline-assign-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.assign-chip {
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
}

/* COMMON TURN CARD */
.turn-header-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  padding: 8px 12px;
  border-radius: 12px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 14px;
  letter-spacing: 0.5px;
  color: var(--accent-gold);
  flex-shrink: 0;
}

/* ==============================================================================
   TAB 4: BOM HẸN GIỜ (BOMB PARTY)
   ============================================================================== */
.bomb-tab-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: 100%;
  gap: 8px;
}

.bomb-topic-card {
  width: 100%;
  background: linear-gradient(145deg, rgba(30, 20, 50, 0.95), rgba(15, 12, 30, 0.98));
  border: 1.5px solid var(--primary);
  border-radius: 16px;
  padding: 10px 14px;
  text-align: center;
  box-shadow: 0 4px 20px var(--primary-glow);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.topic-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.topic-content {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.3;
}
.topic-refresh-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  color: var(--secondary);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 2px;
}

.bomb-stage-area {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 180px;
}
.bomb-animation-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 180px;
  height: 180px;
}
.bomb-icon-svg {
  font-size: 85px;
  filter: drop-shadow(0 0 25px rgba(255, 0, 122, 0.6));
  transition: transform 0.15s ease;
  user-select: none;
}
.bomb-animation-container.ticking .bomb-icon-svg {
  animation: bombShake 0.4s infinite alternate ease-in-out;
}
.bomb-animation-container.fast-ticking .bomb-icon-svg {
  animation: bombShake 0.15s infinite alternate ease-in-out;
  filter: drop-shadow(0 0 35px #ff0055);
}
@keyframes bombShake {
  0% { transform: scale(1) rotate(-4deg); }
  100% { transform: scale(1.1) rotate(4deg); }
}

.bomb-fuse-spark {
  position: absolute;
  top: 15px;
  right: 45px;
  font-size: 24px;
  opacity: 0;
  pointer-events: none;
}
.bomb-animation-container.ticking .bomb-fuse-spark {
  opacity: 1;
  animation: sparkFlicker 0.2s infinite alternate;
}
@keyframes sparkFlicker {
  0% { transform: scale(0.8) translate(0, 0); opacity: 0.7; }
  100% { transform: scale(1.3) translate(2px, -2px); opacity: 1; filter: drop-shadow(0 0 10px #ffd700); }
}

.bomb-status-pulse {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 2px solid transparent;
  pointer-events: none;
}
.bomb-animation-container.ticking .bomb-status-pulse {
  border-color: var(--primary);
  animation: pulseRing 1s infinite cubic-bezier(0.2, 0.8, 0.4, 1);
}
@keyframes pulseRing {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

.bomb-timer-label {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-dim);
}
.bomb-animation-container.ticking .bomb-timer-label {
  color: var(--primary);
  animation: blinkText 0.8s infinite alternate;
}
@keyframes blinkText {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

.btn-bomb-pass {
  width: 100%;
  background: linear-gradient(135deg, #ff0055 0%, #ff5500 100%);
  color: #fff;
  border: none;
  padding: 16px;
  border-radius: 18px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 30px rgba(255, 0, 85, 0.5);
  flex-shrink: 0;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn-bomb-pass:active {
  transform: scale(0.97);
}

/* ==============================================================================
   TAB 5: XOAY CHAI (SPIN THE BOTTLE)
   ============================================================================== */
.bottle-tab-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: 100%;
  gap: 8px;
}

.bottle-stage-area {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 250px;
  overflow: visible;
}

.bottle-players-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

.bottle-player-seat {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(18, 22, 42, 0.9);
  border: 1.5px solid var(--card-border);
  padding: 4px 8px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 95px;
  pointer-events: auto;
  cursor: pointer;
  z-index: 6;
}
.bottle-player-seat .seat-name {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60px;
}
.bottle-player-seat .seat-avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}
.bottle-player-seat.targeted {
  border-color: #ff0055 !important;
  background: linear-gradient(135deg, rgba(255, 0, 85, 0.4), rgba(121, 40, 202, 0.4)) !important;
  box-shadow: 0 0 25px rgba(255, 0, 85, 0.8) !important;
  transform: translate(-50%, -50%) scale(1.18) !important;
  z-index: 25 !important;
  animation: pulseSeat 0.6s infinite alternate ease-in-out;
}
@keyframes pulseSeat {
  0% { transform: translate(-50%, -50%) scale(1.15); }
  100% { transform: translate(-50%, -50%) scale(1.25); }
}

.bottle-canvas-wrapper {
  position: relative;
  width: 250px;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
}
.bottle-canvas {
  width: 250px;
  height: 250px;
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.8));
}

.bottle-result-card {
  width: 100%;
  background: linear-gradient(145deg, rgba(20, 35, 55, 0.95), rgba(12, 20, 35, 0.98));
  border: 1.5px solid var(--secondary);
  border-radius: 16px;
  padding: 10px 14px;
  text-align: center;
  box-shadow: 0 4px 20px var(--secondary-glow);
  flex-shrink: 0;
}
.bottle-result-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--secondary);
  margin-bottom: 2px;
}
.bottle-result-desc {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  line-height: 1.35;
}

/* ==============================================================================
   TAB 6: CHẠM TAY CHỌN NGƯỜI (FINGER ROULETTE)
   ============================================================================== */
.finger-tab-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: 100%;
  gap: 8px;
}

.finger-header-card {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  padding: 8px 12px;
  border-radius: 14px;
  text-align: center;
  flex-shrink: 0;
}
.finger-header-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-gold);
}
.finger-header-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

.finger-touch-surface {
  flex: 1;
  width: 100%;
  background: radial-gradient(circle at center, rgba(30, 20, 60, 0.6) 0%, rgba(10, 12, 25, 0.95) 100%);
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: crosshair;
  min-height: 260px;
}

.finger-center-guide {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
  opacity: 0.7;
  transition: opacity 0.3s ease;
  padding: 20px;
}
.finger-center-guide.hidden {
  opacity: 0;
}
.guide-icon {
  font-size: 36px;
  margin-bottom: 6px;
  animation: floatFinger 1.5s infinite alternate ease-in-out;
}
@keyframes floatFinger {
  0% { transform: translateY(0); }
  100% { transform: translateY(-8px); }
}
.guide-text {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--secondary);
  letter-spacing: 1px;
}
.guide-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Touch energy node element */
.touch-energy-node {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: transform 0.1s ease;
}
.touch-node-core {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 20px currentColor;
}
.touch-node-ring {
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 3px solid currentColor;
  animation: energySpin 1.5s infinite linear;
  box-shadow: 0 0 15px currentColor;
}
.touch-energy-node.selected .touch-node-ring {
  border-color: #ff0055 !important;
  animation: pulseLoser 0.25s infinite alternate ease-in-out !important;
  box-shadow: 0 0 35px #ff0055 !important;
}
@keyframes energySpin {
  0% { transform: rotate(0deg) scale(0.9); }
  50% { transform: rotate(180deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(0.9); }
}
@keyframes pulseLoser {
  0% { transform: scale(1); }
  100% { transform: scale(1.4); }
}

.finger-countdown-overlay {
  position: absolute;
  font-family: var(--font-display);
  font-size: 75px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 0 30px var(--primary);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 20;
}
.finger-countdown-overlay.show {
  opacity: 1;
  transform: scale(1);
}

.finger-footer-card {
  width: 100%;
  flex-shrink: 0;
}

/* ==============================================================================
   UPDATED BOTTOM NAVIGATION BAR (6 TABS RESPONSIVE)
   ============================================================================== */
.bottom-nav-bar {
  display: flex;
  background: rgba(15, 18, 38, 0.95);
  border: 1px solid var(--card-border);
  border-radius: 18px;
  padding: 5px 6px;
  gap: 4px;
  flex-shrink: 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.8);
  overflow-x: auto;
  scrollbar-width: none;
}
.bottom-nav-bar::-webkit-scrollbar { display: none; }

.nav-tab-item {
  flex: 1;
  min-width: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 2px;
  border-radius: 12px;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  background: transparent;
  gap: 2px;
  white-space: nowrap;
}
.nav-tab-item.active-nav {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary-action {
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent-purple) 100%);
  color: #fff;
  border: none;
  padding: 13px;
  border-radius: 16px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 25px var(--primary-glow);
  flex-shrink: 0;
}

/* PLAYER SETUP MODAL */
.bottom-sheet {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  z-index: 9999;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.bottom-sheet.open { display: flex; }
.sheet-content {
  background: #0f1325;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  width: 100%;
  max-width: 500px;
  padding: 16px 16px max(20px, var(--safe-bottom));
  border-top: 2px solid var(--card-border);
  box-shadow: 0 -15px 50px rgba(0,0,0,0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  max-height: 90vh;
  overflow-y: auto;
}
.sheet-handle {
  width: 40px; height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 99px; margin-bottom: 10px;
}
.sheet-header {
  width: 100%; display: flex;
  justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.sheet-title {
  font-family: var(--font-display); font-size: 20px; color: var(--accent-gold);
}
.sheet-close-btn {
  background: rgba(255, 255, 255, 0.1); border: none; color: #fff;
  width: 30px; height: 30px; border-radius: 50%; font-size: 15px; cursor: pointer;
}

.player-input-box {
  display: flex; gap: 8px; width: 100%; margin-bottom: 14px;
}
.player-input-box input {
  flex: 1; background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border); padding: 12px 14px;
  border-radius: 12px; color: #fff; font-size: 14px; outline: none;
}
.player-input-box button {
  background: var(--secondary); color: #000; border: none;
  padding: 12px 18px; border-radius: 12px; font-weight: 800; font-size: 14px; cursor: pointer;
}
.player-list-container {
  width: 100%; display: flex; flex-direction: column; gap: 8px;
  max-height: 220px; overflow-y: auto; margin-bottom: 14px;
}
.player-item-row {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255, 255, 255, 0.05); padding: 8px 12px; border-radius: 10px;
}
.player-name-text {
  font-size: 14px; font-weight: 700; color: #fff; display: flex; align-items: center; gap: 8px;
}
.btn-del-player {
  background: rgba(255, 59, 48, 0.2); border: 1px solid rgba(255, 59, 48, 0.4);
  color: #ff3b30; width: 26px; height: 26px; border-radius: 6px; cursor: pointer;
}
