/* 游戏大厅样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

/* 登录界面 */
.login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.login-box {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
  backdrop-filter: blur(10px);
}

.login-box h1 {
  font-size: 2.5rem;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-box input {
  width: 100%;
  padding: 15px;
  margin: 10px 0;
  border: none;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 1rem;
  outline: none;
}

.login-box input::placeholder {
  color: rgba(255,255,255,0.5);
}

.btn {
  padding: 15px 40px;
  border: none;
  border-radius: 10px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(102,126,234,0.4);
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}

/* 游戏大厅 */
.game-hall {
  display: none;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 30px;
}

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

.coins-display {
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  color: #000;
  padding: 8px 20px;
  border-radius: 20px;
  font-weight: bold;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.game-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 15px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.game-card:hover {
  transform: translateY(-5px);
  background: rgba(255,255,255,0.1);
  border-color: rgba(102,126,234,0.5);
}

.game-card .icon {
  font-size: 3rem;
  margin-bottom: 15px;
}

.game-card h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.game-card p {
  opacity: 0.7;
  font-size: 0.9rem;
}

/* 俄罗斯方块游戏页面 */
.tetris-container {
  display: none;
  padding: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.game-layout {
  display: flex;
  gap: 30px;
  justify-content: center;
  align-items: flex-start;
}

.game-board {
  background: rgba(0,0,0,0.5);
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: 10px;
  padding: 10px;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 200px;
}

.info-box {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 20px;
}

.info-box h3 {
  margin-bottom: 10px;
  font-size: 1rem;
}

.info-box .value {
  font-size: 1.5rem;
  font-weight: bold;
  color: #ffd700;
}

/* 技能卡 */
.skills-panel {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 20px;
}

.skills-panel h3 {
  margin-bottom: 15px;
}

.skill-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  margin: 5px 0;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.skill-item:hover {
  background: rgba(255,255,255,0.1);
}

.skill-item.active {
  border: 1px solid #667eea;
  background: rgba(102,126,234,0.1);
}

.skill-item .count {
  background: #667eea;
  color: #fff;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.8rem;
}

/* 商店 */
.shop-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.shop-modal.active {
  display: flex;
}

.shop-content {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 30px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

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

.price {
  color: #ffd700;
  font-weight: bold;
}

/* 游戏结束 */
.game-over-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.game-over-modal.active {
  display: flex;
}

.game-over-content {
  text-align: center;
  padding: 40px;
}

.game-over-content h2 {
  font-size: 2.5rem;
  margin-bottom: 20px;
}

.rewards {
  font-size: 1.2rem;
  margin: 20px 0;
}

.rewards .coin-reward {
  color: #ffd700;
  font-size: 2rem;
  font-weight: bold;
}

/* 排行榜 */
.leaderboard {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 15px;
  padding: 20px;
  margin-top: 20px;
}

.leaderboard h2 {
  margin-bottom: 15px;
  text-align: center;
}

.leaderboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  margin: 5px 0;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
}

.rank-1 { color: #ffd700; }
.rank-2 { color: #c0c0c0; }
.rank-3 { color: #cd7f32; }

/* 管理后台 */
.admin-container {
  display: none;
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.admin-login {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 15px;
  padding: 25px;
  text-align: center;
}

.stat-card .number {
  font-size: 2.5rem;
  font-weight: bold;
  color: #667eea;
}

.stat-card .label {
  opacity: 0.7;
  margin-top: 10px;
}

.user-table {
  width: 100%;
  border-collapse: collapse;
}

.user-table th,
.user-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.user-table th {
  background: rgba(255,255,255,0.05);
}

.action-btn {
  padding: 5px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  margin: 0 5px;
}

.btn-give {
  background: #4ecdc4;
  color: #fff;
}

.btn-ban {
  background: #ff6b6b;
  color: #fff;
}

/* Canvas */
canvas {
  display: block;
  image-rendering: pixelated;
}

/* 响应式 */
@media (max-width: 768px) {
  .game-layout {
    flex-direction: column;
    align-items: center;
  }
  
  .side-panel {
    width: 100%;
    max-width: 300px;
  }
  
  .games-grid {
    grid-template-columns: 1fr;
  }
}
