:root {
  color-scheme: light;
  --bg: #ffffff;
  --ink: #4f5562;
  --line: #2d2d2d;
  --muted: #727883;
  --green: #31a76a;
  --red: #d55a74;
  --purple: #7563d9;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
}

.app {
  width: min(720px, calc(100vw - 20px));
  margin: 0 auto;
  padding: 20px 0 28px;
}

.start,
.helper-panel,
.result-box {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  background: #fff;
}

.start {
  padding: 22px 18px;
}

.start-eyebrow,
.result-eyebrow,
.helper-label {
  margin: 0 0 10px;
  color: var(--purple);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.start-title,
.result-title {
  margin: 0;
  line-height: 1.25;
}

.start-intro,
.result-summary,
.reward-copy,
.reward-result {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.8;
}

.start-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.start-rules span {
  padding: 8px 12px;
  border-radius: 999px;
  background: #f5f2ff;
  color: #5d51a1;
  font-size: 14px;
  font-weight: 700;
}

.start-btn,
.restart-btn,
.icon-btn,
.emoji-btn,
.nav-btn {
  border: none;
  background: none;
  font: inherit;
}

.start-btn,
.restart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 14px;
  background: #f5f2ff;
  color: #4e428f;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.start-btn {
  margin-top: 22px;
}

.start-btn--small {
  margin-top: 16px;
}

.restart-btn {
  margin-top: 18px;
}

.hidden {
  display: none !important;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 8px 14px;
  font-size: 18px;
  font-weight: 700;
}

.topbar-item--right strong {
  color: var(--ink);
}

.card-stack {
  display: grid;
  gap: 18px;
}

.choice-card {
  position: relative;
  min-height: 240px;
  border: 2px solid var(--line);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.choice-card--triple {
  min-height: 190px;
}

.choice-char {
  font-size: clamp(96px, 16vw, 140px);
  line-height: 1;
  font-weight: 500;
  color: #4f5562;
}

.choice-word {
  font-size: clamp(68px, 12vw, 102px);
  line-height: 1.2;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #4f5562;
}

.choice-speaker {
  position: absolute;
  right: 16px;
  bottom: 14px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
}

.helper-panel {
  margin-top: 18px;
  padding: 16px;
}

.helper-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.helper-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.helper-head h2 {
  margin: 0;
  font-size: 28px;
  color: var(--ink);
}

.helper-toggle {
  border: none;
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: #f6f2ff;
  color: #5c4daa;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.icon-btn {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: #f6f7fb;
  font-size: 26px;
  cursor: pointer;
}

.icon-btn--large {
  width: 56px;
  height: 56px;
  font-size: 30px;
}

.helper-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.helper-grid--collapsed {
  display: none;
}

.helper-box {
  border-radius: 14px;
  background: #fafafa;
  padding: 12px;
}

.helper-box-title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

.helper-list,
.result-list {
  margin: 10px 0 0;
  padding-left: 18px;
  line-height: 1.8;
}

.helper-list {
  padding-left: 0;
  list-style: none;
}

.helper-list li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.08);
}

.helper-list li:last-child {
  border-bottom: none;
}

.helper-speak {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 999px;
  background: #f1f3f8;
  font-size: 18px;
  cursor: pointer;
}

.feedback {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  line-height: 1.8;
  font-size: 16px;
}

.feedback.good {
  background: rgba(49, 167, 106, 0.12);
  color: #216f46;
}

.feedback.fix {
  background: rgba(213, 90, 116, 0.12);
  color: #8a3148;
}

.controls {
  margin-top: 18px;
}

.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.control-row--nav {
  justify-content: center;
  gap: 60px;
  margin-top: 16px;
}

.emoji-btn {
  width: 56px;
  height: 56px;
  font-size: 38px;
  cursor: pointer;
}

.nav-btn {
  width: 60px;
  height: 48px;
  font-size: 34px;
  color: var(--ink);
  cursor: pointer;
}

.nav-btn:disabled,
.icon-btn:disabled,
.emoji-btn:disabled,
.start-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.result {
  padding-bottom: 20px;
}

.result-box {
  margin-top: 16px;
  padding: 16px;
}

.wheel-wrap {
  position: relative;
  width: min(100%, 290px);
  margin: 20px auto 0;
  filter: drop-shadow(0 16px 20px rgba(81, 68, 120, 0.18));
}

.wheel {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  border: 10px solid #fff;
  background:
    conic-gradient(
      #ffd86c 0deg 45deg,
      #ff94bb 45deg 90deg,
      #94b5ff 90deg 135deg,
      #93e4c1 135deg 180deg,
      #ffc280 180deg 225deg,
      #caa5ff 225deg 270deg,
      #ffb1dc 270deg 315deg,
      #98d8ff 315deg 360deg
    );
  box-shadow:
    inset 0 10px 18px rgba(255, 255, 255, 0.55),
    inset 0 -16px 28px rgba(95, 63, 130, 0.18),
    0 16px 30px rgba(101, 91, 134, 0.22);
  transition: transform 4.8s cubic-bezier(0.18, 0.86, 0.18, 1);
  overflow: hidden;
}

.wheel::before {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 28%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 42%);
  pointer-events: none;
}

.wheel-pointer {
  position: absolute;
  left: 50%;
  top: -8px;
  width: 0;
  height: 0;
  transform: translateX(-50%);
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-bottom: 30px solid #ff8d59;
  z-index: 3;
}

.wheel-center {
  position: absolute;
  inset: 50%;
  width: 92px;
  height: 92px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffdf1, #ffe28f 72%, #f1b83d 100%);
  display: grid;
  place-items: center;
  color: #8f620f;
  font-size: 18px;
  font-weight: 900;
  z-index: 2;
  box-shadow:
    inset 0 6px 10px rgba(255, 255, 255, 0.6),
    inset 0 -6px 12px rgba(162, 111, 11, 0.24),
    0 6px 14px rgba(120, 91, 19, 0.2);
}

.wheel-labels {
  position: absolute;
  inset: 0;
}

.wheel-label {
  position: absolute;
  left: 50%;
  top: 50%;
  transform-origin: center center;
  width: 72px;
  margin-left: -36px;
  margin-top: -14px;
  text-align: center;
  color: #3f3557;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

@media (max-width: 640px) {
  .app {
    width: calc(100vw - 14px);
    padding-top: 10px;
  }

  .choice-card {
    min-height: 220px;
  }

  .choice-card--triple {
    min-height: 180px;
  }

  .helper-grid {
    grid-template-columns: 1fr;
  }
}
