/* ===========================
   拉霸抽獎機 Styles
   溫暖米白 × 鵝黃 × 暖橘紅
   可愛手繪風
   =========================== */

:root {
  --bg: #fdf4e9;
  --bg-soft: #fbe8d3;
  --bg-card: #ffffff;

  --yellow: #fcd34d;
  --yellow-bright: #ffd84d;
  --yellow-soft: #fff4d1;

  --orange: #f08149;
  --orange-bright: #ff8b5a;
  --orange-soft: #ffe4d3;

  --red: #c94a3a;
  --red-soft: #e8826e;

  --ink: #2b1810;
  --ink-soft: #6b5444;
  --ink-faded: #a99985;

  --border: #e8d9c2;
  --border-strong: #d4b896;

  --green: #7cb87a;
  --shadow: rgba(139, 97, 58, 0.12);

  --font-display: "Noto Serif TC", serif;
  --font-body: "Noto Sans TC", "PingFang TC", sans-serif;
  --font-en: "Fraunces", serif;
}

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

html,
body {
  height: 100%;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 20%, rgba(252, 211, 77, 0.15), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(240, 129, 73, 0.1), transparent 45%);
  pointer-events: none;
  z-index: 0;
}

/* 祥雲紋理 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200' viewBox='0 0 200 200'%3E%3Cpath d='M40 100c0-11 9-20 20-20 3-12 13-20 25-20s22 8 25 20c11 0 20 9 20 20s-9 20-20 20H60c-11 0-20-9-20-20z' fill='none' stroke='%23d4b896' stroke-width='1' opacity='0.3'/%3E%3C/svg%3E");
  background-size: 240px;
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}

/* ===========================
   頂部標題
   =========================== */
.topbar {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 40px 20px 24px;
}

.brand-en {
  font-family: var(--font-en);
  font-style: italic;
  font-size: 18px;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.brand {
  font-family: var(--font-display);
  font-size: clamp(32px, 5.5vw, 52px);
  font-weight: 900;
  color: var(--ink);
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}

.brand .cloud {
  display: inline-block;
  width: 42px;
  height: 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 42 22'%3E%3Cpath d='M3 15c0-4 3-7 7-7 1-4 5-6 10-6s9 2 10 6c4 0 7 3 7 7s-3 6-7 6H10c-4 0-7-2-7-6z' fill='%23fcd34d' stroke='%232b1810' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.brand-sub {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink-soft);
  margin-top: 10px;
  letter-spacing: 0.15em;
}

.brand-sub .divider {
  color: var(--orange);
  margin: 0 0.3em;
  font-weight: 700;
}

/* ===========================
   Tab 切換
   =========================== */
.mode-tabs {
  display: inline-flex;
  margin-top: 22px;
  background: var(--bg-card);
  padding: 6px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  gap: 4px;
}

.mode-tab {
  background: transparent;
  border: none;
  padding: 10px 22px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.05em;
}

.mode-tab .tab-emoji {
  font-size: 18px;
  transition: transform 0.3s;
}

.mode-tab:hover {
  color: var(--ink);
}

.mode-tab:hover .tab-emoji {
  transform: rotate(-10deg) scale(1.1);
}

.mode-tab.active {
  background: var(--orange);
  color: white;
  box-shadow: 0 2px 0 #c85a24;
}

.mode-tab.active .tab-emoji {
  transform: scale(1.15);
}

/* 切換模式面板（預設全隱藏） */
.mode-panel {
  display: none;
  width: 100%;
}

.mode-panel.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: mode-fade 0.3s ease-out;
}

@keyframes mode-fade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}


/* ===========================
   版面配置
   =========================== */
.layout {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(320px, 400px) 1fr;
  gap: 28px;
  padding: 16px 32px 40px;
  max-width: 1280px;
  margin: 0 auto;
}

/* RWD 在檔案最底部統一處理 */

.panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ===========================
   卡片
   =========================== */
.card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  box-shadow:
    0 4px 0 var(--border),
    0 8px 20px var(--shadow);
  position: relative;
}

.card-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.card-title .emoji {
  font-size: 24px;
  display: inline-block;
  transform: rotate(-8deg);
}

.card-title .num {
  font-family: var(--font-en);
  font-style: italic;
  font-size: 14px;
  color: var(--orange);
  font-weight: 600;
  background: var(--orange-soft);
  padding: 2px 10px;
  border-radius: 12px;
  margin-left: auto;
}

.hint {
  font-size: 13px;
  color: var(--ink-faded);
  margin-bottom: 12px;
  line-height: 1.6;
}

textarea#participants {
  width: 100%;
  min-height: 180px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  padding: 12px 14px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

textarea#participants:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft);
}

textarea#participants::placeholder {
  color: var(--ink-faded);
}

.meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  font-size: 14px;
  color: var(--ink-soft);
}

.meta #participant-count {
  color: var(--orange);
  font-weight: 900;
  font-size: 20px;
  font-family: var(--font-en);
}

/* ===========================
   獎項列表
   =========================== */
.prizes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prize-item {
  display: grid;
  grid-template-columns: 1fr 80px auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  animation: slide-in 0.3s ease-out;
}

@keyframes slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.prize-item input {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  padding: 8px 10px;
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.prize-item input:focus {
  border-color: var(--orange);
}

.prize-item input[type="number"] {
  font-family: var(--font-en);
  text-align: center;
  font-weight: 600;
}

.remove-prize {
  background: transparent;
  border: 1.5px solid var(--border-strong);
  color: var(--red);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.remove-prize:hover {
  background: var(--red);
  color: white;
  border-color: var(--red);
  transform: rotate(90deg);
}

.add-prize-btn {
  width: 100%;
  background: var(--yellow-soft);
  border: 1.5px dashed var(--border-strong);
  color: var(--ink-soft);
  padding: 12px;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  margin-top: 12px;
  transition: all 0.2s;
  font-weight: 600;
}

.add-prize-btn:hover {
  background: var(--yellow);
  color: var(--ink);
  border-color: var(--ink);
}

.add-prize-btn span {
  font-size: 16px;
  margin-right: 4px;
}

/* ===========================
   Toggle 開關
   =========================== */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin-top: 12px;
  background: var(--yellow-soft);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  user-select: none;
}

.toggle-row .toggle-text {
  flex: 1;
  min-width: 0;
}

.toggle-row .toggle-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

.toggle-row .toggle-sub {
  font-size: 11px;
  color: var(--ink-faded);
  line-height: 1.4;
}

/* 隱藏原生 checkbox，自訂開關 */
.toggle-row input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-switch {
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  background: var(--border-strong);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 18px;
  height: 18px;
  background: var(--bg-card);
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toggle-row input[type="checkbox"]:checked ~ .toggle-switch {
  background: var(--orange);
}

.toggle-row input[type="checkbox"]:checked ~ .toggle-switch::after {
  transform: translateX(20px);
}

/* 轉盤模式才顯示這個開關 */
.toggle-row {
  display: none;
}

body.mode-wheel .toggle-row {
  display: flex;
}


/* ===========================
   按鈕
   =========================== */
.card-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.primary-btn {
  width: 100%;
  background: var(--orange);
  border: none;
  color: white;
  padding: 16px;
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.1em;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow:
    0 4px 0 #c85a24,
    0 8px 16px rgba(240, 129, 73, 0.4);
}

.primary-btn::before {
  content: "🐯";
  margin-right: 8px;
  display: inline-block;
  transform: rotate(-10deg);
}

.primary-btn:not(:disabled):hover {
  transform: translateY(-2px);
  background: var(--orange-bright);
  box-shadow:
    0 6px 0 #c85a24,
    0 10px 20px rgba(240, 129, 73, 0.5);
}

.primary-btn:not(:disabled):active {
  transform: translateY(2px);
  box-shadow:
    0 2px 0 #c85a24,
    0 4px 8px rgba(240, 129, 73, 0.4);
}

.primary-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.ghost-btn {
  background: transparent;
  border: 1.5px solid var(--border-strong);
  color: var(--ink-soft);
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 13px;
  transition: all 0.2s;
}

.ghost-btn:hover:not(:disabled) {
  border-color: var(--orange);
  color: var(--orange);
  background: var(--orange-soft);
}

.ghost-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ghost-btn.full {
  width: 100%;
  padding: 10px;
}

/* ===========================
   拉霸機
   =========================== */
.panel-machine {
  align-items: center;
}

.machine {
  width: 100%;
  max-width: 620px;
  background: linear-gradient(180deg, #fef3d6 0%, #fce4a8 100%);
  border-radius: 32px;
  padding: 20px;
  box-shadow:
    0 6px 0 var(--border-strong),
    0 20px 50px rgba(139, 97, 58, 0.2);
  position: relative;
  border: 3px solid var(--ink);
}

.machine::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px dashed var(--ink);
  border-radius: 24px;
  pointer-events: none;
  opacity: 0.3;
}

/* 招牌 */
.machine-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-card);
  border-radius: 20px;
  border: 2.5px solid var(--ink);
  position: relative;
  z-index: 1;
  box-shadow: 0 3px 0 var(--ink);
}

.mascot {
  width: 48px;
  height: 48px;
  background: var(--yellow);
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  animation: mascot-bounce 2s ease-in-out infinite;
}

.mascot.right {
  animation-delay: 1s;
  background: var(--orange-soft);
}

@keyframes mascot-bounce {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-4px) rotate(5deg); }
}

.marquee {
  text-align: center;
}

.marquee-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
  letter-spacing: 0.15em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.marquee-title .deco {
  display: inline-block;
  width: 18px;
  height: 18px;
  background: var(--orange);
  border: 2px solid var(--ink);
  border-radius: 50%;
  position: relative;
}

.marquee-title .deco::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1.5px solid white;
  border-radius: 50%;
}

.current-prize {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
  min-height: 18px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.current-prize.active {
  color: var(--orange);
  font-weight: 700;
  animation: prize-glow 1.5s ease-in-out infinite;
}

@keyframes prize-glow {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* 滾輪 */
.machine-body {
  padding: 24px 20px;
  position: relative;
  z-index: 1;
}

.reels-frame {
  display: flex;
  gap: 10px;
  background: var(--bg-card);
  padding: 20px;
  border-radius: 20px;
  border: 2.5px solid var(--ink);
  box-shadow:
    inset 0 3px 0 rgba(0, 0, 0, 0.05),
    0 4px 0 var(--ink);
  position: relative;
}

.reel-window {
  flex: 1;
  height: 130px;
  background: linear-gradient(180deg, #fffbee 0%, #fef3d6 100%);
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  border: 2.5px solid var(--ink);
  box-shadow:
    inset 0 4px 8px rgba(139, 97, 58, 0.2);
  transition: all 0.3s;
}

.reel-window::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(139, 97, 58, 0.15) 0%,
    transparent 25%,
    transparent 75%,
    rgba(139, 97, 58, 0.15) 100%
  );
  pointer-events: none;
}

.reel {
  position: relative;
  height: 100%;
  width: 100%;
}

.reel-track {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.reel-item {
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  flex-shrink: 0;
  line-height: 1;
  user-select: none;
}

.reel.spinning .reel-track {
  animation: spin-reel 0.08s linear infinite;
}

@keyframes spin-reel {
  from { transform: translateY(0); }
  to { transform: translateY(-130px); }
}

/* 中獎時滾輪邊框變色 */
.reel-window.win {
  border-color: var(--orange);
  box-shadow:
    0 0 0 4px var(--orange-soft),
    inset 0 4px 8px rgba(139, 97, 58, 0.2);
  animation: reel-win-bounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes reel-win-bounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* 中獎時背景流光 */
.reels-frame.jackpot::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 22px;
  background: linear-gradient(90deg,
    var(--yellow), var(--orange), var(--red), var(--orange), var(--yellow));
  background-size: 200% 100%;
  z-index: -1;
  animation: jackpot-glow 1.5s linear infinite;
}

@keyframes jackpot-glow {
  from { background-position: 0% 50%; }
  to { background-position: 200% 50%; }
}

/* 中獎線 */
.payline {
  position: absolute;
  left: 28px;
  right: 28px;
  top: 50%;
  height: 3px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--orange) 20%,
    var(--orange) 80%,
    transparent 100%);
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.3s;
}

.payline.active {
  opacity: 1;
  animation: payline-pulse 0.6s ease-in-out infinite;
}

@keyframes payline-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===========================
   結果顯示
   =========================== */
.result-display {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: 20px;
  text-align: center;
  position: relative;
  box-shadow: 0 4px 0 var(--ink);
  min-height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  transition: all 0.3s;
}

.result-display.win {
  background: linear-gradient(135deg, var(--yellow-soft) 0%, var(--orange-soft) 100%);
  border-color: var(--orange);
  box-shadow: 0 4px 0 var(--orange);
}

.result-label {
  font-family: var(--font-en);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: 0.15em;
}

.result-label .zh {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 700;
  margin-left: 6px;
  color: var(--orange);
}

.result-name {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 900;
  color: var(--ink-faded);
  letter-spacing: 0.08em;
  transition: all 0.4s;
}

.result-name.win {
  color: var(--ink);
  animation: win-pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes win-pop {
  0% { transform: scale(0.3); opacity: 0; }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

/* ===========================
   拉桿
   =========================== */
.machine-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 8px;
  position: relative;
  z-index: 1;
}

.lever {
  background: transparent;
  border: none;
  cursor: pointer;
  width: 60px;
  height: 110px;
  position: relative;
  padding: 0;
}

.lever:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.lever-base {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 44px;
  height: 20px;
  background: var(--ink);
  border-radius: 4px;
}

.lever-stick {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 60px;
  background: linear-gradient(90deg, #6b5444 0%, #a08363 50%, #6b5444 100%);
  border-radius: 4px;
  transform-origin: bottom center;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  border: 1.5px solid var(--ink);
}

.lever-ball {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 34px;
  height: 34px;
  background: radial-gradient(circle at 30% 30%, var(--orange-bright) 0%, var(--orange) 50%, #c85a24 100%);
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  box-shadow:
    inset -3px -3px 6px rgba(0, 0, 0, 0.3),
    inset 2px 2px 4px rgba(255, 255, 255, 0.4);
  transform-origin: center bottom;
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.lever.pulling .lever-stick {
  transform: translateX(-50%) rotate(50deg);
}

.lever.pulling .lever-ball {
  transform: translateX(-50%) translate(42px, 32px);
}

.machine-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-en);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.1em;
}

.machine-label .dot {
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
  animation: dot-blink 1.5s infinite;
}

@keyframes dot-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ===========================
   中獎名單
   =========================== */
.winners-panel {
  width: 100%;
  max-width: 620px;
  margin-top: 24px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  box-shadow:
    0 4px 0 var(--border),
    0 8px 20px var(--shadow);
}

.winners-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1.5px dashed var(--border);
}

.winners-header h3 {
  font-family: var(--font-display);
  font-size: 18px;
  color: var(--ink);
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 8px;
}

.winners-header h3::before {
  content: "🎁";
  font-size: 22px;
}

.winners-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-state {
  color: var(--ink-faded);
  text-align: center;
  padding: 20px;
  font-size: 14px;
}

.winner-group {
  padding: 14px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-left: 4px solid var(--orange);
  border-radius: 12px;
  animation: winner-enter 0.4s ease-out;
}

@keyframes winner-enter {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.winner-prize-title {
  font-family: var(--font-display);
  font-size: 15px;
  color: var(--orange);
  font-weight: 900;
  margin-bottom: 8px;
  letter-spacing: 0.05em;
}

.winner-names {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink);
  line-height: 1.8;
}

.winner-names .name-tag {
  display: inline-block;
  padding: 4px 12px;
  margin: 3px 4px 3px 0;
  background: var(--yellow);
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  box-shadow: 0 2px 0 var(--ink);
}

/* ===========================
   中獎特效（紙花）
   =========================== */
.celebration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  overflow: hidden;
}

.confetti {
  position: absolute;
  width: 12px;
  height: 14px;
  top: -20px;
  border-radius: 2px;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) rotate(0);
    opacity: 1;
  }
  100% {
    transform: translateY(100vh) rotate(720deg);
    opacity: 0.3;
  }
}

/* ===========================
   Toast
   =========================== */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  /* 隱藏時要移出「整段高度 + bottom 間距 + safe area」，否則只 translate 百分比會卡在視窗底緣 */
  transform: translateX(-50%)
    translateY(calc(100% + 32px + env(safe-area-inset-bottom, 0px)));
  background: var(--ink);
  color: var(--yellow);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  z-index: 200;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ===========================
   轉盤模式
   =========================== */
.wheel-stage {
  width: 100%;
  max-width: 620px;
  background: linear-gradient(180deg, #fef3d6 0%, #fce4a8 100%);
  border-radius: 32px;
  padding: 24px 20px;
  border: 3px solid var(--ink);
  box-shadow:
    0 6px 0 var(--border-strong),
    0 20px 50px rgba(139, 97, 58, 0.2);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.wheel-stage::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px dashed var(--ink);
  border-radius: 24px;
  pointer-events: none;
  opacity: 0.3;
}

.wheel-marquee {
  width: 100%;
  padding: 14px 20px;
  background: var(--bg-card);
  border-radius: 20px;
  border: 2.5px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  text-align: center;
  position: relative;
  z-index: 1;
}

.wheel-container {
  position: relative;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1 / 1;
  margin: 8px auto;
  z-index: 1;
}

/* 轉盤指針 */
.wheel-pointer {
  position: absolute;
  top: 50%;
  right: -6px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 18px solid transparent;
  border-bottom: 18px solid transparent;
  border-right: 26px solid var(--red);
  filter: drop-shadow(-2px 0 0 var(--ink))
          drop-shadow(0 -2px 0 var(--ink))
          drop-shadow(0 2px 0 var(--ink))
          drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
  z-index: 3;
}

/* 指針顫動：命中時觸發 */
.wheel-pointer.knock {
  animation: pointer-knock 0.15s ease-out;
}

@keyframes pointer-knock {
  0%, 100% { transform: translateY(-50%) rotate(0); }
  50% { transform: translateY(-50%) rotate(-15deg) translateX(4px); }
}

.wheel-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg-card);
  border: 4px solid var(--ink);
  box-shadow:
    0 6px 0 var(--ink),
    inset 0 0 0 8px var(--yellow),
    inset 0 0 0 10px var(--ink);
  overflow: hidden;
}

.wheel-svg {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 5.5s cubic-bezier(0.17, 0.67, 0.24, 1);
  transform-origin: center;
}

.wheel-svg .wheel-slice-label {
  font-family: var(--font-body);
  font-weight: 700;
  fill: var(--ink);
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: none;
  user-select: none;
}

.wheel-svg .wheel-slice-path {
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linejoin: round;
}

/* 中心 SPIN 鈕 */
.wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--orange-bright) 0%, var(--orange) 50%, #c85a24 100%);
  border: 3px solid var(--ink);
  color: white;
  cursor: pointer;
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.1em;
  box-shadow:
    0 4px 0 var(--ink),
    inset -3px -3px 8px rgba(0, 0, 0, 0.3),
    inset 2px 2px 6px rgba(255, 255, 255, 0.4);
  z-index: 4;
  transition: transform 0.15s, box-shadow 0.15s;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.wheel-hub:hover:not(:disabled) {
  transform: translate(-50%, calc(-50% - 2px));
  box-shadow:
    0 6px 0 var(--ink),
    inset -3px -3px 8px rgba(0, 0, 0, 0.3),
    inset 2px 2px 6px rgba(255, 255, 255, 0.4);
}

.wheel-hub:active:not(:disabled) {
  transform: translate(-50%, calc(-50% + 2px));
  box-shadow:
    0 2px 0 var(--ink),
    inset -3px -3px 8px rgba(0, 0, 0, 0.3),
    inset 2px 2px 6px rgba(255, 255, 255, 0.4);
}

.wheel-hub:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.wheel-hub .hub-text {
  display: block;
  line-height: 1;
  font-size: 22px;
}

/* 轉盤旋轉中時：禁止點擊、微微發光 */
.wheel-wrap.spinning {
  animation: wheel-glow 0.8s ease-in-out infinite;
}

@keyframes wheel-glow {
  0%, 100% { box-shadow:
    0 6px 0 var(--ink),
    inset 0 0 0 8px var(--yellow),
    inset 0 0 0 10px var(--ink); }
  50% { box-shadow:
    0 6px 0 var(--ink),
    0 0 30px rgba(252, 211, 77, 0.5),
    inset 0 0 0 8px var(--yellow),
    inset 0 0 0 10px var(--ink); }
}

.wheel-hint {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}

/* 轉盤命中高亮 */
.wheel-svg .wheel-slice-path.winner {
  animation: slice-win-pulse 0.6s ease-in-out 3;
}

@keyframes slice-win-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.25) saturate(1.3); }
}


/* ===========================
   關於零廢敬媽祖 - 外層
   =========================== */
.about-section {
  position: relative;
  z-index: 10;
  background: linear-gradient(180deg, transparent 0%, var(--bg-soft) 100%);
  padding: 60px 20px 40px;
  margin-top: 40px;
}

.about-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.about-header {
  text-align: center;
  margin-bottom: 36px;
}

.about-en {
  font-family: var(--font-en);
  font-style: italic;
  font-size: 16px;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.about-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 4.5vw, 40px);
  font-weight: 900;
  color: var(--ink);
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin-bottom: 10px;
}

.about-title .cloud {
  display: inline-block;
  width: 36px;
  height: 18px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 42 22'%3E%3Cpath d='M3 15c0-4 3-7 7-7 1-4 5-6 10-6s9 2 10 6c4 0 7 3 7 7s-3 6-7 6H10c-4 0-7-2-7-6z' fill='%23fcd34d' stroke='%232b1810' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.about-desc {
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* ===========================
   主要 CTA 卡片（LINE + 群募）
   =========================== */
.cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.cta-card {
  display: flex;
  gap: 18px;
  padding: 24px;
  background: var(--bg-card);
  border: 2.5px solid var(--ink);
  border-radius: 20px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 5px 0 var(--ink);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.2s;
  position: relative;
  overflow: hidden;
  min-height: 180px;
  align-items: center;
}

.cta-card::before {
  content: "";
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cpath d='M30 70c0-8 6-14 14-14 2-8 9-14 18-14s16 6 18 14c8 0 14 6 14 14s-6 14-14 14H44c-8 0-14-6-14-14z' fill='none' stroke='%23d4b896' stroke-width='1.5' opacity='0.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  pointer-events: none;
}

.cta-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 0 var(--ink);
}

.cta-card:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 var(--ink);
}

.cta-icon {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
}

.line-icon {
  background: #06c755;
}

.line-icon svg {
  width: 48px;
  height: 48px;
  fill: white;
}

.crowdfunding-icon {
  background: var(--yellow);
  font-size: 40px;
  line-height: 1;
}

.cta-content {
  flex: 1;
  min-width: 0;
}

.cta-label {
  font-family: var(--font-en);
  font-style: italic;
  font-size: 13px;
  color: var(--orange);
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.cta-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}

.cta-desc {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 12px;
}

.cta-action {
  display: inline-block;
  font-size: 14px;
  font-weight: 700;
  color: var(--orange);
  padding: 4px 0;
  border-bottom: 2px solid var(--orange);
  transition: transform 0.2s;
}

.cta-card:hover .cta-action {
  transform: translateX(4px);
}

/* 群募卡片強調色：整體更橘 */
.cta-crowdfunding {
  background: linear-gradient(135deg, var(--yellow-soft) 0%, var(--orange-soft) 100%);
}

/* ===========================
   次要連結（籤詩測驗 + 官網）
   =========================== */
.mini-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mini-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: var(--ink);
  transition: all 0.2s;
  box-shadow: 0 2px 0 var(--border);
}

.mini-link:hover {
  border-color: var(--orange);
  box-shadow: 0 4px 0 var(--orange);
  transform: translateY(-2px);
}

.mini-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  background: var(--yellow-soft);
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.mini-text {
  flex: 1;
  min-width: 0;
}

.mini-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 900;
  color: var(--ink);
  margin-bottom: 2px;
}

.mini-sub {
  font-size: 12px;
  color: var(--ink-faded);
  line-height: 1.4;
}

.mini-arrow {
  flex-shrink: 0;
  color: var(--ink-faded);
  font-size: 18px;
  transition: transform 0.2s, color 0.2s;
}

.mini-link:hover .mini-arrow {
  transform: translateX(4px);
  color: var(--orange);
}

/* ===========================
   Footer
   =========================== */
.site-footer {
  position: relative;
  z-index: 10;
  background: var(--ink);
  color: var(--border-strong);
  text-align: center;
  padding: 20px 16px;
  font-size: 13px;
  letter-spacing: 0.05em;
}

/* ===========================
   RWD - 平板
   =========================== */
@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
    padding: 16px 20px 32px;
    gap: 24px;
    max-width: 720px;
  }

  .panel-config {
    order: 2;
  }

  .panel-machine {
    order: 1;
  }

  .machine,
  .winners-panel {
    max-width: 100%;
  }

  /* 拉霸機自動置中、但面積撐滿 */
  .panel-machine {
    width: 100%;
  }
}

/* ===========================
   RWD - 手機
   =========================== */
@media (max-width: 640px) {
  .topbar {
    padding: 28px 16px 16px;
  }

  .brand {
    gap: 0.35em;
    font-size: 28px;
  }

  .brand .cloud {
    width: 32px;
    height: 16px;
  }

  .brand-sub {
    font-size: 13px;
    letter-spacing: 0.1em;
  }

  .layout {
    padding: 12px;
    gap: 16px;
  }

  /* 卡片縮減 padding */
  .card {
    padding: 18px;
    border-radius: 16px;
  }

  .card-title {
    font-size: 17px;
  }

  /* 獎項欄位縮小 */
  .prize-item {
    grid-template-columns: 1fr 64px auto;
    gap: 6px;
    padding: 8px;
  }

  .prize-item input {
    font-size: 14px;
    padding: 7px 8px;
  }

  /* 拉霸機 */
  .machine {
    padding: 14px;
    border-radius: 24px;
  }

  .machine::before {
    inset: 5px;
    border-radius: 18px;
  }

  .machine-top {
    padding: 10px 12px;
    gap: 8px;
    border-radius: 14px;
  }

  .mascot {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }

  .marquee-title {
    font-size: 17px;
    letter-spacing: 0.1em;
  }

  .marquee-title .deco {
    width: 14px;
    height: 14px;
  }

  .current-prize {
    font-size: 12px;
  }

  .machine-body {
    padding: 16px 10px;
  }

  .reels-frame {
    padding: 12px;
    gap: 6px;
    border-radius: 14px;
  }

  .reel-window {
    height: 100px;
    border-radius: 10px;
  }

  .reel-item {
    height: 100px;
    font-size: 48px;
  }

  .reel.spinning .reel-track {
    animation-name: spin-reel-sm;
  }

  @keyframes spin-reel-sm {
    from { transform: translateY(0); }
    to { transform: translateY(-100px); }
  }

  .payline {
    left: 18px;
    right: 18px;
  }

  .result-display {
    padding: 14px;
    min-height: 80px;
    border-radius: 14px;
  }

  .result-name {
    font-size: 24px;
  }

  .result-label {
    font-size: 12px;
  }

  /* 拉桿縮小 */
  .machine-bottom {
    padding: 10px 14px 4px;
  }

  .lever {
    width: 52px;
    height: 96px;
  }

  .lever-stick {
    height: 52px;
  }

  .lever-ball {
    width: 30px;
    height: 30px;
  }

  /* 中獎名單 */
  .winners-panel {
    padding: 16px;
    margin-top: 16px;
    border-radius: 14px;
  }

  .winners-header h3 {
    font-size: 16px;
  }

  /* 關於區塊 */
  .about-section {
    padding: 40px 16px 32px;
    margin-top: 24px;
  }

  .about-header {
    margin-bottom: 24px;
  }

  .about-title {
    font-size: 24px;
  }

  .about-title .cloud {
    width: 28px;
    height: 14px;
  }

  .about-desc {
    font-size: 14px;
  }

  /* CTA 變成單欄直排 */
  .cta-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 18px;
  }

  .cta-card {
    padding: 20px;
    gap: 14px;
    min-height: auto;
    border-radius: 16px;
  }

  .cta-icon {
    width: 60px;
    height: 60px;
  }

  .line-icon svg {
    width: 38px;
    height: 38px;
  }

  .crowdfunding-icon {
    font-size: 32px;
  }

  .cta-title {
    font-size: 19px;
    margin-bottom: 6px;
  }

  .cta-desc {
    font-size: 13px;
    margin-bottom: 10px;
  }

  /* 次要連結也變單欄 */
  .mini-links {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .mini-link {
    padding: 14px 16px;
  }

  .mini-icon {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }

  .mini-title {
    font-size: 14px;
  }

  .mini-sub {
    font-size: 11px;
  }

  .toast {
    bottom: 20px;
    font-size: 13px;
    padding: 10px 18px;
    max-width: calc(100% - 32px);
    transform: translateX(-50%)
      translateY(calc(100% + 20px + env(safe-area-inset-bottom, 0px)));
  }

  .toast.show {
    transform: translateX(-50%) translateY(0);
  }

  /* 轉盤 - 手機 */
  .wheel-stage {
    padding: 16px 12px;
    border-radius: 24px;
    gap: 12px;
  }

  .wheel-stage::before {
    inset: 5px;
    border-radius: 18px;
  }

  .wheel-marquee {
    padding: 10px 14px;
    border-radius: 14px;
  }

  .wheel-container {
    max-width: 100%;
  }

  .wheel-wrap {
    box-shadow:
      0 6px 0 var(--ink),
      inset 0 0 0 6px var(--yellow),
      inset 0 0 0 8px var(--ink);
  }

  .wheel-hub {
    width: 56px;
    height: 56px;
    font-size: 13px;
    border-width: 2.5px;
  }

  .wheel-pointer {
    right: -4px;
    border-top-width: 14px;
    border-bottom-width: 14px;
    border-right-width: 20px;
  }

  .wheel-hint {
    font-size: 12px;
  }

  /* Tab 縮小 */
  .mode-tabs {
    margin-top: 16px;
    padding: 5px;
  }

  .mode-tab {
    padding: 8px 16px;
    font-size: 14px;
  }

  .mode-tab .tab-emoji {
    font-size: 16px;
  }
}

/* 超窄手機（<380px） */
@media (max-width: 380px) {
  .brand {
    font-size: 24px;
  }

  .reel-item {
    font-size: 40px;
  }

  .cta-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .cta-action {
    margin: 0 auto;
  }
}
