/* ============================================
 * Miku 互动小游戏 — 样式
 *
 * 包含：热区定位、侧边栏面板、猜拳（星空质感）、骰子
 * ============================================ */

/* ---- 热区容器（覆盖在 canvas 上） ---- */
#live2d-hit-zone {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 90;
}

/* ---- 各部位热区（透明不可见） ---- */
.miku-hitzone {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
}

#live2d-hit-head {
  top: 5%;
  left: 25%;
  width: 50%;
  height: 28%;
  border-radius: 50%;
}

#live2d-hit-body {
  top: 32%;
  left: 15%;
  width: 70%;
  height: 38%;
}

#live2d-hit-feet {
  top: 68%;
  left: 25%;
  width: 50%;
  height: 25%;
}

/* ---- 侧边栏统计行 ---- */
.miku-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  font-size: 13px;
  opacity: 0.85;
}

.miku-stat-row .miku-stat-val {
  color: var(--red-1, #ff5252);
  font-weight: 700;
  font-family: monospace;
}

/* ---- 游戏主按钮 ---- */
.miku-game-btn {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, var(--red-1, #ff5252), #ff8a65);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(255, 78, 106, 0.25);
}

.miku-game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 78, 106, 0.4);
}

.miku-game-btn:active {
  transform: translateY(0);
}

/* ---- 游戏 Tab 切换 ---- */
.miku-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}

.miku-tab {
  flex: 1;
  padding: 6px 4px;
  border-radius: 8px;
  border: 1px solid var(--red-3, #ffafaf);
  background: transparent;
  color: var(--highlight-foreground, #666);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.miku-tab.active {
  background: linear-gradient(135deg, var(--red-1, #ff5252), #ff8a65);
  color: #fff;
  border-color: transparent;
}

.miku-tab:hover:not(.active) {
  border-color: var(--red-1, #ff5252);
  color: var(--red-1, #ff5252);
}

/* ============================================
 * 星空玻璃质感 RPS 按钮
 * ============================================ */

/* --- 基础风格 --- */
.miku-rps-choice {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1.5px solid rgba(180, 150, 255, 0.4);
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.15) 1px, transparent 2px),
    radial-gradient(circle at 70% 40%, rgba(255,255,255,0.10) 1px, transparent 2px),
    radial-gradient(circle at 50% 80%, rgba(255,255,255,0.12) 1px, transparent 2px),
    linear-gradient(135deg, rgba(55,35,90,0.85), rgba(30,20,55,0.92));
  font-size: 24px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #F8EEFF;
  text-shadow: 0 0 6px rgba(177, 156, 217, 0.6);
  box-shadow:
    0 0 10px rgba(138, 43, 226, 0.25),
    inset 0 0 8px rgba(255, 255, 255, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: visible;
  outline: none;
}

.miku-rps-choice:hover {
  transform: scale(1.15);
  border-color: rgba(200, 170, 255, 0.7);
  animation: rpsGlow 2s infinite ease-in-out;
}

.miku-rps-choice:active {
  transform: scale(0.92);
  transition-duration: 0.05s;
}

.miku-rps-choice.miku-rps-flash {
  transform: scale(0.85);
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,0.35) 1px, transparent 2px),
    radial-gradient(circle at 70% 40%, rgba(255,255,255,0.25) 1px, transparent 2px),
    radial-gradient(circle at 50% 80%, rgba(255,255,255,0.30) 1px, transparent 2px),
    linear-gradient(135deg, rgba(100, 60, 180, 0.95), rgba(60, 40, 110, 0.95));
  box-shadow:
    0 0 30px rgba(177, 156, 217, 0.8),
    0 0 60px rgba(138, 43, 226, 0.5);
  transition-duration: 0.1s;
}

@keyframes rpsGlow {
  0%, 100% {
    box-shadow:
      0 0 20px rgba(138, 43, 226, 0.5),
      0 0 40px rgba(177, 156, 217, 0.3),
      inset 0 0 12px rgba(255, 255, 255, 0.08);
  }
  50% {
    box-shadow:
      0 0 30px rgba(177, 156, 217, 0.7),
      0 0 55px rgba(138, 43, 226, 0.4),
      inset 0 0 16px rgba(255, 255, 255, 0.12);
  }
}

@keyframes vsPop {
  0%   { transform: scale(0); opacity: 0; }
  60%  { transform: scale(1.3); }
  100% { transform: scale(1); opacity: 1; }
}

/* ============================================
 * 粒子爆发
 * ============================================ */
.rps-particle {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 10001;
  animation: rpsParticleFly 0.6s ease-out forwards;
}

@keyframes rpsParticleFly {
  0%   { opacity: 1; transform: translate(0,0) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx),var(--dy)) scale(0); }
}

/* 骰子游戏
   ============================================ */

.miku-die { display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;margin:0 3px;border-radius:6px;background:#fff;border:1.5px solid rgba(180,150,255,0.5);color:#333;font-size:18px;font-weight:700;box-shadow:0 2px 6px rgba(0,0,0,0.1); }
.miku-die.rolling { animation:diceRoll 0.1s infinite alternate; }

@keyframes diceRoll {
  0%   { transform: rotate(-10deg) scale(1); }
  25%  { transform: rotate(10deg) scale(1.1); }
  50%  { transform: rotate(-5deg) scale(0.95); }
  75%  { transform: rotate(15deg) scale(1.05); }
  100% { transform: rotate(0deg) scale(1); }
}

.miku-dice-section { margin-bottom:6px; }
.miku-dice-area { display:flex;justify-content:center;gap:4px;margin:4px 0;min-height:38px;align-items:center; }
.miku-dice-label { font-size:11px;opacity:0.6;font-weight:600;margin-bottom:2px; }
.miku-dice-result { font-size:14px;font-weight:700;color:var(--red-1,#ff5252);margin-bottom:6px;min-height:20px; }
.miku-dice-vs { font-size:11px;font-weight:800;color:rgba(180,150,255,0.6);margin:2px 0; }
.miku-die.yahtzee { border-color:#ffd700;box-shadow:0 0 10px rgba(255,215,0,0.5);color:#b8860b; }

/* 老虎机
   ============================================ */

.miku-slot-machine { margin-bottom:8px; }
.miku-slot-display { display:flex;justify-content:center;gap:6px;margin:8px 0; }
.miku-slot-reel {
  width:44px;height:48px;border-radius:8px;
  background: linear-gradient(135deg, rgba(55,35,90,0.85), rgba(30,20,55,0.92));
  border:1.5px solid rgba(180,150,255,0.5);
  color:#F8EEFF;
  font-size:24px;line-height:48px;text-align:center;
  box-shadow:0 0 10px rgba(138,43,226,0.3);
  overflow:hidden;
  position:relative;
}
.miku-slot-reel.rolling { animation:slotSpin 0.1s infinite linear; }
@keyframes slotSpin {
  0%   { transform:translateY(-2px); }
  50%  { transform:translateY(2px); }
  100% { transform:translateY(-2px); }
}
.miku-slot-reel.win-highlight {
  border-color:#ffd700;
  box-shadow:0 0 20px rgba(255,215,0,0.6);
  animation:slotWin 0.5s ease 3;
}
@keyframes slotWin {
  0%,100% { transform:scale(1); }
  50% { transform:scale(1.15); }
}
.miku-slot-prize {
  font-size:13px;font-weight:700;margin:6px 0;min-height:20px;
}
.miku-slot-chances {
  font-size:11px;opacity:0.6;margin-bottom:6px;
}
.miku-slot-free-msg {
  font-size:12px;opacity:0.6;margin:4px 0;
}
