/* Round 4: Eva 治愈风 - 奶油色、圆角、粉色米色系 */

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

body {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #F8F3E8;
  font-family: "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: #5c4a3a;
}

.game-container {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 20px;
  position: relative;
}

.game-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#gameCanvas {
  display: block;
  background: #f5ebe0;
  border: 2px solid #e8d5c4;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(200, 160, 140, 0.25);
}

.previews {
  display: flex;
  gap: 16px;
}

.preview-box {
  background: #fff8f0;
  border: 2px solid #e8d5c4;
  border-radius: 16px;
  padding: 10px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(200, 160, 140, 0.15);
}

.preview-box h3 {
  font-size: 12px;
  color: #b8957a;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.preview-box canvas {
  display: block;
  background: #f5ebe0;
  border-radius: 12px;
}

.panel {
  background: #fff8f0;
  border: 2px solid #e8d5c4;
  border-radius: 20px;
  padding: 20px;
  min-width: 180px;
  box-shadow: 0 4px 20px rgba(200, 160, 140, 0.2);
  position: relative;
}

.game-title {
  font-size: 18px;
  font-weight: 700;
  color: #c97b84;
  margin-bottom: 16px;
  text-align: center;
  letter-spacing: 0.02em;
}

.line-clear-message {
  position: absolute;
  top: 12px;
  right: 12px;
  left: 12px;
  font-size: 13px;
  color: #c97b84;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.line-clear-message.visible {
  opacity: 1;
}

.panel-section {
  margin-bottom: 16px;
}

.panel-section:last-child {
  margin-bottom: 0;
}

.panel-section h3 {
  font-size: 13px;
  color: #b8957a;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.panel-section p {
  font-size: 18px;
  font-weight: 600;
  color: #5c4a3a;
}

.panel-section.keys p {
  font-size: 13px;
  font-weight: 400;
  margin-top: 4px;
  color: #8a735a;
}

.panel-section.keys h3 {
  margin-bottom: 8px;
}

/* Game Over 遮罩：居中文案 + 重启按钮 */
.game-over-overlay {
  position: fixed;
  inset: 0;
  background: rgba(248, 243, 232, 0.92);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 10;
}

.game-over-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.game-over-text {
  font-size: 26px;
  font-weight: 700;
  color: #5c4a3a;
  text-align: center;
  max-width: 90%;
  animation: bounce 0.6s ease;
}

.game-over-qr {
  display: block;
  width: 140px;
  max-width: 160px;
  max-height: 160px;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(100, 60, 60, 0.2);
}

@keyframes bounce {
  0% { transform: scale(0.9); opacity: 0; }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.restart-btn {
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: #e8a0a8;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(200, 120, 130, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.restart-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(200, 120, 130, 0.4);
}

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