@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Playfair+Display:wght@700&display=swap');

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2332;
  --bg-card-hover: #243044;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-gold: #f59e0b;
  --accent-gold-light: #fbbf24;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;
  --felt-green: #0d6b3e;
  --felt-dark: #095230;
  --felt-light: #0f834d;
  --border: #1e293b;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.5);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.6);
  --radius: 12px;
  --radius-sm: 8px;
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 24px;
  background: rgba(17,24,39,0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 56px;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.top-logo { height: 32px; width: auto; }
.top-title { font-weight: 700; font-size: 16px; color: var(--accent-gold); }
.back-link { color: var(--text-secondary); text-decoration: none; font-size: 14px; transition: .2s; }
.back-link:hover { color: var(--text-primary); }
.balance-display { font-weight: 600; color: var(--accent-gold); font-size: 15px; }
.hand-info { color: var(--text-muted); font-size: 13px; }
.stakes-info { color: var(--accent-blue); font-weight: 600; font-size: 14px; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), #d97706);
  color: #000;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all .3s;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(245,158,11,0.4);
}
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: all .3s;
}
.btn-secondary:hover { background: var(--bg-card-hover); }

.btn-danger {
  background: var(--accent-red);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 13px;
  cursor: pointer;
  transition: all .3s;
}
.btn-danger:hover { background: #dc2626; }

.btn-small { padding: 6px 14px; font-size: 13px; }
.btn-full { width: 100%; }

/* AUTH PAGE */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at center, #111827 0%, #0a0e17 70%);
}

.auth-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 420px;
  max-width: 95vw;
  box-shadow: var(--shadow-lg);
}

.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo img { height: 64px; margin-bottom: 12px; }
.auth-logo h1 { font-size: 24px; color: var(--accent-gold); }

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  transition: all .3s;
}
.auth-tab.active { background: var(--accent-gold); color: #000; }
.auth-tab:hover:not(.active) { color: var(--text-primary); }

.auth-form { display: none; }
.auth-form.active { display: block; }

/* MAIN MENU */
.main-menu-page {
  background: radial-gradient(ellipse at 50% 0%, #1a2332 0%, #0a0e17 70%);
  padding-top: 56px;
}

.main-menu {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
  text-align: center;
}

.menu-hero { margin-bottom: 48px; }
.hero-logo { height: 80px; margin-bottom: 16px; }
.menu-hero h1 { font-size: 36px; color: var(--accent-gold); margin-bottom: 8px; }
.menu-hero p { color: var(--text-secondary); font-size: 18px; }

.menu-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 48px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.menu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 24px;
  cursor: pointer;
  transition: all .3s;
  position: relative;
}
.menu-card:hover {
  border-color: var(--accent-gold);
  transform: translateY(-4px);
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}
.menu-card-icon { font-size: 48px; margin-bottom: 16px; }
.menu-card h2 { font-size: 20px; margin-bottom: 8px; }
.menu-card p { color: var(--text-secondary); font-size: 14px; }
.menu-card-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent-blue);
  color: #fff;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 600;
}

/* TABLES */
.tables-section { margin-top: 24px; }
.tables-section h2 { font-size: 22px; margin-bottom: 16px; text-align: left; }

.table-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all .2s;
}
.filter-btn.active { background: var(--accent-gold); color: #000; border-color: var(--accent-gold); }
.filter-btn:hover:not(.active) { border-color: var(--text-muted); }

.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: left;
  transition: all .3s;
  cursor: pointer;
}
.table-card:hover { border-color: var(--accent-gold); transform: translateY(-2px); box-shadow: 0 8px 25px rgba(0,0,0,0.3); }
.table-card h3 { font-size: 16px; margin-bottom: 8px; }
.table-card .table-stakes { color: var(--accent-gold); font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.table-card .table-detail { color: var(--text-muted); font-size: 13px; }
.table-card .table-players { color: var(--accent-green); font-size: 13px; font-weight: 500; margin-top: 8px; }
.table-card .table-status { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; margin-top: 8px; }
.table-status-waiting { background: rgba(16,185,129,0.2); color: var(--accent-green); }
.table-status-active { background: rgba(59,130,246,0.2); color: var(--accent-blue); }

.create-table-section { text-align: center; }

/* FORMS */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border .2s;
}
.form-group input:focus, .form-group select:focus { border-color: var(--accent-gold); }
.form-hint { color: var(--text-muted); font-size: 12px; margin-top: 4px; }
.form-error { color: var(--accent-red); font-size: 13px; margin-top: 8px; min-height: 20px; }

/* MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  width: 440px;
  max-width: 95vw;
  position: relative;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
}
.modal h2 { margin-bottom: 16px; font-size: 20px; }
.modal p { color: var(--text-secondary); margin-bottom: 16px; font-size: 14px; }

.modal-close {
  position: absolute;
  top: 12px; right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
}
.modal-close:hover { color: var(--text-primary); }

.modal-result { text-align: center; }
.modal-result h2 { font-size: 28px; }
.modal-result p { font-size: 16px; }

/* POKER TABLE */
.game-page { background: #0a0e17; padding-top: 56px; overflow: hidden; }

.poker-table-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 56px - 160px);
  padding: 20px;
}

.poker-table {
  position: relative;
  width: 900px;
  height: 500px;
  border-radius: 250px / 160px;
  background: radial-gradient(ellipse at 50% 40%, #0f834d, #095230 60%, #063d1f);
  box-shadow: 0 0 80px rgba(6,107,62,0.3), inset 0 0 100px rgba(0,0,0,0.3), 0 20px 60px rgba(0,0,0,0.5);
  border: 12px solid #4a3728;
  border-top-color: #5c4432;
  border-bottom-color: #3d2b1e;
}

.table-felt {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  background: repeating-conic-gradient(rgba(255,255,255,0.02) 0% 25%, transparent 0% 50%) 0 0 / 20px 20px;
  pointer-events: none;
}

.community-cards {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -60%);
  display: flex;
  gap: 10px;
}

.community-cards .card-slot {
  width: 60px;
  height: 84px;
  background: rgba(0,0,0,0.25);
  border: 2px dashed rgba(255,255,255,0.1);
  border-radius: 6px;
}
.community-cards .card-slot img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.pot-display {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 30%);
  color: var(--accent-gold);
  font-weight: 800;
  font-size: 20px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.pot-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 55%);
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.dealer-btn {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-weight: 800;
  font-size: 12px;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  border: 2px solid var(--accent-gold);
}

/* SEATS */
.seats-container { position: absolute; top: 0; left: 0; right: 0; bottom: 0; }

.seat {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all .3s;
}

.seat-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--bg-card), var(--bg-card-hover));
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: var(--text-primary);
  position: relative;
  transition: all .3s;
}
.seat.active .seat-avatar { border-color: var(--accent-green); box-shadow: 0 0 15px rgba(16,185,129,0.3); }
.seat.folded .seat-avatar { opacity: .4; }
.seat.current-turn .seat-avatar { border-color: var(--accent-gold); box-shadow: 0 0 20px rgba(245,158,11,0.4); animation: pulse-border 1s ease-in-out infinite; }

@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 10px rgba(245,158,11,0.3); }
  50% { box-shadow: 0 0 25px rgba(245,158,11,0.6); }
}

.seat-name { font-size: 12px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }
.seat-chips { font-size: 11px; font-weight: 500; color: var(--accent-gold); }
.seat-bet { font-size: 11px; font-weight: 600; color: #fff; background: rgba(0,0,0,0.5); padding: 2px 8px; border-radius: 10px; }
.seat-status { font-size: 10px; color: var(--text-muted); }

.seat-cards {
  display: flex;
  gap: 4px;
}
.seat-cards .mini-card {
  width: 44px;
  height: 60px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
}
.seat-cards .mini-card img { width: 100%; height: 100%; object-fit: contain; }
.seat-cards .mini-card.hidden-card {
  background: linear-gradient(135deg, #1e3a8a, #312e81);
  border-color: #4f46e5;
}

.seat-allin { color: var(--accent-red); font-size: 10px; font-weight: 700; text-transform: uppercase; }

/* SEAT POSITIONS - 10-max layout */
.seat-0 { bottom: -60px; left: 50%; transform: translateX(-50%); }
.seat-1 { bottom: -50px; left: 70%; transform: translateX(-50%); }
.seat-2 { bottom: -30px; right: 5%; }
.seat-3 { top: 35%; right: -65px; }
.seat-4 { top: 10%; right: -40px; }
.seat-5 { top: -65px; left: 70%; transform: translateX(-50%); }
.seat-6 { top: -65px; left: 50%; transform: translateX(-50%); }
.seat-7 { top: -65px; left: 30%; transform: translateX(-50%); }
.seat-8 { top: 10%; left: -40px; }
.seat-9 { top: 35%; left: -65px; }

@media (max-width: 768px) {
  .poker-table { width: 100%; height: 400px; border-radius: 200px / 130px; }
  .seat-avatar { width: 36px; height: 36px; font-size: 14px; }
  .seat-cards .mini-card { width: 34px; height: 46px; }
}

/* PLAYER CONTROLS */
.player-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(17,24,39,0.98);
  border-top: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  backdrop-filter: blur(12px);
  z-index: 200;
}

.hole-cards {
  display: flex;
  gap: 8px;
  min-width: 120px;
}
.hole-cards .card-slot {
  width: 66px;
  height: 92px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 6px;
}
.hole-cards .card-slot img { width: 100%; height: 100%; object-fit: contain; border-radius: 4px; }

.controls-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.my-name { font-weight: 700; font-size: 15px; }
.my-chips { color: var(--accent-gold); font-weight: 600; font-size: 14px; min-width: 80px; }

.bet-controls {
  display: none;
  align-items: center;
  gap: 12px;
  flex: 1;
}
.bet-controls.visible { display: flex; }

.bet-slider-container {
  flex: 1;
  max-width: 200px;
}
.bet-slider-container input[type=range] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg-primary);
  border-radius: 3px;
  outline: none;
}
.bet-slider-container input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-gold);
  cursor: pointer;
}

.bet-quick-btns {
  display: flex;
  gap: 4px;
  margin-top: 4px;
}

.btn-bet-qty {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
  transition: all .2s;
}
.btn-bet-qty:hover { border-color: var(--accent-gold); color: var(--accent-gold); }

.bet-input-row {
  display: flex;
  align-items: center;
  gap: 4px;
}
.bet-input {
  width: 90px;
  padding: 8px 10px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  outline: none;
}
.bet-input:focus { border-color: var(--accent-gold); }
.bet-currency { color: var(--text-muted); font-weight: 600; }

.action-buttons {
  display: flex;
  gap: 8px;
}

.btn-action {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: .5px;
  transition: all .2s;
}
.btn-action:hover { transform: translateY(-2px); }
.btn-action:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn-fold { background: var(--accent-red); color: #fff; }
.btn-check { background: var(--accent-blue); color: #fff; }
.btn-call { background: var(--accent-green); color: #fff; }
.btn-raise { background: var(--accent-gold); color: #000; }
.btn-allin { background: linear-gradient(135deg, #dc2626, #991b1b); color: #fff; }

/* ACTION MESSAGE */
.action-message {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 6px 20px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  z-index: 50;
  opacity: 0;
  transition: opacity .3s;
  pointer-events: none;
  white-space: nowrap;
}
.action-message.visible { opacity: 1; }

/* TOAST */
.toast-container {
  position: fixed;
  top: 68px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: slideIn .3s ease;
  max-width: 320px;
}
.toast.success { border-color: var(--accent-green); }
.toast.error { border-color: var(--accent-red); }
.toast.info { border-color: var(--accent-blue); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* EMPTY STATE */
.empty-state {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 14px; }
