:root {
  color-scheme: light;
  --paper: #ffffff;
  --sheet: #ffffff;
  --ink: #282d2a;
  --muted: #6c736d;
  --line: #d9ddd7;
  --red: #a33232;
  --sans: 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic', 'Meiryo', sans-serif;
  --serif: 'Yu Mincho', 'Hiragino Mincho ProN', 'Noto Serif CJK JP', 'Noto Serif JP', 'MS PMincho', serif;
}
* { box-sizing: border-box; }
html { font-size: 16px; height: 100%; }
body { margin: 0; min-width: 280px; background: var(--paper); color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: wait; }
button:focus-visible, summary:focus-visible, a:focus-visible, [tabindex='0']:focus-visible { outline: 2px solid var(--ink); outline-offset: 5px; }
::selection { background: #d7ded5; color: #161a17; }
h1, h2, h3, p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.frame { width: min(1120px, calc(100% - 112px)); margin: 0 auto; }
.site-header { min-height: 109px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.brand { font-family: var(--serif); font-size: 1.3rem; font-weight: 500; letter-spacing: .17em; white-space: nowrap; }
.header-tools { display: flex; align-items: center; gap: 32px; }
.contract-timer { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.timer-pie { --timer-angle: 360deg; display: block; width: 36px; height: 36px; border-radius: 50%; background: conic-gradient(var(--ink) var(--timer-angle), var(--line) 0deg); }
.timer-label { min-width: 35px; font-size: 1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.timer-unit { margin-left: 3px; font-size: .875rem; color: var(--muted); }
.progress { display: flex; align-items: center; gap: 24px; }
.progress-count { color: var(--muted); font-size: .875rem; white-space: nowrap; }
.progress-count strong { font-size: 1rem; color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; margin: 0 4px 0 10px; }
.progress-boxes { display: flex; gap: 5px; }
.progress-box { width: 10px; height: 10px; border: 1px solid #afb6ae; }
.progress-box.filled { border-color: var(--ink); background: var(--ink); }
.title-danger { color: var(--red); }
.frame.frame-intro { width: 100%; }
.intro { position: relative; isolation: isolate; min-height: 100svh; display: flex; flex-direction: column; background: #10100e; color: #f5f5f2; padding: 0 28px; }
.intro-image { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 57%; }
.intro::before { content: ''; position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, rgb(0 0 0 / 68%), rgb(0 0 0 / 43%) 65%, rgb(0 0 0 / 25%)); }
.intro-content { width: min(540px, 100%); margin: auto; padding: 68px 0 84px; }
.intro .title-danger { color: #e25149; }
.intro .button-primary { background: rgb(12 12 10 / 45%); border-color: #deded8; color: #f5f5f2; }
.intro .button-primary:hover { background: #f5f5f2; border-color: #f5f5f2; color: #282d2a; }
.intro button:focus-visible { outline-color: #f5f5f2; }
.intro h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(3.3rem, 6vw, 4.8rem); letter-spacing: .16em; line-height: 1.5; margin-left: -.08em; }
.intro-instructions { margin-top: 32px; font-size: 1rem; line-height: 2; letter-spacing: .02em; }
.intro-start { margin-top: 45px; min-width: 225px; }
.intro .intro-start { display: flex; width: fit-content; margin-left: auto; margin-right: auto; }
.intro-notes { margin-top: 16px; font-size: .75rem; line-height: 1.9; text-align: center; color: #a3a3a3; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; border: 1px solid var(--ink); border-radius: 0; padding: 15px 32px; font-size: .9375rem; letter-spacing: .1em; transition: background .18s, color .18s, opacity .18s; text-decoration: none; line-height: 1.5; }
.button-primary { background: var(--ink); color: #f8f9f5; }
.button-primary:hover { background: #454e46; border-color: #454e46; }
.button-secondary { background: transparent; color: var(--ink); border-color: #929b92; }
.button-secondary:hover { background: #e9ede6; }
.quiet-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 0 28px; color: var(--muted); font-size: .75rem; letter-spacing: .04em; line-height: 1.8; }
.game { height: calc(100svh - 109px); min-height: 510px; max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; }
.document-masthead { flex-shrink: 0; padding: 30px 0 22px; display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; }
.service-identity { display: flex; align-items: center; gap: 16px; min-width: 0; }
.service-identity > div { min-width: 0; }
.service-icon { display: block; width: 56px; height: 56px; border-radius: 22%; flex-shrink: 0; }
.category { color: var(--muted); font-size: .8125rem; letter-spacing: .045em; margin-bottom: 8px; line-height: 1.6; }
.service-name { font-weight: 500; font-size: 1.55rem; line-height: 1.5; letter-spacing: .06em; }

.document-wrap { background: var(--sheet); border: 1px solid var(--line); position: relative; display: flex; flex-direction: column; min-height: 0; flex: 1; }
.document-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 42px 50px 50px; scrollbar-width: thin; scrollbar-color: #adb6ab transparent; }
.document-scroll::-webkit-scrollbar { width: 6px; }
.document-scroll::-webkit-scrollbar-thumb { background: #adb6ab; }
.document-heading { margin-bottom: 34px; border-bottom: 1px solid var(--line); padding-bottom: 30px; }
.document-heading h1 { font-family: var(--serif); font-weight: 500; font-size: 1.8rem; letter-spacing: .2em; line-height: 1.7; }
.document-description { margin-top: 13px; font-size: .875rem; line-height: 1.9; color: var(--muted); }
.article { margin-top: 30px; }
.article h2 { font-size: 1rem; font-weight: 600; line-height: 1.9; letter-spacing: .015em; }
.article ol { margin: 14px 0 0; padding: 0; list-style-type: none; counter-reset: paragraph; }
.article li { position: relative; padding-left: 1.65em; margin-top: 11px; font-size: 1rem; line-height: 2.05; letter-spacing: .025em; overflow-wrap: anywhere; }
.article li::before { counter-increment: paragraph; content: counter(paragraph) '.'; position: absolute; left: 0; top: .06em; font-size: .8125rem; font-variant-numeric: tabular-nums; color: var(--muted); }
.document-end { text-align: right; margin-top: 40px; font-size: .875rem; letter-spacing: .16em; }

.decision-area { display: flex; justify-content: space-between; align-items: center; gap: 22px; padding: 22px 0 max(26px, env(safe-area-inset-bottom)); flex-shrink: 0; }
.decision-note { color: var(--muted); font-size: .8125rem; line-height: 1.8; }
.decision-buttons { display: flex; gap: 12px; }
.decision-buttons .button { min-width: 183px; }
.changing .document-wrap, .changing .document-masthead { opacity: .2; }
.document-wrap, .document-masthead { transition: opacity .2s; }
.view-enter { animation: enter .4s ease-out both; }
@keyframes enter { from { opacity: 0; } to { opacity: 1; } }
.results { max-width: 820px; margin: 0 auto; padding: 58px 0 0; }
.result-masthead { display: flex; justify-content: space-between; gap: 30px; align-items: flex-end; padding-bottom: 32px; }
.results h1 { font-family: var(--serif); font-weight: 500; font-size: 2.4rem; line-height: 1.5; letter-spacing: .13em; }
.result-total { color: var(--muted); font-size: .875rem; white-space: nowrap; padding-bottom: 8px; }
.result-total strong { font-size: 1.8rem; font-weight: 400; line-height: 1; color: var(--ink); margin-right: 7px; }
.result-message { border-top: 1px solid var(--line); padding: 27px 0; }
.result-message p:first-child { font-size: 1rem; line-height: 1.8; }
.result-message p + p { margin-top: 9px; font-size: .8125rem; line-height: 1.9; color: var(--muted); }
.result-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.result-empty { padding: 35px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .9375rem; line-height: 1.9; color: var(--muted); }
.rejected-anomalies { margin-top: 38px; }
.result-section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; font-size: 1rem; font-weight: 500; line-height: 1.8; letter-spacing: .035em; }
.result-section-title span { color: var(--muted); font-size: .8125rem; font-weight: 400; white-space: nowrap; }
.result-item { border-bottom: 1px solid var(--line); }
.result-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 25px 0 22px; }
.result-row .service-icon { width: 44px; height: 44px; }
.result-name { font-size: 1rem; font-weight: 500; line-height: 1.7; letter-spacing: .045em; }
.result-kind { font-size: .75rem; color: var(--muted); margin-left: 12px; font-weight: 400; letter-spacing: 0; }
.result-outcome { font-size: .9375rem; line-height: 1.9; margin-top: 7px; }
.result-tag { font-size: .75rem; padding: 3px 8px; border: 1px solid var(--line); white-space: nowrap; line-height: 1.6; margin-top: 1px; }
.result-item.harmful .result-name, .result-item.harmful .result-outcome, .result-item.harmful .result-tag { color: var(--red); }
.result-item.harmful .result-tag { border-color: #d9b8b5; }
.result-message .unfavorable { color: var(--red); }
.evidence { margin: -4px 0 24px 60px; }
.evidence summary { display: flex; align-items: center; gap: 7px; width: fit-content; cursor: pointer; list-style: none; font-size: .8125rem; color: var(--muted); padding: 4px 0; line-height: 1.7; }
.evidence summary::-webkit-details-marker { display: none; }
.evidence summary::before { content: '+'; font-size: .9375rem; line-height: 1; width: 11px; }
.evidence[open] summary::before { content: '−'; }
.evidence-content { margin-top: 14px; padding: 21px 24px; border-left: 2px solid #bfc7bd; background: #ecefe9; }
.harmful .evidence-content { background: #f2eae7; border-left-color: #b65d54; }
.evidence-title { font-size: .8125rem; line-height: 1.8; font-weight: 500; }
.evidence blockquote { margin: 12px 0 0; font-size: .9375rem; line-height: 2; overflow-wrap: anywhere; }
.evidence-explanation { margin-top: 17px; padding-top: 15px; border-top: 1px solid #d5d8d0; font-size: .875rem; line-height: 1.9; }
.result-actions { padding: 38px 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.result-recap { font-size: .8125rem; color: var(--muted); line-height: 1.9; }
.result-actions .button { min-width: 190px; }
.result-buttons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.result-score { margin-bottom: 12px; font-size: 1.125rem; font-variant-numeric: tabular-nums; }
@media (min-width: 1500px) { .document-scroll { padding-left: 62px; padding-right: 62px; } }
@media (max-width: 780px) {
  .frame { width: calc(100% - 48px); }
  .site-header { min-height: 82px; }
  .header-tools { gap: 22px; }
  .intro-content { padding: 50px 0 70px; max-width: 450px; }
  .intro h1 { font-size: 3.6rem; }
  .progress { gap: 16px; }
  .progress-boxes { gap: 4px; }
  .progress-box { width: 8px; height: 8px; }
  .game { height: calc(100svh - 82px); min-height: 480px; }
  .document-masthead { padding-top: 23px; padding-bottom: 18px; }
  .document-scroll { padding: 29px 27px 35px; }
  .decision-note { display: none; }
  .decision-buttons { width: 100%; }
  .decision-buttons .button { flex: 1; min-width: 0; }
  .decision-area { padding-top: 17px; padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  .results { padding-top: 39px; }
}
@media (max-width: 480px) {
  .frame { width: calc(100% - 36px); }
  .site-header { min-height: 71px; gap: 12px; }
  .brand { font-size: 1.1rem; }
  .header-tools { gap: 16px; }
  .contract-timer { gap: 7px; }
  .timer-pie { width: 30px; height: 30px; }
  .timer-label { min-width: 32px; font-size: .9375rem; }
  .progress { gap: 10px; }
  .progress-count { font-size: .8125rem; }
  .progress-count strong { margin-left: 6px; }
  .progress-boxes { gap: 3px; }
  .progress-box { width: 6px; height: 9px; }
  .intro-content { padding: 54px 9px 60px; }
  .intro h1 { font-size: clamp(2.7rem, 12vw, 3.5rem); }
  .intro-start { margin-top: 33px; min-width: 200px; }
  .quiet-footer { padding: 20px 0; font-size: .75rem; gap: 12px; }
  .game { height: calc(100svh - 71px); min-height: 460px; }
  .document-masthead { padding-top: 20px; padding-bottom: 15px; gap: 15px; }
  .service-name { font-size: 1.3rem; }
  .category { font-size: .75rem; margin-bottom: 4px; }

  .document-scroll { padding: 24px 20px 32px; }
  .document-heading { margin-bottom: 25px; padding-bottom: 21px; }
  .document-heading h1 { font-size: 1.5rem; }
  .document-description { font-size: .8125rem; margin-top: 10px; }
  .article { margin-top: 26px; }
  .article ol { margin-top: 11px; }
  .article li { padding-left: 1.45em; line-height: 1.95; letter-spacing: .015em; }

  .decision-buttons { gap: 10px; }
  .decision-buttons .button { padding-left: 15px; padding-right: 15px; min-height: 53px; font-size: .875rem; }
  .result-masthead { padding-bottom: 24px; }
  .results h1 { font-size: 2rem; }
  .result-total strong { font-size: 1.5rem; }
  .result-row { grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; padding-top: 22px; }
  .result-kind { display: block; margin-left: 0; margin-top: 3px; }
  .result-tag { padding: 3px 5px; }
  .result-outcome { font-size: .875rem; }
  .evidence { margin-left: 46px; }
  .result-row .service-icon { width: 36px; height: 36px; }
  .service-identity { gap: 11px; }
  .service-identity .service-icon { width: 44px; height: 44px; }
  .evidence-content { padding: 16px; }
  .result-actions { flex-direction: column; align-items: stretch; padding-top: 30px; }
  .result-buttons { flex-direction: column; order: -1; }
}
@media (max-width: 360px) { .progress-boxes { display: none; } .result-tag { display: none; } .result-row { grid-template-columns: 36px minmax(0, 1fr); } }
@media (max-height: 600px) and (min-width: 600px) { .game { height: auto; min-height: 560px; } .document-scroll { max-height: 340px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media print { .decision-area, .result-actions, .progress-boxes { display: none; } .game { height: auto; } .document-scroll { overflow: visible; } .frame { width: 100%; } }

/* A single solid red screen appears immediately after a mistake. */
body.failed { background: #b12b2b; }
.failure-screen { position: fixed; inset: 0; min-height: 100svh; background: #b12b2b; z-index: 10; }
.timer-label { min-width: 44px; }

.author-footer { padding: 24px 0 32px; text-align: center; }
.author-button { border: 1px solid var(--line); background: #fff; color: var(--muted); padding: 8px 18px; font-size: .875rem; line-height: 1.5; }
.author-button:hover { color: var(--ink); border-color: var(--ink); }
.author-dialog { width: min(540px, calc(100% - 32px)); max-height: calc(100svh - 32px); margin: auto; overflow-y: auto; padding: 28px; border: 1px solid var(--line); background: #fff; color: var(--ink); box-shadow: 0 16px 64px rgb(0 0 0 / 18%); }
.author-dialog::backdrop { background: rgb(0 0 0 / 40%); }
.author-close { display: flex; justify-content: flex-end; margin: -8px -8px 14px 0; }
.author-close button { padding: 8px; background: transparent; border: 0; color: var(--muted); font-size: .875rem; }
.author-dialog h2 { font-size: 1rem; font-weight: 500; line-height: 1.8; }
.author-books { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 24px; }
.author-book { display: flex; flex-direction: column; min-width: 0; color: var(--ink); text-decoration: none; }
.book-label { min-height: 1.5em; font-size: .875rem; line-height: 1.5; color: var(--muted); margin-bottom: 8px; }
.author-book img { display: block; width: 100%; height: auto; aspect-ratio: 400 / 566; object-fit: contain; object-position: center bottom; }
.book-name { margin-top: 12px; font-size: .875rem; line-height: 1.7; overflow-wrap: anywhere; }
.book-edition { display: block; color: var(--muted); }
.author-book:hover .book-name { text-decoration: underline; text-underline-offset: 3px; }
.author-social { display: flex; justify-content: center; margin-top: 24px; }
.author-social a { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--ink); }
.author-social a:hover { color: var(--red); }
.author-social a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.game-terms-footer { padding: 0 0 24px; text-align: center; }
.game-terms-button { opacity: .45; padding: 10px 14px; border: 0; background: transparent; color: var(--muted); font-size: .75rem; line-height: 1.5; text-decoration: underline; text-underline-offset: 4px; }
.intro .game-terms-button { color: #deded8; }
.game-terms-button:hover, .game-terms-button:focus-visible { opacity: .8; }
.game-terms-dialog { width: min(640px, calc(100% - 32px)); text-align: left; }
.intro .game-terms-dialog button:focus-visible { outline-color: var(--ink); }
.game-terms-content section { margin-top: 24px; }
.game-terms-content h3 { font-size: .875rem; font-weight: 500; line-height: 1.8; }
.game-terms-content p { margin-top: 8px; font-size: .8125rem; line-height: 2; }
@media (max-width: 480px) { .author-dialog { padding: 20px; } .author-books { gap: 16px; } }
@media print { .author-footer, .author-dialog { display: none; } }

.quota-start-area { margin-top: 28px; text-align: center; }
.quota-start-area .button { min-width: 225px; }
.quota-start-area p { margin-top: 12px; font-size: .75rem; line-height: 1.9; color: #a3a3a3; }
.quota-clock { font-variant-numeric: tabular-nums; white-space: nowrap; }
.quota-result-time { margin-top: 28px; line-height: 1.8; }
.quota-result-time strong { font-size: 2.5rem; font-weight: 400; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .quota-tools { gap: 10px; font-size: .8125rem; } }
