/* RiotMaker Poker Table — Telegram Mini App Full-Screen Responsive Design System */

:root {
  --felt-center: #164126;
  --felt-border: #0a2012;
  --gold-primary: #f5c341;
  --gold-dark: #b4871e;
  --card-bg: #fefeff;
  --dark-bg: #0b0f19;
  --red-accent: #dc181e;
  --blue-accent: #2563eb;
  --green-accent: #16a34a;
  --text-light: #f8fafc;
  --sol-purple: #9945FF;
  --sol-green: #14F195;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

button, input, select { user-select: none; }

html, body {
  width: 100%;
  height: 100%;
  height: 100dvh;
  margin: 0;
  padding: 0;
  overflow: hidden;
  position: fixed;
  background-color: var(--dark-bg);
  color: var(--text-light);
  display: flex;
  justify-content: center;
  align-items: center;
}

.poker-container {
  width: 100%;
  max-width: 480px;
  height: 100%;
  height: 100dvh;
  height: var(--tg-vh, 100dvh);
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at center, var(--felt-center) 0%, var(--felt-border) 100%);
  border: 2px solid var(--gold-dark);
  box-shadow: 0 0 30px rgba(0,0,0,0.8);
  position: relative;
  perspective: 1000px;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* 1. LOBBY & LANDING SCREEN STYLES                                            */
/* ═══════════════════════════════════════════════════════════════════════════ */

.lobby-container {
  width: 100%;
  height: 100%;
  height: var(--tg-vh, 100dvh);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
  overflow-y: auto;
}

.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(245, 195, 65, 0.2);
}

.lobby-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--gold-primary);
  letter-spacing: 0.5px;
}

/* Profile Card */
.profile-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--gold-dark);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.user-avatar {
  font-size: 24px;
  background: #0f172a;
  border: 1px solid var(--gold-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.tg-user {
  font-size: 13px;
  font-weight: bold;
  color: #f8fafc;
}

.tg-id {
  font-size: 10px;
  color: #94a3b8;
}

.wallet-status {
  text-align: right;
}

.sol-badge {
  font-size: 10px;
  font-weight: bold;
  color: var(--sol-green);
  background: rgba(20, 241, 149, 0.15);
  border: 1px solid var(--sol-green);
  padding: 3px 8px;
  border-radius: 10px;
}

/* Mode Selection Cards */
.section-title {
  font-size: 10px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.mode-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mode-card {
  width: 100%;
  color: inherit;
  text-align: left;
  font: inherit;
  background: rgba(15, 23, 42, 0.8);
  border: 1.5px solid #334155;
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--sol-green);
  outline-offset: 2px;
}

.mode-card.selected {
  border-color: var(--gold-primary);
  background: rgba(245, 195, 65, 0.1);
}

.mode-icon {
  font-size: 20px;
}

.mode-info {
  flex: 1;
}

.mode-name {
  font-size: 12px;
  font-weight: bold;
  color: #f8fafc;
}

.mode-sub {
  font-size: 10px;
  color: #94a3b8;
}

.radio-indicator {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--gold-primary);
  font-weight: bold;
}

.mode-card.selected .radio-indicator {
  border-color: var(--gold-primary);
  background: rgba(245, 195, 65, 0.2);
}

/* Persona Dropdown */
.lobby-select {
  width: 100%;
  background: #0f172a;
  color: var(--gold-primary);
  border: 1px solid var(--gold-dark);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 11px;
  outline: none;
}

/* Take Seat Button */
.launch-container {
  padding-top: 4px;
}

.btn-launch {
  width: 100%;
  padding: 12px 0;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  transition: transform 0.1s;
}

.btn-launch:active {
  transform: scale(0.97);
}

.btn-launch-gold {
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
  color: #0b0f19;
  box-shadow: 0 4px 20px rgba(245, 195, 65, 0.5);
}

/* ─── Cash Game Setup Panel ─────────────────────────────────────────────────── */

#cash-game-panel {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(circle at top, #1a1a2e 0%, #0b0f19 100%);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 12px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  gap: 10px;
}

.cgp-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(245, 195, 65, 0.2);
}

.cgp-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--gold-primary);
  letter-spacing: 0.5px;
  margin: 0;
}

.cgp-notice {
  background: rgba(220, 24, 30, 0.15);
  border: 1px solid #dc181e;
  border-radius: 10px;
  color: #fca5a5;
  font-size: 12px;
  font-weight: 600;
  padding: 10px 12px;
  text-align: center;
}

.cgp-section {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #1e293b;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fee-display-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.cgp-fee-value {
  font-size: 26px;
  font-weight: 900;
  color: var(--gold-primary);
  letter-spacing: -0.5px;
}

.cgp-pot-preview {
  font-size: 11px;
  color: var(--sol-green);
  font-weight: 600;
}

.fee-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--gold-primary) 0%, var(--gold-primary) 10%, #334155 10%, #334155 100%);
  outline: none;
  cursor: pointer;
}

.fee-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--gold-primary);
  box-shadow: 0 2px 8px rgba(245,195,65,0.5);
  cursor: pointer;
}

.fee-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #64748b;
  letter-spacing: 0.5px;
}

.cgp-size-pills {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}

.cgp-size-pill {
  background: #0f172a;
  border: 1.5px solid #334155;
  color: #94a3b8;
  border-radius: 12px;
  padding: 10px 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  line-height: 1.4;
}

.cgp-size-pill small {
  font-size: 9px;
  display: block;
  font-weight: 400;
  color: #64748b;
}

.cgp-size-pill.active {
  background: rgba(153, 69, 255, 0.2);
  border-color: var(--sol-purple);
  color: #d8b4fe;
}

.cgp-size-pill.active small {
  color: #a78bfa;
}

.cgp-info {
  background: rgba(20, 241, 149, 0.05);
  border: 1px solid rgba(20, 241, 149, 0.15);
  border-radius: 12px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cgp-info-row {
  font-size: 10px;
  color: #94a3b8;
}

/* Active Tables Lobby Section */
.active-tables-section {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid #1e293b;
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.active-tables-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.icon-btn-small {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 6px;
  color: white;
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
}

.active-table-tabs {
  display: flex;
  gap: 6px;
}

.tab-btn {
  flex: 1;
  background: #0f172a;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 6px 0;
  font-size: 11px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--blue-accent);
  border-color: #60a5fa;
  color: white;
}

.active-tables-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 160px;
  overflow-y: auto;
}

.empty-tables-notice {
  text-align: center;
  font-size: 11px;
  color: #64748b;
  padding: 12px 0;
}

.active-table-card {
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 8px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.atc-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.atc-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  max-width: 54%;
}

.atc-title {
  font-size: 11px;
  font-weight: bold;
  color: #f8fafc;
}

.atc-sub {
  font-size: 9px;
  color: #94a3b8;
}

.atc-join-btn {
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
  color: #0b0f19;
  border: none;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
}

.atc-spectate-btn {
  background: #334155;
  color: #f8fafc;
  border: 1px solid #475569;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
}

/* Spectator Banner Styling */
.spectator-banner {
  background: rgba(147, 51, 234, 0.25);
  border-bottom: 2px solid #a855f7;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.spectator-icon {
  font-size: 18px;
}

.spectator-text {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  color: #f3e8ff;
}

.spectator-text small {
  font-size: 9px;
  color: #d8b4fe;
}

.cgp-info-row strong {
  color: var(--sol-green);
}

.cgp-info-row code {
  color: var(--gold-primary);
  background: rgba(245,195,65,0.1);
  padding: 0 4px;
  border-radius: 4px;
}

/* Rebuy Settings in Setup Panel */
.cgp-rebuy-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cgp-rebuy-label {
  font-size: 12px;
  font-weight: 700;
  color: #f8fafc;
}

.cgp-toggle-group {
  display: flex;
  background: #0f172a;
  border-radius: 8px;
  padding: 2px;
  border: 1px solid #334155;
}

.cgp-toggle-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.cgp-toggle-btn.active {
  background: var(--green-accent);
  color: white;
}

.cgp-sublabel {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 4px;
}

.cgp-rebuy-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 4px;
}

.cgp-rebuy-pill {
  background: #0f172a;
  border: 1.5px solid #334155;
  color: #94a3b8;
  border-radius: 8px;
  padding: 6px 0;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}

.cgp-rebuy-pill.active {
  background: rgba(245, 195, 65, 0.15);
  border-color: var(--gold-primary);
  color: var(--gold-primary);
}

/* Rebuy Modal Styling */
.rebuy-card {
  text-align: center;
  padding: 24px 20px;
  border: 2px solid var(--gold-dark);
  background: radial-gradient(circle at top, #1e293b 0%, #0f172a 100%);
}

.rebuy-icon {
  font-size: 44px;
  margin-bottom: 8px;
}

.rebuy-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--gold-primary);
  letter-spacing: 0.5px;
}

.rebuy-desc {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 6px;
}

.rebuy-badge {
  display: inline-block;
  background: rgba(245, 195, 65, 0.15);
  border: 1px solid var(--gold-primary);
  color: var(--gold-primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: bold;
  margin-top: 10px;
}


/* ═══════════════════════════════════════════════════════════════════════════ */
/* 2. POKER TABLE FELT VIEW                                                    */
/* ═══════════════════════════════════════════════════════════════════════════ */

.poker-table-view {
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Table Header */
.table-header {
  height: 44px;
  min-height: 44px;
  background: rgba(10, 32, 18, 0.95);
  border-bottom: 2px solid var(--gold-dark);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 10px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-badge {
  color: var(--gold-primary);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.5px;
}

.wallet-btn {
  background: rgba(153, 69, 255, 0.2);
  border: 1px solid var(--sol-purple);
  color: #c084fc;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.wallet-btn:hover {
  background: rgba(153, 69, 255, 0.4);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.gto-meter {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--gold-primary);
  border-radius: 12px;
  padding: 3px 8px;
  font-size: 10px;
}

.gto-title {
  color: #94a3b8;
  margin-right: 2px;
}

.gto-value {
  color: #4ade80;
  font-weight: bold;
}

.icon-btn {
  background: rgba(0,0,0,0.4);
  border: 1px solid #334155;
  color: white;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  cursor: pointer;
}

/* Main Poker Felt */
.poker-table {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  position: relative;
  overflow: hidden;
}

/* Player Areas */
.opponents-area, .hero-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.live-opponents {
  width: 100%;
  min-height: 96px;
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 6px;
}

.live-opponent-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  max-width: 46%;
}

.live-opponent-seat.away { opacity: 0.72; }
.live-opponent-seat.eliminated { opacity: 0.45; filter: grayscale(1); }
.live-opponent-seat .avatar-badge { padding: 3px 8px; max-width: 150px; }
.live-opponent-seat .player-name,
.live-opponent-seat .player-stack { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 116px; }
.live-opponent-seat .card { width: 34px; height: 48px; font-size: 9px; }
.live-opponent-seat .card-suit-center { font-size: 15px; }

/* Badges */
.avatar-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.85);
  border: 1.5px solid var(--gold-primary);
  border-radius: 18px;
  padding: 3px 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.avatar-icon {
  font-size: 16px;
}

.player-info {
  display: flex;
  flex-direction: column;
}

.player-name {
  font-size: 11px;
  font-weight: 600;
  color: #e2e8f0;
}

.player-stack {
  font-size: 10px;
  color: var(--gold-primary);
  font-weight: bold;
}

/* Cards & 3D Animations */
.card-row {
  display: flex;
  gap: 6px;
}

.card {
  width: 48px;
  height: 68px;
  background: var(--card-bg);
  border-radius: 6px;
  border: 1.5px solid #334155;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: dealCard 0.3s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes dealCard {
  0% {
    opacity: 0;
    transform: translateY(-140px) scale(0.3) rotate(-12deg);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

.card.flip {
  animation: flipCard 0.45s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes flipCard {
  0% {
    transform: rotateY(180deg) scale(0.85);
    opacity: 0.6;
  }
  50% {
    transform: rotateY(90deg) scale(1.08);
  }
  100% {
    transform: rotateY(0deg) scale(1);
    opacity: 1;
  }
}

.card-back {
  background: linear-gradient(135deg, #1e3a8a 0%, #0f172a 100%);
  border: 1.5px solid var(--gold-primary);
}

.card-back::after {
  content: "🃏";
  font-size: 20px;
  margin: auto;
}

.card.slot {
  background: rgba(10, 32, 18, 0.6);
  border: 1.5px dashed #334155;
  color: #64748b;
  font-size: 18px;
  justify-content: center;
  align-items: center;
  animation: none;
}

.card-rank {
  font-size: 12px;
  font-weight: bold;
}

.card-suit-center {
  font-size: 18px;
  align-self: center;
}

.red { color: var(--red-accent); }
.black { color: #0f172a; }

/* Pot Area */
.board-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pot-container {
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--gold-primary);
  border-radius: 14px;
  padding: 3px 14px;
  display: flex;
  gap: 6px;
  align-items: center;
}

.pot-label {
  font-size: 10px;
  color: #94a3b8;
  letter-spacing: 1px;
}

.pot-value {
  font-size: 14px;
  color: var(--gold-primary);
  font-weight: bold;
}

/* Action Controls Footer */
.action-controls {
  background: rgba(15, 23, 42, 0.96);
  border-top: 2px solid var(--gold-dark);
  padding: 8px 12px;
  padding-bottom: max(8px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.game-status {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-primary);
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(245, 195, 65, 0.25);
  border-radius: 8px;
  padding: 5px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slider-container {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.slider-val {
  font-size: 11px;
  color: var(--gold-primary);
  font-weight: bold;
  text-align: right;
}

input[type=range] {
  width: 100%;
  height: 6px;
  accent-color: var(--gold-primary);
}

.button-group {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 6px;
}

.btn {
  padding: 8px 0;
  border-radius: 8px;
  border: none;
  font-weight: bold;
  font-size: 11px;
  color: white;
  cursor: pointer;
  transition: filter 0.15s, transform 0.1s;
}

.btn:active {
  transform: scale(0.96);
}

.btn-fold { background: #dc2626; }
.btn-call { background: #2563eb; }
.btn-raise { background: #d97706; }
.btn-allin { background: linear-gradient(135deg, #b91c1c 0%, #ea580c 100%); }


/* ═══════════════════════════════════════════════════════════════════════════ */
/* 3. REDESIGNED SOLANA WALLET HUB STYLES                                      */
/* ═══════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
  /* Keep overlays independent from the poker layout and Telegram viewport resize. */
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-card {
  width: 100%;
  max-width: 360px;
  max-height: 100%;
  overflow-y: auto;
  background: radial-gradient(circle at top left, #1e1b4b 0%, #0f172a 100%);
  border: 1.5px solid var(--sol-purple);
  border-radius: 20px;
  padding: 14px;
  box-shadow: 0 12px 30px rgba(153, 69, 255, 0.3);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: modalSlideUp 0.25s ease-out forwards;
}

@keyframes modalSlideUp {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(153, 69, 255, 0.25);
  padding-bottom: 10px;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sol-logo-icon {
  font-size: 16px;
  background: linear-gradient(135deg, var(--sol-purple) 0%, var(--sol-green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-header h3 {
  font-size: 15px;
  font-weight: 800;
  color: white;
}

.modal-close {
  background: rgba(255,255,255,0.05);
  border: 1px solid #334155;
  color: #94a3b8;
  font-size: 14px;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Account Card View */
.wallet-account-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(20, 241, 149, 0.3);
  border-radius: 14px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.account-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-indicator {
  font-size: 11px;
  font-weight: bold;
  color: var(--sol-green);
}

.account-tg-badge {
  max-width: 128px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 9px;
  color: #c084fc;
  background: rgba(153, 69, 255, 0.15);
  padding: 2px 6px;
  border-radius: 8px;
}

.pubkey-box {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 6px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pubkey-text {
  font-family: monospace;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
  color: #f8fafc;
  word-break: break-all;
}

.btn-icon-action {
  background: rgba(255,255,255,0.08);
  border: 1px solid #475569;
  color: #cbd5e1;
  flex-shrink: 0;
  font-size: 9px;
  padding: 3px 6px;
  border-radius: 6px;
  cursor: pointer;
}

.balance-box {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 4px;
}

.balance-label {
  font-size: 10px;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.balance-val {
  font-size: 14px;
  font-weight: 800;
  color: var(--sol-green);
}

/* Action Buttons Grid */
.account-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-sol-primary {
  background: linear-gradient(135deg, var(--sol-purple) 0%, #7e22ce 100%);
  color: white;
  border: 1px solid #c084fc;
  border-radius: 10px;
  padding: 10px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
}

.btn-sol-secondary {
  background: rgba(30, 41, 59, 0.8);
  color: #cbd5e1;
  border: 1px solid #475569;
  border-radius: 10px;
  padding: 10px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
}

.btn-sol-danger {
  background: rgba(220, 38, 38, 0.15);
  color: #f87171;
  border: 1px solid #ef4444;
  border-radius: 10px;
  padding: 9px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
}

/* Unconnected Wallet Provider Stack */
.unconnected-view-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wallet-provider-stack {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.provider-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.provider-item-label {
  font-size: 9px;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.8px;
  text-align: center;
}

.provider-btn {
  width: 100%;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.9);
  color: white;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
}

.phantom-mobile-btn {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: var(--sol-green);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.phantom-mobile-btn:active {
  transform: scale(0.97);
}

.phantom-btn {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%);
  border-color: #818cf8;
  color: white;
}

.phantom-btn:active {
  transform: scale(0.97);
}

.provider-icon {
  font-size: 16px;
}

.modal-desc {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
  text-align: center;
  margin-bottom: 4px;
}

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

.address-input-group input {
  flex: 1;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 11px;
  color: white;
  outline: none;
}

.btn-submit-addr {
  background: var(--blue-accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
}

.payout-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.payout-card {
  border: 1px solid rgba(20, 241, 149, 0.3);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  padding: 10px;
}

.payout-card-title {
  color: #f8fafc;
  font-size: 11px;
  font-weight: 800;
}

.payout-card-detail {
  margin-top: 4px;
  color: #94a3b8;
  font-family: monospace;
  font-size: 10px;
}

.payout-card button {
  width: 100%;
  margin-top: 8px;
}

/* 2026 product polish: readable mobile controls and consistent interaction states */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] { display: none !important; }

.brand-title {
  margin: 0;
  font-size: 18px;
}

.section-title {
  display: block;
  margin: 0 0 7px;
  font-size: 12px;
  line-height: 1.2;
  text-transform: uppercase;
}

.wallet-btn {
  min-height: 36px;
  padding: 7px 10px;
  font-size: 12px;
}

.profile-card { min-height: 64px; }
.tg-user { font-size: 15px; }
.tg-id { font-size: 12px; line-height: 1.35; }
.sol-badge { font-size: 11px; }
.sol-badge.disconnected { color: #cbd5e1; border-color: #64748b; background: rgba(100, 116, 139, 0.14); }

.mode-card {
  min-height: 62px;
  padding: 11px 13px;
}
.mode-name { font-size: 14px; }
.mode-sub { margin-top: 2px; font-size: 12px; line-height: 1.3; }

.lobby-select {
  min-height: 42px;
  font-size: 13px;
}

.cpu-settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.cpu-setting {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  color: #cbd5e1;
  font-size: 12px;
}

.cpu-setting > span,
.cpu-setting > legend {
  display: block;
  margin-bottom: 5px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.segmented-control button,
.bet-presets button {
  min-height: 42px;
  border: 1px solid #475569;
  border-radius: 9px;
  background: #0f172a;
  color: #cbd5e1;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.segmented-control button.active,
.segmented-control button[aria-pressed="true"] {
  border-color: var(--gold-primary);
  background: rgba(245, 195, 65, 0.14);
  color: var(--gold-primary);
}

.active-tables-section {
  padding: 0;
  overflow: hidden;
}

.active-tables-summary {
  min-height: 44px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f8fafc;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.active-tables-summary::-webkit-details-marker { display: none; }
.active-tables-summary::before { content: "▸"; margin-right: 8px; color: var(--gold-primary); }
.active-tables-section[open] .active-tables-summary::before { content: "▾"; }
.active-tables-summary > span:first-child { margin-right: auto; }
.live-count { color: var(--sol-green); font-size: 11px; }
.active-tables-section[open] .active-tables-header,
.active-tables-section[open] .active-table-tabs,
.active-tables-section[open] .active-tables-grid { margin-left: 10px; margin-right: 10px; }
.active-tables-section[open] .active-tables-grid { margin-bottom: 10px; }

.icon-btn-small,
.icon-btn {
  min-width: 36px;
  min-height: 36px;
  font-size: 14px;
}

.tab-btn { min-height: 40px; font-size: 12px; }
.btn-launch { min-height: 48px; font-size: 15px; text-transform: none; }

.active-table-card { align-items: flex-start; gap: 8px; padding: 11px; }
.atc-title { font-size: 13px; }
.atc-sub { margin-top: 3px; font-size: 12px; }
.atc-meta { margin-top: 4px; color: #64748b; font-size: 10px; }
.atc-actions { flex-wrap: wrap; justify-content: flex-end; }
.atc-actions button { min-height: 36px; padding: 7px 9px; }

.cgp-title { font-size: 17px; }
.cgp-size-pill { min-height: 58px; font-size: 13px; }
.cgp-info-row { font-size: 12px; line-height: 1.45; }

.table-header { min-height: 48px; padding: 6px 9px; }
.header-badge { font-size: 13px; }
.header-left, .header-right { gap: 6px; }
.connection-state {
  padding: 4px 7px;
  border-radius: 999px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  font-size: 10px;
  font-weight: 800;
}
.connection-state[data-state="live"] { color: var(--sol-green); background: rgba(20, 241, 149, 0.12); }
.connection-state[data-state="offline"] { color: #fca5a5; background: rgba(248, 113, 113, 0.12); }
.insights-toggle {
  min-height: 36px;
  border: 1px solid #475569;
  border-radius: 999px;
  background: #0f172a;
  color: #cbd5e1;
  font-size: 11px;
  cursor: pointer;
}

.game-status { min-height: 38px; font-size: 13px; line-height: 1.35; }
.hand-history {
  min-height: 18px;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 8px;
  overflow: hidden;
  list-style: none;
  color: #94a3b8;
  font-size: 10px;
  white-space: nowrap;
}
.hand-history li { overflow: hidden; text-overflow: ellipsis; }
.hand-history li::after { content: " ·"; }

.slider-container { gap: 5px; }
.slider-val { font-size: 12px; }
.bet-presets {
  display: grid;
  grid-template-columns: repeat(3, 1fr) 1.35fr;
  gap: 5px;
}
.bet-presets button { min-height: 36px; font-size: 11px; }
.bet-amount-label {
  min-height: 36px;
  padding: 3px 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #475569;
  border-radius: 9px;
  color: #94a3b8;
  font-size: 9px;
}
.bet-amount-label input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 12px;
  outline: 0;
}
.button-group { gap: 6px; }
.btn { min-height: 44px; font-size: 12px; }

.modal-card { font-size: 14px; }
.modal-desc { font-size: 13px; }
.provider-btn, .btn-sol-primary, .btn-sol-secondary, .btn-sol-danger { min-height: 46px; font-size: 13px; }
.payout-summary { color: #e2e8f0; font-size: 13px; font-weight: 800; }
.payout-group-title { margin: 6px 0 0; color: var(--gold-primary); font-size: 12px; text-transform: uppercase; }
.payout-card-title { font-size: 13px; }
.payout-card-detail { font-size: 11px; line-height: 1.4; }

.toast-region {
  position: fixed;
  z-index: 2000;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  width: min(420px, calc(100vw - 28px));
  padding: 11px 14px;
  border: 1px solid #60a5fa;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.97);
  color: #f8fafc;
  box-shadow: 0 12px 36px rgba(0,0,0,.45);
  font-size: 13px;
  line-height: 1.4;
  opacity: 0;
  transform: translate(-50%, 12px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.toast-region.visible { opacity: 1; transform: translate(-50%, 0); }
.toast-region[data-tone="error"] { border-color: #f87171; }

@media (max-width: 420px) {
  .lobby-container { padding: 10px; }
  .brand-title { font-size: 16px; }
  .header-badge { display: none; }
  .cpu-settings-grid { grid-template-columns: 1fr; }
  .button-group { display: grid; grid-template-columns: repeat(2, 1fr); }
  .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
