/* うちの子タイプ診断 LIFF Style - Nordic Fog */

:root {
  --bg: #F5EFE6;
  --bg-soft: #FAF6EF;
  --text: #4A453E;
  --text-soft: #7A736A;
  --accent: #D8A48F;
  --accent-dark: #B9826A;
  --border: #E8DDD0;
  --shadow: 0 2px 12px rgba(74, 69, 62, 0.08);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

#app {
  min-height: 100vh;
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 32px 20px 48px;
  animation: fadeIn 0.4s ease;
}

.screen.active {
  display: block;
}

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

.container {
  max-width: 480px;
  margin: 0 auto;
}

/* ===== PC専用画面 ===== */
.qr-box {
  background: white;
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  margin: 24px auto 0;
  max-width: 320px;
  box-shadow: var(--shadow);
}
.qr-img {
  width: 240px;
  height: 240px;
  max-width: 100%;
}
.qr-caption {
  font-size: 13px;
  color: var(--text-soft);
  margin: 16px 0 0;
}

/* ===== Start screen ===== */
.hero {
  text-align: center;
  margin-bottom: 24px;
}

.hero-image {
  width: 60%;
  max-width: 260px;
  height: auto;
}

.title {
  font-size: 32px;
  font-weight: 800;
  text-align: center;
  line-height: 1.3;
  margin: 0 0 16px;
  letter-spacing: 0.04em;
}

.lead {
  text-align: center;
  color: var(--text-soft);
  margin: 0 0 32px;
  font-size: 15px;
}

.meta {
  text-align: center;
  color: var(--text-soft);
  font-size: 13px;
  margin-top: 12px;
}

/* ===== Question screen ===== */
.step {
  font-size: 13px;
  color: var(--accent-dark);
  font-weight: 700;
  letter-spacing: 0.1em;
  margin: 0 0 4px;
}

.qtitle {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.5;
  margin: 0 0 28px;
}

.progress {
  margin-bottom: 28px;
}

.progress-bar {
  background: var(--border);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  background: var(--accent);
  height: 100%;
  width: 0%;
  transition: width 0.4s ease;
}

.progress-text {
  font-size: 12px;
  color: var(--text-soft);
  margin: 8px 0 0;
  text-align: right;
}

/* ===== Options ===== */
.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option {
  background: var(--bg-soft);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  color: var(--text);
  line-height: 1.5;
}

/* PC マウスのみ hover 効果 */
@media (hover: hover) and (pointer: fine) {
  .option:hover {
    background: #fff;
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
  }
}
/* タップ中のみ強調（押した瞬間だけ） */
.option:active {
  background: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
/* :focus はキーボード操作時のみ強調する。スマホタップでは何も起きない */
.option:focus {
  outline: none;
}
.option:focus:not(:focus-visible) {
  background: var(--bg-soft);
  border-color: var(--border);
  transform: none;
  box-shadow: none;
}
.option:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ===== Buttons ===== */
.btn {
  display: block;
  width: 100%;
  padding: 16px 20px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.btn.primary {
  background: var(--accent-dark);
  color: white;
}

.btn.primary:hover, .btn.primary:active {
  background: #A07158;
  transform: translateY(-1px);
}

.btn.ghost {
  background: transparent;
  color: var(--text-soft);
  border: 1px solid var(--border);
}

.btn.ghost:hover, .btn.ghost:active {
  background: var(--bg-soft);
}

.input {
  width: 100%;
  padding: 16px 18px;
  font-size: 18px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--text);
  margin-bottom: 16px;
  font-family: inherit;
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  background: white;
}

/* ===== Loading ===== */
.loading {
  text-align: center;
  padding: 80px 20px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent-dark);
  border-radius: 50%;
  margin: 0 auto 24px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== Result screen ===== */
.result-hero {
  text-align: center;
  margin-bottom: 24px;
}

.result-label {
  font-size: 15px;
  color: var(--text-soft);
  margin: 0 0 8px;
}

.result-type {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.5;
  margin: 0 0 20px;
}

#result-emoji {
  font-size: 48px;
  display: inline-block;
  margin-bottom: 8px;
}

.result-bang {
  color: var(--accent-dark);
}

.result-image {
  width: 80%;
  max-width: 300px;
  height: auto;
  margin: 16px 0;
}

.result-body {
  background: var(--bg-soft);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 28px;
  white-space: pre-line;
  font-size: 15px;
  line-height: 1.8;
}

/* ===== Coupon section ===== */
.coupon-section {
  background: linear-gradient(135deg, #FAF1E4 0%, #F5E8D3 100%);
  border: 2px dashed var(--accent);
  border-radius: 16px;
  padding: 24px 20px;
  margin-bottom: 28px;
  text-align: center;
}

.coupon-thanks {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text);
}

.coupon-card {
  background: white;
  border-radius: 12px;
  padding: 20px 16px;
}

.coupon-code-label {
  font-size: 12px;
  color: var(--text-soft);
  margin: 0 0 8px;
  letter-spacing: 0.1em;
}

.coupon-code {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: var(--accent-dark);
  background: var(--bg-soft);
  padding: 12px 8px;
  border-radius: 8px;
  margin: 0 0 12px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

.coupon-copy {
  display: inline-block;
  background: var(--accent-dark);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 16px;
  transition: all 0.2s ease;
}

.coupon-copy:active {
  transform: scale(0.96);
}

.coupon-copy.copied {
  background: #6FAE8B;
}

.coupon-detail {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  margin: 0;
}

.coupon-detail strong {
  font-size: 15px;
  color: var(--accent-dark);
}

.coupon-detail small {
  font-size: 11px;
  color: var(--text-soft);
}

/* ===== Recommend section ===== */
.recommend-section {
  margin-bottom: 24px;
}

.rec-title {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 12px;
}

.product-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: white;
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
}

.product-card.main {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.product-card:hover, .product-card:active {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(74, 69, 62, 0.12);
}

.product-image {
  width: 110px;
  height: 110px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 10px;
  background: var(--bg-soft);
}

.product-info {
  flex: 1;
  min-width: 0;
}

.product-name {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 2px;
  line-height: 1.4;
}

.product-price {
  font-size: 17px;
  font-weight: 800;
  color: var(--accent-dark);
  margin: 0 0 8px;
}

.product-desc {
  font-size: 12.5px;
  color: var(--text-soft);
  margin: 0 0 8px;
  line-height: 1.5;
}

.product-size-note {
  font-size: 11.5px;
  color: var(--accent-dark);
  background: #FCEEE3;
  padding: 4px 8px;
  border-radius: 6px;
  margin: 0 0 8px;
  line-height: 1.4;
}

.product-cta {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-dark);
}

@media (max-width: 380px) {
  .product-card {
    flex-direction: column;
  }
  .product-image {
    width: 100%;
    height: 160px;
  }
}

/* ===== Extra (senior / order) ===== */
.extra-section {
  background: var(--bg-soft);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
}

.extra-section.special {
  background: #F5E8DA;
}

.extra-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 8px;
}

.extra-section p {
  font-size: 14px;
  margin: 0 0 12px;
  line-height: 1.7;
}

.link-button {
  display: inline-block;
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dark);
  padding-bottom: 2px;
}

/* ===== Actions ===== */
.actions {
  margin-top: 32px;
}
.btn-text-link {
  display: inline-block;
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
  text-decoration: underline;
  padding: 8px 0;
  margin-bottom: 4px;
}
.friend-fallback-note {
  width: 100%;
  text-align: center;
  font-size: 11px;
  color: var(--text-soft);
  line-height: 1.6;
  margin: 0 0 16px;
}

.hashtag {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-soft);
  text-align: center;
}

/* ===== Responsive ===== */
@media (min-width: 640px) {
  .title { font-size: 38px; }
  .qtitle { font-size: 24px; }
}
