/* 俄罗斯方块游戏样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #2d1b69 0%, #1a1a2e 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  color: #fff;
  overflow-x: hidden;
  padding-top: 5px;
}

.game-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
}

/* 头部信息栏 */
.game-header {
  position: relative;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  width: 100%;
  max-width: 500px;
  padding: 2px 8px;
}

.btn-icon {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 2px;
  -webkit-tap-highlight-color: transparent;
}
}

.score-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.score-value {
  font-size: 24px;
  font-weight: bold;
  color: #a78bfa;
}

.high-score .score-value {
  color: #ffd700;
}

/* 控制按钮 */
.control-buttons {
  display: flex;
  gap: 10px;
}

.btn {
  padding: 10px 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: #a78bfa;
  color: #1a1a2e;
}

.btn-primary:hover {
  background: #8b5cf6;
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
}

.btn-home {
  background: #e74c3c;
  color: #fff;
}

.btn-home:hover {
  background: #c0392b;
}

/* 游戏主区域 */
.game-area {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  position: relative;
}

/* 侧边信息栏 */
.side-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 10px;
  min-width: 40px;
}

.side-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.side-label {
  font-size: 9px;
  color: rgba(255, 255, 255, 0.5);
}

.side-value {
  font-size: 14px;
  font-weight: bold;
  color: #a78bfa;
}

#nextCanvas {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  display: block;
  background: rgba(26, 26, 46, 0.5);
  border: 1px solid rgba(167, 139, 250, 0.3);
}

/* 游戏画布容器 */
.canvas-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: visible;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#gameCanvas {
  display: block;
  background: #1a1a2e;
  border: 3px solid #a78bfa;
  border-radius: 12px;
}

/* 游戏覆盖层 - 覆盖整个三栏区域 */
.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(26, 26, 46, 0.98);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  z-index: 1000;
  pointer-events: auto;
  padding: 20px;
}
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  z-index: 1000;
  pointer-events: auto;
  padding: 20px;
}

.game-overlay * {
  position: relative;
  z-index: 1001;
}

.game-overlay.hidden {
  display: none !important;
}



.overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 400px;
  gap: 15px;
}

.overlay-title {
  font-size: 42px;
  font-weight: bold;
  color: #a78bfa;
  margin-bottom: 5px;
  text-shadow: 0 0 20px rgba(167, 139, 250, 0.5);
  text-align: center;
  line-height: 1.2;
}

.overlay-subtitle {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 15px;
  text-align: left;
  line-height: 1.8;
  width: 100%;
}

.overlay-score {
  font-size: 24px;
  color: #ffd700;
  margin-bottom: 20px;
  text-align: center;
}

.overlay-stats {
  display: flex;
  gap: 30px;
  margin-bottom: 20px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.8);
}

.overlay-btn {
  padding: 15px 40px;
  font-size: 18px;
  background: #a78bfa;
  color: #1a1a2e;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  margin: 10px;
  min-width: 180px;
  text-align: center;
}

.overlay-btn:hover {
  background: #8b5cf6;
  transform: scale(1.05);
}

.overlay-btn.secondary {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.overlay-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 控制说明 */
.controls-info {
  display: flex;
  gap: 15px;
  margin-top: 20px;
  padding: 10px 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.control-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-width: 100px;
}

.control-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1;
}

.control-text {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  text-align: left;
  line-height: 1.3;
}

/* 移动端控制按钮 */
.mobile-controls {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  z-index: 100;
  justify-content: space-between;
  padding: 0 20px;
}

.mobile-controls-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.mobile-controls-left .control-row:first-child {
  gap: 15px;
}

.mobile-controls-right {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  margin-top: 30px;
}

.control-row {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.mobile-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: rgba(167, 139, 250, 0.3);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.mobile-btn-large {
  width: 80px;
  height: 80px;
  font-size: 32px;
  background: rgba(167, 139, 250, 0.4);
}

.mobile-btn-wide {
  width: 100px;
  height: 60px;
  font-size: 28px;
  background: rgba(167, 139, 250, 0.35);
}

.mobile-btn:active {
  background: rgba(167, 139, 250, 0.6);
  transform: scale(0.95);
}

.mobile-btn-large:active {
  background: rgba(167, 139, 250, 0.7);
  transform: scale(0.93);
}

/* 响应式设计 */
@media (max-width: 600px) {
  .mobile-controls {
    display: flex;
  }

  .game-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 10px;
  }

  .game-area {
    /* 保持三栏横排 */
    align-items: flex-start;
  }

  .overlay-title {
    font-size: 32px;
  }

  .controls-info {
    flex-direction: column;
    gap: 10px;
  }
}

/* 暂停指示器 */
.pause-indicator {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.2);
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 14px;
  color: #ffd700;
  display: none;
  backdrop-filter: blur(10px);
}

.pause-indicator.visible {
  display: block;
}

/* 动画效果 */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(167, 139, 250, 0.5); }
  50% { box-shadow: 0 0 40px rgba(167, 139, 250, 0.8); }
}

.canvas-wrapper {
  animation: glow 3s infinite;
}
