/* ═══════════════════════════════════════════════════════════════
 * SWAG · 表演輪盤（v3 — 輪盤為主，設定預先配置）
 * 主畫面只剩輪盤；尺度/類型/題目都在 ⚙ 設定抽屜內預先設好
 * 配色一律 cyan / swag tint
 * ═══════════════════════════════════════════════════════════════ */

.wheel-app {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 130px;
}

/* ── Hero（與百科 / 排行 / 工具集合頁對齊） ──────── */
.wheel-hero {
  padding: 28px 0 20px;
  margin-bottom: 0;
}
.wheel-hero-eyebrow {
  display: inline-block;
  font-size: 11px;
  font-weight: var(--w-eb);
  letter-spacing: 0.14em;
  color: var(--mid);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.wheel-hero-title {
  font-size: clamp(1.7rem, 3.5vw, 2.5rem);
  font-weight: var(--w-eb);
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--text);
  margin: 0 0 10px;
}
.wheel-hero-title span { color: var(--swag-dk); }
.wheel-hero-sub {
  font-size: 13px;
  color: var(--mid);
  line-height: 1.5;
  max-width: 480px;
  margin: 0;
}

/* 手機：hero 收緊 */
@media (max-width: 480px) {
  .wheel-hero { padding: 18px 0 14px; }
  .wheel-hero-sub { display: none; }
  .wheel-hero-title { font-size: 22px; }
}

/* ── Section title — 沿用 home page 同款 ─────────── */
.wheel-sec-title {
  font-size: 11px;
  font-weight: var(--w-eb);
  color: var(--swag-dk);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 26px 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.wheel-sec-title::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--swag);
  box-shadow: 0 0 8px rgba(43,197,180,.55);
}

/* ── Topbar：徽章 + 鏡像 + 設定（一行收齊）─────────── */
.wheel-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 22px 0 22px;
}
.wheel-topbar-info {
  flex: 1;
  min-width: 0;
}
.wheel-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.wheel-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  min-height: 36px;
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
  font-weight: var(--w-sb);
  color: var(--text);
  letter-spacing: 0.01em;
  box-shadow: var(--shadow);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wheel-badge::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--swag);
  box-shadow: 0 0 8px rgba(43,197,180,.6);
  flex-shrink: 0;
}
.wheel-badge.is-empty::before { background: var(--faint); box-shadow: none; }
.wheel-badge.is-empty { color: var(--muted); }

/* 沿用 site .rank-link 風格 — touch-friendly 36px 高、subtle hover */
.wheel-settings-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line2);
  background: var(--surface);
  color: var(--mid);
  font-family: inherit;
  font-size: 12px;
  font-weight: var(--w-sb);
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: var(--shadow);
  transition: border-color .13s, color .13s, transform .13s;
  cursor: pointer;
}
.wheel-settings-btn:hover {
  border-color: var(--swag);
  color: var(--swag);
  transform: translateY(-1px);
}
.wheel-settings-btn .ic { font-size: 14px; line-height: 1; }
@media (max-width: 480px) {
  .wheel-settings-btn .lb { display: none; }
  .wheel-settings-btn { width: 36px; padding: 0; }
}

/* 鏡像 toggle — 跟 settings btn 同款，有 active 狀態。label 全平台都顯示讓功能明確 */
.wheel-icon-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line2);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: var(--w-b);
  letter-spacing: 0.02em;
  white-space: nowrap;
  box-shadow: var(--shadow);
  transition: border-color .13s, color .13s, background .13s, transform .13s;
  cursor: pointer;
}
.wheel-icon-btn:hover {
  border-color: var(--swag);
  color: var(--swag);
  transform: translateY(-1px);
}
.wheel-icon-btn .ic {
  font-size: 15px;
  line-height: 1;
  transition: transform .15s;
}
.wheel-icon-btn[aria-pressed="true"] {
  background: var(--swag);
  border-color: var(--swag);
  color: #fff;
  box-shadow: 0 2px 8px rgba(43,197,180,.30);
}
.wheel-icon-btn[aria-pressed="true"] .ic { transform: scaleX(-1); }
@media (max-width: 480px) {
  /* 手機上保留 label，只縮 padding 讓兩顆按鈕跟徽章能並排 */
  .wheel-icon-btn { padding: 0 10px; }
}


/* ── Stage：輪盤大型化 ─────────────────────────────── */
.wheel-stage-wrap { margin-top: 16px; }
.wheel-stage {
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  filter: drop-shadow(0 14px 36px rgba(43,197,180,.22));
}
.wheel-stage-canvas { width: 100%; height: 100%; }
.wheel-stage-canvas > div { width: 100%; height: 100%; }

/* ── 子彈型指針（SVG） ─────────────────────────────── */
.wheel-pointer {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(31,168,152,.40));
  transform-origin: 50% 8%;
}
.wheel-pointer-svg {
  display: block;
  width: 36px;
  height: 50px;
  transition: transform 90ms ease-out;
}
.wheel-pointer-base {
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #5FD4C4 0%, #1FA898 80%);
  border: 2px solid #fff;
  box-shadow: 0 2px 4px rgba(31,168,152,.35);
}
@media (max-width: 480px) {
  .wheel-pointer-svg { width: 30px; height: 42px; }
  .wheel-pointer-base { width: 10px; height: 10px; }
}

/* 切片穿過指針時的微震動 */
.wheel-pointer.is-tick .wheel-pointer-svg {
  animation: pointerTick 110ms ease;
}
@keyframes pointerTick {
  0%   { transform: scaleY(1)    translateY(0); }
  40%  { transform: scaleY(0.88) translateY(3px); }
  100% { transform: scaleY(1)    translateY(0); }
}

/* ── 中央 hub — SWAG logo ─────────────────────────── */
.wheel-hub {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, #FFFFFF 0%, #F4F1EB 85%);
  border: 3px solid var(--swag);
  box-shadow: 0 4px 14px rgba(31,168,152,.28), inset 0 2px 6px rgba(255,255,255,.65);
  pointer-events: none;
  transition: transform var(--dur-base) var(--ease-spring);
  overflow: hidden;
  padding: 0 6%;
}
.wheel-hub[hidden] { display: none; }
.wheel-hub-logo {
  display: block;
  /* SWAG wordmark 是 2139×939 橫向長條，用 contain 完整顯示 */
  width: 100%;
  height: auto;
  max-height: 60%;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(31,168,152,.18));
  -webkit-user-drag: none;
  user-select: none;
  pointer-events: none;
}

/* 慶祝光環 — onRest 後 conic sweep */
.wheel-celebrate {
  position: absolute;
  inset: -6%;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
}
.wheel-celebrate.is-on {
  animation: celebrateSweep 1100ms var(--ease) forwards;
}
@keyframes celebrateSweep {
  0% {
    opacity: 0;
    background: conic-gradient(from 0deg, transparent 0deg, transparent 360deg);
  }
  20% {
    opacity: 1;
    background: conic-gradient(from 0deg,
      rgba(43,197,180,.0) 0deg,
      rgba(43,197,180,.55) 30deg,
      rgba(43,197,180,.0) 80deg);
  }
  100% {
    opacity: 0;
    background: conic-gradient(from 360deg,
      rgba(43,197,180,.0) 0deg,
      rgba(43,197,180,.55) 30deg,
      rgba(43,197,180,.0) 80deg);
  }
}

/* ── 即時題目卡（兩種狀態：cycling / picked）─────── */
.wheel-current {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 auto 18px;
  padding: 14px 20px;
  max-width: 580px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--swag) 6%, var(--surface)) 0%, var(--surface) 70%);
  border: 1px solid color-mix(in srgb, var(--swag) 22%, var(--line2));
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(43,197,180,.08);
  text-align: left;
  transition: border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.wheel-current[hidden] { display: none; }
.wheel-current.is-picked {
  border-color: var(--swag);
  background: linear-gradient(135deg, color-mix(in srgb, var(--swag) 12%, var(--surface)) 0%, var(--surface) 60%);
  box-shadow: 0 4px 14px rgba(43,197,180,.18), 0 1px 3px rgba(43,197,180,.10);
}
/* 只在從 idle / 第一次抽到時跑 pulse；連抽就不再播 */
.wheel-current.is-picked.is-pulsing {
  animation: pickedPulse 600ms var(--ease-spring) 1;
}

/* idle 狀態：尚未抽題，整張卡淡灰提示「點下方按鈕開始抽題」*/
.wheel-current.is-idle {
  background: var(--surface);
  border-color: var(--line2);
  box-shadow: var(--sh-1);
}
.wheel-current.is-idle .wheel-current-num {
  background: var(--c-surface-2);
  color: var(--muted);
  box-shadow: none;
}
.wheel-current.is-idle .wheel-current-title {
  color: var(--muted);
  font-weight: var(--w-sb);
  font-size: var(--t-base);
}
@keyframes pickedPulse {
  0%   { transform: scale(1);    box-shadow: 0 4px 14px rgba(43,197,180,.18); }
  40%  { transform: scale(1.02); box-shadow: 0 8px 24px rgba(43,197,180,.28); }
  100% { transform: scale(1);    box-shadow: 0 4px 14px rgba(43,197,180,.18); }
}

.wheel-current-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.wheel-current-num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--swag);
  color: #fff;
  font-size: var(--t-lg);
  font-weight: var(--w-eb);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 8px rgba(43,197,180,.28);
}
.wheel-current-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.wheel-current-tier {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10.5px;
  font-weight: var(--w-eb);
  letter-spacing: 0.08em;
  color: var(--swag-dk);
  background: var(--swag-bg);
  border: 1px solid color-mix(in srgb, var(--swag) 25%, transparent);
  padding: 2px 8px;
  border-radius: var(--r-full);
  text-transform: uppercase;
  margin-bottom: 2px;
}
.wheel-current-tier[hidden] { display: none; }
.wheel-current-title {
  font-size: clamp(16px, 3.6vw, 19px);
  font-weight: var(--w-eb);
  color: var(--text);
  letter-spacing: -0.005em;
  line-height: var(--lh-tight);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 80ms;
}
.wheel-current-desc {
  font-size: var(--t-sm);
  color: var(--mid);
  line-height: var(--lh-normal);
  display: none;
  margin: 0;
}
.wheel-current.is-picked .wheel-current-desc:not(:empty) {
  display: block;
}

.wheel-current-fs-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  border: 1px solid color-mix(in srgb, var(--swag) 35%, var(--line2));
  background: var(--surface);
  color: var(--swag-dk);
  font-size: 18px;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  line-height: 1;
}
.wheel-current-fs-btn[hidden] { display: none; }
.wheel-current-fs-btn:hover {
  background: var(--swag);
  color: #fff;
  border-color: var(--swag);
  transform: translateY(-1px);
}

.wheel-current-meta {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin-left: 58px;
  padding: 4px 11px;
  background: var(--swag-bg);
  border: 1px solid color-mix(in srgb, var(--swag) 25%, transparent);
  border-radius: var(--r-full);
  font-size: var(--t-xs);
  font-weight: var(--w-sb);
  color: var(--swag-dk);
}
.wheel-current-meta[hidden] { display: none; }

@media (max-width: 480px) {
  .wheel-current { padding: 12px 16px; gap: 8px; }
  .wheel-current-head { gap: 11px; }
  .wheel-current-num { width: 38px; height: 38px; font-size: var(--t-md); }
  .wheel-current-fs-btn { width: 32px; height: 32px; font-size: 15px; }
  .wheel-current-meta { margin-left: 49px; }
}
/* 轉動中指示器淡化 + 切換時 flash */
.wheel-app.is-spinning .wheel-current { opacity: .85; }
.wheel-current.is-flash .wheel-current-title { color: var(--swag-dk); }

.wheel-stage-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  border-radius: 50%;
  pointer-events: none;
}
.wheel-stage-overlay[hidden] { display: none; }
.wheel-overlay-inner {
  text-align: center;
  padding: 20px;
  color: var(--muted);
  font-size: var(--t-sm);
  line-height: var(--lh-snug);
  max-width: 76%;
}
.wheel-overlay-inner .ic { font-size: 32px; display: block; margin-bottom: 6px; opacity: .7; }
.wheel-overlay-inner .spin {
  display: inline-block;
  width: 24px; height: 24px;
  border: 2.5px solid var(--line2);
  border-top-color: var(--swag);
  border-radius: 50%;
  animation: wheelSpin .8s linear infinite;
  margin-bottom: 8px;
}
@keyframes wheelSpin { to { transform: rotate(360deg); } }

.wheel-app.is-spinning .wheel-topbar {
  opacity: .5;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease);
}

/* 切換尺度時：保留輪盤可見、淡化、邊角小 pill 提示 — 不全擋畫面 */
.wheel-stage.is-loading > .wheel-stage-canvas {
  opacity: .35;
  filter: saturate(.6);
  transition: opacity var(--dur-base) var(--ease), filter var(--dur-base) var(--ease);
}
.wheel-stage-loading-pill {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px 5px 9px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--line2);
  font-size: 11px;
  font-weight: var(--w-b);
  color: var(--swag-dk);
  letter-spacing: 0.04em;
  box-shadow: var(--sh-1);
  pointer-events: none;
  animation: hintIn 200ms var(--ease-spring) both;
}
.wheel-stage-loading-pill[hidden] { display: none; }
.wheel-stage-loading-pill::before {
  content: '';
  width: 10px; height: 10px;
  border: 2px solid var(--line2);
  border-top-color: var(--swag);
  border-radius: 50%;
  animation: wheelSpin .8s linear infinite;
  flex-shrink: 0;
}

/* ── 全螢幕題目大字卡 ─────────────────────────────── */
.wheel-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--swag) 8%, var(--surface)) 0%, var(--surface) 70%);
  animation: hintIn 240ms var(--ease-spring) both;
}
.wheel-fullscreen[hidden] { display: none; }
.wheel-fullscreen-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line2);
  background: var(--surface);
  color: var(--mid);
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--sh-1);
  transition: all var(--dur-fast) var(--ease);
}
.wheel-fullscreen-close:hover {
  border-color: var(--swag);
  color: var(--swag-dk);
  transform: scale(1.04);
}
.wheel-fullscreen-inner {
  width: 100%;
  max-width: 880px;
  text-align: center;
}
.wheel-fullscreen-eyebrow {
  font-size: clamp(12px, 1.6vw, 14px);
  font-weight: var(--w-eb);
  letter-spacing: 0.18em;
  color: var(--swag-dk);
  text-transform: uppercase;
  margin-bottom: 24px;
}
.wheel-fullscreen-title {
  font-size: clamp(40px, 9vw, 96px);
  font-weight: var(--w-eb);
  letter-spacing: -0.025em;
  line-height: 1.05;
  color: var(--text);
  margin-bottom: 28px;
  word-break: break-word;
}
.wheel-fullscreen-desc {
  font-size: clamp(16px, 2.4vw, 24px);
  color: var(--mid);
  line-height: 1.55;
  margin-bottom: 32px;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}
.wheel-fullscreen-desc:empty { display: none; }
.wheel-fullscreen-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  background: var(--swag);
  color: #fff;
  border-radius: var(--r-full);
  font-size: clamp(13px, 1.6vw, 15px);
  font-weight: var(--w-eb);
  letter-spacing: 0.04em;
  box-shadow: 0 6px 18px rgba(43,197,180,.30);
}
.wheel-fullscreen-meta:empty { display: none; }

/* 鏡像時，全螢幕也跟著翻 */
body.is-mirrored .wheel-fullscreen-inner {
  transform: scaleX(-1);
}

/* ── 主 CTA ───────────────────────────────────────── */
.wheel-cta-wrap {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}
.wheel-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  padding: 0 36px;
  border: none;
  border-radius: var(--r-full);
  background: var(--swag-dk);
  color: #fff;
  font-family: inherit;
  font-size: var(--t-md);
  font-weight: var(--w-eb);
  letter-spacing: 0.04em;
  cursor: pointer;
  /* 與 site 其他主按鈕同層級，不過度突兀 */
  box-shadow: 0 4px 14px rgba(43,197,180,.28), 0 1px 3px rgba(43,197,180,.18);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  overflow: hidden;
  min-width: 220px;
}
.wheel-cta:hover {
  transform: translateY(-1px);
  background: var(--swag-dk);
  box-shadow: 0 8px 22px rgba(43,197,180,.36), 0 2px 4px rgba(43,197,180,.22);
}
.wheel-cta:active { transform: translateY(0); }
.wheel-cta:disabled,
.wheel-cta:disabled:hover {
  background: var(--c-surface-2);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}
.wheel-cta-label { position: relative; z-index: 1; }
.wheel-cta-glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.3) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease);
}
.wheel-cta:hover .wheel-cta-glow { opacity: 1; }

/* 共用按鈕 utility */
.wheel-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--control-h);
  padding: 0 18px;
  border-radius: var(--r);
  border: 1px solid var(--line2);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: var(--t-base);
  font-weight: var(--w-sb);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.wheel-btn:hover { border-color: var(--swag); color: var(--swag-dk); }
.wheel-btn.is-primary {
  background: var(--swag);
  border-color: var(--swag);
  color: #fff;
  padding: 0 22px;
}
.wheel-btn.is-primary:hover {
  background: var(--swag-dk);
  border-color: var(--swag-dk);
  color: #fff;
  transform: translateY(-1px);
}
.wheel-mini-btn {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border-radius: var(--r-full);
  border: 1px solid var(--line2);
  background: var(--surface);
  color: var(--mid);
  font-family: inherit;
  font-size: var(--t-xs);
  font-weight: var(--w-b);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.wheel-mini-btn:hover { border-color: var(--swag); color: var(--swag-dk); }
.wheel-mini-btn[aria-pressed="true"] {
  background: var(--swag);
  border-color: var(--swag);
  color: #fff;
}
.wheel-mini-btn[aria-pressed="true"]:hover { color: #fff; }
.wheel-prompt-bulk-spacer { flex: 1; }

/* ════════════════════════════════════════════════════════════════
 * 設定抽屜（drawer）
 * ════════════════════════════════════════════════════════════════ */
.wheel-drawer {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
}
.wheel-drawer[hidden] { display: none; }
.wheel-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20,18,15,.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: wheelFadeIn var(--dur-base) var(--ease) forwards;
}
@keyframes wheelFadeIn { from { opacity: 0; } to { opacity: 1; } }

.wheel-drawer-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(440px, 92vw);
  background: var(--surface);
  border-left: 1px solid var(--line2);
  box-shadow: -16px 0 40px rgba(20,18,15,.18);
  display: flex;
  flex-direction: column;
  animation: wheelDrawerIn var(--dur-slow) var(--ease-spring) forwards;
}
@keyframes wheelDrawerIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@media (max-width: 480px) {
  .wheel-drawer-panel { width: 100vw; border-left: none; }
}

.wheel-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--swag) 4%, var(--surface)) 0%, var(--surface) 100%);
}
.wheel-drawer-head h2 {
  font-size: var(--t-lg);
  font-weight: var(--w-eb);
  color: var(--text);
  letter-spacing: var(--ls-tight);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.wheel-drawer-head h2::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--swag);
  box-shadow: 0 0 8px rgba(43,197,180,.55);
}
.wheel-drawer-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.wheel-drawer-close:hover { background: var(--c-surface-2); color: var(--text); }

.wheel-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 24px;
}
.wheel-drawer-section {
  margin-bottom: 22px;
}
.wheel-drawer-section:last-child { margin-bottom: 0; }
.wheel-drawer-label {
  font-size: var(--t-xs);
  font-weight: var(--w-eb);
  letter-spacing: var(--ls-widest);
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}
.wheel-drawer-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.wheel-drawer-label-row .wheel-drawer-label { margin-bottom: 0; }
.wheel-drawer-count {
  font-size: var(--t-xs);
  font-weight: var(--w-b);
  color: var(--swag-dk);
  background: var(--swag-bg);
  border: 1px solid color-mix(in srgb, var(--swag) 25%, transparent);
  padding: 3px 10px;
  border-radius: var(--r-full);
}

.wheel-drawer-foot {
  flex-shrink: 0;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 -4px 14px rgba(20,18,15,.04);
}
.wheel-drawer-foot .wheel-btn { width: 100%; }
.wheel-drawer-foot .wheel-btn.is-warning {
  background: var(--c-surface-2);
  color: var(--error);
  border: 1px solid color-mix(in srgb, var(--error) 35%, var(--line2));
}
.wheel-drawer-foot .wheel-btn.is-warning:hover {
  background: color-mix(in srgb, var(--error) 8%, var(--surface));
}

/* segmented control（drawer 內） */
.wheel-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
  background: var(--c-surface-2);
  border: 1px solid var(--line2);
  border-radius: var(--r-md);
  padding: 5px;
}
.wheel-seg-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 10px 6px;
  background: transparent;
  border: none;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: var(--t-base);
  font-weight: var(--w-sb);
  color: var(--mid);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  min-height: 50px;
}
.wheel-seg-btn:hover { color: var(--text); }
.wheel-seg-btn.is-active {
  background: var(--surface);
  color: var(--swag-dk);
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 10px rgba(43,197,180,.14);
  border: 1px solid color-mix(in srgb, var(--swag) 30%, var(--line2));
}
.wheel-seg-icon { font-size: 18px; line-height: 1; }
.wheel-seg-name { font-size: var(--t-sm); font-weight: var(--w-b); }
.wheel-seg-custom-count {
  display: inline-flex;
  align-items: center;
  margin-top: 4px;
  padding: 1px 7px;
  border-radius: var(--r-full);
  background: var(--swag-bg);
  border: 1px solid color-mix(in srgb, var(--swag) 30%, transparent);
  font-size: 9.5px;
  font-weight: var(--w-eb);
  color: var(--swag-dk);
  letter-spacing: 0.04em;
}
.wheel-seg-btn.is-active .wheel-seg-custom-count {
  background: var(--swag);
  color: #fff;
  border-color: var(--swag);
}

/* chips（drawer 內） */
.wheel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wheel-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--line2);
  border-radius: var(--r-full);
  font-family: inherit;
  font-size: var(--t-xs);
  font-weight: var(--w-sb);
  color: var(--mid);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.wheel-chip:hover { border-color: var(--swag); color: var(--swag-dk); }
.wheel-chip.is-active {
  background: var(--swag);
  border-color: var(--swag);
  color: #fff;
  box-shadow: 0 2px 8px rgba(43,197,180,.30);
}
.wheel-chip-icon { font-size: 13px; line-height: 1; }
.wheel-chips-loading {
  font-size: var(--t-xs);
  color: var(--muted);
  padding: 6px 4px;
}

/* 題目搜尋 + bulk 同列（窄螢幕自動換行）*/
.wheel-prompt-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.wheel-prompt-search {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 200px;
  min-width: 0;
}
.wheel-prompt-search-ic {
  position: absolute;
  left: 11px;
  font-size: 13px;
  color: var(--muted);
  pointer-events: none;
}
.wheel-prompt-search input {
  width: 100%;
  height: 36px;
  padding: 0 30px 0 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line2);
  background: var(--surface);
  font-family: inherit;
  font-size: var(--t-sm);
  color: var(--text);
  transition: border-color var(--dur-fast) var(--ease);
}
.wheel-prompt-search input:focus {
  outline: none;
  border-color: var(--swag);
  box-shadow: var(--focus);
}
.wheel-prompt-search input::-webkit-search-cancel-button { display: none; }
.wheel-prompt-search-clear {
  position: absolute;
  right: 8px;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--c-surface-2);
  color: var(--muted);
  font-size: 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--ease);
}
.wheel-prompt-search-clear[hidden] { display: none; }
.wheel-prompt-search-clear:hover {
  background: var(--swag);
  color: #fff;
}

/* bulk 按鈕群（在 controls 內、靠右）*/
.wheel-prompt-bulk {
  display: inline-flex;
  gap: 6px;
  flex-shrink: 0;
}
.wheel-prompt-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 360px;
  overflow-y: auto;
  padding: 4px 2px 16px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  /* 底端漸層遮罩，暗示「下面還有更多題目」 */
  mask-image: linear-gradient(to bottom, black 0%, black calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black calc(100% - 24px), transparent 100%);
}
.wheel-prompt-empty {
  text-align: center;
  font-size: var(--t-sm);
  color: var(--muted);
  padding: 24px 12px;
}
.wheel-prompt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.wheel-prompt-row:hover { background: var(--c-surface-2); }
.wheel-prompt-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px; height: 18px;
  flex-shrink: 0;
  border: 1.5px solid var(--line2);
  border-radius: 5px;
  background: var(--surface);
  cursor: pointer;
  position: relative;
  transition: all var(--dur-fast) var(--ease);
}
.wheel-prompt-row input[type="checkbox"]:checked {
  background: var(--swag);
  border-color: var(--swag);
}
.wheel-prompt-row input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px; left: 5px;
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.wheel-prompt-text {
  flex: 1;
  min-width: 0;
  font-size: var(--t-sm);
  color: var(--text);
  font-weight: var(--w-m);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wheel-prompt-row.is-off .wheel-prompt-text {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--faint);
}
.wheel-prompt-dur {
  font-size: var(--t-xs);
  color: var(--muted);
  font-weight: var(--w-sb);
  flex-shrink: 0;
}
.wheel-prompt-fav {
  font-size: 13px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(204,140,0,.25));
}

/* 「自訂」徽章（在題目列表中標識自訂主題） */
.wheel-prompt-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  background: var(--swag-bg);
  border: 1px solid color-mix(in srgb, var(--swag) 30%, transparent);
  border-radius: var(--r-full);
  font-size: 9.5px;
  font-weight: var(--w-eb);
  color: var(--swag-dk);
  letter-spacing: 0.08em;
}

/* ── 自訂主題（drawer 內 CRUD）────────────────────── */
.wheel-mini-btn.is-primary {
  background: var(--swag);
  border-color: var(--swag);
  color: #fff;
}
.wheel-mini-btn.is-primary:hover {
  background: var(--swag-dk);
  border-color: var(--swag-dk);
  color: #fff;
}

.wheel-custom-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  background: var(--c-surface-2);
  border: 1px solid var(--line2);
  border-radius: var(--r-md);
  margin-bottom: 10px;
}
.wheel-custom-form[hidden] { display: none; }
.wheel-custom-form input[type="text"],
.wheel-custom-form input[type="number"],
.wheel-custom-form textarea,
.wheel-custom-form select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--line2);
  border-radius: var(--r-sm);
  background: var(--surface);
  font-family: inherit;
  font-size: var(--t-sm);
  color: var(--text);
  resize: vertical;
}
.wheel-custom-form input:focus,
.wheel-custom-form textarea:focus,
.wheel-custom-form select:focus {
  outline: none;
  border-color: var(--swag);
  box-shadow: var(--focus);
}
.wheel-custom-form-row {
  display: flex;
  gap: 8px;
}
.wheel-custom-form-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wheel-custom-form-field span {
  font-size: 10.5px;
  font-weight: var(--w-eb);
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.wheel-custom-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.wheel-custom-head-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}
.wheel-custom-hint {
  margin: 0 0 10px;
  padding: 8px 10px;
  font-size: var(--t-xs);
  color: var(--muted);
  background: color-mix(in srgb, var(--swag) 6%, transparent);
  border-radius: var(--r-sm);
  line-height: 1.5;
}

.wheel-custom-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wheel-custom-list:empty + .wheel-custom-empty { display: block; }
.wheel-custom-empty {
  text-align: center;
  font-size: var(--t-xs);
  color: var(--muted);
  padding: 16px 8px;
  font-style: italic;
}
.wheel-custom-empty[hidden] { display: none; }

.wheel-custom-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color var(--dur-fast) var(--ease);
}
.wheel-custom-row:hover { border-color: color-mix(in srgb, var(--swag) 30%, var(--line2)); }
.wheel-custom-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.wheel-custom-row-tier {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
}
.wheel-custom-row-title {
  flex: 1;
  font-size: var(--t-sm);
  font-weight: var(--w-sb);
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wheel-custom-row-actions {
  display: inline-flex;
  gap: 4px;
  flex-shrink: 0;
}
.wheel-custom-action {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line2);
  background: var(--surface);
  color: var(--mid);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast) var(--ease);
}
.wheel-custom-action:hover {
  border-color: var(--swag);
  color: var(--swag-dk);
}
.wheel-custom-action.wheel-custom-action--danger:hover {
  border-color: var(--error);
  color: var(--error);
  background: color-mix(in srgb, var(--error) 8%, var(--surface));
}

/* ════════════════════════════════════════════════════════════════
 * 結果 modal
 * ════════════════════════════════════════════════════════════════ */
.wheel-modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.wheel-modal[hidden] { display: none; }
.wheel-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20,18,15,.55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: wheelFadeIn var(--dur-base) var(--ease) forwards;
}
.wheel-modal-card {
  position: relative;
  width: 100%;
  max-width: 560px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--swag) 14%, var(--surface)) 0%, var(--surface) 55%);
  border: 1px solid color-mix(in srgb, var(--swag) 40%, var(--line2));
  border-radius: var(--r-xl);
  padding: 38px 36px 28px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(20,18,15,.30), 0 0 64px rgba(43,197,180,.30);
  animation: wheelPopIn var(--dur-slow) var(--ease-spring) forwards;
}
@media (max-width: 720px) {
  .wheel-modal-card { max-width: 100%; padding: 30px 22px 22px; }
}
@keyframes wheelPopIn {
  from { opacity: 0; transform: scale(.85) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.wheel-modal-toolbar {
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  z-index: 1;
}
.wheel-modal-tool,
.wheel-modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.wheel-modal-tool { font-size: 14px; filter: grayscale(.65); opacity: .55; }
.wheel-modal-tool:hover { background: var(--c-surface-2); filter: grayscale(0); opacity: 1; transform: scale(1.08); }
.wheel-modal-tool.is-active {
  background: color-mix(in srgb, var(--swag) 14%, var(--surface));
  filter: grayscale(0);
  opacity: 1;
}
.wheel-modal-close:hover { background: var(--c-surface-2); color: var(--text); }
.wheel-modal-eyebrow {
  font-size: var(--t-sm);
  font-weight: var(--w-eb);
  letter-spacing: var(--ls-widest);
  color: var(--swag-dk);
  text-transform: uppercase;
  margin-bottom: 14px;
}
.wheel-modal-title {
  font-size: clamp(26px, 5.6vw, 34px);
  font-weight: var(--w-eb);
  letter-spacing: var(--ls-tight);
  line-height: var(--lh-tight);
  color: var(--text);
  margin-bottom: 16px;
}
.wheel-modal-desc {
  font-size: var(--t-md);
  color: var(--mid);
  line-height: var(--lh-relaxed);
  margin-bottom: 18px;
}
.wheel-modal-desc:empty { display: none; }
.wheel-modal-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--swag-bg);
  border: 1px solid color-mix(in srgb, var(--swag) 30%, transparent);
  border-radius: var(--r-full);
  font-size: var(--t-sm);
  font-weight: var(--w-sb);
  color: var(--swag-dk);
  margin-bottom: 22px;
}
.wheel-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.wheel-modal-actions .wheel-btn { min-width: 130px; }

/* ── 額外操作列（跳過 / 複製）─────────────────────── */
.wheel-modal-extras {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 4px;
}
.wheel-modal-extra {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-full);
  color: var(--muted);
  font-family: inherit;
  font-size: var(--t-xs);
  font-weight: var(--w-sb);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
}
.wheel-modal-extra:hover {
  border-color: var(--line2);
  background: var(--c-surface-2);
  color: var(--text);
}
.wheel-modal-extra.is-flash {
  background: var(--swag-bg);
  color: var(--swag-dk);
  border-color: var(--swag);
}

/* ── 主畫面歷史 mini 列（單行橫向 scroll，常駐顯示）────── */
.wheel-history-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 14px;
  max-width: 580px;
  padding: 7px 12px 7px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  box-shadow: var(--sh-1);
}
.wheel-history-mini[hidden] { display: none; }
.wheel-history-mini-label {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: var(--w-eb);
  color: var(--muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.wheel-history-mini-list {
  flex: 1;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.wheel-history-mini-list::-webkit-scrollbar { display: none; }
.wheel-history-mini-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  max-width: 160px;
  padding: 4px 10px;
  background: var(--c-surface-2);
  border: 1px solid transparent;
  border-radius: var(--r-full);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: var(--w-sb);
  color: var(--mid);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all var(--dur-fast) var(--ease);
}
.wheel-history-mini-pill:hover {
  background: var(--swag-bg);
  border-color: var(--swag);
  color: var(--swag-dk);
}
.wheel-history-mini-pill.is-current {
  background: var(--swag);
  color: #fff;
  border-color: var(--swag);
}
@media (max-width: 480px) {
  .wheel-history-mini { padding: 6px 10px; }
  .wheel-history-mini-label { display: none; }
}

/* ── Modal 內歷史記錄（完整版）────────────────────── */
.wheel-history {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.wheel-history[hidden] { display: none; }
.wheel-history-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--t-xs);
  font-weight: var(--w-eb);
  letter-spacing: var(--ls-widest);
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.wheel-history-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--r-full);
  background: var(--swag-bg);
  color: var(--swag-dk);
  font-size: 11px;
  letter-spacing: 0;
}
.wheel-history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.wheel-history-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 220px;
  padding: 5px 11px;
  background: var(--c-surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-full);
  font-size: var(--t-xs);
  font-weight: var(--w-sb);
  color: var(--mid);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wheel-history-pill:hover {
  border-color: var(--swag);
  color: var(--swag-dk);
  background: var(--swag-bg);
}

/* ── In-transit（連抽轉動中）────────────────────────── */
.wheel-modal-content[hidden],
.wheel-modal-transit[hidden] { display: none; }

.wheel-modal-transit {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 0 24px;
  min-height: 160px;
}
.wheel-modal-transit-text {
  margin-top: 14px;
  font-size: var(--t-base);
  font-weight: var(--w-b);
  color: var(--swag-dk);
  letter-spacing: 0.04em;
}
.wheel-modal-transit-sub {
  margin-top: 4px;
  font-size: var(--t-xs);
  font-weight: var(--w-sb);
  color: var(--muted);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.wheel-modal-transit-spin {
  display: inline-flex;
  gap: 6px;
}
.wheel-modal-transit-spin span {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--swag);
  animation: dotPulse 1s var(--ease) infinite;
}
.wheel-modal-transit-spin span:nth-child(2) { animation-delay: .15s; }
.wheel-modal-transit-spin span:nth-child(3) { animation-delay: .30s; }
@keyframes dotPulse {
  0%, 80%, 100% { transform: scale(0.7); opacity: .5; }
  40%           { transform: scale(1.1); opacity: 1; }
}

/* in-transit 時 backdrop 淡化讓使用者看見輪盤 */
.wheel-modal.is-transit .wheel-modal-backdrop {
  background: rgba(20,18,15,.18);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.wheel-modal.is-transit .wheel-modal-card {
  box-shadow: 0 16px 40px rgba(20,18,15,.18), 0 0 36px rgba(43,197,180,.20);
}

/* ── 行動裝置：CTA sticky ────────────────────────────── */
@media (max-width: 720px) {
  .wheel-app { padding-bottom: calc(110px + 70px + env(safe-area-inset-bottom)); }
  .wheel-cta-wrap {
    position: fixed;
    left: 0; right: 0;
    bottom: calc(70px + env(safe-area-inset-bottom));
    z-index: 90;
    padding: 12px 16px;
    background: linear-gradient(to top, var(--bg) 60%, transparent);
    pointer-events: none;
    transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
  }
  .wheel-cta { pointer-events: auto; width: 100%; max-width: 320px; }
  .wheel-stage { max-width: 480px; }
  .wheel-modal-actions { flex-direction: column; align-items: stretch; }
  .wheel-modal-actions .wheel-btn { width: 100%; }
}

/* 結果 modal / 設定抽屜 / 全螢幕 開啟時，隱藏主畫面 CTA + 底部 tabbar
   避免被 drawer footer / modal actions 誤觸 */
html.modal-open .wheel-cta-wrap,
html.modal-open #swag-tabbar { display: none; }
@media (max-width: 480px) {
  .wheel-stage { max-width: 88vw; }
}

/* ── 鏡像模式 ─────────────────────────────────────── */
/* 只翻轉「給觀眾看的內容區」，主播操作 UI（hero / topbar / 按鈕 / 抽屜）保持正向 */
body.is-mirrored .wheel-stage,
body.is-mirrored .wheel-current,
body.is-mirrored .wheel-modal-content,
body.is-mirrored .wheel-modal-transit {
  transform: scaleX(-1);
}

/* 鏡像中水印徽章 — 漂在 stage-wrap 外緣，主播一眼確認狀態 */
.wheel-stage-wrap { position: relative; }
.wheel-stage-flag {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: var(--r-full);
  background: var(--swag);
  color: #fff;
  font-size: 10.5px;
  font-weight: var(--w-eb);
  letter-spacing: 0.12em;
  box-shadow: 0 4px 12px rgba(31,168,152,.30);
  pointer-events: none;
  animation: hintIn 240ms var(--ease-spring) both;
}
.wheel-stage-flag[hidden] { display: none; }

/* ── 主播提示卡 — 鏡像模式時浮在右上、保持正向 ─── */
.wheel-mirror-hint {
  position: fixed;
  top: calc(56px + env(safe-area-inset-top, 0) + 12px);
  right: 14px;
  left: auto;
  z-index: 1100;
  width: 200px;
  max-width: calc(100vw - 28px);
  padding: 10px 30px 10px 12px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(8px) saturate(140%);
  backdrop-filter: blur(8px) saturate(140%);
  border: 1px solid color-mix(in srgb, var(--swag) 60%, transparent);
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(31,168,152,.20), 0 1px 3px rgba(31,168,152,.10);
  text-align: left;
  opacity: .92;
  animation: hintIn 240ms var(--ease-spring) both;
  transition: opacity .15s ease;
}
.wheel-mirror-hint:hover { opacity: 1; }
.wheel-mirror-hint.is-left {
  right: auto;
  left: 14px;
}
.wheel-mirror-hint[hidden] { display: none; }
@keyframes hintIn {
  from { opacity: 0; transform: translateY(-6px) scale(.96); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.wheel-mirror-hint-head {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}
.wheel-mirror-hint-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--swag);
  color: #fff;
  font-size: 11px;
  font-weight: var(--w-eb);
}
.wheel-mirror-hint-eyebrow {
  font-size: 9.5px;
  font-weight: var(--w-eb);
  letter-spacing: 0.14em;
  color: var(--swag-dk);
  text-transform: uppercase;
}
.wheel-mirror-hint-title {
  font-size: var(--t-sm);
  font-weight: var(--w-eb);
  color: var(--text);
  letter-spacing: -0.005em;
  line-height: 1.3;
  word-break: break-word;
}

/* flip 按鈕 — 切換到對側 */
.wheel-mirror-hint-flip {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--swag) 30%, var(--line2));
  background: var(--surface);
  color: var(--swag-dk);
  font-size: 11px;
  font-weight: var(--w-eb);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  transition: all var(--dur-fast) var(--ease);
}
.wheel-mirror-hint-flip:hover {
  background: var(--swag);
  border-color: var(--swag);
  color: #fff;
}
.wheel-mirror-hint.is-left .wheel-mirror-hint-flip {
  right: auto;
  left: 6px;
}
.wheel-mirror-hint.is-left {
  padding: 10px 12px 10px 30px;
}

@media (max-width: 480px) {
  .wheel-mirror-hint {
    width: 180px;
    top: calc(56px + env(safe-area-inset-top, 0) + 8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wheel-modal-card,
  .wheel-modal-backdrop,
  .wheel-drawer-panel,
  .wheel-drawer-backdrop { animation-duration: 1ms !important; }
}
