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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  min-height: 100vh;
  color: #fff;
}

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

.page.active {
  display: block;
}

/* 登录页面 */
.auth-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 50px 20px;
  text-align: center;
}

.auth-container h1 {
  font-size: 3em;
  margin-bottom: 30px;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.tabs {
  display: flex;
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  padding: 15px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1em;
  transition: all 0.3s;
}

.tab:first-child {
  border-radius: 10px 0 0 10px;
}

.tab:last-child {
  border-radius: 0 10px 10px 0;
}

.tab.active {
  background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
}

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

.auth-form input {
  padding: 15px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 1em;
}

.auth-form input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.auth-form button {
  padding: 15px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
  color: #fff;
  font-size: 1.1em;
  cursor: pointer;
  transition: transform 0.2s;
}

.auth-form button:hover {
  transform: scale(1.02);
}

.message {
  margin-top: 15px;
  padding: 10px;
  border-radius: 5px;
}

.message.error {
  background: rgba(255, 0, 0, 0.3);
}

.message.success {
  background: rgba(0, 255, 0, 0.3);
}

/* 大厅页面 */
.lobby-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 10px;
}

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

.user-info span {
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 15px;
  border-radius: 20px;
}

.user-info button {
  padding: 8px 20px;
  border: none;
  border-radius: 20px;
  background: #e94560;
  color: #fff;
  cursor: pointer;
}

.create-room {
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  align-items: center;
}

.create-room h3 {
  width: 100%;
  margin-bottom: 10px;
}

.create-room input,
.create-room select {
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  flex: 1;
  min-width: 150px;
}

.create-room select option {
  background: #1a1a2e;
}

.create-room button {
  padding: 12px 30px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
  color: #fff;
  cursor: pointer;
  font-weight: bold;
}

.room-list h3 {
  margin-bottom: 15px;
}

#rooms {
  display: grid;
  gap: 15px;
}

.room-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 20px;
  border-radius: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.room-item .room-name {
  font-size: 1.2em;
  font-weight: bold;
}

.room-item .room-info {
  display: flex;
  gap: 20px;
  color: rgba(255, 255, 255, 0.7);
}

.room-item button {
  padding: 10px 25px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
  color: #fff;
  cursor: pointer;
}

.room-item button:disabled {
  background: #666;
  cursor: not-allowed;
}

/* 游戏页面 */
.game-container {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 10px;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  margin-bottom: 10px;
}

.game-header button {
  padding: 8px 15px;
  border: none;
  border-radius: 5px;
  background: #e94560;
  color: #fff;
  cursor: pointer;
}

.table {
  flex: 1;
  background: radial-gradient(ellipse at center, #2d5a27 0%, #1a3a15 100%);
  border-radius: 150px;
  border: 15px solid #8b4513;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5), 0 10px 30px rgba(0, 0, 0, 0.5);
  position: relative;
  min-height: 300px;
  margin: 10px 0;
}

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

.card {
  width: 50px;
  height: 70px;
  background: #fff;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.card.red {
  color: #e94560;
}

.card.black {
  color: #1a1a2e;
}

.card.back {
  background: linear-gradient(135deg, #e94560 0%, #ff6b6b 100%);
  color: #fff;
}

.card.large {
  width: 70px;
  height: 100px;
  font-size: 1.2em;
}

.players {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.player {
  position: absolute;
  background: rgba(0, 0, 0, 0.7);
  padding: 10px 15px;
  border-radius: 10px;
  text-align: center;
  min-width: 100px;
}

.player.current {
  border: 2px solid #ffd700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}

.player.folded {
  opacity: 0.5;
}

.player.winner {
  border: 2px solid #00ff00;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.7);
}

.player .name {
  font-weight: bold;
  margin-bottom: 5px;
}

.player .chips {
  font-size: 0.9em;
  color: #ffd700;
}

.player .bet {
  font-size: 0.8em;
  color: #00cec9;
  margin-top: 3px;
}

.player .dealer-chip {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #fff;
  color: #000;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.8em;
}

.player .player-cards {
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-top: 5px;
}

.player .player-cards .card {
  width: 35px;
  height: 50px;
  font-size: 0.8em;
}

/* 玩家位置 */
.player:nth-child(1) { bottom: 10%; left: 50%; transform: translateX(-50%); }
.player:nth-child(2) { bottom: 30%; left: 5%; }
.player:nth-child(3) { top: 20%; left: 10%; }
.player:nth-child(4) { top: 10%; left: 50%; transform: translateX(-50%); }
.player:nth-child(5) { top: 20%; right: 10%; }
.player:nth-child(6) { bottom: 30%; right: 5%; }

.my-cards {
  display: flex;
  justify-content: center;
  gap: 15px;
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  margin-bottom: 10px;
}

.actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 15px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
}

.actions button {
  padding: 12px 25px;
  border: none;
  border-radius: 8px;
  font-size: 1em;
  cursor: pointer;
  transition: transform 0.2s;
}

.actions button:hover:not(:disabled) {
  transform: scale(1.05);
}

.actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#readyBtn {
  background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
  color: #fff;
  font-size: 1.2em;
  padding: 15px 50px;
}

#gameActions button:nth-child(1) { background: #e94560; color: #fff; }
#gameActions button:nth-child(2) { background: #6c5ce7; color: #fff; }
#gameActions button:nth-child(3) { background: #00b894; color: #fff; }
#gameActions button:nth-child(4) { background: #fdcb6e; color: #000; }
#gameActions button:nth-child(5) { background: #d63031; color: #fff; }

#raisePanel {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

#raiseSlider {
  width: 200px;
}

#raiseAmount {
  min-width: 80px;
  text-align: center;
  font-weight: bold;
  font-size: 1.2em;
}

#raisePanel button {
  padding: 10px 20px;
}

#raisePanel button:first-of-type {
  background: #00b894;
  color: #fff;
}

#raisePanel button:last-of-type {
  background: #636e72;
  color: #fff;
}

.chat-container {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 10px;
  padding: 10px;
  max-height: 150px;
  display: flex;
  flex-direction: column;
}

#chatMessages {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 10px;
  font-size: 0.9em;
}

.chat-message {
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-message .username {
  color: #00cec9;
  font-weight: bold;
}

.chat-message .time {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8em;
}

.chat-input {
  display: flex;
  gap: 10px;
}

.chat-input input {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.chat-input button {
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  background: #00b894;
  color: #fff;
  cursor: pointer;
}

/* 弹窗 */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  padding: 40px;
  border-radius: 20px;
  text-align: center;
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.modal-content h2 {
  font-size: 2em;
  margin-bottom: 15px;
}

.modal-content p {
  font-size: 1.2em;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 20px;
}

/* 买入弹窗 */
.buyin-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 20px;
}

.buyin-btn {
  padding: 15px 25px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
  color: #000;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s;
}

.buyin-btn:hover {
  transform: scale(1.05);
}

.cancel-btn {
  padding: 12px 30px;
  border: none;
  border-radius: 8px;
  background: #636e72;
  color: #fff;
  font-size: 1em;
  cursor: pointer;
}

/* 响应式 */
@media (max-width: 600px) {
  .auth-container h1 {
    font-size: 2em;
  }
  
  .table {
    border-radius: 100px;
    border-width: 10px;
  }
  
  .card {
    width: 40px;
    height: 56px;
    font-size: 0.9em;
  }
  
  .card.large {
    width: 55px;
    height: 77px;
  }
  
  .player {
    padding: 8px 10px;
    min-width: 80px;
    font-size: 0.85em;
  }
  
  .actions button {
    padding: 10px 15px;
    font-size: 0.9em;
  }
}
