/* 線上抽獎轉盤 /tools/lucky-wheel：在 site.css 之上，只放這一頁用到的樣式 */
.wheel-head { padding-block: 40px 0; }
.wheel-content { padding-top: 8px; }
.wheel-content code { font-size: 0.9em; overflow-wrap: anywhere; }

.wheel-tool {
  width: min(1180px, calc(100% - 48px));
  margin: 32px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

/* 轉盤 */
.wheel-stage {
  padding: 28px;
  border: var(--line);
  border-radius: 4px;
  background: var(--white);
  box-shadow: 9px 9px 0 var(--blue);
}
/* 電腦上讓轉盤和「開始轉」按鈕盡量同時在畫面裡 */
.wheel-box { position: relative; width: min(100%, 540px, max(280px, 62vh)); margin: 0 auto; aspect-ratio: 1; }
.wheel-canvas { display: block; width: 100%; height: 100%; border-radius: 50%; cursor: pointer; will-change: transform; }
.wheel-pointer {
  position: absolute; z-index: 2; left: 50%; top: -14px;
  width: 44px; height: 52px; transform: translateX(-50%);
  fill: var(--coral); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round;
  filter: drop-shadow(3px 3px 0 var(--ink));
}
.wheel-hub {
  position: absolute; z-index: 2; left: 50%; top: 50%;
  width: 19%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border: var(--line); border-width: 3px; border-radius: 50%;
  background: var(--ink); color: var(--lime);
  font: inherit; font-size: clamp(18px, 4vw, 30px); font-weight: 900; cursor: pointer;
  box-shadow: 0 0 0 6px var(--white);
}
.wheel-hub:hover { background: #24345a; }
.wheel-hub:disabled, .wheel-spin:disabled { cursor: progress; }

.wheel-actions { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; align-items: center; margin-top: 28px; }
.wheel-spin { font: inherit; font-size: 20px; font-weight: 850; cursor: pointer; }
.wheel-spin:disabled { opacity: 0.6; transform: none; }
.wheel-count { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: 14px; font-weight: 700; }

/* 一般按鈕 */
.wheel-btn {
  min-height: 48px; padding: 8px 16px;
  border: var(--line); border-radius: 4px; background: var(--white); color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 800; cursor: pointer;
}
.wheel-btn:hover { background: var(--lime); }
.wheel-link { min-height: 44px; padding: 0 8px; border: 0; background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 800; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

/* 名單和設定 */
.wheel-panel { padding: 24px; border: var(--line); border-radius: 4px; background: var(--white); }
.wheel-label { display: block; margin-bottom: 8px; font-weight: 900; font-size: 18px; }
.wheel-items {
  display: block; width: 100%; min-height: 220px; padding: 12px 14px; resize: vertical;
  border: var(--line); border-radius: 4px; background: var(--paper); color: var(--ink);
  font: inherit; font-size: 16px; line-height: 1.6;
}
.wheel-items[readonly] { opacity: 0.7; }
.wheel-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.wheel-sub { margin: 18px 0 0; color: var(--muted); font-size: 14px; font-weight: 800; }
.wheel-presets { margin-top: 8px; }
.wheel-chip { min-height: 44px; padding: 6px 14px; border: var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); font: inherit; font-size: 15px; font-weight: 750; cursor: pointer; }
.wheel-chip:hover { background: var(--lime); }
.wheel-options { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: center; margin-top: 18px; font-weight: 750; font-size: 15px; }
.wheel-options label { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; }
.wheel-options input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--ink); }
.wheel-options select { min-height: 40px; padding: 4px 8px; border: var(--line); border-radius: 4px; background: var(--white); color: var(--ink); font: inherit; font-size: 15px; }

/* 轉盤標題：填了才顯示在轉盤上方，全螢幕投影時也看得到 */
.wheel-title { margin: 0 0 18px; text-align: center; font-size: clamp(24px, 3.4vw, 36px); font-weight: 900; line-height: 1.25; overflow-wrap: anywhere; }
.wheel-stage:fullscreen .wheel-title { margin-bottom: 3vmin; color: var(--white); font-size: clamp(28px, 6vmin, 64px); }
.wheel-title-label { margin-top: 18px; }
.wheel-title-input { display: block; width: 100%; min-height: 48px; padding: 8px 14px; border: var(--line); border-radius: 4px; background: var(--paper); color: var(--ink); font: inherit; font-size: 16px; }
.wheel-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.wheel-history { margin-top: 20px; padding-top: 14px; border-top: var(--line); }
.wheel-history-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.wheel-history h2 { margin: 0; font-size: 18px; font-weight: 900; }
.wheel-history-list { max-height: 220px; margin: 6px 0 0; padding-left: 2.2em; overflow-y: auto; font-size: 15px; }
.wheel-history-list li + li { margin-top: 2px; }
.wheel-history-list time { margin-left: 8px; color: var(--muted); font-size: 13px; }
.wheel-empty { margin: 6px 0 0; color: var(--muted); font-size: 14px; }

.wheel-promo { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: center; justify-content: space-between; padding: 16px 22px; border: var(--line); border-radius: 4px; background: var(--lime); }
.wheel-promo p { margin: 0; font-weight: 650; }
.wheel-promo a { font-weight: 900; }

/* 結果 */
.wheel-result {
  width: min(640px, calc(100% - 32px)); padding: 40px 28px 32px; overflow: hidden;
  border: var(--line); border-width: 3px; border-radius: 6px;
  background: var(--white); color: var(--ink); text-align: center;
  box-shadow: 10px 10px 0 var(--coral);
}
.wheel-result::backdrop { background: rgba(23, 35, 59, 0.6); }
.wheel-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wheel-result > :not(canvas) { position: relative; }
.wheel-result-kicker { display: inline-block; margin: 0; padding: 2px 12px; border: var(--line); background: var(--lime); font-weight: 900; }
.wheel-result-text { margin: 18px 0 28px; font-size: clamp(36px, 9vw, 72px); font-weight: 900; line-height: 1.15; overflow-wrap: anywhere; }
.wheel-result-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; align-items: center; }
.wheel-result-actions .site-enter { min-width: 0; justify-content: center; font: inherit; font-size: 19px; font-weight: 850; cursor: pointer; }

/* 全螢幕：只留轉盤 */
.wheel-stage:fullscreen { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3vmin; border: 0; border-radius: 0; box-shadow: none; background: var(--ink); }
.wheel-stage:fullscreen .wheel-box { width: min(82vmin, 100%); }
.wheel-stage:fullscreen .wheel-hub { box-shadow: 0 0 0 6px var(--ink); }
.wheel-stage:fullscreen .wheel-count { color: var(--paper); }
.wheel-stage:fullscreen .wheel-actions { margin-top: 3vmin; }

@media (prefers-reduced-motion: reduce) { .wheel-canvas { will-change: auto; } }

@media (max-width: 900px) {
  .wheel-tool { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .wheel-tool { width: calc(100% - 32px); margin-top: 24px; gap: 20px; }
  .wheel-head { padding-top: 24px; }
  .wheel-stage { padding: 20px 14px; box-shadow: 6px 6px 0 var(--blue); }
  .wheel-panel { padding: 18px; }
  .wheel-items { min-height: 180px; }
  .wheel-promo { padding: 14px 16px; }
}

/* 英文頁：轉盤中間是 SPIN，字小一點 */
.wheel-hub-en { font-size: clamp(13px, 2.4vw, 20px); letter-spacing: 0.04em; }
