/* Hinoki website. Cypress green and paper from the app icon, hinoki wood as the one accent. */

:root {
  --bg: #16241d;
  --surface: #1c2e25;
  --surface-2: #22392e;
  --line: #31493d;
  --text: #f1e6d2;
  --muted: #b3ab99;
  --wood: #d9b77e;
  --wood-ink: #1b2a22;
  --link: #e7cd9f;
  --focus: #f3d79f;

  --s-playable: #7fc48a;
  --s-ingameplus: #b9d27a;
  --s-ingameminus: #e3c766;
  --s-menu: #e7a65a;
  --s-intro: #dc8a5c;
  --s-boots: #c9745f;
  --s-crashes: #b9606f;
  --s-broken: #8d938f;

  --serif: "Shippori Mincho", "Hiragino Mincho ProN", "Yu Mincho", Georgia, serif;
  --sans: "Zen Kaku Gothic New", "Hiragino Sans", system-ui, -apple-system, sans-serif;

  --measure: 68ch;
  --radius-s: 6px;
  --radius-m: 12px;
  --radius-l: 22px;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4ecdd;
    --surface: #ece1cc;
    --surface-2: #e4d6bb;
    --line: #cdbd9e;
    --text: #1d2f26;
    --muted: #5c6b61;
    --wood: #8a5f22;
    --wood-ink: #f4ecdd;
    --link: #7a5016;
    --focus: #8a5f22;
    --s-playable: #2f7d43;
    --s-ingameplus: #5f7f1f;
    --s-ingameminus: #8f7410;
    --s-menu: #a35e12;
    --s-intro: #a24c25;
    --s-boots: #9b3f2f;
    --s-crashes: #8e2f45;
    --s-broken: #5d6561;
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 17px/1.65 var(--sans);
  font-feature-settings: "palt" 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; margin: 0 0 0.5em; letter-spacing: 0.005em; }
h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); font-weight: 800; line-height: 1.08; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.22rem; }
p { margin: 0 0 1em; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 44ch; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
.prose { max-width: var(--measure); }
.prose h2 { margin-top: 2.2em; }
.prose h3 { margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: 0.4em; }
code, kbd { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.88em; background: var(--surface-2); padding: 0.1em 0.38em; border-radius: 5px; }
.copy-row { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; margin: 0.6em 0 1.2em; }
.copy-row code { flex: 1 1 320px; padding: 0.7em 0.9em; overflow-wrap: anywhere; border: 1px solid var(--line); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--wood); color: var(--wood-ink); padding: 8px 14px; border-radius: var(--radius-s); z-index: 50; }
.skip:focus { left: 12px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--serif); font-weight: 800; font-size: 1.3rem; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.nav { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav a { color: var(--text); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-size: 0.97rem; }
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--surface-2); color: var(--wood); }
.menu-button { display: none; margin-left: auto; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 7px 14px; font: inherit; }

@media (max-width: 860px) {
  .menu-button { display: inline-block; }
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 20px 16px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 10px; border-radius: var(--radius-s); }
  .nav .button { text-align: center; margin-top: 6px; }
}

/* Buttons */
.button { display: inline-flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 999px; font: 500 1rem/1.2 var(--sans); text-decoration: none; border: 1px solid var(--line); color: var(--text); background: transparent; cursor: pointer; }
.button:hover { background: var(--surface-2); text-decoration: none; }
.button.primary { background: var(--wood); color: var(--wood-ink); border-color: var(--wood); font-weight: 700; }
.button.primary:hover { filter: brightness(1.06); background: var(--wood); }
.button small { font-weight: 400; opacity: 0.8; }
.nav .button.primary { padding: 8px 16px; color: var(--wood-ink); }
.nav .button.primary:hover { background: var(--wood); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 1.6em 0 0.8em; }

/* Hero */
.hero { position: relative; padding: clamp(40px, 7vw, 90px) 0 30px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: auto 1fr; gap: clamp(20px, 5vw, 64px); align-items: start; }
.kanji {
  font-family: var(--serif); font-weight: 800; color: var(--wood);
  writing-mode: vertical-rl; font-size: clamp(7rem, 17vw, 15rem); line-height: 0.9;
  margin: 0; user-select: none;
  animation: grow 1.1s cubic-bezier(.2,.7,.2,1) both;
}
.kanji span { display: block; font-size: 0.13em; font-family: var(--sans); font-weight: 500; letter-spacing: 0.3em; color: var(--muted); margin-top: 0.8em; writing-mode: vertical-rl; }
@keyframes grow { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hero h1 { max-width: 15ch; margin-top: 0.2em; }
.release-line { font-size: 0.95rem; color: var(--muted); margin: 0; }
.hero-shot { margin-top: clamp(30px, 5vw, 56px); border-radius: var(--radius-l); overflow: hidden; border: 1px solid var(--line); }
@media (max-width: 640px) {
  .hero-grid { grid-template-columns: 1fr; }
  .kanji { writing-mode: horizontal-tb; font-size: 5.5rem; line-height: 1; }
  .kanji span { display: inline; writing-mode: horizontal-tb; font-size: 0.17em; margin: 0 0 0 0.6em; letter-spacing: 0.15em; vertical-align: middle; }
}

/* Sections */
.section { padding: clamp(56px, 8vw, 100px) 0; }
.section + .section { border-top: 1px solid var(--line); }
.page-head { padding: clamp(40px, 6vw, 72px) 0 10px; }
.page-head h1 { font-size: clamp(2.1rem, 4.4vw, 3.2rem); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.systems { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius-l); overflow: hidden; margin-top: 28px; }
.systems > div { padding: clamp(22px, 3.5vw, 36px); }
.systems > div + div { border-left: 1px solid var(--line); }
.systems h3 { font-size: 1.5rem; }
.systems ul { list-style: none; padding: 0; margin: 0; }
.systems li { padding: 10px 0; border-top: 1px solid var(--line); }
.systems li:first-child { border-top: 0; }
.systems li b { font-weight: 700; display: block; }
@media (max-width: 760px) { .systems { grid-template-columns: 1fr; } .systems > div + div { border-left: 0; border-top: 1px solid var(--line); } }

.both { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px 40px; margin-top: 48px; padding-top: 36px; border-top: 1px solid var(--line); }
.both h3 { font-family: var(--sans); font-size: 1.05rem; font-weight: 700; margin-bottom: 0.3em; }
.both p { color: var(--muted); margin: 0; font-size: 0.97rem; }
@media (max-width: 860px) { .both { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .both { grid-template-columns: 1fr; } }

.figure { border-radius: var(--radius-l); overflow: hidden; border: 1px solid var(--line); margin: 0; }
.figure + figcaption, .caption { font-size: 0.88rem; color: var(--muted); margin-top: 10px; }

/* Install steps: a real sequence */
.steps { list-style: none; padding: 0; margin: 28px 0 0; counter-reset: step; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 34px 64px; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--serif); font-weight: 800; font-size: 1.15rem;
  background: var(--surface-2); color: var(--wood); border: 1px solid var(--line);
}
.steps > li::after { content: ""; position: absolute; left: 20px; top: 46px; bottom: 6px; width: 1px; background: var(--line); }
.steps > li:last-child::after { display: none; }
.steps h3 { font-family: var(--sans); font-size: 1.15rem; margin: 6px 0 0.4em; }

.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin: 14px 0 6px; }
.choice { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px 18px; background: var(--surface); }
.choice h4 { margin: 0 0 4px; font-size: 1rem; }
.choice p { margin: 0; color: var(--muted); font-size: 0.94rem; }

.note { border-left: 3px solid var(--wood); background: var(--surface); padding: 14px 18px; border-radius: 0 var(--radius-m) var(--radius-m) 0; margin: 1.2em 0; }
.note p:last-child { margin: 0; }

.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); margin: 8px 0 18px; flex-wrap: wrap; }
.tabs button { font: 500 0.95rem var(--sans); color: var(--text); background: none; border: 0; padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--wood); color: var(--wood-ink); }
[role="tabpanel"][hidden] { display: none; }

/* Guide index */
.toc { position: sticky; top: 88px; font-size: 0.95rem; }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 6px 14px; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--text); }
.guide { display: grid; grid-template-columns: 220px 1fr; gap: 56px; }
@media (max-width: 900px) { .guide { grid-template-columns: 1fr; } .toc { position: static; } }

/* FAQ */
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; padding: 18px 40px 18px 0; font-weight: 700; font-size: 1.07rem; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 6px; top: 12px; font: 400 1.6rem var(--sans); color: var(--wood); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 0 18px; max-width: var(--measure); color: var(--text); }
.faq h2 { margin-top: 1.8em; font-size: 1.4rem; }

/* Status pills and the compatibility list */
.status { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 0.9rem; white-space: nowrap; }
.status::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--s-broken)); flex: none; }
.st-playable { --c: var(--s-playable); }
.st-ingameplus { --c: var(--s-ingameplus); }
.st-ingameminus { --c: var(--s-ingameminus); }
.st-menu { --c: var(--s-menu); }
.st-intro { --c: var(--s-intro); }
.st-boots { --c: var(--s-boots); }
.st-crashes { --c: var(--s-crashes); }
.st-broken { --c: var(--s-broken); }

.meter { display: flex; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-2); margin: 14px 0 10px; }
.meter span { background: var(--c); min-width: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0; padding: 0; list-style: none; font-size: 0.92rem; }
.legend b { font-variant-numeric: tabular-nums; }

.statuses { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 28px; margin-top: 14px; }
.statuses div { padding: 10px 0; border-top: 1px solid var(--line); }
.statuses p { margin: 4px 0 0; color: var(--muted); font-size: 0.94rem; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 26px 0 14px; }
.search { flex: 1 1 260px; position: relative; }
.search input { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 11px 18px; }
.search input::placeholder { color: var(--muted); }
select, .field input, .field textarea, .field select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; }
.toolbar select { border-radius: 999px; padding: 10px 14px; }

.game-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.game-list li { border-bottom: 1px solid var(--line); }
.game-row { display: grid; grid-template-columns: 1fr 150px 120px 110px; gap: 14px; align-items: center; width: 100%; text-align: left; background: none; border: 0; color: inherit; font: inherit; padding: 14px 6px; cursor: pointer; }
.game-row:hover { background: var(--surface); }
.game-row .name { font-weight: 700; }
.game-row .name small { display: block; font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.game-row .sys, .game-row .count { color: var(--muted); font-size: 0.9rem; }
@media (max-width: 640px) { .game-row { grid-template-columns: 1fr auto; } .game-row .sys, .game-row .count { display: none; } }

.empty { padding: 48px 0; max-width: 52ch; }
.empty h3 { font-size: 1.4rem; }

dialog.game { width: min(760px, 100% - 24px); max-height: min(90vh, 1000px); border: 1px solid var(--line); border-radius: var(--radius-l); background: var(--bg); color: var(--text); padding: 0; }
dialog.game::backdrop { background: rgba(8, 14, 11, 0.7); }
dialog.game header { position: sticky; top: 0; background: var(--bg); padding: 22px 24px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 14px; align-items: start; }
dialog.game header h2 { font-size: 1.6rem; margin: 0 0 4px; }
dialog.game .close { margin-left: auto; }
dialog.game .body { padding: 8px 24px 24px; }
.report { padding: 18px 0; border-bottom: 1px solid var(--line); }
.report:last-child { border-bottom: 0; }
.report dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 18px; margin: 10px 0; font-size: 0.92rem; }
.report dt { color: var(--muted); font-size: 0.82rem; }
.report dd { margin: 0; }
.report .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin-top: 10px; }
.shots a { display: block; border-radius: var(--radius-s); overflow: hidden; border: 1px solid var(--line); }
.shots img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }

/* Report form */
.form { display: grid; gap: 18px; max-width: 760px; margin-top: 24px; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 640px) { .form .row { grid-template-columns: 1fr; } }
.field { display: grid; gap: 6px; }
.field label, .field legend { font-weight: 700; }
.field .hint { color: var(--muted); font-size: 0.88rem; margin: 0; }
.field textarea { min-height: 120px; resize: vertical; }
fieldset.field { border: 0; padding: 0; margin: 0; }
.status-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 8px; }
.status-pick label { display: flex; gap: 10px; align-items: start; border: 1px solid var(--line); border-radius: var(--radius-m); padding: 10px 12px; cursor: pointer; font-weight: 400; background: var(--surface); }
.status-pick input { margin-top: 5px; accent-color: var(--wood); }
.status-pick label:has(input:checked) { border-color: var(--wood); background: var(--surface-2); }
.status-pick .status { display: flex; }
.status-pick small { display: block; color: var(--muted); font-size: 0.82rem; line-height: 1.4; }
.form-error { color: var(--s-crashes); font-weight: 700; min-height: 1.4em; margin: 0; }

/* Releases */
.release { padding: 26px 0; border-top: 1px solid var(--line); }
.release h3 { font-size: 1.5rem; margin-bottom: 0.2em; }
.release .md { max-width: var(--measure); }
.release .md h4 { font-family: var(--sans); font-size: 1rem; margin: 1.2em 0 0.3em; color: var(--wood); }
.release .md ul { padding-left: 1.2em; margin: 0; }
.release .md li { margin-bottom: 0.3em; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--muted); font-size: 0.93rem; margin-top: 40px; }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 28px; }
.site-footer h2 { font: 700 0.95rem var(--sans); color: var(--text); margin-bottom: 0.6em; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr 1fr; } .site-footer .about { grid-column: 1 / -1; } }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tabs label.button { border: 0; padding: 8px 16px; position: relative; cursor: pointer; }
.tabs label.button input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.tabs label.button:has(input:checked) { background: var(--wood); color: var(--wood-ink); }
.tabs label.button:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.wrap.prose { max-width: none; }
.wrap.prose > * { max-width: var(--measure); }
.field { align-content: start; }
.tabs { border-radius: 20px; }
.steps.prose { max-width: 780px; }
