* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background:
    /* Felt texture pattern - high resolution */
    url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E"),
    linear-gradient(135deg, #1a5f2a 0%, #0d3d15 100%);
  background-blend-mode: soft-light, normal;
  background-size: 512px 512px, 100% 100%;
  min-height: 100vh;
  color: #fff;
}

#app {
  min-height: 100vh;
}

/* Language buttons (inside burger menus) */
.lang-btn {
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-btn:hover {
  background: rgba(0, 0, 0, 0.6);
}

.lang-btn.active {
  background: #2e7d32;
}

.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: block;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
}

.hidden {
  display: none !important;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary { background: #2e7d32; color: white; }
.btn-primary:hover { background: #388e3c; }
.btn-secondary { background: #546e7a; color: white; }
.btn-secondary:hover { background: #607d8b; }
.btn-success { background: #f9a825; color: #1a1a1a; }
.btn-success:hover { background: #fbc02d; }
.btn-danger { background: #c62828; color: white; }
.btn-danger:hover { background: #d32f2f; }
.btn-small { padding: 8px 16px; font-size: 14px; }
.btn-large { padding: 16px 48px; font-size: 20px; }

/* Select Dropdowns */
.bet-select {
  padding: 10px 15px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  background: #fff;
  color: #333;
  cursor: pointer;
  min-width: 80px;
}

.bet-select:focus {
  outline: 2px solid #2e7d32;
}

/* ==================== LOGIN SCREEN ==================== */
#login-screen {
  background: #f5f5f5;
}

#login-screen.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

#login-screen .container {
  text-align: center;
  background: #ffffff;
  padding: 60px 40px;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1);
}

#login-screen .login-title {
  font-size: 32px;
  margin-bottom: 8px;
  color: #222;
  font-weight: 700;
}

#login-screen .subtitle {
  font-size: 16px;
  color: #888;
  margin-bottom: 40px;
}

.login-footer {
  margin-top: 32px;
  font-size: 13px;
  color: #aaa;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 300px;
  margin: 0 auto;
}

.login-form input {
  padding: 16px;
  font-size: 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  text-align: center;
  background: #fafafa;
  color: #333;
}

.login-form input:focus {
  outline: none;
  border-color: #999;
}

.login-form input[type="password"] {
  font-family: inherit;
}

.auth-buttons {
  display: flex;
  gap: 10px;
}

.auth-buttons .btn {
  flex: 1;
}

.btn-login { background: #333; color: white; }
.btn-login:hover { background: #555; }

.auth-error {
  color: #d32f2f;
  background: #fdecea;
  padding: 10px;
  border-radius: 6px;
  font-size: 14px;
  margin-top: 5px;
}

.phone-input-group {
  display: flex;
  gap: 6px;
  width: 100%;
}

.country-code-select {
  width: 80px;
  min-width: 80px;
  padding: 12px 4px;
  font-size: 14px;
  border: none;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  flex-shrink: 0;
}

.phone-input-group input {
  flex: 1;
  min-width: 0;
  text-align: left !important;
  padding: 12px 10px !important;
  font-size: 16px;
}

/* ==================== LOBBY SCREEN ==================== */
.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  position: relative;
}

.lobby-header h2 {
  font-size: 32px;
}

.lobby-logo {
  flex-shrink: 0;
}

.lobby-logo-svg {
  width: 180px;
  height: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.rules-link {
  color: #4fc3f7;
  text-decoration: none;
  font-size: 16px;
  padding: 8px 16px;
  border: 1px solid #4fc3f7;
  border-radius: 8px;
  transition: all 0.2s;
}

.rules-link:hover {
  background: #4fc3f7;
  color: #1a237e;
}

.player-info {
  display: flex;
  align-items: center;
  gap: 15px;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 20px;
  border-radius: 10px;
}

.balance {
  color: #ffd54f;
  font-weight: bold;
}

.lobby-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

.create-room-section,
.rooms-section {
  background: rgba(0, 0, 0, 0.2);
  padding: 25px;
  border-radius: 15px;
}

.create-room-section h3,
.rooms-section h3 {
  margin-bottom: 20px;
  font-size: 20px;
}

.create-room-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.create-room-form input {
  padding: 12px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
}

.settings-row {
  display: flex;
  gap: 15px;
}

.settings-row label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 14px;
}

.room-search-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
}

.room-search-input:focus {
  outline: 2px solid #2e7d32;
}

.rooms-list {
  margin-bottom: 15px;
}

.no-rooms {
  text-align: center;
  opacity: 0.6;
  padding: 20px;
}

.room-item {
  background: rgba(255, 255, 255, 0.1);
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.room-item:hover {
  background: rgba(255, 255, 255, 0.15);
}

.room-item-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.room-item-name {
  font-weight: 600;
}

.room-item-details {
  font-size: 13px;
  opacity: 0.7;
}

/* VIP Rooms */
.room-item.vip-room {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.2) 0%, rgba(255, 152, 0, 0.2) 100%);
  border: 1px solid rgba(255, 193, 7, 0.5);
}

.room-item.vip-room:hover {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.3) 0%, rgba(255, 152, 0, 0.3) 100%);
}

.vip-badge {
  background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
  color: #000;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  text-transform: uppercase;
}

/* In-Game Rooms */
.room-item.in-game {
  opacity: 0.85;
  border: 1px solid rgba(76, 175, 80, 0.4);
}

.in-game-badge {
  background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
  text-transform: uppercase;
}

/* Private room toggle */
.private-room-toggle {
  display: flex;
  align-items: center;
}

.private-room-toggle label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.private-room-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.room-password-field input {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
}

/* Join private room section */
.join-private-section {
  background: rgba(0, 0, 0, 0.2);
  padding: 20px 25px;
  border-radius: 15px;
  margin-top: 20px;
  grid-column: 1 / -1;
}

.join-private-section h3 {
  margin-bottom: 15px;
  font-size: 18px;
}

.join-private-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.join-private-form input {
  flex: 1;
  padding: 10px 12px;
  font-size: 14px;
  border: none;
  border-radius: 6px;
}

/* ==================== GAME SCREEN ==================== */
#game-screen.active {
  display: block;
}

.game-layout {
  display: flex;
  height: 100vh;
  gap: 0;
}

/* Table Area - 75% */
.table-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px;
  min-width: 0;
  overflow: visible;
}

.room-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 25%; /* Leave space for chat */
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: transparent;
  padding: 10px 20px;
  z-index: 100;
}

.room-name {
  font-size: 18px;
  font-weight: 600;
}

/* Burger menu - always visible */
.burger-menu-btn {
  display: block;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  color: #fff;
  font-size: 22px;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.burger-menu-btn:hover {
  background: rgba(0, 0, 0, 0.6);
}

.burger-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 10px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  padding: 12px;
  flex-direction: column;
  gap: 10px;
  min-width: 140px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  z-index: 101;
}

.burger-dropdown.open {
  display: flex;
}

.burger-lang-buttons {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.burger-leave-btn {
  width: 100%;
}

/* Lobby burger */
.lobby-burger {
  position: relative;
}

.burger-player-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 4px;
}

.burger-player-name {
  font-weight: 600;
  color: #fff;
  font-size: 14px;
}

.burger-player-balance {
  color: #ffd54f;
  font-weight: bold;
  font-size: 13px;
}

.burger-rules-btn {
  width: 100%;
}

/* Rules Modal */
.rules-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.3s ease;
}

.rules-modal.hidden {
  display: none;
}

.rules-modal-content {
  background: linear-gradient(135deg, #1a5f2a 0%, #0d3d15 100%);
  border-radius: 16px;
  max-width: 600px;
  width: 90%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  border: 2px solid #5d4037;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.rules-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.rules-modal-header h2 {
  color: #ffd54f;
  font-size: 22px;
  margin: 0;
}

.rules-modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  padding: 0 5px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.rules-modal-close:hover {
  opacity: 1;
}

.rules-modal-body {
  padding: 20px 25px;
  overflow-y: auto;
  flex: 1;
  line-height: 1.6;
}

.rules-modal-body h3 {
  color: #ffd54f;
  font-size: 16px;
  margin: 18px 0 8px;
}

.rules-modal-body h3:first-child {
  margin-top: 0;
}

.rules-modal-body p {
  color: #ddd;
  font-size: 14px;
  margin-bottom: 10px;
}

.rules-modal-body ol,
.rules-modal-body ul {
  color: #ddd;
  font-size: 14px;
  padding-left: 20px;
  margin-bottom: 10px;
}

.rules-modal-body li {
  margin-bottom: 6px;
}

.rules-lang-content {
  display: none;
}

/* Game Table - circular */
.game-table {
  flex: 0 0 auto;
  background:
    /* Felt texture - high resolution */
    url("data:image/svg+xml,%3Csvg viewBox='0 0 512 512' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.6' numOctaves='5' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E"),
    radial-gradient(circle at center, #1a6b2e 0%, #0d4a1a 70%, #0a3d15 100%);
  background-blend-mode: soft-light, normal;
  background-size: 256px 256px, 100% 100%;
  border: 3px solid #5d4037;
  border-radius: 50%;
  position: relative;
  width: min(55vw, 500px);
  height: min(55vw, 500px);
  min-width: 350px;
  min-height: 350px;
  max-width: 500px;
  max-height: 500px;
  margin: clamp(100px, 12vh, 140px) auto clamp(140px, 18vh, 220px) auto;
  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.5),
    0 0 60px rgba(0, 0, 0, 0.4);
  overflow: visible;
}

/* Player Seats */
.player-seat {
  position: absolute;
  text-align: center;
  /* Scale with viewport */
  font-size: clamp(12px, 1.2vw, 16px);
  z-index: 1;
}

.player-seat.empty {
  display: none;
}

/* Seat positions - clock layout around circular table
   Positions calculated for circle: center at 50%,50%, seats outside at ~58% radius
   18:00 = bottom (me), 12:00 = top, etc. */

/* 12:00 - top center */
.seat-12 {
  top: -10px;
  left: 50%;
  transform: translate(-50%, -100%);
}

/* 14:00 - 2 o'clock (60° from top) */
.seat-14 {
  top: 10%;
  right: -3%;
  transform: translateX(100%);
}

/* 15:00 - 3 o'clock (right) */
.seat-15 {
  top: 50%;
  right: -3%;
  transform: translate(100%, -50%);
}

/* 16:00 - 4 o'clock (120° from top) */
.seat-16 {
  bottom: 10%;
  right: -3%;
  transform: translateX(100%);
}

/* 20:00 - 8 o'clock (240° from top) */
.seat-20 {
  bottom: 10%;
  left: -3%;
  transform: translateX(-100%);
}

/* 21:00 - 9 o'clock (left) */
.seat-21 {
  top: 50%;
  left: -3%;
  transform: translate(-100%, -50%);
}

/* 22:00 - 10 o'clock (300° from top) */
.seat-22 {
  top: 10%;
  left: -3%;
  transform: translateX(-100%);
}

/* Legacy seat names mapped to clock positions */
.seat-top { /* 12:00 */
  top: -25%;
  left: 50%;
  transform: translateX(-50%);
}

.seat-top-right { /* 14:00 */
  top: -8%;
  right: -22%;
}

.seat-right { /* 15:00 */
  top: 50%;
  right: -30%;
  transform: translateY(-50%);
}

.seat-top-left { /* 22:00 */
  top: -8%;
  left: -22%;
}

.seat-left { /* 21:00 */
  top: 50%;
  left: -30%;
  transform: translateY(-50%);
}

.seat-bottom {
  /* Position below the circular table, centered */
  position: absolute;
  bottom: calc(-15% - 80px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
}

/* Opponent display */
.opponent-box {
  background: rgba(0, 0, 0, 0.5);
  padding: clamp(8px, 1vw, 12px) clamp(10px, 1.2vw, 18px);
  border-radius: clamp(8px, 1vw, 12px);
  min-width: clamp(100px, 10vw, 140px);
  max-width: 160px;
}

.opponent-box.active {
  box-shadow: 0 0 20px #ffd54f;
  border: 2px solid #ffd54f;
}

.opponent-box.folded {
  opacity: 0.5;
}

.opponent-name {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.opponent-balance {
  font-size: 12px;
  color: #ffd54f;
  margin-bottom: 3px;
}

.opponent-bet {
  font-size: 11px;
  opacity: 0.8;
  margin-bottom: 8px;
}

.opponent-cards {
  display: flex;
  justify-content: center;
  gap: 3px;
  margin-top: 10px;
}

.opponent-cards:empty {
  display: none;
}

.ready-badge {
  background: #4caf50;
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-top: 5px;
  display: inline-block;
}

/* Table Center */
.table-center {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

/* Table Logo - circular text along table edge */
.table-logo {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.9;
  z-index: 0;
  pointer-events: none;
}

.table-logo .logo-svg {
  width: 100%;
  height: 100%;
}

.table-logo.hidden {
  display: none;
}

.pot-display {
  background: rgba(0, 0, 0, 0.6);
  padding: 15px 25px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.pot-label {
  font-size: 14px;
  opacity: 0.8;
}

.pot-value {
  font-size: 28px;
  color: #ffd54f;
  font-weight: bold;
  display: block;
}

.current-bet-display {
  font-size: 14px;
  opacity: 0.9;
}

/* Game info container - hidden during waiting phase */
.game-info {
  display: block;
}

.game-info.hidden {
  display: none;
}

/* Service messages container on table */
.service-messages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  position: absolute;
  top: calc(60% + 40px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: max-content;
}

.service-message {
  background: rgba(0, 0, 0, 0.8);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  display: flex;
  transition: opacity 0.5s ease, max-height 0.5s ease, margin 0.5s ease, padding 0.5s ease, border-color 0.5s ease;
  max-height: 50px;
  overflow: hidden;
  white-space: nowrap;
  align-items: center;
  gap: 8px;
  opacity: 1;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.service-message.fade-out {
  opacity: 0;
  max-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  border-color: transparent;
}

.service-message.action-raise {
  border: 1px solid #4caf50;
}

.service-message.action-fold {
  border: 1px solid #f44336;
}

.service-message.action-bet {
  border: 1px solid #ffc107;
}

.service-message.action-call {
  border: 1px solid #2196f3;
}

.service-message.action-peek {
  border: 1px solid #9c27b0;
}

.service-message.action-reveal {
  border: 1px solid #ffffff;
}

.service-message-icon {
  font-size: 16px;
}

.service-message-player {
  font-weight: bold;
  color: #ffd54f;
}

/* Table timer (visible to all players) - bottom-left corner, above action panel */
/* Table timer - circular progress on table */
.table-timer {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 15px;
}

.table-timer.hidden {
  display: none;
}

.table-timer-player {
  font-size: 14px;
  color: #ffd54f;
  margin-bottom: 8px;
  font-weight: 600;
}

.timer-circle {
  position: relative;
  width: 70px;
  height: 70px;
}

.timer-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg) scaleX(-1); /* Start from top, go clockwise */
}

.timer-ring-bg {
  fill: rgba(0, 0, 0, 0.85);
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 5;
}

.timer-ring-progress {
  fill: none;
  stroke: #4caf50;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 283; /* 2 * PI * 45 */
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
}

.table-timer.warning .timer-ring-progress {
  stroke: #ff9800;
}

.table-timer.danger .timer-ring-progress {
  stroke: #f44336;
}

.table-timer-value {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  text-align: center;
}

/* Action notification */
.action-notification {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(0, 0, 0, 0.9);
  padding: 15px 30px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  z-index: 50;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

.action-notification.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.action-notification.fade-out {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
  transition: all 1s ease-out;
}

.action-notification.action-raise {
  border: 2px solid #4caf50;
  box-shadow: 0 0 20px rgba(76, 175, 80, 0.4);
}

.action-notification.action-fold {
  border: 2px solid #f44336;
  box-shadow: 0 0 20px rgba(244, 67, 54, 0.4);
}

.action-notification.action-bet {
  border: 2px solid #ffc107;
  box-shadow: 0 0 20px rgba(255, 193, 7, 0.4);
}

.action-icon {
  font-size: 28px;
}

.action-player {
  font-weight: bold;
  color: #ffd54f;
}

.action-text {
  color: #ccc;
}

/* Discarded cards in center */
.discarded-cards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-top: 15px;
  max-width: 200px;
}

.discarded-cards .card {
  width: 40px;
  height: 58px;
  transform: rotate(var(--rotation, 0deg));
  opacity: 0.9;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.discarded-cards .card-front .card-rank {
  font-size: 12px;
}

.discarded-cards .card-front .card-suit {
  font-size: 16px;
}

.discarded-cards .folded-label {
  font-size: 10px;
  color: #ff6b6b;
  margin-top: 5px;
  display: block;
  width: 100%;
  text-align: center;
}

/* Dealer indicator badge */
.opponent-box {
  position: relative;
}

.dealer-badge {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #ffd54f 0%, #ffb300 100%);
  color: #000;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  border: 1px solid #fff;
  z-index: 15;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

/* Seat 12 (top): badges below the box instead of above */
#seat-12 .dealer-badge {
  top: auto;
  bottom: -18px;
}

#seat-12 .peek-target-badge {
  bottom: auto;
  top: -18px;
}

/* Table deck - positioned on table near dealer */
.table-deck {
  position: absolute;
  z-index: 5;
  transition: all 0.3s ease;
}

.deck-cards {
  position: relative;
  width: 40px;
  height: 58px;
}

.deck-cards .card {
  position: absolute;
  width: 40px;
  height: 58px;
}

.deck-cards .card:nth-child(1) { top: 0; left: 0; }
.deck-cards .card:nth-child(2) { top: 2px; left: 1px; }
.deck-cards .card:nth-child(3) { top: 4px; left: 2px; }

/* Deck positions based on dealer seat (clock positions) */
.table-deck.deck-12 {
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
}

.table-deck.deck-14 {
  top: 28%;
  right: 22%;
}

.table-deck.deck-15 {
  top: 50%;
  right: 18%;
  transform: translateY(-50%);
}

.table-deck.deck-16 {
  bottom: 28%;
  right: 22%;
}

.table-deck.deck-20 {
  bottom: 28%;
  left: 22%;
}

.table-deck.deck-21 {
  top: 50%;
  left: 18%;
  transform: translateY(-50%);
}

.table-deck.deck-22 {
  top: 28%;
  left: 22%;
}

.table-deck.deck-bottom {
  bottom: 15%;
  left: calc(50% + 80px);
  transform: none;
}

/* Legacy deck positions for backwards compatibility */
.table-deck.deck-top {
  top: 20%;
  left: 50%;
  transform: translateX(-50%);
}

.table-deck.deck-top-left {
  top: 28%;
  left: 22%;
}

.table-deck.deck-top-right {
  top: 28%;
  right: 22%;
}

.table-deck.deck-left {
  top: 50%;
  left: 18%;
  transform: translateY(-50%);
}

.table-deck.deck-right {
  top: 50%;
  right: 18%;
  transform: translateY(-50%);
}

.table-deck.deck-bottom .deck-cards {
  width: 45px;
  height: 65px;
}

.table-deck.deck-bottom .deck-cards .card {
  width: 45px;
  height: 65px;
}

/* Turn Timer - inside action panel */
.action-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  margin-right: 15px;
  border: 3px solid #4caf50;
  transition: border-color 0.3s;
}

.action-timer.warning {
  border-color: #ff9800;
}

.action-timer.danger {
  border-color: #f44336;
  animation: pulse-border 0.5s ease-in-out infinite;
}

.action-timer #timer-value {
  font-size: 20px;
  font-weight: bold;
  color: #fff;
}

.action-timer.warning #timer-value {
  color: #ff9800;
}

.action-timer.danger #timer-value {
  color: #f44336;
}

@keyframes pulse-border {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* My seat (bottom) */
.seat-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.my-cards-area {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.my-cards {
  display: flex;
  gap: 8px;
}

.my-info {
  display: none; /* Hidden - info shown in action panel */
}

.my-info .player-name {
  font-weight: 600;
}

.my-info .player-balance {
  color: #ffd54f;
  font-weight: bold;
}

.my-info .player-bet {
  font-size: 13px;
  opacity: 0.8;
}

.my-dealer-badge {
  background: linear-gradient(135deg, #ffd54f 0%, #ffb300 100%);
  color: #000;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  border: 1px solid #fff;
  margin-bottom: 4px;
}

/* Cards */
.card {
  width: clamp(40px, 4vw, 55px);
  height: clamp(58px, 5.8vw, 80px);
  border-radius: clamp(4px, 0.5vw, 8px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.card-front {
  background-color: white;
  color: #333;
}

.card-back {
  background-image: url('/assets/cards/deck.svg');
  background-size: 1529.25% 428.57%;
  background-position: 99.3957% 1.6938%;
  background-repeat: no-repeat;
  border: none;
}

/* SVG sprite card face */
.card-svg {
  background-image: url('/assets/cards/deck.svg');
  background-size: 1529.25% 428.57%;
  background-repeat: no-repeat;
}

/* Ace of Diamonds (col 0, row 1) */
.card-svg.card-A-diamonds  { background-position: 0.5848% 33.8792%; }

/* === SVG sprite positions for Seka deck (36 cards) === */
/* Row 0: Hearts | Row 1: Diamonds | Row 2: Clubs | Row 3: Spades */
/* posX = (30 + col*390) / 5131 * 100, posY = (30 + row*570) / 1771 * 100 */

/* Aces (col 0) */
.card-svg.card-A-hearts    { background-position: 0.5848% 1.6938%; }
.card-svg.card-A-clubs     { background-position: 0.5848% 66.0644%; }
.card-svg.card-A-spades    { background-position: 0.5848% 98.2497%; }

/* 6s (col 5) */
.card-svg.card-6-hearts    { background-position: 38.5889% 1.6938%; }
.card-svg.card-6-diamonds  { background-position: 38.5889% 33.8792%; }
.card-svg.card-6-clubs     { background-position: 38.5889% 66.0644%; }
.card-svg.card-6-spades    { background-position: 38.5889% 98.2497%; }

/* 7s (col 6) */
.card-svg.card-7-hearts    { background-position: 46.1898% 1.6938%; }
.card-svg.card-7-diamonds  { background-position: 46.1898% 33.8792%; }
.card-svg.card-7-clubs     { background-position: 46.1898% 66.0644%; }
.card-svg.card-7-spades    { background-position: 46.1898% 98.2497%; }

/* 8s (col 7) */
.card-svg.card-8-hearts    { background-position: 53.7907% 1.6938%; }
.card-svg.card-8-diamonds  { background-position: 53.7907% 33.8792%; }
.card-svg.card-8-clubs     { background-position: 53.7907% 66.0644%; }
.card-svg.card-8-spades    { background-position: 53.7907% 98.2497%; }

/* 9s (col 8) */
.card-svg.card-9-hearts    { background-position: 61.3916% 1.6938%; }
.card-svg.card-9-diamonds  { background-position: 61.3916% 33.8792%; }
.card-svg.card-9-clubs     { background-position: 61.3916% 66.0644%; }
.card-svg.card-9-spades    { background-position: 61.3916% 98.2497%; }

/* 10s (col 9) */
.card-svg.card-10-hearts   { background-position: 68.9925% 1.6938%; }
.card-svg.card-10-diamonds { background-position: 68.9925% 33.8792%; }
.card-svg.card-10-clubs    { background-position: 68.9925% 66.0644%; }
.card-svg.card-10-spades   { background-position: 68.9925% 98.2497%; }

/* Jacks (col 10) */
.card-svg.card-J-hearts    { background-position: 76.5934% 1.6938%; }
.card-svg.card-J-diamonds  { background-position: 76.5934% 33.8792%; }
.card-svg.card-J-clubs     { background-position: 76.5934% 66.0644%; }
.card-svg.card-J-spades    { background-position: 76.5934% 98.2497%; }

/* Queens (col 11) */
.card-svg.card-Q-hearts    { background-position: 84.1943% 1.6938%; }
.card-svg.card-Q-diamonds  { background-position: 84.1943% 33.8792%; }
.card-svg.card-Q-clubs     { background-position: 84.1943% 66.0644%; }
.card-svg.card-Q-spades    { background-position: 84.1943% 98.2497%; }

/* Kings (col 12) */
.card-svg.card-K-hearts    { background-position: 91.7952% 1.6938%; }
.card-svg.card-K-diamonds  { background-position: 91.7952% 33.8792%; }
.card-svg.card-K-clubs     { background-position: 91.7952% 66.0644%; }
.card-svg.card-K-spades    { background-position: 91.7952% 98.2497%; }

.card.red { color: #c62828; }
.card.black { color: #212121; }

.card-rank {
  font-size: 16px;
  line-height: 1;
}

.card-suit {
  font-size: 22px;
  line-height: 1;
}

/* My cards - bigger */
.my-cards .card {
  width: clamp(55px, 6vw, 85px);
  height: clamp(80px, 8.5vw, 120px);
}

.my-cards .card .card-rank {
  font-size: clamp(18px, 2vw, 26px);
}

.my-cards .card .card-suit {
  font-size: clamp(24px, 2.8vw, 36px);
}

/* Dealer deck stack - shown next to dealer's own cards */
.my-dealer-deck {
  position: relative;
  margin-left: 20px;
  width: clamp(55px, 6vw, 85px);
  height: clamp(80px, 8.5vw, 120px);
  pointer-events: none;
}

.my-dealer-deck .card {
  position: absolute;
  width: 100%;
  height: 100%;
  cursor: default !important;
}

.my-dealer-deck .card:nth-child(1) { top: 0; left: 0; }
.my-dealer-deck .card:nth-child(2) { top: -2px; left: 2px; }
.my-dealer-deck .card:nth-child(3) { top: -4px; left: 4px; }

.my-dealer-deck .card:hover {
  transform: none !important;
}

/* Small cards for opponents */
.opponent-cards .card {
  width: clamp(30px, 3vw, 42px);
  height: clamp(44px, 4.3vw, 60px);
}

.opponent-cards .card-rank {
  font-size: clamp(9px, 1vw, 13px);
}

.opponent-cards .card-suit {
  font-size: clamp(12px, 1.3vw, 17px);
}

/* Opponent cards when shown (showAllCards mode) */
.opponent-cards .card-front {
  width: 40px;
  height: 58px;
}

.opponent-cards .card-front .card-rank {
  font-size: 12px;
}

.opponent-cards .card-front .card-suit {
  font-size: 16px;
}

/* Dealer selection ceremony cards */
.ceremony-cards {
  position: relative;
  width: clamp(55px, 6vw, 85px);
  height: clamp(80px, 8.5vw, 120px);
}

.ceremony-card {
  position: absolute;
  animation: ceremonyCardIn 0.3s ease;
}

/* Ceremony cards — match deck and game card sizes */
.ceremony-card .card {
  width: clamp(55px, 6vw, 85px) !important;
  height: clamp(80px, 8.5vw, 120px) !important;
}

.ceremony-card .card .card-rank {
  font-size: clamp(12px, 1.5vw, 18px) !important;
}

.ceremony-card .card .card-suit {
  font-size: clamp(16px, 2vw, 24px) !important;
}

.ceremony-card.ace-highlight .card {
  box-shadow: 0 0 12px 4px rgba(255, 215, 0, 0.8);
  border: 2px solid gold;
}

@keyframes ceremonyCardIn {
  from {
    opacity: 0;
    transform: scale(0.5) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Ceremony deck — shown to player whose turn it is to draw */
.ceremony-deck {
  position: relative;
  margin-left: 20px;
  width: clamp(55px, 6vw, 85px);
  height: clamp(80px, 8.5vw, 120px);
  pointer-events: none;
  animation: ceremonyCardIn 0.3s ease;
}

.ceremony-deck .card {
  position: absolute;
  width: 100%;
  height: 100%;
  cursor: default !important;
}

.ceremony-deck .card:nth-child(1) { top: 0; left: 0; }
.ceremony-deck .card:nth-child(2) { top: -2px; left: 2px; }
.ceremony-deck .card:nth-child(3) { top: -4px; left: 4px; }

/* Reveal Button (В светлую) */
.btn-reveal {
  background: #ffffff;
  color: #333;
  border: 2px solid #ccc;
  font-weight: bold;
}

.btn-reveal:hover {
  background: #f0f0f0;
}

.btn-showdown {
  background: #ff6b35;
  color: #fff;
  border: 2px solid #e55a2b;
  font-weight: bold;
}

.btn-showdown:hover {
  background: #e55a2b;
}

/* Peek Button */
#btn-peek {
  background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
  color: #000;
  font-weight: bold;
}

#btn-peek:hover {
  background: linear-gradient(135deg, #ffca28 0%, #ffa726 100%);
}

#btn-peek:disabled {
  background: #666;
  color: #999;
  cursor: not-allowed;
}

/* Peek Result Modal */
.peek-result-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.peek-result-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 16px;
  padding: 30px 40px;
  text-align: center;
  border: 2px solid #ffc107;
  box-shadow: 0 0 50px rgba(255, 193, 7, 0.3);
  max-width: 600px;
  width: 90%;
}

.peek-result-content h2 {
  color: #ffc107;
  margin-bottom: 25px;
  font-size: 24px;
}

.peek-players {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 30px;
  margin-bottom: 25px;
}

.peek-player {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 20px;
  min-width: 180px;
}

.peek-player-name {
  font-size: 18px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #fff;
}

.peek-initiator .peek-player-name {
  color: #4fc3f7;
}

.peek-target .peek-player-name {
  color: #ff6b6b;
}

.peek-player-cards {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.peek-player-cards .card {
  width: 55px;
  height: 80px;
}

.peek-player-cards .card-rank {
  font-size: 16px;
}

.peek-player-cards .card-suit {
  font-size: 22px;
}

.peek-player-score {
  margin-top: 12px;
  font-size: 14px;
}

.peek-score-value {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: bold;
}

.peek-score-value.winner {
  background: rgba(76, 175, 80, 0.3);
  color: #81c784;
  border: 1px solid #4caf50;
}

.peek-score-value.loser {
  background: rgba(244, 67, 54, 0.3);
  color: #e57373;
  border: 1px solid #f44336;
}

.peek-player.peek-winner {
  border: 2px solid #4caf50;
  box-shadow: 0 0 20px rgba(76, 175, 80, 0.4);
}

.peek-player.peek-loser {
  border: 2px solid #f44336;
  box-shadow: 0 0 20px rgba(244, 67, 54, 0.3);
  opacity: 0.85;
}

.peek-vs {
  font-size: 28px;
  font-weight: bold;
  color: #ffc107;
  text-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

.peek-loser-text {
  font-size: 18px;
  color: #ff6b6b;
  margin-bottom: 20px;
  padding: 10px;
  background: rgba(255, 107, 107, 0.1);
  border-radius: 8px;
}

#btn-close-peek {
  margin-top: 10px;
}

/* Peek Notification Modal (for non-participants) */
.peek-notification-modal {
  position: fixed;
  top: 20%;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.peek-notification-modal.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.peek-notification-modal.fade-out {
  opacity: 0;
  transform: translateX(-50%) translateY(-20px);
  transition: all 1s ease-out;
}

.peek-notification-modal.hidden {
  display: none;
}

.peek-notification-content {
  background: linear-gradient(135deg, #2d1b4e 0%, #1a1a2e 100%);
  border: 2px solid #9c27b0;
  border-radius: 12px;
  padding: 20px 30px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 10px 40px rgba(156, 39, 176, 0.4);
  animation: peekPulse 0.5s ease;
}

@keyframes peekPulse {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.peek-notification-icon {
  font-size: 36px;
  animation: peekEye 0.6s ease;
}

@keyframes peekEye {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.peek-notification-text {
  text-align: left;
}

.peek-notification-title {
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  margin-bottom: 5px;
}

.peek-notification-loser {
  font-size: 14px;
  color: #ff6b6b;
}

/* Action Panel - fixed at bottom of table area (not covering chat) */
.action-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: transparent;
  padding: 10px 0 0 0;
  pointer-events: none;
  width: max-content;
}

.action-panel > * {
  pointer-events: auto;
}

/* Player info in action panel */
.action-player-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.7);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  height: auto;
  min-height: 44px;
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
}

.action-player-name {
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
  flex-shrink: 1;
}

.action-player-balance {
  color: #ffd54f;
  font-weight: bold;
  white-space: nowrap;
  flex-shrink: 0;
}

.action-player-index {
  color: #ff9800;
  font-size: 11px;
  opacity: 0.8;
  flex-shrink: 0;
}

/* Ready controls in action panel */
.ready-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ready-controls .waiting-text {
  color: #ffd54f;
  font-size: 13px;
  margin: 0;
}

.bet-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  background: none;
}

.raise-controls {
  display: flex;
  gap: 5px;
  align-items: center;
}

/* Ready Panel */
/* Ready panel moved to action panel */

.waiting-text {
  opacity: 0.7;
}

/* ==================== CHAT AREA - 25% ==================== */

/* Mobile Chat Toggle Button */
.chat-toggle-btn {
  display: none;
  position: fixed;
  top: 15px;
  right: 15px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2e7d32 0%, #1b5e20 100%);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}

.chat-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.chat-toggle-btn:active {
  transform: scale(0.95);
}

.chat-toggle-icon {
  display: block;
  line-height: 1;
}

.chat-unread-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #f44336;
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  border-radius: 9px;
  text-align: center;
  padding: 0 4px;
}

.chat-close-btn {
  display: none;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 5px 10px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.chat-close-btn:hover {
  opacity: 1;
}

.chat-area {
  width: 25%;
  min-width: 250px;
  max-width: 350px;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header {
  padding: 15px;
  font-weight: 600;
  font-size: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.chat-message {
  padding: 8px 10px;
  border-radius: 8px;
  max-width: 95%;
  word-break: break-word;
  font-size: 13px;
}

.chat-message.own {
  background: #2e7d32;
  align-self: flex-end;
}

.chat-message.other {
  background: rgba(255, 255, 255, 0.1);
  align-self: flex-start;
}

.chat-message.system {
  background: rgba(255, 193, 7, 0.2);
  align-self: center;
  font-size: 12px;
  font-style: italic;
  text-align: center;
}

.chat-message.private {
  background: rgba(220, 53, 69, 0.3);
  border: 1px solid rgba(220, 53, 69, 0.5);
  color: #ffcccc;
}

.chat-message.private .chat-message-author {
  color: #ff6b6b;
}

.chat-message-author {
  font-weight: 600;
  font-size: 11px;
  margin-bottom: 2px;
  opacity: 0.8;
}

.chat-message-text {
  font-size: 13px;
}

.chat-input {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-input input {
  flex: 1;
  padding: 8px 10px;
  font-size: 13px;
  border: none;
  border-radius: 6px;
  min-width: 0;
}

.chat-input .btn {
  padding: 8px 12px;
  font-size: 12px;
}

/* ==================== GAME RESULT MODAL ==================== */
.game-result {
  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: 100;
}

.result-content {
  background: linear-gradient(135deg, #1a5f2a 0%, #0d3d15 100%);
  padding: 40px 50px;
  border-radius: 20px;
  text-align: center;
  max-width: 450px;
  border: 3px solid #5d4037;
}

.result-content h2 {
  font-size: 26px;
  margin-bottom: 20px;
}

.result-hand {
  background: rgba(0, 0, 0, 0.3);
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 10px;
}

.result-hand.winner {
  background: rgba(255, 213, 79, 0.2);
  border: 2px solid #ffd54f;
}

.result-hand-name {
  font-weight: 600;
  margin-bottom: 5px;
}

.result-hand-cards {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin: 10px 0;
}

.result-hand-cards .card {
  width: 45px;
  height: 65px;
}

.result-hand-cards .card .card-rank {
  font-size: 13px;
}

.result-hand-cards .card .card-suit {
  font-size: 18px;
}

.result-hand-score {
  font-size: 13px;
  opacity: 0.8;
}

#btn-close-result {
  margin-top: 20px;
}

/* ==================== RESPONSIVE ==================== */

/* ===== TABLET (≤ 1024px) ===== */
@media (max-width: 1024px) {
  .lobby-header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .game-layout {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .table-area {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 10px;
    padding-bottom: 20px;
  }

  /* Chat as Drawer */
  .chat-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .chat-close-btn {
    display: block;
  }

  .chat-area {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 100%;
    min-width: auto;
    height: 100vh;
    height: 100dvh;
    border-left: none;
    border-top: none;
    z-index: 500;
    transition: right 0.3s ease;
    box-shadow: none;
  }

  .chat-area.chat-open {
    right: 0;
  }

  .chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 499;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }

  .chat-overlay.visible {
    opacity: 1;
    visibility: visible;
  }

  .game-table {
    width: min(80vw, 520px);
    height: min(80vw, 520px);
    min-width: 280px;
    min-height: 280px;
    max-width: 520px;
    max-height: 520px;
    margin: 100px auto 180px auto;
  }

  /* Seat positions for tablet - outside the circle */
  .seat-12 { top: -10px; left: 50%; transform: translate(-50%, -100%); }
  .seat-14 { top: 15%; right: -8%; transform: none; }
  .seat-15 { top: 50%; right: -8%; transform: translateY(-50%); }
  .seat-16 { bottom: 15%; right: -8%; transform: none; }
  .seat-20 { bottom: 15%; left: -8%; transform: none; }
  .seat-21 { top: 50%; left: -8%; transform: translateY(-50%); }
  .seat-22 { top: 15%; left: -8%; transform: none; }

  /* Action panel full width */
  .action-panel {
    gap: 10px;
    padding: 10px 0 0 0;
    flex-wrap: wrap;
  }

  /* Fix seat-bottom position */
  .seat-bottom {
    bottom: calc(-15% - 80px);
    left: 50%;
    transform: translateX(-50%);
  }

  /* Room header full width */
  .room-header {
    right: 0;
    padding: 8px 10px;
  }

  /* Chat toggle: bottom-right above action panel */
  .chat-toggle-btn {
    top: auto;
    bottom: 130px;
    right: 10px;
  }
}

/* ===== SMALL TABLET / LANDSCAPE PHONE (≤ 768px) ===== */
@media (max-width: 768px) {
  .lobby-content {
    grid-template-columns: 1fr;
  }
}

/* ===== MOBILE (480px - 600px) ===== */
@media (max-width: 600px) {
  /* Container padding */
  .container {
    padding: 15px 10px;
  }

  /* Login screen */
  #login-screen .container {
    padding: 40px 20px;
  }

  #login-screen .login-title {
    font-size: 24px;
  }

  #login-screen .subtitle {
    font-size: 14px;
  }

  .login-form {
    max-width: 100%;
  }

  .login-form input {
    padding: 14px;
    font-size: 16px; /* Prevent iOS zoom */
  }

  /* Lobby header stacked */
  .lobby-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    position: relative;
  }

  .lobby-header h2 {
    font-size: 24px;
    text-align: center;
  }

  .lobby-logo {
    width: 100%;
    text-align: center;
  }

  .lobby-logo-svg {
    width: 160px;
  }

  .lobby-burger {
    position: absolute;
    top: 0;
    right: 0;
  }

  .rules-link {
    text-align: center;
  }

  .player-info {
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    text-align: center;
  }

  #player-balance {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
  }

  /* Lobby sections */
  .create-room-section,
  .rooms-section {
    padding: 15px;
  }

  /* Room header in game */
  .room-header {
    padding: 8px 10px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .room-name {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
  }

  /* Game table scaling - circular */
  .game-table {
    width: min(75vw, 300px);
    height: min(75vw, 300px);
    margin: 40px auto 140px auto;
  }

  /* Smaller opponent boxes */
  .opponent-box {
    padding: 6px 8px;
    min-width: 80px;
    max-width: 120px;
  }

  .opponent-box .player-avatar {
    width: 22px !important;
    height: 22px !important;
  }

  .opponent-name {
    font-size: 11px;
  }

  .opponent-balance {
    font-size: 9px;
  }

  .opponent-bet {
    font-size: 8px;
    margin-bottom: 5px;
  }

  /* Clock seat positions for mobile - outside the circle */
  .seat-12 {
    top: -10px;
    left: 50%;
    transform: translate(-50%, -100%);
  }

  .seat-14 {
    top: 15%;
    right: -2%;
    transform: none;
  }

  .seat-15 {
    top: 50%;
    right: -2%;
    transform: translateY(-50%);
  }

  .seat-16 {
    bottom: 15%;
    right: -2%;
    transform: none;
  }

  .seat-20 {
    bottom: 15%;
    left: -2%;
    transform: none;
  }

  .seat-21 {
    top: 50%;
    left: -2%;
    transform: translateY(-50%);
  }

  .seat-22 {
    top: 15%;
    left: -2%;
    transform: none;
  }

  .seat-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    z-index: 100;
    padding: 0 10px 10px 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(10, 61, 21, 0.95) 60%, transparent);
  }

  /* My cards - ensure visibility */
  .my-cards .card {
    width: 75px;
    height: 108px;
  }

  .my-cards .card .card-rank {
    font-size: 24px;
  }

  .my-cards .card .card-suit {
    font-size: 33px;
  }

  .my-cards-area {
    margin-bottom: 0;
  }

  /* Ceremony deck on tablet/mobile */
  .ceremony-deck {
    margin-left: 12px;
    width: 45px;
    height: 65px;
  }

  /* Deck position for current player on mobile */
  .table-deck.deck-bottom {
    bottom: 10%;
    left: calc(50% + 50px);
  }

  /* Chat icon above fixed action panel */
  .chat-toggle-btn {
    top: auto;
    bottom: 240px;
    right: 10px;
  }

  /* Service messages at top of screen on mobile */
  .service-messages {
    position: fixed;
    top: 35px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    margin-top: 0;
  }

  /* Action panel */
  .action-panel {
    padding: 6px 0 0 0;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }

  .action-player-info {
    width: 100%;
    justify-content: center;
    padding: 4px 10px;
    font-size: 11px;
    min-height: 30px;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .action-player-name {
    max-width: 70px;
    font-size: 11px;
  }

  .action-player-balance {
    font-size: 11px;
  }

  .action-player-index {
    display: none;
  }

  .bet-controls {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
    width: 100%;
  }

  .bet-controls .btn {
    min-height: 36px;
    padding: 6px 8px;
    font-size: 12px;
    flex: 1 1 auto;
  }

  .raise-controls {
    width: 100%;
    justify-content: center;
    gap: 4px;
  }

  .raise-controls .bet-select {
    min-height: 36px;
    padding: 6px 8px;
    font-size: 13px;
  }

  .ready-controls {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
  }

  .ready-controls .btn {
    min-height: 36px;
    padding: 8px 16px;
  }

  /* Chat header/messages compact */
  .chat-header {
    padding: 10px;
    font-size: 14px;
  }

  .chat-messages {
    padding: 8px;
  }

  .chat-input {
    padding: 8px;
    gap: 6px;
  }

  .chat-input input {
    padding: 10px;
    font-size: 16px; /* Prevent iOS zoom */
    min-height: 44px;
  }

  .chat-input .btn {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 12px;
  }

  /* Table center info */
  .pot-display {
    padding: 10px 15px;
  }

  .pot-value {
    font-size: 22px;
  }

  .timer-circle {
    width: 55px;
    height: 55px;
  }

  .table-timer-value {
    font-size: 18px;
  }

  /* Modals */
  .result-content {
    padding: 25px 20px;
    max-width: 90vw;
  }

  .result-content h2 {
    font-size: 20px;
  }

  .peek-result-content {
    padding: 20px;
    width: 95%;
  }

  .peek-players {
    flex-direction: column;
    gap: 15px;
  }

  .peek-vs {
    font-size: 20px;
  }

  .peek-player {
    min-width: auto;
    width: 100%;
    padding: 15px;
  }

  /* Gift modal */
  .gift-modal-content {
    min-width: 280px;
    width: 90vw;
    max-width: 350px;
    padding: 20px;
  }

  /* Bet popup */
  .bet-popup-content {
    min-width: 280px;
    width: 90vw;
    max-width: 350px;
    padding: 20px;
  }
}

/* ===== SMALL MOBILE (320px - 480px) ===== */
@media (max-width: 480px) {
  /* Deck closer to cards on small screens */
  .table-deck.deck-bottom {
    bottom: 8%;
    left: calc(50% + 40px);
  }

  /* Chat toggle button position - bottom right */
  .chat-toggle-btn {
    width: 40px;
    height: 40px;
    font-size: 18px;
    bottom: 210px;
  }

  /* Login screen */
  #login-screen .container {
    padding: 30px 15px;
  }

  #login-screen .login-title {
    font-size: 22px;
  }

  #login-screen .subtitle {
    font-size: 12px;
    margin-bottom: 30px;
  }

  .login-form input {
    padding: 12px;
  }

  .auth-buttons {
    flex-direction: column;
    gap: 8px;
  }

  /* Lobby */
  .lobby-header h2 {
    font-size: 20px;
  }

  .player-info {
    font-size: 12px;
  }

  #player-balance {
    font-size: 14px;
  }

  /* Room list */
  .room-item {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .room-item-info {
    text-align: center;
  }

  .room-item .btn {
    width: 100%;
  }

  /* Game table very small - circular */
  .game-table {
    width: min(70vw, 260px);
    height: min(70vw, 260px);
    margin: 35px auto 140px auto;
  }

  /* Opponent boxes very compact */
  .opponent-box {
    padding: 4px 6px;
    min-width: 65px;
    max-width: 100px;
  }

  .opponent-box .player-avatar {
    width: 20px !important;
    height: 20px !important;
  }

  .opponent-name {
    font-size: 9px;
  }

  .opponent-balance,
  .opponent-bet {
    font-size: 7px;
  }

  .opponent-cards .card {
    width: 20px;
    height: 29px;
  }

  .opponent-cards .card-rank {
    font-size: 6px;
  }

  .opponent-cards .card-suit {
    font-size: 8px;
  }

  .my-dealer-deck {
    margin-left: 10px;
  }

  /* Dealer badge smaller */
  .dealer-badge {
    top: -12px;
    padding: 1px 4px;
    font-size: 6px;
    border-radius: 5px;
  }

  /* Clock seat positions for small mobile - outside the circle */
  .seat-12 {
    top: -10px;
    left: 50%;
    transform: translate(-50%, -100%);
  }

  .seat-14 {
    top: 12%;
    right: -12%;
    transform: none;
  }

  .seat-15 {
    top: 50%;
    right: -12%;
    transform: translateY(-50%);
  }

  .seat-16 {
    bottom: 12%;
    right: -12%;
    transform: none;
  }

  .seat-20 {
    bottom: 12%;
    left: -12%;
    transform: none;
  }

  .seat-21 {
    top: 50%;
    left: -12%;
    transform: translateY(-50%);
  }

  .seat-22 {
    top: 12%;
    left: -12%;
    transform: none;
  }

  /* My cards - ensure good visibility */
  .my-cards .card {
    width: 66px;
    height: 96px;
  }

  .my-cards .card .card-rank {
    font-size: 21px;
  }

  .my-cards .card .card-suit {
    font-size: 27px;
  }

  .my-cards-area {
    margin-bottom: 0;
  }

  /* Ceremony deck smaller on mobile, aligned with card */
  .ceremony-deck {
    margin-left: 8px;
    width: 40px;
    height: 58px;
  }

  /* Action panel stacked */
  .action-panel {
    flex-direction: row;
    flex-wrap: wrap;
    padding: 4px 0 0 0;
    gap: 3px;
  }

  .action-player-info {
    font-size: 10px;
    padding: 3px 8px;
    min-height: 28px;
    order: -1;
    width: 100%;
  }

  .action-player-name {
    max-width: 60px;
    font-size: 10px;
  }

  .action-player-balance {
    font-size: 10px;
  }

  .bet-controls {
    gap: 3px;
    width: 100%;
  }

  .bet-controls .btn {
    min-height: 32px;
    padding: 5px 6px;
    font-size: 11px;
    flex: 1 1 auto;
  }

  .raise-controls {
    gap: 3px;
    width: 100%;
  }

  .raise-controls .bet-select {
    min-height: 38px;
    min-width: 55px;
    padding: 4px 6px;
    font-size: 11px;
  }

  .ready-controls .btn {
    min-height: 38px;
    padding: 8px 16px;
    font-size: 12px;
  }

  /* Room header */
  .room-header {
    padding: 6px 8px;
  }

  .room-name {
    font-size: 12px;
    max-width: 120px;
  }

  #leave-room-btn {
    padding: 6px 10px;
    font-size: 11px;
  }

  /* Chat compact */
  .chat-message {
    font-size: 11px;
    padding: 6px 8px;
  }

  /* Timer */
  .timer-circle {
    width: 45px;
    height: 45px;
  }

  .table-timer-value {
    font-size: 14px;
  }

  .table-timer-player {
    font-size: 10px;
  }

  /* Pot display */
  .pot-display {
    padding: 6px 10px;
  }

  .pot-value {
    font-size: 16px;
  }

  .current-bet-display {
    font-size: 10px;
  }

  /* Buttons touch-friendly */
  .btn {
    min-height: 40px;
  }

  .btn-small {
    min-height: 36px;
    padding: 5px 10px;
    font-size: 11px;
  }

  /* Result modal */
  .result-content {
    padding: 20px 15px;
  }

  .result-content h2 {
    font-size: 18px;
  }

  .result-hand-cards .card {
    width: 38px;
    height: 55px;
  }

  #btn-close-result {
    padding: 12px 30px;
    font-size: 16px;
  }
}

/* ===== iPhone SE / Small phones (320px - 375px) ===== */
@media (max-width: 375px) {
  /* Game table smaller - circular */
  .game-table {
    width: min(68vw, 230px);
    height: min(68vw, 230px);
    margin: 35px auto 140px auto;
  }

  /* Opponent boxes smaller */
  .opponent-box {
    min-width: 55px;
    max-width: 85px;
    padding: 3px 5px;
  }

  .opponent-box .player-avatar {
    width: 18px !important;
    height: 18px !important;
  }

  .opponent-name {
    font-size: 8px;
  }

  .opponent-cards .card {
    width: 18px;
    height: 26px;
  }

  .opponent-cards .card-rank {
    font-size: 6px;
  }

  .opponent-cards .card-suit {
    font-size: 8px;
  }

  /* Clock seat positions for iPhone SE - inside the circle */
  .seat-12 {
    top: -10px;
    left: 50%;
    transform: translate(-50%, -100%);
  }

  .seat-14 {
    top: 10%;
    right: -3%;
    transform: none;
  }

  .seat-15 {
    top: 50%;
    right: -3%;
    transform: translateY(-50%);
  }

  .seat-16 {
    bottom: 10%;
    right: -3%;
    transform: none;
  }

  .seat-20 {
    bottom: 10%;
    left: -3%;
    transform: none;
  }

  .seat-21 {
    top: 50%;
    left: -3%;
    transform: translateY(-50%);
  }

  .seat-22 {
    top: 10%;
    left: -3%;
    transform: none;
  }

  /* My cards */
  .my-cards .card {
    width: 60px;
    height: 87px;
  }

  .my-cards .card .card-rank {
    font-size: 20px;
  }

  .my-cards .card .card-suit {
    font-size: 26px;
  }

  /* Action panel compact */
  .bet-controls .btn {
    min-height: 32px;
    padding: 4px 6px;
    font-size: 10px;
  }

  .raise-controls .bet-select {
    min-height: 32px;
    font-size: 10px;
  }

  .action-player-name {
    max-width: 55px;
    font-size: 10px;
  }
}

/* ===== VERY SMALL MOBILE (< 320px) ===== */
@media (max-width: 320px) {
  .chat-toggle-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
    bottom: 190px;
  }

  #login-screen .login-title {
    font-size: 20px;
  }

  #login-screen .subtitle {
    font-size: 11px;
  }

  .game-table {
    width: min(65vw, 200px);
    height: min(65vw, 200px);
    margin: 30px auto 140px auto;
  }

  .opponent-box {
    min-width: 48px;
    max-width: 75px;
    padding: 2px 4px;
  }

  .opponent-box .player-avatar {
    width: 16px !important;
    height: 16px !important;
  }

  .opponent-name {
    font-size: 7px;
  }

  .opponent-balance,
  .opponent-bet {
    font-size: 6px;
  }

  .opponent-cards .card {
    width: 15px;
    height: 22px;
  }

  .opponent-cards .card-rank {
    font-size: 5px;
  }

  .opponent-cards .card-suit {
    font-size: 7px;
  }

  .dealer-badge {
    top: -10px;
    padding: 1px 3px;
    font-size: 5px;
  }

  /* Clock seat positions for very small screens - inside the circle */
  .seat-12 {
    top: -10px;
    left: 50%;
    transform: translate(-50%, -100%);
  }

  .seat-14 {
    top: 12%;
    right: -4%;
    transform: none;
  }

  .seat-15 {
    top: 50%;
    right: -4%;
    transform: translateY(-50%);
  }

  .seat-16 {
    bottom: 12%;
    right: -4%;
    transform: none;
  }

  .seat-20 {
    bottom: 12%;
    left: -4%;
    transform: none;
  }

  .seat-21 {
    top: 50%;
    left: -4%;
    transform: translateY(-50%);
  }

  .seat-22 {
    top: 12%;
    left: -4%;
    transform: none;
  }

  .my-cards .card {
    width: 57px;
    height: 83px;
  }

  .my-cards .card .card-rank {
    font-size: 18px;
  }

  .my-cards .card .card-suit {
    font-size: 24px;
  }

  .action-panel {
    padding: 3px 0 0 0;
    gap: 3px;
  }

  .action-player-info {
    font-size: 9px;
    padding: 3px 6px;
    min-height: 28px;
  }

  .action-player-name {
    max-width: 50px;
    font-size: 9px;
  }

  .bet-controls .btn {
    font-size: 10px;
    padding: 5px 8px;
    min-height: 34px;
  }

  .raise-controls .bet-select {
    min-height: 34px;
    min-width: 50px;
    font-size: 10px;
  }

  .room-header {
    padding: 4px 6px;
  }

  .room-name {
    font-size: 11px;
    max-width: 100px;
  }

  /* Pot and timer smaller */
  .pot-display {
    padding: 5px 8px;
  }

  .pot-value {
    font-size: 14px;
  }

  .timer-circle {
    width: 40px;
    height: 40px;
  }

  .table-timer-value {
    font-size: 12px;
  }

  .table-timer-player {
    font-size: 9px;
  }
}

/* Gift Money Feature */
.btn-gift {
  position: absolute;
  bottom: 5px;
  right: 5px;
  padding: 4px 8px;
  font-size: 14px;
  background: rgba(255, 193, 7, 0.8);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.opponent-box {
  position: relative;
}

.opponent-box:hover .btn-gift {
  opacity: 1;
}

.btn-gift:hover {
  background: rgba(255, 193, 7, 1);
}

/* Gift Modal */
.gift-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.gift-modal-content {
  background: linear-gradient(135deg, #1a5f2a 0%, #0d3d15 100%);
  padding: 30px;
  border-radius: 15px;
  min-width: 300px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.gift-modal-content h3 {
  margin-bottom: 15px;
  text-align: center;
  color: #ffc107;
}

.gift-modal-content p {
  margin-bottom: 20px;
  text-align: center;
  color: #ccc;
}

.gift-modal-content .form-group {
  margin-bottom: 20px;
}

.gift-modal-content input {
  width: 100%;
  padding: 12px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 18px;
  text-align: center;
}

.gift-modal-content input:focus {
  outline: none;
  border-color: #ffc107;
}

.gift-modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.gift-modal-buttons .btn {
  padding: 10px 25px;
}

/* Gift Notification */
.gift-notification {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
  color: #000;
  padding: 15px 30px;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  z-index: 3000;
  animation: slideDown 0.5s ease;
}

.gift-notification-content {
  font-size: 16px;
}

.gift-notification.fade-out {
  animation: fadeOut 0.5s ease forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
  }
}

/* DEBUG: Force Seka label */
.debug-label {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 60, 60, 0.75);
  color: #fff;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  z-index: 110;
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: 0.5px;
}

/* DEBUG: Player index numbers */
.debug-index {
  color: #ff9800;
  font-size: 11px;
  font-weight: bold;
  opacity: 0.9;
}

/* Peek target highlight */
.opponent-box.peek-target {
}

.peek-target-badge {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #ce93d8 0%, #9c27b0 100%);
  color: #fff;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 9px;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  border: 1px solid #fff;
  z-index: 10;
  white-space: nowrap;
  cursor: pointer;
  letter-spacing: 0.5px;
}

.peek-target-badge:hover {
  transform: translateX(-50%) scale(1.1);
  box-shadow: 0 4px 12px rgba(156, 39, 176, 0.6);
}

/* Peek Animation */
.peek-flying-eye {
  position: fixed;
  font-size: 40px;
  z-index: 9999;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: left 0.5s ease-in-out, top 0.5s ease-in-out, transform 0.5s ease-in-out;
  filter: drop-shadow(0 0 10px rgba(156, 39, 176, 0.8));
}

.peek-flying-eye.flying {
  transform: translate(-50%, -50%) scale(1.5);
}

.peek-animation-source {
  animation: peekSourcePulse 0.5s ease-in-out;
  box-shadow: 0 0 30px #4fc3f7 !important;
}

.peek-animation-target {
  animation: peekTargetGlow 0.5s ease-in-out 0.3s;
}

@keyframes peekSourcePulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes peekTargetGlow {
  0% { box-shadow: 0 0 0 rgba(156, 39, 176, 0); }
  50% { box-shadow: 0 0 40px rgba(156, 39, 176, 0.8); }
  100% { box-shadow: 0 0 20px rgba(156, 39, 176, 0.4); }
}

.peek-loser-flash {
  animation: loserFlash 1s ease-in-out !important;
}

@keyframes loserFlash {
  0%, 100% { opacity: 1; }
  25% { opacity: 0.3; background: rgba(255, 0, 0, 0.3); }
  50% { opacity: 1; }
  75% { opacity: 0.3; background: rgba(255, 0, 0, 0.3); }
}

/* Folded cards shown at player's seat */
.folded-card {
  opacity: 0.7;
  filter: grayscale(30%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.opponent-box.folded .opponent-cards {
  margin-top: 5px;
}

/* Bet Popup */
.bet-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.bet-popup-content {
  background: linear-gradient(135deg, #1a5f2a 0%, #0d3d15 100%);
  padding: 30px;
  border-radius: 15px;
  min-width: 320px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.bet-popup-content h3 {
  margin-bottom: 20px;
  color: #ffc107;
  font-size: 20px;
}

.bet-popup-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.bet-popup-minus,
.bet-popup-plus {
  width: 50px;
  height: 50px;
  font-size: 24px;
  font-weight: bold;
  padding: 0;
  border-radius: 8px;
}

.bet-amount-input {
  width: 100px;
  height: 50px;
  font-size: 24px;
  text-align: center;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  -moz-appearance: textfield; /* Firefox */
}

/* Hide number input spinners */
.bet-amount-input::-webkit-outer-spin-button,
.bet-amount-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.bet-amount-input:focus {
  outline: none;
  border-color: #ffc107;
}

.bet-popup-minmax {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

.bet-popup-minmax-btn {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 8px;
}

.bet-popup-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.bet-popup-buttons .btn {
  padding: 12px 30px;
}

/* ==================== Profile Modal ==================== */
.profile-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.profile-modal.hidden {
  display: none !important;
}

.profile-modal-content {
  background: #1a2a1a;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255, 215, 0, 0.2);
}

.profile-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.profile-modal-header h2 {
  font-size: 18px;
  color: #ffd54f;
}

.profile-modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.profile-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.profile-tab {
  flex: 1;
  padding: 10px 8px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.profile-tab:hover {
  color: #fff;
}

.profile-tab.active {
  color: #ffd54f;
  border-bottom-color: #ffd54f;
}

.profile-tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.profile-pane {
  display: none;
}

.profile-pane.active {
  display: block;
}

/* Profile Info/Stats */
.profile-info-card {
  text-align: center;
}

.profile-avatar-display {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 16px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #ffd54f;
  overflow: hidden;
  border: 2px solid rgba(255, 215, 0, 0.3);
}

.profile-avatar-display img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-stats {
  text-align: left;
}

.profile-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 14px;
}

.profile-stat-label {
  color: rgba(255, 255, 255, 0.6);
}

.profile-stat-value {
  color: #fff;
  font-weight: 600;
}

/* Transactions */
.profile-transactions-list {
  max-height: 400px;
  overflow-y: auto;
}

.profile-tx-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
}

.profile-tx-info {
  flex: 1;
}

.profile-tx-type {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profile-tx-type.deposit {
  color: #66bb6a;
}

.profile-tx-type.withdrawal {
  color: #ef5350;
}

.profile-tx-comment {
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  margin-top: 2px;
}

.profile-tx-amount {
  font-weight: 600;
  font-size: 14px;
}

.profile-tx-amount.deposit {
  color: #66bb6a;
}

.profile-tx-amount.withdrawal {
  color: #ef5350;
}

.profile-tx-date {
  color: rgba(255, 255, 255, 0.4);
  font-size: 11px;
  margin-left: 12px;
  white-space: nowrap;
}

.profile-no-data {
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
  padding: 30px 0;
  font-size: 14px;
}

/* Password form */
.profile-password-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-password-form input {
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  font-size: 14px;
}

.profile-password-form input:focus {
  border-color: #ffd54f;
  outline: none;
}

.profile-msg {
  font-size: 13px;
  padding: 8px;
  border-radius: 6px;
  text-align: center;
}

.profile-msg.success {
  color: #66bb6a;
  background: rgba(102, 187, 106, 0.1);
}

.profile-msg.error {
  color: #ef5350;
  background: rgba(239, 83, 80, 0.1);
}

/* Avatar section */
.profile-avatar-section {
  text-align: center;
}

.profile-avatar-preview {
  width: 128px;
  height: 128px;
  border-radius: 50%;
  margin: 0 auto 20px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: #ffd54f;
  overflow: hidden;
  border: 3px solid rgba(255, 215, 0, 0.3);
}

.profile-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-upload-btn {
  cursor: pointer;
  display: inline-block;
}

/* Player avatar on game table */
.player-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 215, 0, 0.3);
  font-size: 14px;
  font-weight: 700;
  color: #ffd54f;
  flex-shrink: 0;
}

.player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.opponent-box .player-avatar {
  border-radius: 50%;
  flex-shrink: 0;
}

.my-player-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 215, 0, 0.3);
  font-size: 12px;
  font-weight: 700;
  color: #ffd54f;
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 4px;
}

.my-player-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 768px) {
  .profile-modal-content {
    max-height: 90vh;
  }

  .profile-tab {
    font-size: 11px;
    padding: 8px 6px;
  }

  .player-avatar {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .my-player-avatar {
    width: 24px;
    height: 24px;
    font-size: 10px;
  }
}
