:root {
  --bg-1: #fbf5d4;
  --bg-2: #e7f8c8;
  --text-main: #143324;
  --text-light: #f7fbe9;
  --muted: #5f7867;
  --accent: #f3a91f;
  --accent-strong: #e08a00;
  --line: rgba(20, 51, 36, 0.2);
  --panel: rgba(255, 255, 255, 0.78);
  --soft: #edf6ef;
  --shadow: 0 22px 60px rgba(20, 51, 36, 0.22);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body {
  font-family: "Noto Sans SC", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 12% 12%, #ffe8a8 0, transparent 34%),
    radial-gradient(circle at 86% 22%, #caef9a 0, transparent 36%),
    linear-gradient(145deg, var(--bg-1), var(--bg-2) 55%, #d8f1b2);
}

.app-shell {
  width: min(980px, calc(100vw - 32px));
  margin: 24px auto;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow);
  border-radius: 28px;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.brand-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(24, 74, 51, 0.94), rgba(31, 93, 58, 0.88));
}

.brand-mark { width: 34px; height: 34px; }
.brand-name {
  color: var(--text-light);
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.view {
  display: none;
  min-height: 590px;
  padding: 34px 30px 34px;
  position: relative;
  animation: slide-up 0.45s ease;
}

.view.active { display: block; }

.hero-orb {
  position: absolute;
  right: -56px;
  top: -52px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 239, 182, 0.92), transparent 44%),
    radial-gradient(circle at 64% 58%, rgba(143, 203, 76, 0.92), transparent 50%),
    linear-gradient(140deg, #1f5d3a, #8fcb4c);
  opacity: 0.95;
}

.hero-copy { position: relative; z-index: 1; max-width: 640px; }
.eyebrow {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(20, 51, 36, 0.7);
}
h1 {
  font-family: "Outfit", "Noto Sans SC", sans-serif;
  font-size: clamp(36px, 6vw, 62px);
  line-height: 1.03;
  margin: 14px 0;
}
.subtitle {
  margin: 0 0 24px;
  font-size: 17px;
  line-height: 1.7;
  max-width: 38ch;
}

.mode-pick { margin: 24px 0 24px; }
.mode-pick p { margin: 0 0 10px; font-weight: 700; }
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mode-btn {
  border: 1px solid rgba(20, 51, 36, 0.2);
  background: rgba(255, 255, 255, 0.72);
  color: var(--text-main);
  padding: 12px 14px;
  border-radius: 14px;
  text-align: left;
  font-size: 14px;
  cursor: pointer;
  transition: 0.22s ease;
}
.mode-btn strong { display: block; font-size: 15px; }
.mode-btn.active,
.mode-btn:hover {
  transform: translateY(-2px);
  border-color: rgba(224, 138, 0, 0.7);
  box-shadow: 0 8px 24px rgba(224, 138, 0, 0.18);
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 13px 22px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-strong));
  color: #241a02;
  box-shadow: 0 10px 24px rgba(243, 169, 31, 0.32);
}
.btn-secondary { background: rgba(20, 51, 36, 0.08); color: var(--text-main); }
.btn-ghost {
  background: transparent;
  color: rgba(20, 51, 36, 0.78);
  border: 1px dashed rgba(20, 51, 36, 0.4);
}

.quiz-head { display: flex; align-items: center; gap: 16px; }
.quiz-progress { margin: 0; font-weight: 700; }
.progress-track {
  flex: 1;
  height: 9px;
  border-radius: 999px;
  background: rgba(20, 51, 36, 0.11);
  overflow: hidden;
}
.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8fcb4c, #f3a91f);
  transition: width 0.25s ease;
}

.quiz-title {
  margin: 18px 0 8px;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.34;
}
.quiz-meta {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.options { display: grid; gap: 10px; margin-bottom: 20px; }
.option {
  border: 1px solid rgba(20, 51, 36, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  padding: 14px;
  text-align: left;
  cursor: pointer;
  transition: 0.2s ease;
}
.option .flag {
  display: inline-block;
  font-family: "Outfit", sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(20, 51, 36, 0.07);
  margin-bottom: 9px;
}
.option:hover { transform: translateX(3px); border-color: rgba(143, 203, 76, 0.7); }
.option.selected {
  border-color: rgba(224, 138, 0, 0.78);
  background: rgba(255, 236, 190, 0.82);
}

.tendency-board { margin: 20px 0; display: grid; gap: 9px; }
.tendency-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.tendency-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(20, 51, 36, 0.12);
  overflow: hidden;
}
.tendency-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #8fcb4c, #1f5d3a);
  transition: width 0.25s ease;
}

.result-top {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: 16px;
  align-items: stretch;
}

.poster-box,
.type-box,
.analysis-box,
.top3-box,
.dim-box,
.note-box,
.history-box {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff, #fbfdfb);
}

.poster-box {
  background:
    radial-gradient(circle at top right, rgba(127,165,134,0.16), rgba(127,165,134,0) 40%),
    linear-gradient(180deg, #ffffff, #f7fbf8);
}

.poster-image {
  width: 100%;
  min-height: 230px;
  max-height: 420px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
}
.poster-caption { margin: 10px 0 0; font-size: 13px; color: var(--muted); line-height: 1.8; }

.type-kicker { margin: 0 0 8px; font-size: 12px; color: var(--accent-strong); letter-spacing: 0.06em; }
.result-name {
  margin: 0;
  font-family: "Outfit", "Noto Sans SC", sans-serif;
  font-size: clamp(28px, 5vw, 48px);
  line-height: 1.08;
}
.match {
  margin: 12px 0 8px;
  display: inline-flex;
  border-radius: 999px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--accent-strong);
  font-weight: 700;
}
.result-sub { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.8; }

.analysis-box,
.top3-box,
.dim-box,
.note-box,
.history-box { margin-top: 16px; }
.analysis-box h3,
.top3-box h3,
.dim-box h3,
.note-box h3,
.history-box h3 {
  margin: 0 0 10px;
  font-size: 16px;
}
.result-summary,
.result-ai,
.result-reco { margin: 0; line-height: 1.9; }
.result-reco { margin-top: 10px; }
.result-ai { margin-top: 10px; color: #2a4a37; }

.result-quote {
  margin: 14px 0;
  padding-left: 12px;
  border-left: 3px solid rgba(243, 169, 31, 0.9);
  color: rgba(20, 51, 36, 0.85);
}
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag {
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  background: rgba(31, 93, 58, 0.1);
}

.top3-list { display: grid; gap: 10px; }
.top3-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.top3-item strong { display: block; margin-bottom: 3px; }
.top3-item span { color: var(--muted); font-size: 13px; }
.top3-score { color: var(--accent-strong); font-weight: 800; white-space: nowrap; }

.dim-list { display: grid; gap: 10px; }
.dim-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}
.dim-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.dim-item-name { font-size: 14px; font-weight: 700; }
.dim-item-score { color: var(--accent-strong); font-size: 13px; font-weight: 800; }
.dim-item p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.75; }

.note-box p { margin: 0; color: var(--muted); line-height: 1.8; font-size: 13px; }

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.history-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}
.history-list li {
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.64);
}

.poster-title { margin: 0 0 14px; }
#poster-canvas {
  width: min(100%, 560px);
  max-width: 560px;
  border-radius: 18px;
  background: #eef6da;
  border: 1px solid rgba(20, 51, 36, 0.14);
  box-shadow: 0 16px 30px rgba(20, 51, 36, 0.2);
}
.poster-style { display: flex; gap: 8px; margin: 14px 0; }
.poster-chip {
  border-radius: 999px;
  border: 1px solid rgba(20, 51, 36, 0.2);
  background: rgba(255, 255, 255, 0.76);
  padding: 6px 12px;
  cursor: pointer;
}
.poster-chip.active { border-color: rgba(224, 138, 0, 0.72); }

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

@media (max-width: 860px) {
  .result-top { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .app-shell { width: calc(100vw - 14px); margin: 8px auto; border-radius: 18px; }
  .view { padding: 24px 14px 20px; min-height: 560px; }
  .mode-grid { grid-template-columns: 1fr; }
  .hero-orb { width: 210px; height: 210px; right: -62px; top: -30px; }
}
