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

body {
  background: #1a1a2e;
  overflow: hidden;
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  width: 100vw;
  height: 100vh;
}

.game-container {
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* 状态栏 */
.status-bar {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 100;
  background: rgba(0,0,0,0.6);
  color: #fff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.dot.online { background: #6bcb77; }
.dot.offline { background: #ff6b6b; }

/* 画面切换 */
.screen {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: none;
  justify-content: center;
  align-items: center;
}
.screen.active { display: flex; }

/* ===== 待机画面 ===== */
.idle-content {
  text-align: center;
  color: #fff;
}
.title {
  font-size: 64px;
  margin-bottom: 40px;
  text-shadow: 0 0 20px rgba(255,200,50,0.8);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
.qr-placeholder { margin-top: 20px; }
.qr-box {
  width: 280px; height: 280px;
  background: #fff;
  color: #333;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  border-radius: 16px;
  padding: 12px;
}
.qr-box canvas {
  width: 100% !important;
  height: 100% !important;
}
.qr-placeholder p {
  font-size: 20px;
  color: #aaa;
}

/* ===== 准备画面 ===== */
.ready-content {
  text-align: center;
  color: #fff;
}
.ready-content h2 {
  font-size: 56px;
  margin-bottom: 20px;
  animation: pulse 1.5s infinite;
}
.ready-content p {
  font-size: 28px;
  color: #ccc;
}

/* ===== 游戏画面 ===== */
.machine-bg {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(180deg, #16213e 0%, #0f3460 50%, #533483 100%);
}

.machine-body {
  position: relative;
  width: 80%;
  height: 70%;
  margin: 5% auto 0;
  background: rgba(255,255,255,0.05);
  border: 3px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  overflow: hidden;
}

/* 爪子 */
.claw-mechanism {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 120px;
  z-index: 10;
  transition: left 1s ease, height 1.5s ease;
}
.claw-rod {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 60%;
  background: linear-gradient(180deg, #888, #ccc);
  border-radius: 3px;
  z-index: 3;
}
.claw-left, .claw-right {
  position: absolute;
  bottom: 0;
  width: 8px;
  height: 40px;
  background: #ddd;
  border-radius: 0 0 4px 4px;
  z-index: 2;
  transition: transform 0.3s ease;
}
.claw-left {
  left: 20px;
  transform-origin: top center;
  transform: rotate(15deg);
}
.claw-right {
  right: 20px;
  transform-origin: top center;
  transform: rotate(-15deg);
}
.claw-left.closed { transform: rotate(0deg); }
.claw-right.closed { transform: rotate(0deg); }

.caught-ball {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #ffd93d;
  z-index: 1;
}
.caught-ball.hidden { display: none; }

/* 奖品池 */
.prize-pool {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30%;
}
.ball {
  position: absolute;
  width: 50px; height: 50px;
  border-radius: 50%;
  box-shadow: inset -5px -5px 10px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.2);
}

/* 等待提示 */
.overlay-text {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 28px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  z-index: 20;
}

/* 爪子摆动动画 */
@keyframes swingClaw {
  0% { left: 15%; }
  100% { left: 75%; }
}
.claw-mechanism.swinging {
  animation: swingClaw 2.5s ease-in-out infinite alternate;
}

/* ===== 结果画面 ===== */
.result-content {
  text-align: center;
  color: #fff;
  z-index: 30;
}
.result-content h2 {
  font-size: 64px;
  margin-bottom: 20px;
}
.result-content p {
  font-size: 28px;
  color: #ccc;
}
.result-content .prize-name {
  font-size: 36px;
  color: #ffd93d;
  margin: 16px 0;
}
.result-content .redeem-code {
  font-size: 48px;
  font-family: monospace;
  color: #6bcb77;
  background: rgba(0,0,0,0.3);
  padding: 10px 30px;
  border-radius: 12px;
  display: inline-block;
  margin-top: 10px;
}

/* 烟花 */
@keyframes firework {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(3); opacity: 0; }
}
.firework {
  position: fixed;
  width: 20px; height: 20px;
  border-radius: 50%;
  animation: firework 1s ease-out forwards;
  pointer-events: none;
  z-index: 50;
}
