:root {
  color-scheme: dark;
  --底色: #080b24;
  --紙色: rgba(14, 19, 54, 0.86);
  --紙線: rgba(153, 221, 255, 0.2);
  --字色: #f7f8ff;
  --淡字: #aeb8d7;
  --青: #58e7df;
  --黃: #ffd45c;
  --粉: #ff6fbd;
  --紫: #806eff;
  --紅: #ff6482;
  --陰影: 0 28px 90px rgba(1, 3, 20, 0.46);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--底色);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  color: var(--字色);
  background:
    radial-gradient(circle at 78% 16%, rgba(128, 110, 255, 0.22), transparent 30rem),
    radial-gradient(circle at 8% 70%, rgba(14, 200, 209, 0.12), transparent 34rem),
    linear-gradient(145deg, #06081b 0%, #0b1035 52%, #090a22 100%);
  font-family:
    "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", "MingLiU-ExtB",
    "PMingLiU-ExtB", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

button,
textarea {
  font: inherit;
}

button,
a,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--黃);
  outline-offset: 3px;
}

.星空 {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.78) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(88,231,223,.7) 0 1px, transparent 1.7px);
  background-position: 0 0, 38px 56px;
  background-size: 92px 92px, 137px 137px;
  opacity: 0.42;
  mask-image: linear-gradient(to bottom, black, transparent 92%);
}

.星空 i {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px 3px rgba(255,255,255,.7);
  animation: 閃星 3.6s ease-in-out infinite;
}

.星空 i:nth-child(1) { left: 12%; top: 12%; animation-delay: -.7s; }
.星空 i:nth-child(2) { left: 27%; top: 41%; animation-delay: -2.2s; }
.星空 i:nth-child(3) { left: 52%; top: 9%; animation-delay: -1.4s; }
.星空 i:nth-child(4) { left: 72%; top: 33%; animation-delay: -3s; }
.星空 i:nth-child(5) { left: 88%; top: 14%; animation-delay: -.2s; }
.星空 i:nth-child(6) { left: 93%; top: 74%; animation-delay: -1.9s; }

.頁身 {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(24px, 4vw, 52px) 0 24px;
}

.頭前 {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: end;
  gap: 6px 24px;
  margin: 0 4px 22px;
}

.頭前 h1 {
  grid-column: 1;
  margin: 0;
  font-family:
    "BiauKai", "DFKai-SB", "Noto Serif TC", "MingLiU-ExtB", serif;
  font-size: clamp(2.5rem, 6vw, 5.3rem);
  font-weight: 800;
  line-height: 1.03;
  letter-spacing: -0.04em;
  text-shadow: 0 0 42px rgba(88, 231, 223, 0.25);
}

.頭前 > p {
  grid-column: 2;
  max-width: 29rem;
  margin: 0 0 0.45em;
  color: var(--淡字);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
}

.細標 {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--青);
  font-weight: 800;
  letter-spacing: 0.13em;
}

.細標 span {
  padding: 3px 10px;
  border: 1px solid rgba(88, 231, 223, 0.55);
  border-radius: 999px;
  background: rgba(88, 231, 223, 0.08);
}

.細標 a {
  color: var(--淡字);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration-color: rgba(174, 184, 215, 0.4);
  text-underline-offset: 4px;
}

.主格 {
  display: grid;
  grid-template-columns: minmax(310px, 0.78fr) minmax(460px, 1.22fr);
  gap: 18px;
  align-items: stretch;
}

.紙枋 {
  position: relative;
  border: 1px solid var(--紙線);
  border-radius: 26px;
  background:
    linear-gradient(155deg, rgba(255,255,255,.045), transparent 34%),
    var(--紙色);
  box-shadow: var(--陰影);
  backdrop-filter: blur(18px);
}

.操作區 {
  padding: clamp(20px, 3vw, 30px);
}

.抽鬮區 {
  display: flex;
  min-height: 610px;
  flex-direction: column;
  padding: clamp(18px, 2.3vw, 26px);
  overflow: hidden;
}

.抽鬮區::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 20%, rgba(88,231,223,.06) 45%, transparent 70%);
}

.區題 {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 16px;
}

.區題 h2 {
  margin: 1px 0 0;
  font-size: 1.48rem;
  line-height: 1.15;
}

.步數 {
  margin: 0;
  color: var(--青);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.人數,
.公平話 {
  margin: 2px 0 0;
  color: var(--淡字);
  font-size: 0.9rem;
}

.人數 {
  flex: none;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 999px;
  background: rgba(255,255,255,.045);
}

.輸入標 {
  display: block;
  margin-bottom: 7px;
  font-weight: 800;
}

textarea {
  display: block;
  width: 100%;
  min-height: 244px;
  resize: vertical;
  border: 1px solid rgba(174,184,215,.28);
  border-radius: 16px;
  padding: 15px 16px;
  color: var(--字色);
  caret-color: var(--黃);
  background: rgba(3, 6, 25, 0.64);
  box-shadow: inset 0 1px 14px rgba(0,0,0,.16);
  font-size: 1.04rem;
  line-height: 1.65;
  transition: border-color .2s ease, box-shadow .2s ease, opacity .2s ease;
}

textarea::placeholder {
  color: #76809f;
}

textarea:hover {
  border-color: rgba(88,231,223,.48);
}

textarea:focus {
  border-color: var(--青);
  box-shadow: 0 0 0 4px rgba(88,231,223,.09), inset 0 1px 14px rgba(0,0,0,.16);
}

textarea:disabled {
  opacity: .64;
}

.說明 {
  min-height: 3em;
  margin: 9px 1px 17px;
  color: var(--淡字);
  font-size: .88rem;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .4;
}

.大鈕 {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 15px;
  color: #08101d;
  background: linear-gradient(115deg, var(--黃), #ffec9d 48%, var(--青));
  box-shadow: 0 14px 35px rgba(88,231,223,.17);
  font-size: 1.12rem;
  font-weight: 900;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.大鈕:not(:disabled):hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 18px 42px rgba(88,231,223,.26);
}

.大鈕:not(:disabled):active {
  transform: translateY(1px) scale(.99);
}

.大鈕 > span:first-child {
  font-size: 1.35rem;
}

.細鈕列 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 10px;
}

.細鈕 {
  min-height: 46px;
  border: 1px solid rgba(174,184,215,.2);
  border-radius: 13px;
  color: var(--字色);
  background: rgba(255,255,255,.055);
  font-size: .92rem;
  font-weight: 750;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.細鈕:not(:disabled):hover {
  border-color: rgba(88,231,223,.45);
  background: rgba(88,231,223,.09);
}

.細鈕:not(:disabled):active {
  transform: scale(.98);
}

.聲圖 {
  display: inline-grid;
  width: 24px;
  height: 24px;
  margin-right: 4px;
  place-items: center;
  border-radius: 50%;
  color: var(--青);
  background: rgba(88,231,223,.09);
}

.細鈕[aria-pressed="false"] .聲圖 {
  color: var(--淡字);
  text-decoration: line-through;
}

.私密話 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 17px 2px 0;
  color: #8d98ba;
  font-size: .82rem;
}

.私密話 span {
  color: var(--青);
}

.抽鬮題 {
  margin-bottom: 0;
}

.舞台 {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(100%, 470px);
  aspect-ratio: 1;
  margin: clamp(2px, 1vw, 10px) auto 0;
  place-items: center;
  isolation: isolate;
}

.光湧 {
  position: absolute;
  inset: 17%;
  z-index: -2;
  border-radius: 50%;
  background: rgba(88,231,223,.24);
  filter: blur(42px);
  opacity: .66;
  transition: opacity .4s ease, transform .4s ease;
}

.飛𥐵仔 {
  position: relative;
  width: 88%;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: drop-shadow(0 20px 28px rgba(0,0,0,.35));
  transform: perspective(900px) rotateX(0deg);
  transform-origin: center;
}

#輪盤 {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.中心罩 {
  position: absolute;
  inset: 35.5%;
  display: grid;
  place-content: center;
  border: 2px solid rgba(255,255,255,.7);
  border-radius: 50%;
  color: #08101d;
  background:
    radial-gradient(circle at 38% 29%, #fff 0 5%, #dffeff 22%, var(--青) 57%, #26a0b8 100%);
  box-shadow:
    inset 0 -12px 20px rgba(0,35,72,.28),
    0 0 0 8px rgba(5,10,34,.32),
    0 0 34px rgba(88,231,223,.62);
  font-family: "BiauKai", "DFKai-SB", "MingLiU-ExtB", serif;
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-weight: 900;
  text-align: center;
  line-height: 1;
  pointer-events: none;
}

.小飛𥐵 {
  display: block;
  margin-bottom: 5px;
  font-family: sans-serif;
  font-size: .78em;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.22));
}

.指針 {
  position: absolute;
  z-index: 7;
  top: 1.2%;
  left: 50%;
  width: 42px;
  height: 58px;
  transform: translateX(-50%);
  filter: drop-shadow(0 7px 9px rgba(0,0,0,.4));
}

.指針::before {
  position: absolute;
  top: 0;
  left: 50%;
  width: 22px;
  height: 22px;
  content: "";
  border: 5px solid #fff7cf;
  border-radius: 50%;
  background: var(--黃);
  transform: translateX(-50%);
  box-shadow: 0 0 20px rgba(255,212,92,.72);
}

.指針 span {
  position: absolute;
  top: 16px;
  left: 50%;
  width: 0;
  height: 0;
  border-top: 32px solid var(--黃);
  border-right: 15px solid transparent;
  border-left: 15px solid transparent;
  transform: translateX(-50%);
}

.結果 {
  position: relative;
  z-index: 3;
  width: min(100%, 440px);
  min-height: 89px;
  margin: auto auto 0;
  border: 1px solid rgba(174,184,215,.16);
  border-radius: 17px;
  padding: 13px 18px 15px;
  background: rgba(3,6,25,.48);
  text-align: center;
  transition: border-color .3s ease, box-shadow .3s ease, transform .3s ease;
}

.結果 p {
  margin: 0 0 1px;
  color: var(--淡字);
  font-size: .86rem;
}

.結果 strong {
  display: block;
  overflow-wrap: anywhere;
  font-family:
    "BiauKai", "DFKai-SB", "Noto Serif TC", "MingLiU-ExtB", serif;
  font-size: clamp(1.6rem, 4vw, 2.45rem);
  line-height: 1.25;
}

.結果.著矣 {
  border-color: rgba(255,212,92,.7);
  box-shadow: 0 0 38px rgba(255,212,92,.14);
  transform: translateY(-2px);
}

.結果.著矣 p {
  color: var(--黃);
  font-weight: 800;
}

.舞台.咧踅 .飛𥐵仔 {
  animation: 飛行 1.15s ease-in-out infinite;
}

.舞台.咧踅 .光湧 {
  opacity: 1;
  transform: scale(1.16);
  animation: 光脈 1s ease-in-out infinite alternate;
}

.舞台.咧踅 .中心罩 {
  animation: 中心光 .72s ease-in-out infinite alternate;
}

.火花 {
  position: absolute;
  inset: 10%;
  z-index: 10;
  pointer-events: none;
}

.火花 b {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 14px;
  border-radius: 3px;
  background: var(--火花色, var(--黃));
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: 噴花 .9s cubic-bezier(.12,.7,.2,1) forwards;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 6px 0;
  color: #8993b2;
  font-size: .82rem;
}

footer p {
  margin: 0;
}

footer strong {
  color: #bac4e2;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

@keyframes 閃星 {
  0%, 100% { opacity: .2; transform: scale(.7); }
  50% { opacity: 1; transform: scale(1.35); }
}

@keyframes 飛行 {
  0%, 100% { transform: perspective(900px) rotateX(0deg) translateY(0); }
  35% { transform: perspective(900px) rotateX(3deg) translateY(-5px) scale(1.008); }
  72% { transform: perspective(900px) rotateX(-2deg) translateY(2px); }
}

@keyframes 光脈 {
  from { filter: blur(38px); }
  to { filter: blur(50px); }
}

@keyframes 中心光 {
  from { box-shadow: inset 0 -12px 20px rgba(0,35,72,.28), 0 0 0 8px rgba(5,10,34,.32), 0 0 26px rgba(88,231,223,.5); }
  to { box-shadow: inset 0 -12px 20px rgba(0,35,72,.28), 0 0 0 8px rgba(5,10,34,.32), 0 0 48px rgba(88,231,223,.9); }
}

@keyframes 噴花 {
  0% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--方向)) translateY(0) rotate(var(--倒向)); }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--方向)) translateY(-170px) rotate(var(--倒向)); }
}

@media (max-width: 850px) {
  .頭前 {
    display: block;
  }

  .頭前 h1 {
    margin-top: 6px;
  }

  .頭前 > p {
    margin: 7px 0 0;
  }

  .主格 {
    grid-template-columns: 1fr;
  }

  .抽鬮區 {
    min-height: 0;
  }

  .舞台 {
    width: min(100%, 520px);
  }

  .結果 {
    margin-top: 3px;
  }
}

@media (max-width: 520px) {
  .頁身 {
    width: min(100% - 18px, 1180px);
    padding-top: 18px;
  }

  .紙枋 {
    border-radius: 19px;
  }

  .操作區,
  .抽鬮區 {
    padding: 17px;
  }

  .頭前 h1 {
    font-size: clamp(2.3rem, 13vw, 3.7rem);
  }

  .抽鬮題 {
    align-items: end;
  }

  .公平話 {
    max-width: 9rem;
    text-align: right;
  }

  .舞台 {
    width: calc(100% + 8px);
    margin-left: -4px;
  }

  .指針 {
    top: 0;
    transform: translateX(-50%) scale(.82);
    transform-origin: top;
  }

  .細鈕列 {
    grid-template-columns: 1fr;
  }

  footer {
    display: block;
  }

  footer p + p {
    margin-top: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
  }
}
