/* ============================================================
 * style.css — yeah-what-to-eat
 * 薄荷浅色系，克制无多余装饰；移动优先。
 * ============================================================ */

:root {
  --bg: #e6f7f6;
  --card: #ffffff;
  --ink: #17403b;
  --muted: #5d817c;
  --accent: #2bb3a6;
  --accent-dark: #1e8f85;
  --accent-soft: #d4efeb;
  --line: #e2f0ee;
  --pointer: #ff5a5f;
  --radius: 18px;
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif,
    "Segoe UI Emoji", "Apple Color Emoji";
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 22px 18px calc(28px + env(safe-area-inset-bottom));
}

.hidden { display: none !important; }

/* ---------- 顶部 ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.title { font-size: 30px; font-weight: 800; letter-spacing: 1px; }

.sound-btn {
  width: 40px; height: 40px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--accent-dark);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .12s ease, background .15s ease;
}
.sound-btn:active { transform: scale(.92); }
.sound-ic { width: 20px; height: 20px; fill: currentColor; }

.tagline { margin-top: 6px; font-size: 14px; color: var(--muted); }

/* ---------- 区块面板 ---------- */
.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-top: 16px;
  box-shadow: 0 2px 10px rgba(23, 64, 59, .06);
}

.q + .q { margin-top: 16px; }
.q-title { font-size: 14px; font-weight: 700; margin-bottom: 9px; color: var(--accent-dark); }
.q-title .dim { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 4px; }

/* ---------- 选择 chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: #f4faf9;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  line-height: 1;
  padding: 8px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
}
.chip:hover { border-color: var(--accent); }
.chip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}

.chip-add { border-style: dashed; background: transparent; color: var(--accent-dark); }

.custom-row { display: flex; gap: 8px; margin-top: 10px; }
.custom-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
  background: #f4faf9;
  color: var(--ink);
  outline: none;
}
.custom-row input:focus { border-color: var(--accent); background: #fff; }
.custom-row .chip { flex: none; }

/* ---------- 按钮 ---------- */
.btn {
  appearance: none;
  border: 1px solid transparent;
  font: inherit;
  border-radius: 14px;
  cursor: pointer;
  padding: 12px 18px;
  transition: transform .12s ease, background .15s ease, opacity .15s ease;
  user-select: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; }

.btn-primary {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(43, 179, 166, .28);
}
.btn-primary:hover { background: var(--accent-dark); }

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
  font-size: 14px;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-dark); }

.btn-block { width: 100%; }
#genBtn { margin-top: 18px; }

.hint { margin-top: 10px; font-size: 12.5px; color: var(--muted); text-align: center; }

/* ---------- 转盘舞台 ---------- */
#wheelPanel { text-align: center; }
#backBtn { display: block; margin: 0 auto 14px; padding: 6px 14px; font-size: 13px; border-radius: 999px; }

.wheel-stage {
  position: relative;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
}

#wheel { width: 100%; height: 100%; display: block; }

/* 顶部固定指针 */
.pointer {
  position: absolute;
  left: 50%;
  top: -15px;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 13px solid transparent;
  border-right: 13px solid transparent;
  border-top: 24px solid var(--pointer);
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.2));
  z-index: 3;
}

/* 中央 hub（装饰，不响应点击） */
.hub {
  position: absolute;
  left: 50%; top: 50%;
  width: 27%;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--card);
  border: 3px solid var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: var(--accent-dark);
  box-shadow: 0 2px 8px rgba(23, 64, 59, .14);
  z-index: 2;
  pointer-events: none;
}

.btn-spin {
  width: 100%;
  margin-top: 16px;
  font-size: 19px;
  padding: 15px 18px;
  letter-spacing: 1px;
}

/* ---------- 结果浮层 ---------- */
.overlay {
  position: fixed; inset: 0;
  background: rgba(15, 40, 36, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  z-index: 50;
}

.card {
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border-radius: 22px;
  padding: 26px 22px 20px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
  animation: pop .28s cubic-bezier(.2, 1.4, .4, 1);
}

@keyframes pop {
  from { transform: scale(.82); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.res-emoji { font-size: 52px; line-height: 1.2; }
.res-name { margin-top: 6px; font-size: 24px; font-weight: 800; }
.res-sub { margin-top: 8px; font-size: 14px; color: var(--muted); min-height: 20px; }

.card-actions { display: flex; gap: 10px; margin-top: 18px; }
.card-actions .btn { flex: 1; }
#rerollBtn { margin-top: 10px; }
.overlay .hint { color: rgba(255,255,255,.85); margin: 14px 0 -2px; }

/* ---------- 小屏适配 ---------- */
@media (max-width: 360px) {
  .title { font-size: 25px; }
  .app { padding: 16px 12px; }
}

/* 减少动态偏好：极速出结果 */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
