:root {
  --paper: #fbf8f3;
  --paper-strong: #ffffff;
  --ink: #201a16;
  --muted: #51463e;
  --brown: #5a3820;
  --brown-dark: #432817;
  --brown-soft: #eadfd4;
  --brown-pale: #f3ebe3;
  --line: #cbb8a6;
  --unity: #2b2d30;
  --unity-deep: #1e2023;
  --unity-line: #151618;
  --unity-text: #eeeeee;
  --unity-muted: #bfc1c5;
  --unity-blue: #2d6f9f;
  --warning: #73420f;
  --danger: #a33828;
  --body: "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.75;
}
a { color: var(--brown); text-underline-offset: .2em; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--brown); outline-offset: 3px; }
.skip-link { position: fixed; z-index: 100; top: -8rem; left: 1rem; padding: .7rem 1rem; color: #fff; background: var(--brown); }
.skip-link:focus { top: 1rem; }

.site-header { border-bottom: 1px solid var(--line); background: var(--paper-strong); }
.site-nav,
.hero-content,
.content-section,
footer {
  width: min(1360px, calc(100% - 64px));
  margin-inline: auto;
}
.site-nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-bottom: 1px solid var(--line);
}
.brand { color: var(--ink); font-size: 21px; font-weight: 800; text-decoration: none; letter-spacing: .02em; }
.brand span { margin-left: .7rem; color: var(--brown); font-size: 16px; font-weight: 700; }
.nav-links { display: flex; gap: 2rem; }
.nav-links a { color: var(--brown); font-weight: 700; text-decoration: none; }
.nav-links a:hover { text-decoration: underline; }
.hero-content { padding: 72px 0 64px; }
.section-label { margin: 0 0 .5rem; color: var(--brown); font-weight: 700; }
h1, h2, h3, h4, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(42px, 6vw, 76px); line-height: 1.18; letter-spacing: -.03em; }
.hero-content > p:not(.section-label) { max-width: 40em; margin: 1.5rem 0; font-size: 18px; }
.primary-action,
.expand-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: .65rem 1.25rem;
  color: #fff;
  background: var(--brown);
  border: 2px solid var(--brown);
  border-radius: 4px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.primary-action:hover,
.expand-button:hover { background: var(--brown-dark); border-color: var(--brown-dark); }
.environment { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 1rem; margin: 3rem 0 0; }
.environment div { padding: 1rem 1.1rem; background: var(--brown-pale); border-top: 4px solid var(--brown); }
.environment dt { color: var(--brown); font-weight: 700; }
.environment dd { margin: .15rem 0 0; font-weight: 700; }

.content-section { padding-top: 80px; padding-bottom: 80px; }
.flow-section { border-bottom: 1px solid var(--line); }
.section-heading { display: grid; grid-template-columns: minmax(240px, .7fr) minmax(300px, 1fr); align-items: end; gap: 3rem; margin-bottom: 2rem; }
.section-heading h2 { margin: 0; padding-bottom: .65rem; border-bottom: 5px solid var(--brown); font-size: clamp(32px, 4vw, 48px); line-height: 1.25; }
.section-heading p { max-width: 40em; margin: 0; }
.route { display: grid; grid-template-columns: repeat(3, 1fr); padding: 0; margin: 0; list-style: none; border: 1px solid var(--line); background: var(--paper-strong); }
.route li { min-height: 150px; display: grid; grid-template-columns: 52px 1fr; gap: 1rem; padding: 1.4rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.route li:nth-child(3n) { border-right: 0; }
.route li:nth-last-child(-n + 3) { border-bottom: 0; }
.route li > span { width: 42px; height: 42px; display: grid; place-items: center; color: #fff; background: var(--brown); border-radius: 50%; font-weight: 800; }
.route strong { font-size: 18px; }
.route p { margin: .35rem 0 0; }

.toc-drawer { margin-bottom: 2rem; background: var(--paper-strong); border: 1px solid var(--line); }
.toc-drawer summary { min-height: 58px; display: flex; align-items: center; gap: 1rem; padding: .75rem 1rem; color: var(--brown); font-weight: 800; cursor: pointer; }
.toc-drawer summary small { margin-left: auto; color: var(--ink); font-size: 15px; }
.toc { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; padding: 1rem; border-top: 1px solid var(--line); }
.toc-group { grid-column: 1 / -1; margin-top: .75rem; padding-top: .75rem; color: var(--brown); border-top: 1px solid var(--line); font-weight: 800; }
.toc-group:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.toc button { min-height: 48px; display: grid; grid-template-columns: 2.2rem 1fr; align-items: center; gap: .5rem; padding: .55rem .75rem; color: var(--ink); background: var(--paper); border: 1px solid var(--line); text-align: left; cursor: pointer; line-height: 1.45; }
.toc button span { color: var(--brown); font-weight: 800; }
.toc button b { font-size: 15px; }
.toc button:hover { border-color: var(--brown); }
.toc button.active { color: #fff; background: var(--brown); border-color: var(--brown); }
.toc button.active span { color: #fff; }

.player-column { min-width: 0; }
.step-status { display: grid; grid-template-columns: auto auto minmax(160px, 1fr); align-items: center; gap: 1.2rem; margin-bottom: 1rem; color: var(--brown); font-weight: 800; }
.progress-track { height: 5px; overflow: hidden; background: var(--brown-soft); border-radius: 5px; }
.progress-track i { display: block; width: 0; height: 100%; background: var(--brown); transition: width .3s; }
.screen-actions { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.screen-actions p { margin: 0; }
.expand-button { min-height: 44px; padding: .45rem 1rem; }

.unity-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #111;
  border: 4px solid var(--brown-dark);
  box-shadow: 0 8px 24px rgba(32, 20, 12, .18);
}
.unity-editor {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: 25px 30px 34px 1fr 31%;
  color: var(--unity-text);
  background: var(--unity);
  font: 13px/1.35 Arial, "Yu Gothic UI", sans-serif;
  overflow: hidden;
  user-select: none;
  transform: scale(1);
  transform-origin: 50% 50%;
  transition: transform .55s ease, transform-origin .55s ease;
}
.unity-titlebar { display: flex; align-items: center; gap: 8px; padding: 0 9px; background: #18191b; color: var(--unity-muted); font-size: 12px; }
.unity-glyph { color: #fff; }
.win-controls { margin-left: auto; letter-spacing: 9px; }
.unity-menu { position: relative; display: flex; align-items: center; gap: 19px; padding: 0 12px; background: #303236; border-bottom: 1px solid #18191b; font-size: 13px; }
.unity-menu > span { white-space: nowrap; }
.menu-mire.active { margin: -4px -6px; padding: 4px 6px; color: #fff; background: #4b4e52; }
.dropdown { display: none; position: absolute; z-index: 20; top: 29px; left: 360px; width: 330px; padding: 6px 0; background: #303236; border: 1px solid #111; box-shadow: 5px 7px 14px rgba(0,0,0,.55); font-size: 13px; }
.dropdown.open { display: block; }
.dropdown div { padding: 5px 14px; color: #eee; white-space: nowrap; }
.dropdown div.selected { color: #fff; background: var(--unity-blue); }
.dropdown hr { margin: 5px 0; border: 0; border-top: 1px solid #4a4c50; }
.unity-toolbar { display: flex; align-items: center; gap: 4px; padding: 4px 7px; background: #27292c; border-bottom: 1px solid #171719; }
.unity-toolbar button { width: 29px; height: 24px; padding: 0; color: #d5d6d7; background: #34363a; border: 1px solid #17181a; border-radius: 2px; font-size: 12px; }
.unity-toolbar > span { flex: 1; }
.unity-toolbar small { padding: 3px 8px; color: #eee; background: #383a3e; border-radius: 2px; font-size: 12px; }
.unity-workspace { min-height: 0; display: grid; grid-template-columns: 23% 1fr 28%; }
.unity-pane, .scene-pane { min-width: 0; min-height: 0; overflow: hidden; background: #26282b; border-right: 1px solid var(--unity-line); }
.inspector-pane { border-right: 0; }
.pane-tab, .scene-tabs, .bottom-tabs, .console-head { min-height: 32px; display: flex; align-items: center; justify-content: space-between; padding: 0 9px; color: #eeeeee; background: #202225; border-bottom: 1px solid var(--unity-line); font-size: 13px; }
.pane-tab b { font-weight: 400; }
.pane-search { margin: 5px 6px; padding: 4px 8px; color: #c2c4c7; background: #1f2023; border-radius: 4px; }
.tree { padding: 3px 0; }
.tree-row { display: flex; align-items: center; gap: 5px; min-height: 24px; padding: 2px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: 0; transform: translateX(-4px); transition: .3s; font-size: 13px; }
.tree-row.visible { opacity: 1; transform: none; }
.tree-row::before { content: "◇"; color: #e7e7e7; font-size: 10px; }
.tree-row.scene-root::before { content: "▽"; color: #fff; }
.tree-row.created { color: #fff; background: rgba(255,255,255,.10); }
.tree-row.created::before { color: #fff; }
.tree-row[data-depth="1"] { padding-left: 20px; }
.tree-row[data-depth="2"] { padding-left: 32px; }
.scene-pane { position: relative; }
.scene-tabs { justify-content: flex-start; gap: 20px; }
.scene-tabs .active, .bottom-tabs .active { min-height: 32px; display: flex; align-items: center; color: #fff; border-bottom: 2px solid #fff; }
.scene-view { position: absolute; inset: 32px 0 0; overflow: hidden; background: linear-gradient(#4a5157, #30363b 63%, #292d30); }
.scene-view::before { content: ""; position: absolute; inset: 48% -20% -30%; transform: perspective(180px) rotateX(65deg); background-image: linear-gradient(rgba(255,255,255,.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.12) 1px, transparent 1px); background-size: 22px 22px; }
.axis { position: absolute; z-index: 2; right: 10px; top: 10px; width: 48px; height: 48px; border-radius: 50%; background: rgba(20,20,20,.45); }
.axis i { position: absolute; font: 700 10px/1 Arial; }
.axis-y { left: 20px; top: 4px; color: #fff; }.axis-x { right: 4px; top: 26px; color: #f58a7d; }.axis-z { left: 5px; top: 29px; color: #85aef2; }
.scene-object { position: absolute; z-index: 3; left: 50%; top: 60%; width: 44%; height: 23%; transform: translate(-50%,-50%) perspective(260px) rotateX(66deg) rotateZ(-5deg); background: linear-gradient(130deg, #74513a, #3e2b20); border: 2px solid #fff; box-shadow: 0 0 18px rgba(255,255,255,.15); transition: .5s; }
.scene-object.sticky { background: linear-gradient(130deg,#725d52,#3a312d); border-color: #fff; }
.scene-object.tar { background: linear-gradient(130deg,#25282b,#090a0b); border-color: #d6d6d6; }
.scene-object.wash { width: 24%; height: 45%; top: 55%; background: rgba(210,220,225,.18); border-color: #fff; transform: translate(-50%,-50%); }
.scene-object i,.scene-object b,.scene-object em { position: absolute; width: 8px; height: 8px; background: #ff6d5f; border-radius: 50%; }
.scene-object i { left: 0; top: 0; }.scene-object b { right: 0; top: 0; }.scene-object em { right: 0; bottom: 0; }
.scene-label { position: absolute; left: 10px; bottom: 9px; color: #fff; font-size: 12px; }
.inspector { padding: 8px; }
.inspector-title { margin: 0 0 7px; padding: 6px; color: #fff; background: #33363a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.component { margin-bottom: 6px; background: #2d3033; border: 1px solid var(--unity-line); }
.component > strong { display: block; padding: 5px 7px; color: #eee; background: #36393d; font-size: 13px; }
.inspector-field { display: grid; grid-template-columns: 48% 1fr; gap: 5px; padding: 3px 6px; color: #d0d0d0; font-size: 13px; }
.inspector-field b { padding: 2px 4px; color: #fff; background: #202225; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unity-bottom { min-height: 0; display: grid; grid-template-columns: 62% 38%; border-top: 1px solid var(--unity-line); }
.project-pane { min-width: 0; background: #25272a; border-right: 1px solid var(--unity-line); }
.bottom-tabs { justify-content: flex-start; gap: 20px; }
.project-content { height: calc(100% - 32px); display: grid; grid-template-columns: 39% 61%; }
.folders { padding: 5px; overflow: hidden; border-right: 1px solid #161719; }
.folder { min-height: 23px; padding: 2px 5px; color: #e1e1e1; white-space: nowrap; font-size: 13px; }
.folder::before { content: "▸ 📁"; margin-right: 5px; filter: grayscale(1); }.folder.open::before { content: "▾ 📂"; }.folder[data-depth="1"] { padding-left: 18px; }.folder[data-depth="2"] { padding-left: 31px; }.folder.active { color: #fff; background: var(--unity-blue); }
.assets { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); align-content: start; gap: 8px; padding: 9px; overflow: hidden; }
.asset { min-width: 0; color: #e1e1e1; text-align: center; font-size: 12px; opacity: 0; transform: scale(.85); transition: .3s; }
.asset.visible { opacity: 1; transform: none; }
.asset::before { content: ""; display: block; width: 31px; height: 35px; margin: 0 auto 3px; background: #737a80; clip-path: polygon(0 0,70% 0,100% 25%,100% 100%,0 100%); }.asset.audio::before { background: #7a6b62; }.asset.material::before { background: #7c7068; border-radius: 50%; clip-path: none; }.asset.folder-asset::before { height: 27px; background: #a47a51; clip-path: polygon(0 20%,35% 20%,42% 0,100% 0,100% 100%,0 100%); }
.asset span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.console-pane { min-width: 0; background: #202225; }
.console-head small { color: #d0d0d0; font-size: 12px; }
.console-lines { padding: 6px; overflow: hidden; }
.console-line { display: flex; gap: 6px; padding: 3px 4px; color: #e2e2e2; border-bottom: 1px solid #2c2e31; font-size: 12px; opacity: 0; transform: translateY(3px); transition: .3s; }
.console-line.visible { opacity: 1; transform: none; }.console-line::before { content: "●"; color: #d0d0d0; }.console-line.warning::before { color: #e8a55b; }.console-line.error::before { color: #ff7467; }
.setup-window { display: none; position: absolute; z-index: 15; left: 27%; top: 13%; width: 48%; max-height: 76%; color: #eeeeee; background: #303236; border: 1px solid #121315; box-shadow: 9px 14px 30px rgba(0,0,0,.7); transform: translateY(10px) scale(.98); opacity: 0; overflow: hidden; transition: .3s; font-size: 13px; }
.setup-window.open { display: block; opacity: 1; transform: none; }
.setup-title { min-height: 29px; display: flex; align-items: center; justify-content: space-between; padding: 0 9px; color: #fff; background: #1d1f21; font-size: 13px; }.setup-title b { font-weight: 400; }
.setup-body { max-height: calc(100% - 29px); padding: 10px 13px 13px; overflow: hidden; }
.language-toggle { display: flex; justify-content: flex-end; margin-bottom: 5px; }.language-toggle span { padding: 3px 8px; background: #25272a; border: 1px solid #17181a; font-size: 12px; }.language-toggle .active { color: #fff; background: #53575c; }
.setup-body h3 { margin: 5px 0 8px; font-size: 14px; }
.help-box { margin: 0 0 9px; padding: 7px 9px; color: #fff; background: #41464b; border-left: 4px solid #fff; font-size: 12px; line-height: 1.45; }
.setup-fields { display: grid; gap: 4px; }
.setup-field { display: grid; grid-template-columns: 54% 1fr; align-items: center; gap: 7px; font-size: 13px; }
.setup-field label { color: #eeeeee; }
.field-value { min-height: 22px; padding: 3px 6px; color: #cfcfcf; background: #212326; border: 1px solid #17181a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setup-field.check .field-value::before { content: "✓"; display: inline-grid; place-items: center; width: 14px; height: 14px; margin-right: 5px; color: #111; background: #fff; }
.setup-window.filled .field-value { color: #fff; border-color: #747a80; }
.unity-action { width: 100%; min-height: 32px; margin-top: 10px; padding: 5px; color: #fff; background: #4b4f54; border: 1px solid #17181a; border-radius: 2px; font-size: 13px; }
.unity-action.pressed { background: var(--unity-blue); box-shadow: inset 0 1px 5px #17394f; }
.fake-cursor { position: absolute; z-index: 30; left: 48%; top: 52%; width: 22px; height: 29px; pointer-events: none; filter: drop-shadow(1px 2px 1px #000); transition: left .58s cubic-bezier(.2,.75,.25,1), top .58s cubic-bezier(.2,.75,.25,1); }.fake-cursor svg { width: 100%; height: 100%; }.fake-cursor path { fill: #fff; stroke: var(--brown-dark); stroke-width: 1.7; }
.click-ring { position: absolute; z-index: 29; width: 25px; height: 25px; border: 3px solid #fff; border-radius: 50%; transform: translate(-50%,-50%) scale(.3); opacity: 0; pointer-events: none; }.click-ring.flash { animation: click .35s ease-out; }
@keyframes click { 20% { opacity: 1; transform: translate(-50%,-50%) scale(.3); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.5); } }
.unity-editor[data-focus="menu"] { transform: scale(1.16); transform-origin: 47% 7%; }
.unity-editor[data-focus="window"] { transform: scale(1.18); transform-origin: 51% 40%; }
.unity-editor[data-focus="project"] { transform: scale(1.12); transform-origin: 25% 88%; }
.unity-editor[data-focus="hierarchy"] { transform: scale(1.14); transform-origin: 9% 45%; }
.unity-editor[data-focus="inspector"] { transform: scale(1.14); transform-origin: 92% 43%; }
.unity-editor[data-focus="console"] { transform: scale(1.12); transform-origin: 82% 87%; }
.unity-editor[data-focus="project"] .project-pane,
.unity-editor[data-focus="hierarchy"] .hierarchy-pane,
.unity-editor[data-focus="inspector"] .inspector-pane,
.unity-editor[data-focus="console"] .console-pane { box-shadow: inset 0 0 0 3px #fff; }
/* 「画面を大きく」は画面と説明をまとめて全画面にする（画面だけにすると手順が読めないため） */
.player-column:fullscreen { padding: 20px; overflow: auto; background: var(--paper); }
.player-column:fullscreen::backdrop { background: var(--paper); }

.player-side { max-width: 900px; margin: 2rem auto 0; }
.step-copy { margin: 0; padding: 2rem; background: var(--paper-strong); border: 1px solid var(--line); }
.step-number { display: inline-block; margin-bottom: .75rem; padding: .2rem .65rem; color: #fff; background: var(--brown); border-radius: 3px; font-weight: 800; }
.step-copy h3 { margin: 0; font-size: clamp(28px, 4vw, 42px); line-height: 1.3; }
.step-summary { max-width: 40em; margin: 1rem 0 1.5rem; font-size: 18px; }
.step-copy h4 { margin: 0 0 .4rem; color: var(--brown); font-size: 20px; }
.step-actions { padding: 0; margin: 0; list-style: none; counter-reset: action; }
.step-actions li { counter-increment: action; position: relative; min-height: 52px; padding: .85rem .5rem .85rem 3.2rem; border-top: 1px solid var(--line); }
.step-actions li::before { content: counter(action); position: absolute; left: .25rem; top: .7rem; width: 32px; height: 32px; display: grid; place-items: center; color: #fff; background: var(--brown); border-radius: 50%; font-weight: 800; }
.step-note { margin-top: 1.25rem; padding: 1rem 1.1rem; color: var(--warning); background: #f4e8d6; border-left: 5px solid var(--warning); font-weight: 700; }
.player-controls { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin: 1.25rem 0 0; }
.player-controls button { min-height: 54px; padding: .6rem 1rem; color: var(--brown); background: #fff; border: 2px solid var(--brown); border-radius: 4px; font-weight: 800; cursor: pointer; }
.player-controls button:hover { background: var(--brown-pale); }
.player-controls button:disabled { color: #6f6259; background: #eee9e4; border-color: #8f8176; cursor: not-allowed; }
.player-controls .play-button { color: #fff; background: var(--brown); }
.player-controls .play-button:hover { background: var(--brown-dark); }
.play-button i { display: inline-block; width: 0; height: 0; margin-right: .45rem; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 9px solid currentColor; }
.play-button.playing i { width: 9px; height: 12px; border: 0; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.keyboard-help, .motion-note { margin: .75rem 0 0; }

/* PC 幅: 左に Unity 風の画面、右に説明と操作ボタン。どちらも縦は画面の高さに収め（sticky）、
   画面と説明・前へ／次へが同時に見えるようにする。説明が長いときは説明の中だけを送る */
@media (min-width: 1200px) {
  .player-column { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
  .player-stage { position: sticky; top: 16px; }
  /* 幅が狭いぶん 4:3 にして、Setup ウィンドウの欄とボタンが全部入る高さを取る */
  /* 高さから引く 66px は上の「画面を大きく」の行、100px は下の前へ・次へとキー操作の案内 */
  .unity-wrap { aspect-ratio: 4 / 3; max-height: calc(100vh - 32px - 66px - 100px); }
  .setup-window { top: 8%; max-height: 88%; }
  /* 文字が読める大きさで画面全体が入るので、PC では拡大しない（拡大すると画面の端が切れる）。操作中の枠は残す */
  .unity-editor[data-focus] { transform: none; }
  .player-side { position: sticky; top: 16px; max-width: none; max-height: calc(100vh - 32px); margin: 0; display: flex; flex-direction: column; }
  .player-side > * { flex: none; }
  .player-side .step-copy { flex: 0 1 auto; min-height: 0; overflow-y: auto; }
  .step-copy { padding: 1.4rem 1.5rem; }
  .step-copy h3 { font-size: 26px; }
  .step-summary { margin: .75rem 0 1.1rem; font-size: 17px; }
  .step-copy h4 { font-size: 18px; }
  .step-actions li { padding: .7rem .25rem .7rem 2.9rem; }
  .step-actions li::before { width: 28px; height: 28px; }
  .player-controls { margin-top: .75rem; gap: .6rem; }
  .player-controls button { min-height: 50px; padding: .5rem .6rem; }
  .player-stage .keyboard-help { margin-top: .5rem; font-size: 15px; }
  .player-column:fullscreen { grid-template-columns: minmax(0, 1fr) 400px; }
  .player-column:fullscreen .player-stage { position: static; }
  .player-column:fullscreen .unity-wrap { aspect-ratio: auto; height: calc(100vh - 40px - 66px - 100px); max-height: none; }
  .player-column:fullscreen .player-side { max-height: calc(100vh - 40px); overflow: auto; }
}

.notes-section { border-top: 1px solid var(--line); }
.note-grid { display: grid; grid-template-columns: 1fr 1fr; background: #fff; border: 1px solid var(--line); }
.note-card { min-height: 210px; padding: 1.6rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.note-card:nth-child(2n) { border-right: 0; }.note-card:nth-last-child(-n + 2) { border-bottom: 0; }
.note-card > span { width: 38px; height: 38px; display: grid; place-items: center; color: #fff; background: var(--brown); border-radius: 50%; font-weight: 800; }
.note-card h3 { margin: 1rem 0 .5rem; font-size: 24px; }.note-card p { max-width: 40em; margin: 0; }
.finish-panel { margin-bottom: 80px; padding: 2rem; background: var(--brown-pale); border: 1px solid var(--line); border-left: 8px solid var(--brown); }
.finish-panel h2 { margin: 0 0 1rem; font-size: clamp(30px, 4vw, 44px); }.finish-panel p { max-width: 40em; margin: 0 0 1rem; }.finish-panel a { font-weight: 800; }
footer { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2rem; padding-top: 2rem; padding-bottom: 2rem; border-top: 1px solid var(--line); }
footer p { margin: 0; } footer a { font-weight: 800; }
.footer-links { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.secondary-action { min-height: 48px; display: inline-flex; align-items: center; padding: .65rem 1.25rem; color: var(--brown); background: #fff; border: 2px solid var(--brown); border-radius: 4px; font-weight: 700; text-decoration: none; }
.secondary-action:hover { background: var(--brown-pale); }

@media (max-width: 900px) {
  .site-nav, .hero-content, .content-section, footer { width: min(100% - 40px, 1360px); }
  .section-heading { grid-template-columns: 1fr; gap: 1rem; }
  .route { grid-template-columns: 1fr 1fr; }.route li:nth-child(3n) { border-right: 1px solid var(--line); }.route li:nth-child(2n) { border-right: 0; }.route li:nth-last-child(-n + 3) { border-bottom: 1px solid var(--line); }.route li:nth-last-child(-n + 2) { border-bottom: 0; }
  .toc { grid-template-columns: 1fr 1fr; }
  .unity-editor { font-size: 12px; }.unity-menu, .tree-row, .folder, .pane-tab, .scene-tabs, .bottom-tabs, .inspector-title, .component > strong, .inspector-field, .setup-window, .setup-title, .setup-field, .unity-action { font-size: 12px; }
  footer { grid-template-columns: 1fr; gap: .75rem; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .site-nav, .hero-content, .content-section, footer { width: min(100% - 32px, 1360px); }
  .site-nav { min-height: 64px; }.nav-links { display: none; }.brand { font-size: 19px; }.brand span { font-size: 15px; }
  .hero-content { padding: 48px 0; }.hero-content > p:not(.section-label) { font-size: 16px; }.environment { grid-template-columns: 1fr; gap: .65rem; margin-top: 2rem; }
  .content-section { padding-top: 56px; padding-bottom: 56px; }.section-heading h2 { font-size: 34px; }
  .route { grid-template-columns: 1fr; }.route li, .route li:nth-child(2n), .route li:nth-child(3n), .route li:nth-last-child(-n + 2) { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }.route li:last-child { border-bottom: 0; }
  .toc { grid-template-columns: 1fr; }.toc button b { font-size: 16px; }
  .step-status { grid-template-columns: 1fr auto; gap: .5rem; }.progress-track { grid-column: 1 / -1; }
  .screen-actions { align-items: stretch; flex-direction: column; }.screen-actions p { line-height: 1.5; }.expand-button { width: 100%; }
  .unity-wrap { height: 500px; aspect-ratio: auto; border-width: 3px; }
  .unity-editor { inset: auto; left: 0; top: 14px; width: 760px; height: 475px; grid-template-rows: 25px 30px 34px 1fr 31%; font-size: 13px; transition: transform .45s ease; }
  .unity-titlebar { font-size: 12px; }.unity-menu { gap: 15px; font-size: 13px; }.unity-menu > span:nth-child(4), .unity-menu > span:nth-child(5), .unity-menu > span:nth-child(6) { display: none; }.dropdown { left: 182px; top: 29px; width: 320px; font-size: 13px; }
  .unity-workspace { grid-template-columns: 23% 1fr 28%; }.pane-tab, .scene-tabs, .bottom-tabs, .console-head { min-height: 32px; font-size: 13px; }.tree-row, .folder, .inspector-title, .component > strong, .inspector-field, .setup-window, .setup-title, .setup-field, .unity-action { font-size: 13px; }.asset, .console-line, .console-head small, .scene-label, .language-toggle span, .help-box { font-size: 12px; }
  .setup-window { left: 26%; top: 12%; width: 52%; max-height: 78%; }
  .unity-editor[data-focus="menu"] { transform: translateX(-150px) scale(1.03); transform-origin: 0 0; }
  .unity-editor[data-focus="window"] { transform: translateX(-190px) scale(1.04); transform-origin: 0 0; }
  .unity-editor[data-focus="project"] { transform: translate(0, 0) scale(1); transform-origin: 0 0; }
  .unity-editor[data-focus="hierarchy"] { transform: translate(0, 0) scale(1.03); transform-origin: 0 0; }
  .unity-editor[data-focus="inspector"] { transform: translateX(-395px) scale(1.02); transform-origin: 0 0; }
  .unity-editor[data-focus="console"] { transform: translateX(-365px) scale(1); transform-origin: 0 0; }
  .player-side { margin-top: 1.25rem; }
  .step-copy { padding: 1.25rem; }.step-copy h3 { font-size: 30px; }.step-summary { font-size: 16px; }.step-actions li { padding-right: 0; }
  .player-controls { grid-template-columns: 1fr 1fr; }.player-controls button { min-height: 58px; }.restart-button { grid-column: 1 / -1; }
  .keyboard-help { line-height: 1.6; }
  .note-grid { grid-template-columns: 1fr; }.note-card, .note-card:nth-child(2n), .note-card:nth-last-child(-n + 2) { min-height: 0; border-right: 0; border-bottom: 1px solid var(--line); }.note-card:last-child { border-bottom: 0; }
  .finish-panel { margin-bottom: 56px; padding: 1.25rem; }
}

/* ---- パラメーター一覧（parameters.html） ---- */
.nav-links a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: .45em; }
.reference-hero { padding: 56px 0 48px; }
.reference-hero h1 { font-size: clamp(36px, 5vw, 60px); }
.reference-hero > p { max-width: 40em; margin: 1.25rem 0 0; font-size: 18px; }
.reference-hero > p.reference-meta { margin-top: .5rem; color: var(--muted); font-size: 15px; }
.basics-section { border-bottom: 1px solid var(--line); }
.basics-list { max-width: 60em; display: grid; gap: 1rem; margin: 0; padding: 0; list-style: none; }
.basics-list li { padding: 1.1rem 1.25rem; background: var(--paper-strong); border: 1px solid var(--line); border-left: 6px solid var(--brown); }
.basics-list strong { display: block; margin-bottom: .25rem; }
.reference-layout { display: grid; gap: 2rem; }
.reference-nav-drawer { background: var(--paper-strong); border: 1px solid var(--line); }
.reference-nav-drawer summary { min-height: 52px; display: flex; align-items: center; padding: .6rem 1rem; color: var(--brown); font-weight: 800; cursor: pointer; }
#reference-nav { padding: .25rem 1rem 1rem; border-top: 1px solid var(--line); }
.reference-nav-group { margin: .9rem 0 .3rem; color: var(--brown); font-size: 15px; font-weight: 800; }
#reference-nav ul { margin: 0; padding: 0; list-style: none; }
#reference-nav a { display: block; padding: .35rem .5rem; color: var(--ink); line-height: 1.5; text-decoration: none; border-radius: 3px; }
#reference-nav a:hover { background: var(--brown-pale); }
#reference-nav a.is-empty { color: #7d7067; }
.reference-tools { position: sticky; z-index: 5; top: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: .5rem 1.5rem; margin-bottom: 1.5rem; padding: 1rem 0; background: var(--paper); border-bottom: 1px solid var(--line); }
.reference-search span { display: block; margin-bottom: .3rem; font-weight: 700; }
.reference-search input { width: 100%; min-height: 48px; padding: .5rem .8rem; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 4px; font: inherit; }
.reference-search input:focus { border-color: var(--brown); }
.reference-toggle { min-height: 48px; display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.reference-toggle input { width: 20px; height: 20px; accent-color: var(--brown); }
.reference-count { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 15px; }
.ref-component { margin-bottom: 3.5rem; scroll-margin-top: 150px; }
.component-head { padding-bottom: .75rem; border-bottom: 4px solid var(--brown); }
.component-group { margin: 0; color: var(--brown); font-size: 15px; font-weight: 800; }
.component-head h3 { margin: .1rem 0 0; font-size: clamp(24px, 3vw, 32px); line-height: 1.35; }
.component-script { margin: .2rem 0 0; color: var(--muted); font-size: 15px; }
.component-summary { max-width: 46em; margin: 1rem 0 1.5rem; }
.component-summary p { margin: 0 0 .75rem; }
.field-link { font-weight: 700; }
.field-group { margin-top: 1.75rem; }
.field-group h4 { margin: 0 0 .5rem; font-size: 18px; }
.field-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); font-size: 16px; line-height: 1.6; }
.field-table thead th { padding: .55rem .8rem; color: #fff; background: var(--brown); text-align: left; font-size: 15px; }
.field-table tbody tr { border-top: 1px solid var(--line); scroll-margin-top: 150px; }
.field-table tbody tr:target { background: #f4e8d6; outline: 3px solid var(--brown); outline-offset: -3px; }
.field-table tbody th, .field-table td { padding: .65rem .8rem; text-align: left; vertical-align: top; }
.field-table tbody th { width: 30%; font-weight: 400; }
.field-label { display: block; font-weight: 800; }
.field-sub { display: flex; flex-wrap: wrap; gap: .1rem .6rem; margin-top: .15rem; color: var(--muted); font-size: 14px; }
.field-sub code { font-family: Consolas, "Cascadia Mono", monospace; }
.field-default { width: 17%; font-weight: 700; overflow-wrap: anywhere; }
.field-default small { display: block; color: var(--muted); font-size: 14px; font-weight: 400; }
.is-ref .field-label::after { content: "参照"; margin-left: .5rem; padding: .05rem .4rem; color: var(--brown); background: var(--brown-pale); border: 1px solid var(--line); border-radius: 3px; font-size: 13px; font-weight: 700; vertical-align: .1em; }
.field-table tr[hidden], .field-group[hidden], .ref-component[hidden] { display: none !important; }
.reference-empty, .no-value-fields { max-width: 46em; padding: 1rem 1.25rem; background: var(--brown-pale); border-left: 6px solid var(--brown); }

@media (min-width: 1100px) {
  .reference-layout { grid-template-columns: 270px minmax(0, 1fr); align-items: start; }
  .reference-nav { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
  /* PC では一覧を常に開いておく */
  .reference-nav-drawer summary { pointer-events: none; list-style: none; }
  .reference-nav-drawer summary::-webkit-details-marker { display: none; }
}

@media (max-width: 760px) {
  .reference-tools { position: static; grid-template-columns: 1fr; }
  .field-table, .field-table tbody, .field-table tr, .field-table tbody th, .field-table td { display: block; width: 100%; }
  .field-table thead { display: none; }
  .field-table tbody tr { padding: .75rem .9rem; }
  .field-table tbody th, .field-table td { padding: 0; }
  .field-default, .field-desc { margin-top: .5rem; }
  .field-default::before, .field-desc::before { content: attr(data-label); display: block; color: var(--brown); font-size: 13px; font-weight: 800; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .fake-cursor, .click-ring { display: none !important; }
}
