/* ========== RESET & BASE ========== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #8b5e3c;
  --primary-light: #c4956a;
  --primary-dark: #5a3825;
  --accent: #e88a2a;
  --bg: #faf6f1;
  --text: #3e2c1c;
  --text-light: #7a6555;
  --white: #ffffff;
  --shadow: 0 4px 24px rgba(62,44,28,.08);
  --radius: 16px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Noto Sans JP', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
}

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

/* ========== SCREENS ========== */
.screen {
  display: none;
  min-height: 100dvh;
  animation: fadeIn .4s ease;
}
.screen.active { display: flex; align-items: center; justify-content: center; }

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

/* ========== START SCREEN ========== */
#screen-start {
  background: linear-gradient(160deg, #3e2215 0%, #5a3825 30%, #8b5e3c 60%, #c4956a 100%);
  color: var(--white);
  text-align: center;
}

.start-badge {
  display: inline-block;
  background: rgba(255,255,255,.15);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.2);
  padding: 6px 20px;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .1em;
  margin-bottom: 28px;
}

.start-title {
  font-size: 2.6rem;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 16px;
}
.start-title .highlight {
  background: linear-gradient(90deg, #f0a500, #f77f00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.start-subtitle {
  font-size: 1.15rem;
  opacity: .9;
  margin-bottom: 32px;
}

.start-features {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 36px;
}
.feature-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  opacity: .85;
}
.feature-icon { font-size: 1.1rem; }

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  border: none;
  padding: 18px 56px;
  font-size: 1.15rem;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(232,138,42,.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(232,138,42,.45); }
.btn-primary:active { transform: scale(.97); }

.start-credit {
  margin-top: 32px;
  font-size: .8rem;
  opacity: .6;
  line-height: 1.6;
}

/* ========== QUIZ SCREEN ========== */
#screen-quiz {
  background: var(--bg);
  align-items: flex-start;
  padding-top: 20px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: #e0e0d8;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 16px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary-dark), var(--accent));
  border-radius: 3px;
  transition: width .4s ease;
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.btn-back {
  background: none;
  border: none;
  color: var(--primary);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  font-family: inherit;
  transition: background .2s;
}
.btn-back:hover { background: rgba(139,94,60,.08); }

.question-counter {
  font-size: .85rem;
  color: var(--text-light);
}
.question-counter span { color: var(--primary); font-weight: 700; font-size: 1.1rem; }

.question-area {
  animation: slideIn .35s ease;
}
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: translateX(0); } }

.question-text {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.6;
  margin-bottom: 28px;
  text-align: center;
  min-height: 3.2em;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-btn {
  width: 100%;
  text-align: left;
  background: var(--white);
  border: 2px solid #e8e8e0;
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 1rem;
  line-height: 1.5;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
  color: var(--text);
}
.option-btn:hover {
  border-color: var(--primary-light);
  background: #fdf5ec;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.option-btn:active { transform: scale(.98); }
.option-btn.selected {
  border-color: var(--accent);
  background: #fef0e0;
  font-weight: 600;
}
.option-neutral {
  background: #f5f5f0;
  border-color: #ddd;
  color: var(--text-light);
  font-size: .9rem;
  text-align: center;
}

/* ========== ANALYZING ========== */
#screen-analyzing {
  background: linear-gradient(160deg, #3e2215, #5a3825);
  color: var(--white);
}
.analyzing-container { text-align: center; }

.pulse-ring {
  position: absolute;
  width: 120px; height: 120px;
  border: 3px solid rgba(255,255,255,.2);
  border-radius: 50%;
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { transform: scale(.8); opacity: .5; } 50% { transform: scale(1.2); opacity: 0; } }

.analyzing-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  animation: float 2s ease-in-out infinite;
  position: relative;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.analyzing-text { font-size: 1.1rem; font-weight: 600; line-height: 1.7; }
.analyzing-dots span {
  animation: blink 1.4s infinite;
  font-size: 2rem;
}
.analyzing-dots span:nth-child(2) { animation-delay: .2s; }
.analyzing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,100% { opacity: .2; } 50% { opacity: 1; } }

/* ========== RESULT SCREEN ========== */
#screen-result {
  background: var(--bg);
  align-items: flex-start;
  padding-top: 20px;
}

.result-label {
  text-align: center;
  font-size: .95rem;
  color: var(--text-light);
  margin-bottom: 16px;
  animation: fadeIn .5s ease;
}

.result-card {
  text-align: center;
  border-radius: 20px;
  padding: 36px 24px;
  margin-bottom: 28px;
  color: var(--white);
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  animation: cardPop .5s cubic-bezier(.34,1.56,.64,1);
}
@keyframes cardPop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: scale(1); } }

.result-icon { font-size: 3rem; margin-bottom: 12px; }
.result-type { font-size: 2rem; font-weight: 900; margin-bottom: 8px; }
.result-name { font-size: 1rem; opacity: .85; margin-bottom: 16px; font-weight: 600; }
.result-desc { font-size: .9rem; line-height: 1.7; opacity: .9; }

/* detail sections */
.result-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 32px;
}
.detail-section {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  animation: fadeIn .6s ease;
}
.detail-section h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--primary-dark);
}
.detail-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.detail-section li {
  font-size: .9rem;
  line-height: 1.5;
  padding-left: 20px;
  position: relative;
  color: var(--text);
}
.detail-section li::before {
  content: '';
  position: absolute;
  left: 0; top: 8px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.food-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.food-tag {
  background: #fdf5ec;
  color: var(--primary-dark);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  border: 1px solid #e8d5c0;
}

/* ========== CTA ========== */
.cta-box {
  background: linear-gradient(135deg, #fdf5ec, #fef9f3);
  border: 2px solid var(--primary-light);
  border-radius: 20px;
  padding: 28px 20px;
  text-align: center;
  margin-bottom: 28px;
}
.cta-lead {
  font-size: .95rem;
  line-height: 1.7;
  margin-bottom: 16px;
  color: var(--primary-dark);
}
.btn-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #06c755;
  color: var(--white);
  padding: 16px 40px;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(6,199,85,.3);
}
.btn-line:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(6,199,85,.4); }
.cta-note {
  display: block;
  margin-top: 12px;
  font-size: .75rem;
  color: var(--text-light);
}

/* ========== SHARE ========== */
.share-section { text-align: center; margin-bottom: 28px; }
.share-label { font-size: .85rem; color: var(--text-light); margin-bottom: 12px; }
.share-buttons { display: flex; justify-content: center; gap: 12px; }

.btn-share {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  color: var(--white);
  transition: transform .2s;
  font-family: inherit;
}
.btn-share:hover { transform: translateY(-2px); }
.btn-x { background: #000; }
.btn-share-line { background: #06c755; }

.btn-retry {
  display: block;
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 2px solid #ddd;
  border-radius: 999px;
  font-size: .95rem;
  color: var(--text-light);
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
  margin-bottom: 40px;
}
.btn-retry:hover { border-color: var(--primary-light); color: var(--primary); }

/* ========== HARRY-CHAN ========== */
.harry-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.harry-img {
  object-fit: contain;
  border-radius: 16px;
}

.harry-start {
  width: 140px;
  height: 140px;
  animation: float 2.5s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,.2));
}

.harry-quiz-container {
  margin-bottom: 12px;
}

.harry-quiz {
  width: 120px;
  height: 120px;
  animation: fadeIn .4s ease;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.08));
}

.harry-analyzing {
  width: 140px;
  height: 140px;
  animation: float 2s ease-in-out infinite;
  filter: drop-shadow(0 4px 12px rgba(255,255,255,.2));
  position: relative;
}

.harry-result {
  width: 130px;
  height: 130px;
  animation: cardPop .6s cubic-bezier(.34,1.56,.64,1);
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.08));
}
