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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* Auth Screen */
.auth-container {
  max-width: 400px;
  margin: 80px auto;
  padding: 40px;
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
  border: 1px solid rgba(255,215,0,0.2);
  text-align: center;
}

.auth-container h1 {
  font-size: 2.5rem;
  background: linear-gradient(90deg, #ffd700, #ffed4e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.subtitle { color: #8892b0; margin-bottom: 24px; }

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #8892b0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.auth-tab.active {
  background: rgba(255,215,0,0.15);
  border-color: #ffd700;
  color: #ffd700;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.auth-form input:focus {
  outline: none;
  border-color: #ffd700;
}

.btn-primary {
  padding: 14px;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  border: none;
  border-radius: 8px;
  color: #1a1a2e;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-primary:hover { transform: translateY(-2px); }

.error {
  color: #ff6b6b;
  font-size: 0.9rem;
  min-height: 20px;
}

/* Game Header */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(0,0,0,0.2);
  border-bottom: 1px solid rgba(255,215,0,0.1);
}

.logo {
  font-size: 1.5rem;
  font-weight: 900;
  background: linear-gradient(90deg, #ffd700, #ffed4e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.balance {
  background: rgba(0,255,136,0.1);
  padding: 8px 16px;
  border-radius: 20px;
  color: #00ff88;
  font-weight: 700;
}

.username { color: #8892b0; }

.btn-small {
  padding: 8px 16px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-admin { background: rgba(255,107,107,0.2); border-color: #ff6b6b; }

/* Navigation */
.game-nav {
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  background: rgba(0,0,0,0.15);
  overflow-x: auto;
}

.nav-btn {
  padding: 10px 20px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #8892b0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s;
}

.nav-btn:hover, .nav-btn.active {
  background: rgba(255,215,0,0.15);
  border-color: #ffd700;
  color: #ffd700;
}

/* Game Area */
.game-area {
  padding: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.game-panel {
  animation: fadeIn 0.3s ease;
}

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

/* Slots */
.slots-machine {
  background: linear-gradient(180deg, #2d1b4e 0%, #1a1a2e 100%);
  border-radius: 16px;
  padding: 32px;
  border: 2px solid #ffd700;
  text-align: center;
}

.reels-container {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.reel {
  width: 100px;
  height: 100px;
  background: #0a0a0a;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  border: 3px solid #ffd700;
  box-shadow: inset 0 0 20px rgba(255,215,0,0.2);
  transition: transform 0.1s;
}

.reel.spinning { transform: scale(0.95); }

.slots-result {
  min-height: 32px;
  margin-bottom: 20px;
  font-size: 1.2rem;
  font-weight: 700;
}

.game-controls {
  display: flex;
  justify-content: center;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.bet-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.05);
  padding: 8px 16px;
  border-radius: 8px;
  color: #8892b0;
}

.bet-control button {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
}

.bet-control button:first-of-type { background: #ff6b6b; color: white; }
.bet-control button:last-of-type { background: #00ff88; color: #0a0a0a; }

.bet-control span:nth-child(3) {
  font-weight: 700;
  color: #fff;
  min-width: 40px;
  text-align: center;
}

.btn-spin {
  padding: 16px 48px;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  border: none;
  border-radius: 12px;
  color: #1a1a2e;
  font-size: 1.3rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255,215,0,0.4);
  transition: all 0.2s;
}

.btn-spin:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,215,0,0.6); }
.btn-spin:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-wheel { background: linear-gradient(135deg, #ff6b6b, #ff8e8e); color: white; box-shadow: 0 4px 15px rgba(255,107,107,0.4); }

.paytable {
  margin-top: 20px;
  padding: 16px;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
}

.paytable h4 { color: #ffd700; margin-bottom: 12px; }

.paytable-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  font-size: 0.85rem;
  color: #8892b0;
}

/* Wheel */
.wheel-container {
  background: linear-gradient(180deg, #2d1b4e 0%, #1a1a2e 100%);
  border-radius: 16px;
  padding: 32px;
  border: 2px solid #ff6b6b;
  text-align: center;
}

.wheel-wrapper {
  position: relative;
  width: 300px;
  height: 300px;
  margin: 0 auto 24px;
}

#wheel-canvas {
  transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.wheel-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 25px solid #ffd700;
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

.wheel-result {
  min-height: 32px;
  margin-bottom: 20px;
  font-size: 1.2rem;
  font-weight: 700;
}

/* Teen Patti */
.teenpatti-table {
  background: linear-gradient(180deg, #1b4e2d 0%, #1a1a2e 100%);
  border-radius: 16px;
  padding: 32px;
  border: 2px solid #00ff88;
}

.tp-section {
  text-align: center;
  margin-bottom: 20px;
}

.tp-label {
  color: #ffd700;
  font-weight: 700;
  margin-bottom: 8px;
}

.tp-cards {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
  min-height: 80px;
}

.card-back, .card-front {
  width: 60px;
  height: 80px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.card-back {
  background: linear-gradient(135deg, #b91c1c, #7f1d1d);
  border: 2px solid #fff;
}

.card-front {
  background: #fff;
  border: 2px solid #ccc;
  flex-direction: column;
  font-size: 1rem;
}

.card-front.red { color: #e11d48; }
.card-front.black { color: #1e293b; }

.tp-hand {
  color: #00ff88;
  font-size: 0.9rem;
  min-height: 20px;
}

.tp-pot {
  text-align: center;
  margin: 20px 0;
}

.tp-pot span {
  display: inline-block;
  background: rgba(0,0,0,0.5);
  padding: 12px 32px;
  border-radius: 50px;
  border: 2px solid #ffd700;
  color: #ffd700;
  font-weight: 700;
}

.tp-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.btn-deal {
  padding: 14px 36px;
  background: linear-gradient(135deg, #00ff88, #00cc6a);
  border: none;
  border-radius: 12px;
  color: #0a0a0a;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-fold {
  padding: 14px 36px;
  background: #ff6b6b;
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

.btn-play {
  padding: 14px 36px;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  border: none;
  border-radius: 12px;
  color: #1a1a2e;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}

.tp-result {
  text-align: center;
  margin-top: 16px;
  font-size: 1.2rem;
  font-weight: 700;
  min-height: 30px;
}

.tp-rankings {
  margin-top: 20px;
  padding: 16px;
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  font-size: 0.85rem;
}

.tp-rankings h4 { color: #00ff88; margin-bottom: 8px; }

.rankings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  color: #8892b0;
}

/* Profile */
.profile-card, .leaderboard-card {
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
  padding: 32px;
  border: 1px solid rgba(255,255,255,0.1);
}

.profile-card h2, .leaderboard-card h2 {
  margin-bottom: 24px;
  color: #ffd700;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat {
  background: rgba(0,0,0,0.2);
  padding: 16px;
  border-radius: 8px;
  text-align: center;
}

.stat-label {
  display: block;
  color: #8892b0;
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #00ff88;
}

.history-list {
  max-height: 300px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 0.9rem;
}

.history-item.win { border-left: 3px solid #00ff88; }
.history-item.loss { border-left: 3px solid #ff6b6b; }

/* Leaderboard */
.lb-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.lb-tab {
  padding: 8px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: #8892b0;
  border-radius: 6px;
  cursor: pointer;
}

.lb-tab.active {
  background: rgba(255,215,0,0.15);
  border-color: #ffd700;
  color: #ffd700;
}

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

.lb-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
}

.lb-rank {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,215,0,0.2);
  border-radius: 50%;
  font-weight: 700;
  color: #ffd700;
}

.lb-name { flex: 1; }
.lb-winnings { color: #00ff88; font-weight: 700; }

/* Admin */
.admin-main {
  padding: 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.admin-card {
  background: rgba(255,255,255,0.03);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(255,255,255,0.1);
}

.admin-card h3 {
  color: #ffd700;
  margin-bottom: 16px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.admin-stat {
  background: rgba(0,0,0,0.2);
  padding: 12px;
  border-radius: 8px;
}

.admin-stat-label { color: #8892b0; font-size: 0.85rem; }
.admin-stat-value { font-size: 1.5rem; font-weight: 700; color: #00ff88; }

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
}

.setting-row input {
  width: 100px;
  padding: 6px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px;
  color: #fff;
  text-align: right;
}

.players-list, .games-list {
  max-height: 300px;
  overflow-y: auto;
  font-size: 0.85rem;
}

.player-row, .game-row {
  display: flex;
  justify-content: space-between;
  padding: 8px;
  background: rgba(0,0,0,0.2);
  border-radius: 6px;
  margin-bottom: 6px;
  align-items: center;
}

/* Footer */
.game-footer {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 16px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 0.85rem;
  color: #8892b0;
}

.green { color: #00ff88; }
.red { color: #ff6b6b; }

/* Responsive */
@media (max-width: 768px) {
  .reels-container { gap: 8px; }
  .reel { width: 80px; height: 80px; font-size: 2.5rem; }
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-grid { grid-template-columns: 1fr; }
  .paytable-grid { grid-template-columns: repeat(2, 1fr); }
  .game-header { flex-direction: column; gap: 12px; }
}
