:root {
  --bg-dark: #0b0f19;
  --bg-card: #151c2c;
  --bg-card-hover: #1e293b;
  --felt-green: #0b4f32;
  --felt-dark: #063521;
  --accent-gold: #fbbf24;
  --accent-gold-glow: rgba(251, 191, 36, 0.4);
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.1);
  --radius-lg: 16px;
  --radius-md: 10px;
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Header & Nav */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent-gold), #d97706);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #000;
  box-shadow: 0 0 10px var(--accent-gold-glow);
}

.logo-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(to right, #fff, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.room-badge {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.icon-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Views Container */
.app-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: 16px;
}

/* Lobby Screen */
.lobby-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  margin: auto 0;
}

.tab-group {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 10px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--accent-gold);
  color: #000;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-control:focus {
  border-color: var(--accent-gold);
}

.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--accent-gold), #d97706);
  border: none;
  border-radius: var(--radius-md);
  color: #000;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 4px 15px var(--accent-gold-glow);
  transition: transform 0.1s ease;
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Poker Room Screen */
.game-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
}

/* Pot & Turn Banner */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.pot-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pot-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
}

.pot-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-gold);
  text-shadow: 0 0 8px var(--accent-gold-glow);
}

.stage-badge {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.turn-banner {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.05));
  border-left: 4px solid var(--accent-green);
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.turn-banner.your-turn {
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.3), rgba(251, 191, 36, 0.1));
  border-left-color: var(--accent-gold);
  animation: pulseGlow 1.5s infinite alternate;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 5px rgba(251, 191, 36, 0.2); }
  100% { box-shadow: 0 0 18px rgba(251, 191, 36, 0.6); }
}

/* Poker Table Layout */
.table-area {
  position: relative;
  background: radial-gradient(circle at center, var(--felt-green) 0%, var(--felt-dark) 85%);
  border: 10px solid #1e293b;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.8), 0 10px 30px rgba(0,0,0,0.5);
  border-radius: 120px;
  min-height: 380px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  margin: 10px 0;
}

.table-center {
  text-align: center;
  pointer-events: none;
}

.table-logo {
  font-size: 1.2rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.15);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Player Seat Layout (Circle / Flex Wrap Grid) */
.seats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  width: 100%;
  z-index: 10;
}

.seat-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.seat-card.active-turn {
  border-color: var(--accent-gold);
  box-shadow: 0 0 15px var(--accent-gold-glow);
  transform: scale(1.03);
}

.seat-card.folded {
  opacity: 0.45;
  filter: grayscale(80%);
}

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

.seat-name {
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.badge-group {
  display: flex;
  gap: 3px;
}

.badge-dealer {
  background: var(--accent-gold);
  color: #000;
  font-size: 0.65rem;
  font-weight: 900;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge-blind {
  background: var(--accent-blue);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 800;
  padding: 2px 4px;
  border-radius: 4px;
}

.seat-stack {
  font-size: 1rem;
  font-weight: 800;
  color: var(--accent-green);
}

.seat-bet {
  background: rgba(251, 191, 36, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(251, 191, 36, 0.3);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  align-self: flex-start;
  margin-top: 2px;
}

/* Action Bar Controls */
.action-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 10px;
}

.btn-action {
  padding: 14px 10px;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.btn-action:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.btn-action:active:not(:disabled) {
  transform: scale(0.96);
}

.btn-fold {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid var(--accent-red);
  color: var(--accent-red);
}

.btn-check-call {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid var(--accent-blue);
  color: #60a5fa;
}

.btn-raise {
  background: linear-gradient(135deg, var(--accent-green), #059669);
  color: #fff;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

/* Raise Slider & Presets Drawer */
.raise-drawer {
  background: rgba(0, 0, 0, 0.4);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preset-group {
  display: flex;
  gap: 6px;
}

.btn-preset {
  flex: 1;
  padding: 8px 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-preset:hover {
  background: rgba(255, 255, 255, 0.18);
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.range-slider {
  flex: 1;
  accent-color: var(--accent-gold);
  height: 6px;
  cursor: pointer;
}

.raise-input-box {
  width: 90px;
  padding: 6px;
  background: #000;
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-size: 1.1rem;
  font-weight: 800;
  text-align: center;
  border-radius: 6px;
}

/* Modal Drawer */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

/* Reorder Seating List */
.reorder-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.reorder-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.reorder-actions {
  display: flex;
  gap: 6px;
}

.btn-sm {
  padding: 4px 8px;
  font-size: 0.8rem;
  border-radius: 4px;
}

/* Action Log Feed */
.log-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  max-height: 60px;
  overflow-y: auto;
}

.winner-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.winner-option {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
}
