/* ═══════════════════════════════════════════════════════════════════════
   PINKTRIP HOLD'EM — TELEGRAM MINI APP
   A polished, mobile-first poker UI
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Reset & Base ─────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Colors — PinkTrip palette */
  --bg-dark: #0e0812;
  --bg-card: #150d1a;
  --felt-green: #1a6b2a;
  --felt-dark: #0d4a1a;
  --felt-light: #2d8a3d;
  --wood-dark: #2a0e2a;
  --wood-light: #5c2060;
  --wood-rim: #4a1850;
  --gold: #ff69b4;
  --gold-dim: #d44a8f;
  --card-red: #e53935;
  --card-black: #1a1a2e;
  --chip-white: #f0f0f0;
  --accent-blue: #e040a0;
  --accent-green: #4CAF50;
  --accent-red: #f44336;
  --accent-orange: #ff69b4;
  --pink: #ff69b4;
  --pink-hot: #ff1493;
  --pink-glow: rgba(255, 105, 180, 0.3);
  --pink-dim: #c44a85;
  --text-primary: #ffffff;
  --text-secondary: #c0a0c0;
  --text-muted: #7a5a80;

  /* Sizes */
  --card-width: 48px;
  --card-height: 68px;
  --card-radius: 6px;

  /* Fonts */
  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  touch-action: manipulation;
}

#app {
  width: 100%;
  height: 100%;
  height: 100dvh;
  position: relative;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════════
   MENU SCREEN
   ═══════════════════════════════════════════════════════════════════════ */

.menu-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 24px;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255, 105, 180, 0.1) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(200, 50, 150, 0.06) 0%, transparent 40%),
    linear-gradient(180deg, #150d1a 0%, #0e0812 100%);
  animation: menuFadeIn 0.8s ease-out;
}

@keyframes menuFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.menu-logo {
  text-align: center;
  margin-bottom: 40px;
}

.menu-cards {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.menu-card {
  width: 60px;
  height: 84px;
  background: linear-gradient(145deg, #ffffff 0%, #f0f0f0 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), 0 0 30px rgba(255, 105, 180, 0.2);
  transition: transform 0.3s ease;
}

.menu-card:first-child {
  transform: rotate(-8deg) translateY(4px);
}

.menu-card:last-child {
  transform: rotate(8deg) translateY(4px);
}

.card-heart { color: var(--pink-hot); }
.card-diamond { color: var(--pink); }

.menu-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--pink-hot) 0%, #ffb6d9 40%, var(--pink) 70%, #fff0f5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1px;
  margin-bottom: 4px;
  text-shadow: none;
  filter: drop-shadow(0 0 12px rgba(255, 105, 180, 0.3));
}

.menu-subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
}

.menu-options {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.menu-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 16px;
}

.menu-option label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.option-selector {
  display: flex;
  align-items: center;
  gap: 12px;
}

.opt-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.opt-btn:active {
  background: rgba(255,255,255,0.15);
  transform: scale(0.9);
}

.opt-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  min-width: 60px;
  text-align: center;
}

.play-btn {
  width: 100%;
  max-width: 320px;
  height: 56px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--pink-hot) 0%, var(--pink) 50%, #ff85c0 100%);
  color: white;
  font-family: var(--font-main);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(255, 20, 147, 0.35);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.play-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,0.1) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.5s;
}

.play-btn:hover::before {
  transform: translateX(100%);
}

.play-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 10px rgba(76, 175, 80, 0.2);
}

.play-btn-icon {
  font-size: 14px;
}

/* ═══════════════════════════════════════════════════════════════════════
   GAME CONTAINER
   ═══════════════════════════════════════════════════════════════════════ */

.game-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(26, 107, 42, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(255, 105, 180, 0.04) 0%, transparent 40%),
    radial-gradient(ellipse at 80% 20%, rgba(200, 50, 150, 0.03) 0%, transparent 40%),
    var(--bg-dark);
  position: relative;
}

/* ─── Table Area ───────────────────────────────────────────────────── */

.table-area {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  min-height: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(26, 107, 42, 0.06) 0%, transparent 50%),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 40px,
      rgba(255,255,255,0.008) 40px,
      rgba(255,255,255,0.008) 41px
    ),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 40px,
      rgba(255,255,255,0.008) 40px,
      rgba(255,255,255,0.008) 41px
    );
}

/* ─── Poker Table ──────────────────────────────────────────────────── */

.poker-table {
  width: 88%;
  max-width: 420px;
  aspect-ratio: 1.8 / 1;
  border-radius: 50%;
  position: relative;
  background:
    radial-gradient(ellipse at 50% 50%,
      var(--felt-light) 0%,
      var(--felt-green) 35%,
      var(--felt-dark) 80%,
      #0a3a12 100%
    );
  border: 8px solid var(--wood-rim);
  box-shadow:
    inset 0 0 40px rgba(0,0,0,0.3),
    inset 0 0 80px rgba(0,0,0,0.1),
    0 0 0 3px var(--wood-dark),
    0 0 0 6px var(--wood-light),
    0 0 0 9px var(--wood-dark),
    0 8px 32px rgba(0,0,0,0.5),
    0 0 50px rgba(255, 105, 180, 0.08),
    0 0 80px rgba(26, 107, 42, 0.12);
  z-index: 1;
}

.table-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px;
}

/* ─── Community Cards ──────────────────────────────────────────────── */

.community-area {
  display: flex;
  gap: 5px;
  justify-content: center;
  align-items: center;
  min-height: var(--card-height);
  z-index: 2;
}

/* ─── Pot Display ──────────────────────────────────────────────────── */

.pot-display {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  background: rgba(0,0,0,0.35);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.3s ease;
  z-index: 2;
}

.pot-display.visible {
  opacity: 1;
  transform: scale(1);
}

.pot-label {
  color: var(--text-secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.pot-amount {
  color: var(--gold);
  font-weight: 700;
}

/* ─── Dealer Button ────────────────────────────────────────────────── */

.dealer-button {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffffff, #e0e0e0);
  color: #333;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  z-index: 10;
  opacity: 0;
  transition: all 0.5s ease;
  transform: translate(-50%, -50%);
}

.dealer-button.visible {
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════════════════════
   PLAYER SEATS
   ═══════════════════════════════════════════════════════════════════════ */

.player-seat {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  z-index: 5;
  transition: all 0.3s ease;
}

.seat-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(13, 18, 32, 0.9);
  border: 1.5px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 4px 10px 6px;
  min-width: 68px;
  backdrop-filter: blur(8px);
  transition: all 0.3s ease;
}

.player-seat.active-turn .seat-info {
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.3), 0 0 24px rgba(255, 215, 0, 0.1);
}

.player-seat.is-human .seat-info {
  border-color: var(--pink);
  background: rgba(30, 12, 25, 0.92);
}

.player-seat.is-human.active-turn .seat-info {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.4);
}

.player-seat.folded {
  opacity: 0.4;
}

.player-seat.winner .seat-info {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
  animation: winnerPulse 1s ease-in-out infinite;
}

@keyframes winnerPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(255, 215, 0, 0.4); }
  50%      { box-shadow: 0 0 30px rgba(255, 215, 0, 0.7); }
}

.player-seat.all-in .seat-info {
  border-color: var(--accent-red);
}

.seat-avatar {
  font-size: 20px;
  line-height: 1;
  margin-bottom: 1px;
}

.seat-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat-chips {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
}

.chip-icon {
  font-size: 10px;
}

.chip-count {
  font-variant-numeric: tabular-nums;
}

/* ─── Seat Cards ───────────────────────────────────────────────────── */

.seat-cards {
  display: flex;
  gap: 3px;
  margin-bottom: 2px;
}

/* Adjust cards for side/top seats to be smaller */
.player-seat:not(.seat-bottom) .seat-cards .card-wrapper {
  --card-width: 38px;
  --card-height: 54px;
  width: var(--card-width);
  height: var(--card-height);
}

.player-seat:not(.seat-bottom) .seat-cards .card-wrapper .card-rank {
  font-size: 11px;
}

.player-seat:not(.seat-bottom) .seat-cards .card-wrapper .card-suit-small {
  font-size: 9px;
}

.player-seat:not(.seat-bottom) .seat-cards .card-wrapper .card-center-suit {
  font-size: 18px;
}

/* ─── Seat Action Badge ───────────────────────────────────────────── */

.seat-action-badge {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%) translateY(-100%) scale(0.8);
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 20;
}

.seat-action-badge.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(-100%) scale(1);
}

.seat-action-badge.fold   { background: rgba(120,120,120,0.9); color: #ddd; }
.seat-action-badge.check  { background: rgba(33,150,243,0.9); color: #fff; }
.seat-action-badge.call   { background: rgba(76,175,80,0.9); color: #fff; }
.seat-action-badge.raise  { background: rgba(255,152,0,0.9); color: #fff; }
.seat-action-badge.all-in { background: rgba(244,67,54,0.9); color: #fff; }

/* ─── Seat Bet ─────────────────────────────────────────────────────── */

.seat-bet {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,215,0,0.3);
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.seat-bet.visible {
  opacity: 1;
}

/* ─── Dealer Indicator ─────────────────────────────────────────────── */

.dealer-indicator {
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   PLAYING CARDS
   ═══════════════════════════════════════════════════════════════════════ */

.card-wrapper {
  width: var(--card-width);
  height: var(--card-height);
  perspective: 600px;
  flex-shrink: 0;
}

.card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s ease;
}

/* Face-down by default */
.card-wrapper:not(.face-up) .card-inner {
  transform: rotateY(0deg);
}

.card-wrapper.face-up .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--card-radius);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* ─── Card Front ───────────────────────────────────────────────────── */

.card-front {
  background: linear-gradient(145deg, #ffffff 0%, #f5f5f5 100%);
  transform: rotateY(180deg);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  overflow: hidden;
}

.card-front::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: calc(var(--card-radius) - 1px);
  border: 1px solid rgba(0,0,0,0.06);
  pointer-events: none;
}

.card-front.red {
  color: var(--card-red);
}

.card-front.black {
  color: var(--card-black);
}

.card-corner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  gap: 0;
}

.card-corner.top-left {
  top: 3px;
  left: 4px;
}

.card-corner.bottom-right {
  bottom: 3px;
  right: 4px;
  transform: rotate(180deg);
}

.card-rank {
  font-size: 13px;
  font-weight: 800;
  font-family: var(--font-main);
}

.card-suit-small {
  font-size: 10px;
  line-height: 1;
}

.card-center-suit {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  opacity: 0.9;
}

/* ─── Card Back ────────────────────────────────────────────────────── */

.card-back {
  background: linear-gradient(135deg, #3a0a30 0%, #5c1050 50%, #3a0a30 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border: 2px solid #6a2060;
}

.card-back-pattern {
  position: absolute;
  inset: 4px;
  border-radius: calc(var(--card-radius) - 4px);
  border: 1.5px solid rgba(255, 105, 180, 0.5);
  background:
    repeating-linear-gradient(
      45deg,
      transparent,
      transparent 4px,
      rgba(255, 105, 180, 0.08) 4px,
      rgba(255, 105, 180, 0.08) 5px
    ),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 4px,
      rgba(255, 105, 180, 0.08) 4px,
      rgba(255, 105, 180, 0.08) 5px
    );
}

.card-back-pattern::after {
  content: '♦';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  color: rgba(255, 105, 180, 0.6);
}

/* ─── Card Hover/Active State ──────────────────────────────────────── */

.seat-bottom .card-wrapper.face-up {
  transition: transform 0.2s ease;
  cursor: default;
}

.seat-bottom .card-wrapper.face-up:hover {
  transform: translateY(-4px);
}

/* ─── Card Dealing Animation ───────────────────────────────────────── */

@keyframes dealCard {
  0% {
    opacity: 0;
    transform: translate(0, -80px) scale(0.3) rotate(15deg);
  }
  50% {
    opacity: 1;
    transform: translate(0, -10px) scale(1.05) rotate(2deg);
  }
  100% {
    opacity: 1;
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
}

.card-wrapper.dealing {
  animation: dealCard 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ─── Community Card Reveal ────────────────────────────────────────── */

@keyframes revealCommunity {
  0% {
    opacity: 0;
    transform: translateY(-30px) scale(0.6);
  }
  60% {
    opacity: 1;
    transform: translateY(2px) scale(1.03);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.community-card.dealing {
  animation: revealCommunity 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ═══════════════════════════════════════════════════════════════════════
   ACTION PANEL
   ═══════════════════════════════════════════════════════════════════════ */

.action-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 12px 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
  background: linear-gradient(180deg, rgba(13,18,32,0.97) 0%, rgba(10,14,26,0.99) 100%);
  border-top: 1px solid rgba(255,255,255,0.08);
  transform: translateY(100%);
  transition: transform 0.3s ease;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.action-panel.visible {
  transform: translateY(0);
}

/* ─── Hand Info ────────────────────────────────────────────────────── */

.hand-info {
  text-align: center;
  margin-bottom: 6px;
  min-height: 18px;
}

.hand-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  opacity: 0;
  transition: opacity 0.3s;
}

.hand-name.visible {
  opacity: 1;
}

/* ─── Bet Controls ─────────────────────────────────────────────────── */

.bet-controls {
  margin-bottom: 8px;
}

.bet-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.bet-slider {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  outline: none;
}

.bet-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--pink), var(--pink-dim));
  box-shadow: 0 2px 6px rgba(255, 105, 180, 0.4);
  cursor: pointer;
}

.bet-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--pink), var(--pink-dim));
  box-shadow: 0 2px 6px rgba(255, 105, 180, 0.4);
  cursor: pointer;
  border: none;
}

.bet-presets-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.bet-preset {
  flex: 1;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.05);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.bet-preset:active {
  background: rgba(255,255,255,0.12);
  transform: scale(0.95);
}

.bet-amount-display {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
}

.bet-value {
  color: var(--gold);
  font-weight: 700;
}

/* ─── Action Buttons ───────────────────────────────────────────────── */

.action-buttons {
  display: flex;
  gap: 8px;
}

.action-btn {
  flex: 1;
  height: 48px;
  border: none;
  border-radius: 12px;
  font-family: var(--font-main);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.action-btn:active {
  transform: scale(0.95);
}

.fold-btn {
  background: linear-gradient(145deg, #424242 0%, #303030 100%);
  color: #ccc;
}

.check-btn {
  background: linear-gradient(145deg, #8e24aa 0%, #6a1b9a 100%);
  color: white;
  box-shadow: 0 3px 12px rgba(142, 36, 170, 0.3);
}

.call-btn {
  background: linear-gradient(145deg, var(--accent-green) 0%, #2e7d32 100%);
  color: white;
  box-shadow: 0 3px 12px rgba(76, 175, 80, 0.3);
}

.raise-btn {
  background: linear-gradient(145deg, var(--pink-hot) 0%, var(--pink-dim) 100%);
  color: white;
  box-shadow: 0 3px 12px rgba(255, 20, 147, 0.35);
}

/* ═══════════════════════════════════════════════════════════════════════
   MESSAGE OVERLAY
   ═══════════════════════════════════════════════════════════════════════ */

.message-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  padding: 16px 32px;
  background: rgba(0,0,0,0.85);
  border: 1px solid rgba(255, 105, 180, 0.4);
  border-radius: 16px;
  font-size: 18px;
  font-weight: 700;
  color: var(--pink);
  text-align: center;
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  backdrop-filter: blur(10px);
}

.message-overlay.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

/* ═══════════════════════════════════════════════════════════════════════
   RESULT MODAL
   ═══════════════════════════════════════════════════════════════════════ */

.result-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.7);
  z-index: 500;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}

.result-modal.visible {
  opacity: 1;
}

.result-content {
  background: linear-gradient(145deg, #1f0a1a 0%, #150d1a 100%);
  border: 1px solid rgba(255, 105, 180, 0.3);
  border-radius: 20px;
  padding: 24px;
  max-width: 320px;
  width: 90%;
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.3s ease;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.result-modal.visible .result-content {
  transform: translateY(0);
}

.result-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 16px;
}

.result-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: 10px;
  margin-bottom: 6px;
  background: rgba(255,255,255,0.03);
}

.result-entry.winner {
  background: rgba(255, 105, 180, 0.1);
  border: 1px solid rgba(255, 105, 180, 0.2);
}

.result-player {
  font-weight: 600;
  font-size: 13px;
}

.result-hand {
  font-size: 11px;
  color: var(--text-secondary);
}

.result-amount {
  font-weight: 700;
  font-size: 14px;
  color: var(--accent-green);
}

.result-continue-btn {
  width: 100%;
  height: 48px;
  margin-top: 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--pink-hot) 0%, var(--pink-dim) 100%);
  color: white;
  font-family: var(--font-main);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 3px 12px rgba(255, 20, 147, 0.35);
}

.result-continue-btn:active {
  transform: scale(0.97);
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE ADJUSTMENTS
   ═══════════════════════════════════════════════════════════════════════ */

/* Small screens */
@media (max-height: 600px) {
  :root {
    --card-width: 40px;
    --card-height: 56px;
  }

  .seat-info {
    padding: 3px 8px 4px;
    min-width: 60px;
  }

  .seat-avatar { font-size: 16px; }
  .seat-name   { font-size: 9px; }
  .seat-chips  { font-size: 10px; }

  .card-rank { font-size: 11px; }
  .card-suit-small { font-size: 8px; }
  .card-center-suit { font-size: 20px; }

  .action-btn { height: 42px; font-size: 13px; }
}

/* Larger screens */
@media (min-width: 500px) {
  :root {
    --card-width: 56px;
    --card-height: 78px;
  }

  .card-rank { font-size: 15px; }
  .card-suit-small { font-size: 12px; }
  .card-center-suit { font-size: 28px; }
}

/* Very tall screens (more table space) */
@media (min-height: 800px) {
  .poker-table {
    max-width: 480px;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   UTILITY ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════ */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes chipBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-4px); }
}

/* Smooth chip count changes */
.chip-count {
  transition: color 0.3s;
}

.player-seat.winner .chip-count {
  color: var(--accent-green);
  animation: chipBounce 0.5s ease-in-out 3;
}

/* ═══════════════════════════════════════════════════════════════════════
   PVP / LOBBY / WALLET STYLES
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── PvP Menu Info ───────────────────────────────────────────────── */
.menu-pvp-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0;
  padding: 0 20px;
}

.pvp-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 105, 180, 0.08);
  border: 1px solid rgba(255, 105, 180, 0.15);
  border-radius: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.pvp-icon {
  font-size: 16px;
}

.connection-status {
  margin-top: 16px;
  font-size: 12px;
  text-align: center;
  color: var(--text-muted);
  transition: color 0.3s;
}

.connection-status.connecting {
  color: var(--pink-dim);
  animation: pulse 1.5s ease-in-out infinite;
}

.connection-status.connected {
  color: var(--accent-green);
}

.connection-status.disconnected {
  color: var(--accent-red);
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ─── Lobby Screen ────────────────────────────────────────────────── */
.lobby-screen {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 20px;
  padding-top: max(20px, env(safe-area-inset-top, 20px));
  background: var(--bg-dark);
}

.lobby-header {
  text-align: center;
  margin-bottom: 24px;
}

.lobby-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.lobby-heart {
  font-size: 28px;
  color: var(--pink);
  text-shadow: 0 0 10px var(--pink-glow);
}

.lobby-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--pink), var(--pink-hot));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lobby-subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 4px;
}

/* ─── Table Cards ─────────────────────────────────────────────────── */
.lobby-tables {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-bottom: 16px;
}

.lobby-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-size: 14px;
}

.lobby-table-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 105, 180, 0.12);
  border-radius: 14px;
  padding: 16px;
  transition: border-color 0.2s, transform 0.2s;
}

.lobby-table-card:active {
  transform: scale(0.98);
}

.lobby-table-card.full {
  opacity: 0.5;
}

.table-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.table-stake {
  font-size: 18px;
  font-weight: 700;
  color: var(--pink);
}

.table-blinds {
  font-size: 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 6px;
}

.table-card-seats {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.seat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: background 0.2s;
}

.seat-dot.occupied {
  background: var(--pink);
  border-color: var(--pink-hot);
  box-shadow: 0 0 6px var(--pink-glow);
}

.table-card-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.table-players {
  font-size: 13px;
  color: var(--text-secondary);
}

.table-live {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-green);
  background: rgba(76, 175, 80, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
  animation: pulse 2s ease-in-out infinite;
}

.table-join-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--pink), var(--pink-hot));
  color: white;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.table-join-btn:active {
  transform: scale(0.97);
}

.table-join-btn:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  cursor: default;
}

/* ─── Create Table Button ─────────────────────────────────────────── */
.lobby-actions {
  padding: 16px 0;
}

.create-table-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: 2px dashed rgba(255, 105, 180, 0.3);
  border-radius: 14px;
  background: transparent;
  color: var(--pink);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.create-table-btn:hover {
  background: rgba(255, 105, 180, 0.06);
  border-color: rgba(255, 105, 180, 0.5);
}

.btn-icon {
  font-size: 20px;
  font-weight: 300;
}

.lobby-footer {
  text-align: center;
  padding: 8px 0;
  padding-bottom: max(8px, env(safe-area-inset-bottom, 8px));
}

.lobby-status {
  font-size: 11px;
  color: var(--text-muted);
}

.lobby-status.connected::before {
  content: '●';
  color: var(--accent-green);
  margin-right: 4px;
}

.lobby-status.disconnected::before {
  content: '●';
  color: var(--accent-red);
  margin-right: 4px;
}

/* ─── Modal Overlay ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 105, 180, 0.2);
  border-radius: 18px;
  padding: 28px 24px;
  width: 100%;
  max-width: 380px;
  animation: slideUp 0.3s ease;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--pink);
  text-align: center;
  margin-bottom: 20px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.form-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.form-select,
.form-input {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font-main);
  outline: none;
  transition: border-color 0.2s;
}

.form-select:focus,
.form-input:focus {
  border-color: var(--pink-dim);
}

.form-select option {
  background: var(--bg-dark);
  color: var(--text-primary);
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.modal-btn-cancel {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.modal-btn-confirm {
  background: linear-gradient(135deg, var(--pink), var(--pink-hot));
  color: white;
}

/* ─── Wallet / Deposit Screen ─────────────────────────────────────── */
.wallet-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.wallet-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 105, 180, 0.2);
  border-radius: 20px;
  padding: 30px 24px;
  width: 100%;
  max-width: 400px;
  animation: slideUp 0.3s ease;
}

.wallet-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--pink);
  text-align: center;
  margin-bottom: 12px;
}

.wallet-desc {
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.5;
}

.wallet-desc strong {
  color: var(--pink);
}

/* QR Code */
.deposit-qr {
  display: flex;
  justify-content: center;
  margin-bottom: 18px;
}

.qr-placeholder {
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.qr-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 14px;
}

.qr-loading,
.qr-fallback {
  color: var(--text-muted);
  font-size: 12px;
}

/* Deposit Address */
.deposit-address {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  margin-bottom: 12px;
}

.address-text {
  flex: 1;
  font-size: 11px;
  color: var(--text-secondary);
  word-break: break-all;
  font-family: 'SF Mono', 'Consolas', 'Menlo', monospace;
}

.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.2s;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Deposit Amount */
.deposit-amount {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255, 105, 180, 0.08);
  border-radius: 10px;
  margin-bottom: 16px;
}

.amount-label {
  font-size: 13px;
  color: var(--text-muted);
}

.amount-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--pink);
}

/* Deposit Status */
.deposit-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-secondary);
}

.status-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 105, 180, 0.3);
  border-top-color: var(--pink);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.status-confirmed,
.status-pending {
  display: flex;
  align-items: center;
  gap: 8px;
}

.confirmed-icon {
  font-size: 20px;
  color: var(--accent-green);
}

.deposit-status.confirmed {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.2);
}

/* Wallet Buttons */
.wallet-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.wallet-btn:active {
  transform: scale(0.97);
}

.wallet-btn-cancel {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.wallet-btn-confirm {
  background: linear-gradient(135deg, var(--pink), var(--pink-hot));
  color: white;
}

/* ─── Cashout ─────────────────────────────────────────────────────── */
.cashout-balance {
  text-align: center;
  margin-bottom: 20px;
  padding: 16px;
  background: rgba(255, 105, 180, 0.08);
  border-radius: 12px;
}

.balance-chips {
  display: block;
  font-size: 28px;
  font-weight: 800;
  color: var(--pink);
  margin-bottom: 4px;
}

.balance-ltc {
  font-size: 14px;
  color: var(--text-muted);
}

.cashout-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.cashout-status {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
}

.status-error {
  color: var(--accent-red);
  padding: 10px;
  background: rgba(244, 67, 54, 0.1);
  border-radius: 8px;
}

.txid {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-muted);
  word-break: break-all;
}

/* ─── Game HUD ────────────────────────────────────────────────────── */
.game-hud {
  position: fixed;
  top: max(12px, env(safe-area-inset-top, 12px));
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 150;
}

.hud-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(14, 8, 18, 0.8);
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.2s, border-color 0.2s;
}

.hud-btn:hover {
  background: rgba(255, 105, 180, 0.15);
  border-color: var(--pink-dim);
}

.hud-leave {
  font-size: 16px;
}

.hud-cashout {
  font-size: 16px;
}

/* ─── Empty Seat ──────────────────────────────────────────────────── */
.player-seat.empty-seat .seat-info {
  opacity: 0.3;
  border-style: dashed;
}

.player-seat.empty-seat .seat-cards {
  display: none;
}

/* ─── Error Toast ─────────────────────────────────────────────────── */
.error-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--accent-red);
  color: white;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  z-index: 500;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.error-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── Mock Mode Banner ────────────────────────────────────────────── */
.mock-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  margin-bottom: 16px;
  background: rgba(76, 175, 80, 0.12);
  border: 1px solid rgba(76, 175, 80, 0.25);
  border-radius: 10px;
  font-size: 13px;
  color: var(--accent-green);
}

.mock-icon {
  font-size: 16px;
}
