:root {
      --bg: #eef2f0;
      --ink: #17211f;
      --muted: #5f6b68;
      --panel: #fbfcfa;
      --panel-soft: #f3f6f4;
      --line: #253b37;
      --accent: #2e766d;
      --accent-dark: #1d514b;
      --gold: #b1842d;
      --rose: #a84f5f;
      --blue: #3e668f;
      --shadow: rgba(22, 35, 31, 0.12);
      --focus: #d9a83a;
    }

    * {
      box-sizing: border-box;
    }

    body {
      margin: 0;
      min-height: 100vh;
      color: var(--ink);
      background:
        linear-gradient(90deg, rgba(46, 118, 109, 0.05) 1px, transparent 1px),
        linear-gradient(rgba(46, 118, 109, 0.05) 1px, transparent 1px),
        var(--bg);
      background-size: 28px 28px;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      line-height: 1.65;
    }

    button {
      font: inherit;
    }

    .app {
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      padding: 24px;
      gap: 16px;
    }

    .site-header {
      position: sticky;
      top: 0;
      z-index: 20;
      display: grid;
      gap: 10px;
      max-width: 1280px;
      width: 100%;
      margin: 0 auto;
      padding: 0 0 8px;
      background:
        linear-gradient(90deg, rgba(46, 118, 109, 0.05) 1px, transparent 1px),
        linear-gradient(rgba(46, 118, 109, 0.05) 1px, transparent 1px),
        var(--bg);
      background-size: 28px 28px;
    }

    .topbar {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 16px;
      align-items: center;
      width: 100%;
      padding-top: 2px;
    }

    .quest-nav {
      border: 3px solid var(--line);
      background: rgba(251, 252, 250, 0.96);
      box-shadow: 4px 4px 0 var(--line);
      padding: 8px 10px;
    }

    .quest-nav ol {
      list-style: none;
      margin: 0;
      padding: 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 6px;
      flex-wrap: wrap;
    }

    .quest-nav li {
      display: inline-flex;
      align-items: center;
      min-width: 0;
    }

    .quest-nav li + li::before {
      content: "→";
      color: var(--muted);
      font-weight: 900;
      margin-right: 6px;
    }

    .quest-nav span {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      min-height: 34px;
      padding: 4px 10px;
      border: 2px solid transparent;
      color: var(--muted);
      background: #eef3f1;
      font-size: clamp(13px, 1.45vw, 16px);
      font-weight: 800;
      white-space: nowrap;
      transition: background 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms ease;
    }

    .quest-nav span.is-complete {
      color: #2e766d;
      background: #e8f4ef;
    }

    .quest-nav span.is-current {
      color: var(--ink);
      background: #fff5d8;
      border-color: var(--line);
      box-shadow: inset 0 -4px 0 rgba(217, 168, 58, 0.34);
      font-weight: 900;
      transform: translateY(-1px);
    }

    .quest-nav span.is-current::before {
      content: "◆";
      color: var(--gold);
      font-size: 12px;
      margin-right: 5px;
    }

    .brand {
      display: flex;
      align-items: baseline;
      gap: 12px;
      min-width: 0;
    }

    .brand-mark {
      display: inline-grid;
      place-items: center;
      width: 42px;
      height: 42px;
      border: 3px solid var(--line);
      background: var(--panel);
      color: var(--accent-dark);
      font-weight: 800;
      box-shadow: 4px 4px 0 var(--line);
      flex: 0 0 auto;
    }

    .brand h1 {
      margin: 0;
      font-size: clamp(24px, 3vw, 36px);
      line-height: 1.2;
      letter-spacing: 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .version-badge,
    .title-version {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 2px solid var(--line);
      background: #fff8e8;
      color: var(--accent-dark);
      box-shadow: 2px 2px 0 var(--line);
      font-weight: 900;
      letter-spacing: 0;
      white-space: nowrap;
    }

    .version-badge {
      margin-left: 8px;
      padding: 1px 8px;
      font-size: 14px;
      vertical-align: middle;
    }

    .title-version {
      justify-self: center;
      min-height: 34px;
      padding: 3px 14px;
      font-size: 18px;
      color: #7a551f;
      background: linear-gradient(180deg, #fff7dd, #f7e2aa);
    }

    .screen-count {
      color: var(--muted);
      font-size: 18px;
      white-space: nowrap;
    }

    .stage {
      max-width: 1280px;
      width: 100%;
      margin: 0 auto;
      display: grid;
      grid-template-columns: minmax(0, 1fr) 330px;
      gap: 18px;
      flex: 1;
      min-height: 0;
    }

    .main-panel,
    .status-panel {
      border: 3px solid var(--line);
      background: var(--panel);
      box-shadow: 7px 7px 0 var(--line);
    }

    .main-panel {
      min-height: 650px;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .scene-header {
      background: var(--accent-dark);
      color: #fff;
      padding: 12px 22px;
      display: flex;
      gap: 12px;
      align-items: center;
      justify-content: space-between;
      border-bottom: 3px solid var(--line);
      font-weight: 700;
      font-size: 21px;
    }

    .tag {
      display: inline-flex;
      align-items: center;
      min-height: 32px;
      padding: 2px 12px;
      border: 2px solid currentColor;
      background: rgba(255, 255, 255, 0.12);
      font-size: 16px;
      white-space: nowrap;
    }

    .content {
      padding: 28px;
      display: grid;
      gap: 20px;
      align-content: start;
      flex: 0 1 auto;
      transition: background 220ms ease;
    }

    .content.screen-title {
      background:
        linear-gradient(180deg, rgba(46, 118, 109, 0.08), rgba(217, 168, 58, 0.08)),
        #fbfcfa;
    }

    .content.route-recommended {
      background: linear-gradient(180deg, rgba(255, 248, 232, 0.85), rgba(255, 255, 255, 0.92));
    }

    .content.route-recovery {
      background: linear-gradient(180deg, rgba(229, 246, 239, 0.9), rgba(255, 255, 255, 0.94));
    }

    .content.route-caution {
      background: linear-gradient(180deg, rgba(250, 238, 204, 0.86), rgba(255, 255, 255, 0.94));
    }

    .content.route-maze {
      background:
        radial-gradient(circle at 22% 18%, rgba(255, 255, 255, 0.22), transparent 30%),
        linear-gradient(180deg, rgba(67, 74, 101, 0.18), rgba(255, 255, 255, 0.94));
    }

    .content.recovery-meeting {
      background:
        radial-gradient(circle at 16% 16%, rgba(242, 199, 110, 0.28), transparent 22%),
        linear-gradient(180deg, #fffaf0, #f1fbf6);
    }

    .content.recovery-meeting h2 {
      color: #2e766d;
    }

    .content.recovery-meeting .choices {
      border: 3px solid #70a583;
      background: rgba(255, 255, 255, 0.62);
      padding: 14px;
    }

    .meeting-note {
      border: 3px solid var(--line);
      border-left: 12px solid #70a583;
      background: #f1fbf6;
      padding: 16px 20px;
      display: grid;
      gap: 8px;
    }

    .meeting-note p {
      font-size: clamp(21px, 2.1vw, 27px);
    }

    .content.screen-boss {
      background:
        linear-gradient(180deg, rgba(42, 43, 62, 0.24), rgba(255, 255, 255, 0.9)),
        #fbfcfa;
    }

    .content.end-true {
      background: linear-gradient(180deg, rgba(255, 236, 190, 0.9), rgba(255, 255, 255, 0.94));
    }

    .content.end-normal {
      background: linear-gradient(180deg, rgba(224, 244, 238, 0.92), rgba(255, 255, 255, 0.94));
    }

    .content.end-bad,
    .content.end-rest {
      background:
        radial-gradient(circle at 86% 8%, rgba(217, 168, 58, 0.18), transparent 22%),
        linear-gradient(180deg, rgba(96, 107, 124, 0.18), rgba(255, 255, 255, 0.95));
    }

    .title-card {
      display: grid;
      gap: 16px;
      align-content: center;
      min-height: 430px;
      padding: 36px 24px;
      text-align: center;
    }

    .hero-visual {
      width: min(760px, 100%);
      height: auto;
      justify-self: center;
      border: 3px solid var(--line);
      background: linear-gradient(180deg, #f9fcfb, #e8f1ee);
      box-shadow: 6px 6px 0 var(--line);
      object-fit: contain;
    }

    .portrait-card {
      width: min(760px, 100%);
      justify-self: center;
      display: grid;
      grid-template-columns: minmax(250px, 0.8fr) minmax(260px, 1fr);
      gap: 18px;
      align-items: center;
      border: 3px solid var(--line);
      background: linear-gradient(180deg, #ffffff, #f4f8f6);
      box-shadow: 6px 6px 0 var(--line);
      padding: 16px;
      text-align: left;
    }

    .portrait-card.end {
      background: linear-gradient(180deg, #fff8e8, #ffffff);
      border-color: #9f6d1d;
      box-shadow: 6px 6px 0 #9f6d1d;
    }

    .yuu-portrait {
      width: 100%;
      height: auto;
      display: block;
      background: #fff;
      border: 3px solid var(--line);
      object-fit: contain;
    }

    .portrait-copy {
      display: grid;
      gap: 10px;
    }

    .portrait-copy strong {
      color: var(--accent-dark);
      font-size: clamp(26px, 3vw, 38px);
      line-height: 1.2;
    }

    .portrait-copy p {
      font-size: clamp(20px, 2.1vw, 28px);
      line-height: 1.55;
    }

    .content.screen-title .hero-visual {
      border-color: #1d514b;
      box-shadow: 6px 6px 0 #1d514b;
    }

    .content.end-true .hero-visual {
      border-color: #9f6d1d;
      box-shadow: 6px 6px 0 #9f6d1d;
    }

    .content.end-normal .hero-visual {
      border-color: #2e766d;
      box-shadow: 6px 6px 0 #2e766d;
    }

    .content.end-bad .hero-visual,
    .content.end-rest .hero-visual {
      border-color: #4f5870;
      box-shadow: 6px 6px 0 #4f5870;
    }

    .growth-card {
      position: relative;
      overflow: hidden;
      border: 4px solid #9b2f35;
      background:
        linear-gradient(135deg, rgba(255, 244, 230, 0.95), rgba(255, 255, 255, 0.98)),
        #fff;
      box-shadow: 6px 6px 0 rgba(155, 47, 53, 0.28);
      padding: 18px 20px;
      display: grid;
      gap: 12px;
    }

    .growth-card::before {
      content: "";
      position: absolute;
      inset: 10px;
      border: 2px dashed rgba(155, 47, 53, 0.38);
      pointer-events: none;
    }

    .growth-title-row {
      position: relative;
      z-index: 1;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 14px;
      flex-wrap: wrap;
    }

    .growth-title-row h3 {
      color: #7f2028;
      font-size: clamp(28px, 3.2vw, 40px);
    }

    .growth-stamp {
      display: inline-grid;
      place-items: center;
      width: 112px;
      height: 112px;
      border: 5px double #9b2f35;
      border-radius: 50%;
      background: radial-gradient(circle at 50% 42%, #fff7ed, #f1c2b7);
      color: #8c2630;
      box-shadow: 4px 4px 0 rgba(37, 59, 55, 0.22);
      transform: rotate(-7deg);
      text-align: center;
      font-size: 19px;
      font-weight: 900;
      line-height: 1.15;
    }

    .growth-stamp small {
      display: block;
      font-size: 14px;
      letter-spacing: 0;
    }

    .growth-stamp::before,
    .growth-stamp::after {
      content: "";
      position: absolute;
      width: 24px;
      height: 52px;
      bottom: -32px;
      background: #c5484f;
      border: 3px solid #7f2028;
      z-index: -1;
    }

    .growth-stamp::before {
      left: 30px;
      transform: rotate(12deg);
    }

    .growth-stamp::after {
      right: 30px;
      transform: rotate(-12deg);
    }

    .growth-track {
      position: relative;
      z-index: 1;
      display: grid;
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 10px;
    }

    .growth-step {
      border: 2px solid #9b2f35;
      background: var(--panel-soft);
      padding: 8px;
      text-align: center;
      font-size: 19px;
      font-weight: 900;
      color: #7f2028;
    }

    .growth-step.active {
      color: #fff;
      background: linear-gradient(180deg, #d85b5f, #9b2f35);
      box-shadow: inset 0 -6px 0 rgba(84, 20, 27, 0.36), 0 0 0 4px rgba(216, 91, 95, 0.18);
    }

    .content.end-normal .growth-step.active {
      background: linear-gradient(180deg, #d85b5f, #9b2f35);
      box-shadow: inset 0 -6px 0 rgba(84, 20, 27, 0.36), 0 0 0 4px rgba(216, 91, 95, 0.18);
    }

    .content.end-bad .growth-step.active,
    .content.end-rest .growth-step.active {
      background: linear-gradient(180deg, #b94e58, #7f3038);
      box-shadow: inset 0 -6px 0 rgba(84, 20, 27, 0.32), 0 0 0 4px rgba(185, 78, 88, 0.16);
    }

    .growth-card p {
      position: relative;
      z-index: 1;
      font-size: 21px;
      line-height: 1.5;
    }

    .medal-panel {
      border: 4px solid var(--line);
      background: #fffaf0;
      box-shadow: 5px 5px 0 rgba(37, 59, 55, 0.18);
      padding: 14px 18px;
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 14px;
      align-items: center;
    }

    .medal-panel.gold {
      border-color: #9f6d1d;
      background: linear-gradient(180deg, #fff7dc, #fffdf8);
    }

    .medal-panel.silver {
      border-color: #637482;
      background: linear-gradient(180deg, #f2f7f8, #fff);
    }

    .medal-panel.rest {
      border-color: #7d5a86;
      background: linear-gradient(180deg, #f7eff8, #fff);
    }

    .medal-symbol {
      width: 70px;
      height: 70px;
      border: 4px solid currentColor;
      border-radius: 50%;
      display: grid;
      place-items: center;
      color: #9f6d1d;
      background: #fff;
      font-size: 38px;
      font-weight: 900;
      line-height: 1;
    }

    .medal-panel.silver .medal-symbol {
      color: #637482;
    }

    .medal-panel.rest .medal-symbol {
      color: #7d5a86;
      border-radius: 12px;
    }

    .medal-panel h3 {
      color: var(--ink);
      font-size: clamp(24px, 2.6vw, 32px);
    }

    .medal-panel p {
      font-size: clamp(19px, 2vw, 24px);
      line-height: 1.45;
    }

    .title-card h2 {
      margin: 0;
      color: var(--accent-dark);
      font-size: clamp(42px, 6vw, 72px);
      line-height: 1.15;
      letter-spacing: 0;
    }

    .logo-svg {
      width: min(680px, 100%);
      height: auto;
      justify-self: center;
      filter: drop-shadow(4px 5px 0 rgba(37, 59, 55, 0.2));
    }

    .logo-small {
      width: min(430px, 86%);
      margin-bottom: -4px;
    }

    .title-card .subtitle {
      margin-top: -4px;
    }

    .subtitle {
      margin: 0;
      color: var(--muted);
      font-size: clamp(24px, 3vw, 34px);
      line-height: 1.35;
      font-weight: 700;
    }

    h2 {
      margin: 0;
      color: var(--accent-dark);
      font-size: clamp(32px, 4vw, 48px);
      line-height: 1.25;
      letter-spacing: 0;
    }

    h3 {
      margin: 0;
      color: var(--accent-dark);
      font-size: 28px;
      line-height: 1.3;
      letter-spacing: 0;
    }

    p {
      margin: 0;
      font-size: clamp(22px, 2.25vw, 30px);
      line-height: 1.65;
    }

    .lead {
      font-size: clamp(25px, 2.7vw, 34px);
      line-height: 1.55;
      font-weight: 700;
    }

    .small {
      color: var(--muted);
      font-size: 18px;
      line-height: 1.55;
    }

    .note {
      border-left: 8px solid var(--gold);
      background: #fff8e8;
      padding: 16px 20px;
      font-size: clamp(21px, 2.1vw, 28px);
      line-height: 1.55;
    }

    .dialogue {
      border: 3px solid var(--line);
      background: var(--panel-soft);
      padding: 18px 22px;
      display: grid;
      grid-template-columns: auto 1fr;
      gap: 12px 18px;
      align-items: start;
    }

    .speaker {
      min-width: 72px;
      color: #fff;
      background: var(--blue);
      border: 2px solid var(--line);
      padding: 4px 10px;
      font-weight: 800;
      text-align: center;
      font-size: 20px;
    }

    .dialogue p {
      font-size: clamp(23px, 2.35vw, 31px);
      line-height: 1.55;
    }

    .dialogue,
    .typewriter-line {
      cursor: pointer;
    }

    .typewriter-active::after {
      content: "";
      display: inline-block;
      width: 0.6em;
      height: 1em;
      margin-left: 0.08em;
      border-right: 3px solid var(--accent-dark);
      vertical-align: -0.12em;
      animation: cursorBlink 920ms steps(2, start) infinite;
    }

    .typewriter-waiting {
      min-height: 1.55em;
    }

    .typewriter-trigger {
      display: inline-grid;
      place-items: center;
      min-width: 2.1em;
      min-height: 1.7em;
      border: 3px solid var(--line);
      background: #fff8e8;
      color: var(--accent-dark);
      box-shadow: 3px 3px 0 var(--line);
      cursor: pointer;
      font: inherit;
      font-size: 0.85em;
      font-weight: 900;
      line-height: 1;
      animation: triangleBlink 1.05s steps(2, start) infinite;
    }

    .typewriter-trigger:hover,
    .typewriter-trigger:focus-visible {
      background: #ffe8ae;
      outline: 4px solid var(--focus);
    }

    .progressive-hidden,
    .actions.progressive-actions-hidden {
      display: none !important;
    }

    .progressive-trigger {
      justify-self: start;
      min-height: 48px;
      border: 3px solid var(--line);
      background: #fff8e8;
      color: var(--accent-dark);
      box-shadow: 4px 4px 0 var(--line);
      cursor: pointer;
      font: inherit;
      font-size: 20px;
      font-weight: 900;
      padding: 8px 16px;
      animation: triangleBlink 1.05s steps(2, start) infinite;
    }

    .progressive-trigger:hover,
    .progressive-trigger:focus-visible {
      background: #ffe8ae;
      outline: 4px solid var(--focus);
    }

    .typewriter-hint {
      grid-column: 1 / -1;
      color: var(--muted);
      font-size: 15px;
      line-height: 1.35;
    }

    @keyframes cursorBlink {
      0%, 55% { opacity: 1; }
      56%, 100% { opacity: 0; }
    }

    @keyframes triangleBlink {
      0%, 62% { opacity: 1; transform: translateY(0); }
      63%, 100% { opacity: 0.38; transform: translateY(1px); }
    }

    .visual-row {
      display: grid;
      grid-template-columns: auto minmax(0, 1fr);
      gap: 18px;
      align-items: center;
      border: 3px solid var(--line);
      background: linear-gradient(180deg, #ffffff, #f4f8f6);
      padding: 14px 18px;
    }

    .visual-row.boss {
      background: linear-gradient(180deg, #f4f2f2, #e8eeee);
      border-color: #1f2f2d;
    }

    .visual-caption {
      display: grid;
      gap: 4px;
    }

    .visual-caption strong {
      font-size: 24px;
      color: var(--accent-dark);
    }

    .visual-caption span {
      font-size: 19px;
      color: var(--muted);
      line-height: 1.45;
    }

    .avatar {
      width: 132px;
      height: 132px;
      border: 3px solid var(--line);
      background: #fff;
      box-shadow: 4px 4px 0 var(--line);
      flex: 0 0 auto;
      object-fit: cover;
      object-position: top center;
    }

    .mini-icon {
      width: 68px;
      height: 68px;
      border: 3px solid var(--line);
      background: #fff;
      box-shadow: 3px 3px 0 var(--line);
      flex: 0 0 auto;
      object-fit: cover;
      object-position: top center;
    }

    .choice-figure {
      display: grid;
      gap: 6px;
      justify-items: center;
    }

    .choice .mini-icon {
      width: 64px;
      height: 64px;
      box-shadow: none;
      border-width: 2px;
    }

    .party-head {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .party-head .mini-icon {
      width: 64px;
      height: 64px;
      box-shadow: none;
    }

    .result-visual {
      display: flex;
      align-items: center;
      gap: 14px;
      flex-wrap: wrap;
      border: 3px solid var(--line);
      background: #fff;
      padding: 10px 14px;
    }

    .result-visual p {
      font-size: 20px;
      line-height: 1.45;
      margin: 0;
    }

    .choices {
      display: grid;
      gap: 12px;
    }

    .choice {
      width: 100%;
      text-align: left;
      border: 3px solid var(--line);
      background: #fff;
      color: var(--ink);
      padding: 15px 18px;
      display: grid;
      grid-template-columns: 82px 1fr;
      gap: 14px;
      align-items: start;
      cursor: pointer;
      box-shadow: 4px 4px 0 var(--line);
      transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
      animation: floatSoft 3.4s ease-in-out infinite;
    }

    .choice:nth-child(2) {
      animation-delay: 0.22s;
    }

    .choice:nth-child(3) {
      animation-delay: 0.44s;
    }

    .choice:nth-child(4) {
      animation-delay: 0.66s;
    }

    .choice:hover,
    .choice:focus-visible {
      outline: 4px solid var(--focus);
      animation-play-state: paused;
      background: #f9fbfa;
      transform: translate(-1px, -1px);
      box-shadow: 5px 5px 0 var(--line);
    }

    .choice-key {
      display: inline-grid;
      place-items: center;
      width: 46px;
      height: 46px;
      border: 3px solid var(--line);
      background: var(--accent);
      color: #fff;
      font-size: 26px;
      font-weight: 900;
      line-height: 1;
    }

    .choice-text {
      font-size: clamp(22px, 2.2vw, 29px);
      line-height: 1.45;
      font-weight: 700;
    }

    .choice-role {
      display: block;
      color: var(--accent-dark);
      font-size: 18px;
      font-weight: 900;
      margin-bottom: 2px;
    }

    .actions {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 12px;
      margin-top: 4px;
      padding: 0 28px 18px;
    }

    .action-btn {
      min-height: 54px;
      border: 3px solid var(--line);
      background: var(--accent);
      color: #fff;
      padding: 8px 22px;
      font-size: 22px;
      font-weight: 800;
      cursor: pointer;
      box-shadow: 4px 4px 0 var(--line);
      animation: floatSoft 3.2s ease-in-out infinite;
    }

    .action-btn.secondary {
      background: #fff;
      color: var(--accent-dark);
    }

    .action-btn.review-button,
    .action-btn.skip-intro-button {
      background: #fff;
      color: var(--accent-dark);
      border-color: #7d8b98;
      box-shadow: 3px 3px 0 #7d8b98;
      font-size: 19px;
      opacity: 0.88;
    }

    .action-btn.review-button:hover,
    .action-btn.review-button:focus-visible,
    .action-btn.skip-intro-button:hover,
    .action-btn.skip-intro-button:focus-visible {
      opacity: 1;
      background: #f4f8f6;
    }

    .action-btn.skip-intro-button.seen-before {
      border-color: #2e766d;
      box-shadow: 3px 3px 0 #2e766d;
      opacity: 1;
    }

    .action-btn.map-start-button {
      background: linear-gradient(180deg, #3f8f83, #2e766d);
      box-shadow: 4px 4px 0 var(--line), inset 0 -4px 0 rgba(25, 38, 52, 0.16);
    }

    .action-btn.report-button {
      background: linear-gradient(180deg, #4e8fa8, #2f6f8f);
      box-shadow: 4px 4px 0 var(--line), inset 0 -4px 0 rgba(25, 38, 52, 0.16);
    }

    .action-btn.report-button:hover,
    .action-btn.report-button:focus-visible {
      filter: brightness(1.05);
    }

    .action-btn:hover,
    .action-btn:focus-visible {
      outline: 4px solid var(--focus);
      animation-play-state: paused;
    }

    .start-button.pico-button {
      position: relative;
      overflow: visible;
      background: linear-gradient(180deg, #3f8f83, #2e766d);
      padding: 10px 26px 10px 46px;
      min-height: 60px;
      font-size: clamp(20px, 2.2vw, 26px);
      box-shadow: 4px 4px 0 var(--line), inset 0 -4px 0 rgba(25, 38, 52, 0.18);
      animation: picoStart 1.55s ease-in-out infinite;
      transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
    }

    .start-button.pico-button::before {
      content: "▶";
      position: absolute;
      left: 18px;
      top: 50%;
      transform: translateY(-50%);
      color: #fff6cf;
      font-size: 18px;
      line-height: 1;
      animation: picoArrow 1.55s ease-in-out infinite;
    }

    .start-button.pico-button:hover,
    .start-button.pico-button:focus-visible {
      animation: none;
      filter: brightness(1.06);
      transform: translateY(-2px);
      box-shadow: 5px 5px 0 var(--line), inset 0 -4px 0 rgba(25, 38, 52, 0.14);
    }

    .start-button.pico-button:active {
      animation: none;
      transform: translateY(1px);
      box-shadow: 2px 2px 0 var(--line), inset 0 3px 0 rgba(25, 38, 52, 0.18);
    }

    @keyframes picoStart {
      0%, 100% { transform: translateY(0) scale(1); }
      50% { transform: translateY(-2px) scale(1.01); }
    }

    @keyframes picoArrow {
      0%, 100% { transform: translateY(-50%) translateX(0); }
      50% { transform: translateY(-50%) translateX(2px); }
    }

    @keyframes floatSoft {
      0%, 100% { transform: translateY(0); }
      50% { transform: translateY(-2px); }
    }

    @media (prefers-reduced-motion: reduce) {
      .start-button.pico-button,
      .start-button.pico-button::before,
      .action-btn,
      .choice,
      .reflection-btn,
      .epilogue-btn,
      .profile-button,
      .stat.changed,
      .meter-fill.animate-status-bar,
      .typewriter-active::after,
      .typewriter-trigger,
      .progressive-trigger {
        animation: none;
      }

      .meter-fill {
        transition: none;
      }
    }

    .status-panel {
      padding: 18px;
      display: grid;
      gap: 16px;
      align-content: start;
    }

    .status-panel h2 {
      font-size: 26px;
      color: var(--ink);
      border-bottom: 3px solid var(--line);
      padding-bottom: 8px;
    }

    .status-group {
      display: grid;
      gap: 8px;
    }

    .status-group + .status-group {
      margin-top: 4px;
      padding-top: 12px;
      border-top: 2px dashed rgba(35, 45, 58, 0.3);
    }

    .status-group-title {
      display: inline-flex;
      align-items: center;
      width: fit-content;
      min-height: 28px;
      padding: 2px 10px;
      border: 2px solid var(--line);
      background: #f6fbf8;
      color: var(--accent-dark);
      font-size: 16px;
      font-weight: 900;
      line-height: 1.35;
      box-shadow: 2px 2px 0 rgba(35, 45, 58, 0.18);
    }

    .stat {
      display: grid;
      gap: 6px;
      position: relative;
      padding: 8px;
      border: 2px solid transparent;
      transition: background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
    }

    .stat.changed {
      animation: statPulse 900ms ease;
    }

    .stat.changed.improve {
      background: #e8f4ff;
      border-color: #3f8fd2;
      box-shadow: 0 0 0 3px rgba(63, 143, 210, 0.16), 0 0 18px rgba(63, 143, 210, 0.18);
    }

    .stat.changed.decline {
      background: #fff0f0;
      border-color: #c96868;
      box-shadow: 0 0 0 3px rgba(201, 104, 104, 0.14), 0 0 18px rgba(201, 104, 104, 0.16);
    }

    .stat.maze.changed.improve,
    .stat.anxiety.changed.improve {
      background: #e8f4ff;
      border-color: #3f8fd2;
    }

    .stat.maze.changed.decline,
    .stat.anxiety.changed.decline {
      background: #fff0f0;
      border-color: #c96868;
    }

    .change-badge {
      color: #fff;
      background: #2f7fbf;
      border: 2px solid var(--line);
      padding: 0 6px;
      margin-left: auto;
      font-size: 13px;
      line-height: 1.5;
      white-space: nowrap;
    }

    .change-badge.down {
      background: #bf6262;
    }

    .stat.maze .change-badge,
    .stat.anxiety .change-badge {
      background: #bf6262;
    }

    .stat.maze .change-badge.down,
    .stat.anxiety .change-badge.down {
      background: #2f7fbf;
    }

    .status-delta {
      color: var(--ink);
      background: #fff;
      border: 2px solid currentColor;
      padding: 0 5px;
      font-size: 13px;
      line-height: 1.45;
      white-space: nowrap;
    }

    .stat.changed.improve .status-delta {
      color: #236ca5;
    }

    .stat.changed.decline .status-delta {
      color: #a44747;
    }

    @keyframes statPulse {
      0% { filter: brightness(1); }
      35% { filter: brightness(1.08); }
      100% { filter: brightness(1); }
    }

    @keyframes statusBarMove {
      from { width: var(--from-pct); }
      to { width: var(--to-pct); }
    }

    .stat-label {
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 8px;
      font-size: 17px;
      font-weight: 800;
    }

    .meter {
      height: 18px;
      border: 2px solid var(--line);
      background: #fff;
      overflow: hidden;
      position: relative;
    }

    .meter-fill {
      height: 100%;
      width: 0%;
      background: var(--accent);
      transition: width 780ms ease;
    }

    .meter-fill.animate-status-bar {
      animation: statusBarMove 780ms ease-out both;
    }

    .stat.changed.improve .meter-fill {
      background: #3f8fd2;
    }

    .stat.changed.decline .meter-fill {
      background: #c96868;
    }

    .stat.maze .meter-fill {
      background: var(--rose);
    }

    .stat.maze.changed.improve .meter-fill,
    .stat.anxiety.changed.improve .meter-fill {
      background: #3f8fd2;
    }

    .stat.maze.changed.decline .meter-fill,
    .stat.anxiety.changed.decline .meter-fill {
      background: #c96868;
    }

    .meter-before {
      position: absolute;
      top: 0;
      bottom: 0;
      left: var(--from-pct);
      border-left: 3px dashed rgba(23, 33, 31, 0.55);
      pointer-events: none;
    }

    .stat-help {
      color: var(--muted);
      font-size: 13px;
      line-height: 1.35;
    }

    .party-grid,
    .map-grid,
    .summary-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
    }

    .info-card {
      border: 3px solid var(--line);
      background: #fff;
      padding: 16px;
      display: grid;
      gap: 8px;
      min-height: 120px;
    }

    .info-card h3 {
      font-size: 24px;
      color: var(--ink);
    }

    .info-card p,
    .info-card li {
      font-size: 20px;
      line-height: 1.45;
    }

    .profile-grid {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 14px;
    }

    .profile-card {
      border: 3px solid var(--line);
      background: #fff;
      padding: 16px;
      display: grid;
      gap: 10px;
      box-shadow: 4px 4px 0 rgba(25, 38, 52, 0.14);
    }

    .profile-card h3 {
      font-size: 23px;
    }

    .profile-card p,
    .profile-card li {
      font-size: 18px;
      line-height: 1.45;
    }

    .profile-button {
      min-height: 48px;
      border: 3px solid var(--line);
      background: #2f6f73;
      color: #fff;
      cursor: pointer;
      font: inherit;
      font-size: 18px;
      font-weight: 900;
      padding: 8px 12px;
      box-shadow: 3px 3px 0 var(--line);
      animation: floatSoft 3.2s ease-in-out infinite;
    }

    .profile-button:hover,
    .profile-button:focus-visible {
      animation-play-state: paused;
      background: #d98c24;
      outline: 4px solid var(--focus);
    }

    .profile-note {
      border: 3px solid var(--line);
      border-left: 12px solid #2e766d;
      background: #f4f8f6;
      padding: 14px 18px;
    }

    ul {
      margin: 0;
      padding-left: 1.2em;
    }

    .result {
      border: 3px solid var(--line);
      background: #fff;
      padding: 18px 20px;
      display: grid;
      gap: 10px;
    }

    .result.good {
      border-left: 12px solid #d98c24;
      background: #fffaf0;
    }

    .result.warn {
      border-left: 12px solid #c79a3a;
      background: #fff8e8;
    }

    .result.bad {
      border-left: 12px solid #4f5870;
      background: #f4f6f8;
    }

    .route-cue {
      border: 3px solid var(--line);
      padding: 10px 14px;
      font-size: 21px;
      font-weight: 800;
      background: #fff8e8;
    }

    .route-cue.recovery {
      background: #e5f6ef;
    }

    .route-cue.caution {
      background: #faeecc;
    }

    .route-cue.maze {
      color: #fff;
      background: #4f5870;
    }

    .bias-note {
      border: 3px solid #7d5a86;
      background: #fbf4fc;
      padding: 12px 16px;
      display: grid;
      gap: 6px;
    }

    .bias-note h3 {
      color: #5d3b66;
      font-size: 22px;
    }

    .bias-note p {
      font-size: 20px;
      line-height: 1.45;
    }

    .learning-box,
    .change-box,
    .score-box,
    .style-box {
      border: 3px solid var(--line);
      background: var(--panel-soft);
      padding: 14px 18px;
      display: grid;
      gap: 8px;
    }

    .content.route-recommended .learning-box,
    .content.route-recommended .change-box {
      border-color: #b87820;
      background: #fff8e8;
    }

    .content.route-recovery .learning-box,
    .content.route-recovery .change-box {
      border-color: #4e9b74;
      background: #e5f6ef;
    }

    .content.route-caution .learning-box,
    .content.route-caution .change-box {
      border-color: #b1842d;
      background: #faeecc;
    }

    .content.route-maze .learning-box,
    .content.route-maze .change-box {
      border-color: #4f5870;
      background: #edf1f4;
    }

    .content.route-recommended .result,
    .content.route-recommended .result-visual {
      border-color: #b87820;
      background: #fffaf0;
    }

    .content.route-recovery .result,
    .content.route-recovery .result-visual {
      border-color: #4e9b74;
      background: #f1fbf6;
    }

    .content.route-caution .result,
    .content.route-caution .result-visual {
      border-color: #b1842d;
      background: #fff8e8;
    }

    .content.route-maze .result,
    .content.route-maze .result-visual {
      border-color: #4f5870;
      background: #f4f6f8;
    }

    .content.screen-boss .visual-row.boss {
      color: #fff;
      background: linear-gradient(180deg, #2a2b3e, #45465a);
      border-color: #1f2230;
    }

    .content.screen-boss .visual-row.boss .visual-caption strong,
    .content.screen-boss .visual-row.boss .visual-caption span {
      color: #fff;
    }

    .learning-box h3,
    .change-box h3,
    .score-box h3,
    .style-box h3 {
      font-size: 22px;
      color: var(--ink);
    }

    .change-box ul {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 4px 24px;
    }

    .change-box li,
    .score-box p,
    .style-box p,
    .style-box li {
      font-size: 20px;
      line-height: 1.45;
    }

    .style-title {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 10px;
    }

    .style-name {
      color: #fff;
      background: var(--blue);
      border: 2px solid var(--line);
      padding: 2px 10px;
      font-size: 21px;
      font-weight: 900;
    }

    .style-role-icons {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
      gap: 10px;
      margin: 2px 0 4px;
    }

    .style-role-icon {
      display: grid;
      grid-template-columns: 68px 1fr;
      align-items: center;
      gap: 10px;
      border: 2px solid var(--line);
      background: #fffaf0;
      padding: 8px 10px;
      box-shadow: 3px 3px 0 rgba(25, 38, 52, 0.12);
    }

    .style-role-icon img {
      width: 64px;
      height: 64px;
      object-fit: cover;
      object-position: top center;
      border: 2px solid var(--line);
      border-radius: 10px;
      background: #fff;
    }

    .style-role-icon strong {
      display: block;
      font-size: 20px;
      color: var(--ink);
      line-height: 1.2;
    }

    .style-role-icon span {
      display: block;
      margin-top: 2px;
      font-size: 16px;
      line-height: 1.35;
      color: var(--muted);
    }

    .history-list {
      display: grid;
      gap: 6px;
      padding-left: 1.2em;
    }

    .companion-reflection-grid {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 14px;
      margin-top: 8px;
    }

    .companion-card {
      border: 3px solid var(--line);
      background: #fffaf0;
      box-shadow: 4px 4px 0 rgba(25, 38, 52, 0.18);
      display: grid;
      grid-template-rows: auto auto 1fr auto;
      gap: 8px;
      padding: 12px;
      min-height: 100%;
    }

    .companion-card img {
      width: 100%;
      aspect-ratio: 1 / 1;
      object-fit: cover;
      object-position: top center;
      border: 3px solid var(--line);
      background: #fff;
    }

    .companion-card h3 {
      font-size: 23px;
      color: var(--ink);
    }

    .companion-card p {
      font-size: 18px;
      line-height: 1.35;
    }

    .reflection-btn {
      appearance: none;
      border: 3px solid var(--line);
      background: #2f6f73;
      color: #fff;
      cursor: pointer;
      font: inherit;
      font-size: 18px;
      font-weight: 900;
      padding: 8px 10px;
      box-shadow: 3px 3px 0 var(--line);
      transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
      animation: floatSoft 3.2s ease-in-out infinite;
    }

    .reflection-btn:hover,
    .reflection-btn:focus-visible {
      animation-play-state: paused;
      background: #d98c24;
      transform: translate(-1px, -1px);
      box-shadow: 4px 4px 0 var(--line);
      outline: none;
    }

    .reflection-prompt {
      border: 3px solid var(--line);
      border-left: 12px solid #d98c24;
      background: #fff8e8;
      padding: 16px 18px;
      display: grid;
      gap: 8px;
    }

    .reflection-prompt h3 {
      font-size: 23px;
      color: var(--ink);
    }

    .reflection-prompt p {
      font-size: 21px;
      line-height: 1.45;
    }

    .epilogue-action {
      display: flex;
      justify-content: center;
      margin: 8px 0 2px;
    }

    .epilogue-btn {
      appearance: none;
      border: 3px solid var(--line);
      background: linear-gradient(180deg, #f2c76e, #d98c24);
      color: #182635;
      cursor: pointer;
      font: inherit;
      font-size: 22px;
      font-weight: 900;
      padding: 12px 22px;
      min-height: 54px;
      box-shadow: 4px 4px 0 var(--line);
      transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
      animation: floatSoft 3.2s ease-in-out infinite;
    }

    .epilogue-btn:hover,
    .epilogue-btn:focus-visible {
      animation-play-state: paused;
      transform: translate(-1px, -1px);
      box-shadow: 5px 5px 0 var(--line);
      filter: brightness(1.04);
      outline: none;
    }

    .epilogue-panel {
      border: 3px solid var(--line);
      border-left: 12px solid #2f6f73;
      background: linear-gradient(180deg, #fffaf0, #f7fbf7);
      padding: 18px;
      display: none;
      gap: 16px;
      box-shadow: 4px 4px 0 rgba(25, 38, 52, 0.14);
    }

    .epilogue-panel.is-open {
      display: grid;
    }

    .epilogue-visual {
      border: 3px solid var(--line);
      background: #fffaf0;
      overflow: hidden;
      min-height: 160px;
      margin: 4px 0 6px;
      position: relative;
    }

    .epilogue-visual img {
      display: block;
      width: 100%;
      max-width: 100%;
      height: auto;
      object-fit: contain;
      object-position: center;
      background: #fff;
    }

    .epilogue-visual.missing-image::before {
      content: "エピローグ画像を assets/images/epilogue_question_map.png に置くと、ここに表示されます。";
      position: absolute;
      inset: 0;
      display: grid;
      place-items: center;
      padding: 20px;
      color: var(--muted);
      font-size: 18px;
      text-align: center;
      background: #edf1f4;
    }

    .epilogue-visual.missing-image img {
      visibility: hidden;
    }

    .epilogue-text {
      display: grid;
      gap: 12px;
    }

    .epilogue-text p {
      font-size: 21px;
      line-height: 1.7;
    }

    .karakuchi-master-card {
      display: grid;
      grid-template-columns: 116px 1fr;
      gap: 14px;
      align-items: center;
      border: 3px solid var(--line);
      background: #fbfcfa;
      padding: 12px;
      box-shadow: 4px 4px 0 rgba(25, 38, 52, 0.12);
    }

    .karakuchi-master-card img {
      width: 116px;
      height: 116px;
      border: 3px solid var(--line);
      background: #fff;
      object-fit: cover;
      object-position: top center;
    }

    .karakuchi-master-card strong {
      display: inline-block;
      color: #583f49;
      font-size: 22px;
      font-weight: 900;
      margin-bottom: 4px;
    }

    .karakuchi-master-card p {
      margin: 0;
      color: var(--muted);
      font-size: 18px;
      line-height: 1.55;
    }

    .next-labyrinth {
      margin-top: 4px;
      border-top: 2px solid #d8dfdc;
      padding-top: 12px;
      color: #2f6f73;
      font-size: 22px;
      font-weight: 900;
      text-align: center;
    }

    .highscore {
      color: var(--rose);
      font-weight: 900;
    }

    .status-note {
      font-size: 18px;
      color: var(--muted);
      border-top: 2px solid #d8dfdc;
      padding-top: 12px;
    }

    .footer-hint {
      color: var(--muted);
      font-size: 17px;
      margin-top: 6px;
    }

    @media (max-width: 1180px) and (min-width: 961px) {
      .companion-reflection-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
      }
    }

    @media (max-width: 960px) {
      .app {
        padding: 14px;
      }

      .site-header {
        gap: 8px;
        padding-bottom: 6px;
      }

      .topbar {
        grid-template-columns: 1fr;
        gap: 8px;
      }

      .brand h1 {
        white-space: normal;
      }

      .version-badge {
        margin-left: 4px;
        font-size: 12px;
        padding: 0 6px;
      }

      .quest-nav {
        padding: 7px;
      }

      .quest-nav ol {
        justify-content: center;
        gap: 5px;
      }

      .quest-nav li + li::before {
        margin-right: 5px;
      }

      .quest-nav span {
        min-height: 30px;
        padding: 3px 7px;
        font-size: 13px;
      }

      .stage {
        grid-template-columns: 1fr;
      }

      .main-panel {
        min-height: auto;
      }

      .actions {
        padding: 0 18px 22px;
      }

      .start-button.pico-button {
        width: 100%;
        justify-content: center;
        padding-right: 18px;
      }

      .party-grid,
      .map-grid,
      .summary-grid,
      .profile-grid {
        grid-template-columns: 1fr;
      }

      .companion-reflection-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
      }

      .epilogue-btn {
        width: 100%;
        font-size: 20px;
      }

      .epilogue-panel {
        padding: 14px;
      }

      .epilogue-text p {
        font-size: 19px;
        line-height: 1.65;
      }

      .karakuchi-master-card {
        grid-template-columns: 84px 1fr;
      }

      .karakuchi-master-card img {
        width: 84px;
        height: 84px;
      }

      .visual-row {
        grid-template-columns: 1fr;
      }

      .growth-track {
        grid-template-columns: 1fr;
      }

      .portrait-card {
        grid-template-columns: 1fr;
      }
    }
  
