﻿:root {
  --ink: #342313;
  --muted: #6f604d;
  --line: #d9b879;
  --paper: #fff9e9;
  --panel: #fff3cf;
  --cream: #fffdf6;
  --gold: #f6b833;
  --orange: #ef7b2d;
  --green: #61b947;
  --blue: #4385d8;
  --red: #ef5665;
  --brown: #7b4f22;
  --shadow: 0 14px 30px rgba(92, 58, 18, .18);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 227, 84, .45), transparent 28rem),
    linear-gradient(180deg, #fff7d9 0%, #f7f1dd 42%, #dff3d7 100%);
}
button { font: inherit; color: inherit; }
.app-shell { width: min(100%, 480px); min-height: 100vh; margin: 0 auto; padding: 12px; }
.topbar {
  height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  position: sticky; top: 0; z-index: 5; padding: 8px 0 10px;
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand-mark { font-size: 34px; filter: drop-shadow(0 3px 0 rgba(123,79,34,.18)); }
h1 { margin: 0; font-size: clamp(22px, 7vw, 34px); line-height: 1.02; color: #6b421d; }
.brand p, .screen-head p { margin: 2px 0 0; color: var(--muted); font-size: 12px; }
.icon-button {
  width: 44px; height: 44px; border-radius: 14px; border: 2px solid #e0bc75; background: #fff8df;
  box-shadow: 0 4px 0 #c79b4b; font-size: 23px; font-weight: 800;
}
.screen { display: none; animation: pop .22s ease-out; }
.screen.active { display: block; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.hero-panel, .quiz-card, .result-card, .status-panel, .radar-card, .stage-card {
  border: 2px solid var(--line); border-radius: 20px; background: rgba(255,253,246,.92); box-shadow: var(--shadow);
}
.hero-panel { padding: 18px; min-height: 410px; display: grid; align-content: space-between; position: relative; overflow: hidden; }
.hero-panel::before {
  content: ""; position: absolute; inset: auto -40px -56px -40px; height: 170px;
  background: linear-gradient(160deg, #5eb851, #2e8f47); border-radius: 55% 55% 0 0;
}
.eyebrow { display: inline-block; margin: 0 0 8px; padding: 5px 10px; border-radius: 999px; background: #153e7a; color: #fff; font-weight: 800; }
.hero-copy h2 { margin: 0; font-size: 27px; line-height: 1.28; color: #113f7c; }
.quick-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.stat-pill { background: #fff3cf; border: 1px solid #e6c984; border-radius: 14px; padding: 8px; text-align: center; font-weight: 800; }
.stat-pill span { display: block; font-size: 12px; color: var(--muted); }
.coach-card { position: relative; z-index: 1; display: flex; align-items: end; gap: 12px; }
.chick { display: grid; place-items: center; filter: drop-shadow(0 6px 0 rgba(109,73,20,.16)); }
.big { font-size: 116px; }
.trophy { font-size: 78px; }
.speech { max-width: 230px; padding: 12px 14px; border: 2px solid #e5bd70; border-radius: 18px; background: #fffdf6; font-weight: 800; }
.action-stack { display: grid; gap: 12px; margin-top: 14px; }
.action-stack.two { grid-template-columns: 1fr 1fr; }
.primary-button, .secondary-button {
  min-height: 58px; border-radius: 18px; border: 2px solid #b9832b; font-weight: 900; font-size: 18px; box-shadow: 0 5px 0 #b9832b;
}
.primary-button { background: linear-gradient(180deg, #ff6f7c, #e94358); color: #fff; border-color: #b63c45; box-shadow: 0 5px 0 #a8323b; }
.secondary-button { background: #fffdf6; color: #133b75; }
.screen-head { margin: 12px 0; padding: 0 4px; }
.screen-head h2 { margin: 0; font-size: 24px; color: #143e78; }
.map-path { display: grid; gap: 12px; }
.stage-card { min-height: 92px; padding: 12px; display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center; }
.stage-card.locked { filter: grayscale(.65); opacity: .72; }
.stage-icon { width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; background: #dff3d7; font-size: 30px; }
.stage-card h3 { margin: 0; font-size: 17px; }
.stage-card p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.stage-badge { padding: 7px 9px; border-radius: 999px; background: #f3e2ba; font-size: 12px; font-weight: 900; }
.quiz-card { padding: 18px; min-height: 560px; display: grid; align-content: start; }
.quiz-meta, .progress-wrap { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 900; }
.progress-wrap { margin: 12px 0; }
.progress-track { flex: 1; height: 12px; border-radius: 999px; background: #eadab7; overflow: hidden; }
.progress-fill { height: 100%; width: 10%; border-radius: 999px; background: linear-gradient(90deg, #73c650, #2f9b55); transition: width .2s; }
.tag-row span { display: inline-block; padding: 7px 12px; border-radius: 12px; background: #ffe0df; color: #74363a; font-weight: 900; font-size: 13px; }
.question-text { min-height: 110px; margin: 18px 0 10px; font-size: 21px; line-height: 1.55; }
.chart-scene { height: 150px; margin: 4px 0 20px; border-radius: 18px; background: linear-gradient(180deg, #fff, #f5ecd5); border: 1px solid #ead0a0; position: relative; overflow: hidden; }
.chart-scene::before { content: ""; position: absolute; inset: 18px; background: repeating-linear-gradient(0deg, transparent 0 26px, rgba(123,79,34,.1) 27px), repeating-linear-gradient(90deg, transparent 0 38px, rgba(123,79,34,.08) 39px); }
.candle { position: absolute; bottom: 32px; width: 13px; border-radius: 3px; }
.candle.green { background: #4eb75a; } .candle.red { background: #ea5c5c; }
.trend-arrow { position: absolute; right: 30px; top: 32px; font-size: 58px; color: #42a853; transform: rotate(-18deg); }
.answer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 8px; }
.answer-button { height: 88px; border-radius: 20px; border: 2px solid rgba(42,42,42,.15); font-size: 54px; color: #fff; font-weight: 900; box-shadow: inset 0 2px 0 rgba(255,255,255,.4), 0 6px 0 rgba(75,49,19,.22); }
.answer-button.yes { background: linear-gradient(180deg, #ff6e79, #e54454); }
.answer-button.no { background: linear-gradient(180deg, #67a6ee, #3e78c7); }
.choice-grid { grid-template-columns: 1fr; gap: 10px; }
.answer-button.choice {
  min-height: 64px;
  height: auto;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  text-align: left;
  color: var(--ink);
  background: linear-gradient(180deg, #fffdf6, #fff0c7);
  border-color: #d9b879;
  font-size: 16px;
  line-height: 1.45;
}
.choice-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: #4385d8;
  font-weight: 900;
}
.coach-line { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 10px 12px; border-radius: 18px; background: rgba(255,253,246,.85); border: 1px solid #e6c984; font-weight: 800; }
.mini-chick { font-size: 34px; }
.result-card { padding: 18px; text-align: center; }
.result-card.compact { text-align: left; }
.banner { display: inline-block; padding: 9px 22px; border-radius: 12px; color: #fff; background: var(--red); transform: rotate(-2deg); font-size: 24px; font-weight: 900; }
.banner.clear { background: var(--orange); }
.answer-note { font-size: 18px; font-weight: 900; }
.explain-box { margin: 12px 0; padding: 12px; border: 1px solid #e5c477; border-radius: 14px; background: #fff9e9; }
.explain-box p { margin: 8px 0 0; line-height: 1.65; }
.explain-box.soft { background: #fffdf6; }
.focus-point {
  margin: 12px 0;
  padding: 12px;
  border: 2px solid #f0b343;
  border-radius: 14px;
  background: #fff3cf;
}
.focus-point strong,
.focus-point span {
  display: block;
}
.focus-point strong {
  color: #74363a;
  margin-bottom: 4px;
}
.score-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.score-box { padding: 10px; border-radius: 14px; background: #fff3cf; border: 1px solid #e4c173; font-weight: 900; }
.score-box span { display: block; font-size: 12px; color: var(--muted); }
.ability-list { display: grid; gap: 8px; margin: 14px 0; text-align: left; }
.ability-row { display: grid; grid-template-columns: 96px 1fr 45px; gap: 8px; align-items: center; font-size: 13px; font-weight: 800; }
.bar { height: 11px; border-radius: 999px; background: #eadab7; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: #65bc4b; }
.title-card { margin: 14px 0; padding: 14px; border-radius: 16px; background: #fff1bf; border: 1px solid #e0b45a; font-weight: 900; }
.status-layout { display: grid; gap: 12px; }
.radar-card { padding: 12px; display: grid; place-items: center; background: rgba(255,253,246,.96); }
.status-panel { padding: 14px; }
.status-panel h3 { margin: 0 0 8px; }
.status-panel p { margin: 6px 0; color: var(--muted); }
@media (min-width: 780px) {
  .app-shell { width: min(100%, 1060px); }
  main { display: block; }
  .hero-panel { min-height: 500px; grid-template-columns: 1fr 360px; align-items: end; }
  .hero-copy h2 { font-size: 42px; }
  .action-stack { grid-template-columns: repeat(3, 1fr); }
  .quiz-card, .result-card { width: min(520px, 100%); margin: 0 auto; }
  .map-path { grid-template-columns: repeat(2, 1fr); }
  .status-layout { grid-template-columns: 380px 1fr; }
}

/* Hero image integration */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.visual-hero {
  padding: 0;
  min-height: 0;
  display: block;
  overflow: hidden;
  background: #fff8df;
}
.visual-hero::before {
  content: none;
}
.hero-art,
.hero-art img {
  display: block;
  width: 100%;
}
.hero-art img {
  height: auto;
}
.home-summary {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.speech.compact {
  max-width: none;
  width: 100%;
  font-size: 14px;
  box-shadow: var(--shadow);
}
@media (min-width: 780px) {
  .visual-hero {
    min-height: 0;
  }
  .home-summary {
    grid-template-columns: 1fr 340px;
    align-items: stretch;
  }
  .speech.compact {
    display: flex;
    align-items: center;
  }
}

/* Mobile layout correction */
@media (max-width: 779px) {
  .app-shell {
    width: 100%;
    max-width: 480px;
  }
  .topbar {
    gap: 6px;
  }
  .brand {
    flex: 1;
    justify-content: center;
  }
  .brand p {
    display: none;
  }
  h1 {
    font-size: 25px;
    white-space: nowrap;
  }
  .action-stack,
  .action-stack.two {
    grid-template-columns: 1fr;
  }
  .primary-button,
  .secondary-button {
    width: 100%;
    white-space: normal;
    line-height: 1.25;
  }
  .quick-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stat-pill {
    min-width: 0;
    padding: 8px 4px;
    font-size: 16px;
  }
  .speech.compact {
    font-size: 14px;
    line-height: 1.6;
  }
}

/* Rules screen */
.rules-card {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 253, 246, .94);
  box-shadow: var(--shadow);
}
.rules-block {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid #e5c477;
  border-radius: 14px;
  background: #fff9e9;
}
.rules-block strong {
  display: block;
  margin-bottom: 8px;
  color: #123f7c;
  font-size: 17px;
}
.rules-block ul {
  margin: 0;
  padding-left: 1.2em;
  line-height: 1.75;
}
.rules-block p {
  margin: 0;
  line-height: 1.75;
}
.rules-block.notice {
  background: #fff3cf;
  border-color: #e0b45a;
}
.rules-card .primary-button {
  width: 100%;
}
