/* ========== 模块轮盘样式 ========== */

/* 右下角小轮盘兼作切换模式入口 */
.mini-module-wheel {
  position: fixed;
  bottom: calc(var(--game-bottom-controls-height, 76px) + 12px + env(safe-area-inset-bottom));
  right: max(20px, env(safe-area-inset-right));
  width: 90px;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 500;
  cursor: pointer;
  pointer-events: auto;
}

.mini-module-wheel:focus-visible {
  outline: 3px solid #FCD34D;
  outline-offset: 4px;
}

.mini-module-wheel svg {
  display: block;
  width: 100%;
  height: auto;
  flex: none;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.3));
}

.mini-module-wheel .wheel-label {
  position: static;
  align-self: flex-end;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,0.6);
  padding: 2px 8px;
  border-radius: 8px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mini-module-wheel .wheel-action-label {
  color: #FCD34D;
  font-size: 12px;
}

/* 点击“切换模式”后弹出的大轮盘 */
.module-wheel-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.55);
  z-index: 1000003;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.module-wheel-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.module-wheel-container {
  position: relative;
  width: min(420px, calc(100vw - 24px), calc(100dvh - 144px));
  aspect-ratio: 1;
  overflow: visible;
  transform: scale(0.82);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.module-wheel-overlay.active .module-wheel-container {
  transform: scale(1);
}

.module-wheel-container svg {
  display: block;
  overflow: visible;
}

.module-wheel-container svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 8px 32px rgba(0,0,0,0.4));
}

/* 轮盘扇区 */
.wheel-sector {
  cursor: pointer;
  transition: fill-opacity 0.25s ease, stroke 0.25s ease, stroke-width 0.25s ease, filter 0.25s ease;
  transform-origin: center center;
}

.wheel-sector:hover {
  filter: brightness(1.15);
}

.wheel-sector:focus-visible {
  stroke: #FCD34D;
  stroke-width: 4px;
  outline: none;
  filter: brightness(1.15);
}

.wheel-sector[data-locked="true"] { stroke-dasharray: 4 3; }

.wheel-sector-lock {
  fill: #FDE68A;
  font-size: 13px;
  font-weight: 700;
  paint-order: stroke;
  stroke: #1F2937;
  stroke-width: 3px;
  pointer-events: none;
}

.module-wheel-close {
  position: absolute;
  right: 0;
  top: -48px;
  min-width: 64px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.5);
  border-radius: 8px;
  color: #fff;
  background: #1F2937;
  font: inherit;
  cursor: pointer;
}

.module-wheel-close:focus-visible { outline: 3px solid #FCD34D; outline-offset: 3px; }

.wheel-icon-group {
  transition: transform 0.15s ease;
  pointer-events: none;
}

.wheel-icon-group image {
  pointer-events: none;
}

/* 悬停提示文字（放在遮罩层，用视口坐标定位，避免被SVG裁剪） */
.wheel-hover-label {
  position: absolute;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0,0,0,0.8);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  letter-spacing: 3px;
  z-index: 1;
}

.wheel-hover-label.visible {
  opacity: 1;
}

/* 折线指示器 */
#wheel-indicator {
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* 底部提示 */
.module-wheel-hint {
  position: absolute;
  bottom: -50px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  width: min(420px, calc(100vw - 24px));
  text-align: center;
  line-height: 1.8;
}

@media (max-width: 768px) {
  .mini-module-wheel { width: 72px; right: max(12px, env(safe-area-inset-right)); }
  .mini-module-wheel .wheel-label { gap: 4px; padding: 3px 6px; }
  .wheel-hover-label { font-size: 15px; letter-spacing: 1px; }
  .module-wheel-hint { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .module-wheel-overlay,
  .module-wheel-container,
  .wheel-sector,
  .wheel-icon-group,
  .wheel-hover-label,
  #wheel-indicator { transition: none !important; }
}

.module-wheel-hint kbd {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  padding: 2px 8px;
  font-family: monospace;
  font-size: 12px;
  margin: 0 2px;
}
