:root {
  --bg: #f6f7f4;
  --card: #ffffff;
  --ink: #2b2b2b;
  --muted: #8a8f86;
  --brand: #06c755;          /* LINE green */
  --brand-ink: #04a948;
  --accent: #ff8a3d;         /* warm pet accent */
  --line: #e7e9e3;
  --shadow: 0 6px 24px rgba(40, 50, 35, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) 16px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* ---- screens ---- */
.screen { display: none; flex: 1; flex-direction: column; }
.screen.is-active { display: flex; }

/* ---- loading ---- */
#screen-loading { align-items: center; justify-content: center; gap: 14px; }
.spinner {
  width: 38px; height: 38px; border-radius: 50%;
  border: 4px solid var(--line); border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- header ---- */
.hd { padding: 18px 4px 8px; }
.hd-top { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.paw { font-size: 22px; }
.greeting { font-weight: 700; font-size: 16px; }
.progress { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress-bar {
  height: 100%; width: 0%; background: linear-gradient(90deg, var(--brand), #34d77a);
  border-radius: 99px; transition: width 0.35s cubic-bezier(.4,0,.2,1);
}
.muted { color: var(--muted); }
.small { font-size: 12px; }
.hd .small { margin: 8px 2px 0; }

/* ---- question card ---- */
#questions { flex: 1; }
.q { animation: rise 0.3s ease both; padding-top: 10px; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.q-title { font-size: 21px; font-weight: 800; line-height: 1.4; margin: 6px 2px 4px; }
.q-note { font-size: 13px; margin: 0 2px 16px; }

.options { display: grid; gap: 12px; }
.opt {
  display: flex; align-items: center; gap: 14px;
  width: 100%; text-align: left;
  background: var(--card); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
  font-size: 16px; font-weight: 600; color: var(--ink);
  box-shadow: var(--shadow); cursor: pointer;
  transition: transform .08s ease, border-color .15s ease, background .15s ease;
}
.opt:active { transform: scale(0.98); }
.opt .emoji { font-size: 24px; }
.opt.selected { border-color: var(--brand); background: #effaf2; }
.opt.selected::after { content: "✓"; margin-left: auto; color: var(--brand-ink); font-weight: 900; }

/* ---- footer ---- */
.ft { display: flex; gap: 10px; padding: 16px 2px 6px; }
.btn {
  flex: 1; border: none; border-radius: 14px; padding: 15px 18px;
  font-size: 16px; font-weight: 700; cursor: pointer;
  transition: transform .08s ease, opacity .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(6,199,85,.28); }
.btn-primary:disabled { opacity: .45; box-shadow: none; }
.btn-ghost { flex: 0 0 auto; background: transparent; color: var(--muted); font-weight: 600; }

/* ---- thanks / error ---- */
.thanks { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 10px; padding: 24px; }
.thanks-emoji { font-size: 64px; animation: rise .4s ease both; }
.thanks h1 { font-size: 23px; margin: 4px 0; }
.coupon {
  margin-top: 14px; width: 100%; max-width: 320px;
  background: repeating-linear-gradient(135deg, #fff 0 14px, #fff7f1 14px 28px);
  border: 2px dashed var(--accent); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 6px;
}
.coupon-label { font-size: 12px; font-weight: 700; color: var(--accent); letter-spacing: .08em; }
.coupon-code { font-size: 24px; font-weight: 900; letter-spacing: .04em; }
#btn-retry { margin-top: 18px; max-width: 200px; }

/* ---- preview badge ---- */
.preview-badge {
  position: fixed; top: 10px; right: 10px; z-index: 10;
  background: #1b1b1b; color: #ffd24a; font-size: 11px; font-weight: 800;
  letter-spacing: .12em; padding: 5px 10px; border-radius: 99px; opacity: .85;
}
