:root { color-scheme: light; --ink: #193b40; --muted: #6d8284; --teal: #147d72; --line: #d9e4e1; --paper: #f4f7f3; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: "Yu Gothic UI", "Meiryo", system-ui, sans-serif; font-size: 14px; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: white; padding: 9px 13px; transition: background .15s, box-shadow .15s; }
button:hover:not(:disabled) { background: #eaf4ef; border-color: #80b9aa; }
button:focus-visible, a:focus-visible { outline: 3px solid #e8aa42; outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .45; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
a { color: var(--teal); }
.topbar { height: 84px; display: flex; align-items: center; justify-content: space-between; padding: 0 36px; border-bottom: 1px solid var(--line); background: #fff; gap: 20px; }
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); font-size: 22px; font-weight: 800; letter-spacing: 2px; }
.brand-mark { display: grid; place-items: center; background: var(--ink); color: #bce5c9; width: 42px; height: 42px; border-radius: 12px 12px 12px 2px; font-size: 18px; }
.brand small { display: block; letter-spacing: 1px; font-size: 10px; margin-top: 2px; color: var(--muted); }
.top-note { font-size: 11px; letter-spacing: 1.5px; color: var(--muted); }
main { max-width: 1660px; padding: 30px 36px 18px; margin: auto; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.eyebrow { color: var(--teal); font-size: 10px; font-weight: 800; letter-spacing: 2px; margin-bottom: 8px; }
h1 { font-size: clamp(26px, 2.7vw, 40px); letter-spacing: 1px; font-weight: 800; }
h1 span { color: var(--teal); }
.subtitle { margin-top: 10px; color: var(--muted); font-size: 13px; }
.intro-tag { line-height: 2; font-size: 12px; color: var(--ink); padding-left: 22px; border-left: 1px solid #bdceca; }
.intro-tag small { color: var(--muted); font-size: 10px; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3c9b7f; margin-right: 7px; }
.help-panel { padding: 20px; background: #e7f1e8; border: 1px solid #b9d2bd; border-radius: 12px; margin-bottom: 20px; line-height: 1.9; }
.help-panel h2 { font-size: 18px; margin-bottom: 8px; }
.help-panel p + p { margin-top: 8px; }
.stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.stage-button { flex: 1; display: flex; gap: 12px; align-items: center; text-align: left; padding: 12px 16px; background: transparent; }
.stage-button[aria-current="step"] { background: var(--ink); border-color: var(--ink); color: white; }
.stage-button[aria-current="step"]:hover { background: #245057; }
.step-index { font-family: monospace; font-size: 20px; opacity: .6; }
.stage-button small { display: block; font-size: 9px; margin-bottom: 3px; letter-spacing: 1px; opacity: .65; }
.step-complete { margin-left: auto; color: #76c29d; }
.mission { display: flex; gap: 18px; align-items: center; padding: 20px 24px; background: #e8f0e7; border: 1px solid #d2e0cd; border-radius: 12px; margin-bottom: 20px; }
.mission-number { font: 44px monospace; color: #a7c5ac; }
.mission h2 { font-size: 20px; margin-bottom: 6px; }
.mission p:not(.eyebrow) { font-size: 12px; line-height: 1.8; color: #546f61; }
.mission-target { margin-left: auto; max-width: 250px; padding-left: 22px; border-left: 1px solid #cad9c8; line-height: 1.8; font-size: 12px; }
.mission-target small { display: block; font-size: 10px; color: var(--muted); }
.workspace { display: grid; grid-template-columns: 218px minmax(0, 1fr) 262px; gap: 16px; align-items: start; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 4px 16px #173a3810; overflow: hidden; }
.palette-panel, .inspector { padding: 18px 16px; }
.panel-heading { display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.panel-heading h2 { font-size: 13px; }
.panel-heading > span { font-size: 8px; letter-spacing: .7px; color: #839593; }
.muted { color: var(--muted); font-size: 11px; line-height: 1.7; margin: 8px 0 14px; }
.palette { display: grid; gap: 9px; }
.equipment-button { text-align: left; display: flex; align-items: center; gap: 10px; padding: 10px; width: 100%; position: relative; }
.equipment-button[aria-pressed="true"] { background: #e9f6ed; border-color: var(--teal); box-shadow: inset 3px 0 var(--teal); }
.equipment-button svg { width: 44px; height: 44px; flex: none; }
.equipment-button strong { display: block; font-size: 13px; }
.equipment-button small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.equipment-button .placed { color: var(--teal); }
.material-key { margin-top: 18px; font-size: 9px; line-height: 2; color: var(--muted); padding-top: 14px; border-top: 1px solid var(--line); }
.bag-dot, .frame-dot { display: inline-block; width: 7px; height: 7px; border-radius: 2px; background: #70bca1; margin-right: 6px; }
.frame-dot { background: #b7c2c6; }
.board-toolbar { padding: 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.board-toolbar .panel-heading { gap: 12px; }
.tools { display: flex; gap: 5px; }
.tools button { font-size: 11px; padding: 7px 10px; }
.tools button[aria-pressed="true"] { background: #e8f3ed; border-color: #7bafa0; color: var(--teal); }
.board-meta { display: flex; justify-content: space-between; padding: 0 16px 10px; font: 9px monospace; color: var(--muted); letter-spacing: .8px; }
.board { position: relative; width: 100%; aspect-ratio: 2 / 1; min-height: 330px; background-color: #f5f9f7; background-image: radial-gradient(#bfcfc7 1px, transparent 1px); background-size: 16px 16px; border-top: 1px solid #e2eae6; border-bottom: 1px solid #e2eae6; }
#pipes { position: absolute; width: 100%; height: 100%; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
.pipe { stroke: #126b62; stroke-width: 3; fill: none; }
.pipe-halo { stroke: white; stroke-width: 8; fill: none; }
.pipe.preview { stroke: #126b62; stroke-dasharray: 6 5; }
.pipe.running { stroke: #198e70; stroke-width: 5; stroke-dasharray: 10 8; animation: flowing .6s linear infinite; }
.pipe.finished { stroke: #2d9c7a; stroke-width: 4; }
.pipe.uninstalled-pipe { stroke: #a88355; stroke-dasharray: 3 7; }
@keyframes flowing { to { stroke-dashoffset: -36; } }
.slots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); position: absolute; inset: 0; padding: 0; }
.slot { background: transparent; border: 1px solid transparent; border-radius: 9px; margin: 14px 8px; padding: 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; }
.slot.empty { margin: 26px 20px; font-size: 20px; color: #aec2b8; border: 1px dashed #c8d7cf; opacity: .65; }
.slot.empty:hover:not(:disabled) { background: #e3f2e8; opacity: 1; }
.slot.node { background: #ffffffed; border: 1px solid #d3e0db; box-shadow: 0 4px 9px #224c3914; }
.slot.node svg { width: 48px; height: 48px; max-height: 60%; }
.slot.node strong { font-size: 11px; margin-top: 4px; overflow-wrap: anywhere; line-height: 1.3; }
.slot.node small { font: 8px monospace; color: #7a9490; margin-top: 3px; }
.slot.selected { border: 2px solid var(--teal); background: #e2f5e9; }
.slot.candidate { border: 2px dashed #319c87; background: #f0faf4; }
.slot.candidate:hover:not(:disabled), .slot.candidate:focus-visible { background: #d9f2e5; border-style: solid; }
.connection-badge { font-size: 10px; font-weight: 800; color: #126b62; background: #ddf1e6; border-radius: 4px; padding: 2px 5px; margin-top: 3px; }
.slot.selected .connection-badge { color: white; background: #147d72; }
.slot.active { border: 2px solid #168a6d; background: #d8f3df; box-shadow: 0 0 0 4px #359e7620; }
.slot.stopped { border: 2px solid #c07836; background: #fff1dc; }
.board-footer { min-height: 58px; display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 10px 16px; color: var(--muted); font-size: 11px; }
.quiet { background: transparent; font-size: 11px; }
.board-footer button { white-space: nowrap; }
.run-toolbar { padding: 14px 16px; background: #fafcf9; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.run-toolbar > span { font-size: 10px; color: var(--muted); }
.primary { background: var(--teal); border-color: var(--teal); color: white; font-weight: 700; padding: 11px 19px; white-space: nowrap; }
.primary:hover:not(:disabled) { background: #11695f; color: white; border-color: #11695f; }
.feedback { padding: 16px 13px; margin-top: 16px; background: #edf4ee; border: 1px solid #d7e5d8; border-radius: 10px; min-height: 160px; }
.feedback-label { font-size: 9px; font-weight: 800; letter-spacing: 1px; color: var(--teal); }
.feedback h3 { font-size: 15px; margin: 10px 0 8px; }
.feedback p, .equipment-note p { font-size: 12px; line-height: 1.9; overflow-wrap: anywhere; }
.feedback p { white-space: pre-line; }
.feedback[data-kind="error"] { background: #fff4e4; border-color: #e8d1ad; }
.feedback[data-kind="error"] .feedback-label { color: #a0642c; }
.feedback[data-kind="success"] { background: #dff1e3; border-color: #8abb97; }
.feedback[data-kind="running"] { background: #e5f3f2; }
.next { width: 100%; margin-top: 10px; font-size: 12px; }
.equipment-note { margin-top: 22px; }
.equipment-note h3, .connections-section h3 { font-size: 12px; margin-bottom: 8px; }
.equipment-note p { color: #587172; font-size: 11px; }
.material-note { margin-top: 10px; padding: 10px; background: #f5f7f3; border-radius: 6px; font-size: 10px !important; }
.connections-section { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.connections-section h3 { display: flex; justify-content: space-between; }
.connections-section h3 span { background: #edf1ed; padding: 2px 7px; border-radius: 10px; }
#connections { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
#connections li { display: flex; gap: 4px; justify-content: space-between; align-items: center; font-size: 10px; padding: 6px 8px; background: #f5f8f5; border-radius: 6px; }
#connections button { border: 0; background: transparent; padding: 4px 6px; color: #a56744; }
.pipe-hit { stroke: transparent; stroke-width: 22; fill: none; pointer-events: stroke; cursor: pointer; }
.pipe.detach-target { stroke: #c15d29; stroke-width: 5; }
.pipe-hit, .pipe-hit title { pointer-events: stroke; }
.connection-picker, .disconnect-notice { padding: 12px 16px; border-top: 1px solid #e1d7c2; background: #fff6e5; font-size: 12px; line-height: 1.8; }
#connection-options { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.disconnect-notice { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #e7f4ed; }
.disconnect-notice button, #connections button { white-space: nowrap; }
.tools { flex-wrap: wrap; }
.port-introduction { margin-top: 14px; padding: 14px; background: white; border: 1px solid #cbdcd6; border-radius: 10px; }
.port-introduction h3 { font-size: 16px; margin-bottom: 8px; }
.port-introduction p { font-size: 12px; line-height: 1.8; }
.port-diagram { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 12px 0; max-width: 520px; }
.port-diagram span { grid-column: 1; padding: 6px 10px; background: #eaf3f8; border-radius: 6px; font-size: 12px; }
.port-diagram strong { grid-column: 2; grid-row: 1 / 4; display: grid; place-items: center; border: 2px solid #8c75b2; padding: 14px; border-radius: 10px; font-size: 12px; }
#port-guidance { color: #126b62; font-weight: 700; margin-top: 10px; }
.board.ports-visible { min-height: 510px; }
.port-cell { position: relative; min-width: 0; }
.port-cell > .slot { position: absolute; inset: 0 0 auto; height: 56px; margin: 8px; flex-direction: row; gap: 4px; }
.port-cell > .slot svg { width: 26px; height: 32px; max-height: none; flex: none; }
.port-cell > .slot small, .port-cell > .slot .connection-badge { display: none; }
.equipment-ports { position: absolute; top: 70px; left: 8px; right: 8px; display: grid; gap: 4px; z-index: 3; }
.equipment-ports button { padding: 4px 2px; min-height: 26px; font-size: 10px; border-color: #7f9ba8; background: #f3f9fc; }
.equipment-ports .guided-port { background: #ffe8a9; border: 2px solid #b78111; box-shadow: 0 0 0 3px #e4aa3c30; font-weight: 800; }
.operation-guide { margin-bottom: 18px; padding: 16px 20px; border: 1px solid #b9d5c7; background: #eaf5ef; border-radius: 12px; }
.operation-guide h2 { font-size: 14px; margin-bottom: 8px; }
.operation-guide p { font-size: 12px; line-height: 1.8; }
#operation-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.stock-panel { margin-bottom: 16px; }
.stock-panel h3 { font-size: 14px; margin-bottom: 10px; }
.stock-panel h3 small { display: block; font-size: 10px; font-weight: 400; margin-top: 5px; }
#stock-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; max-height: 380px; overflow-y: auto; padding: 4px; }
.stock-card { padding: 8px 5px; display: flex; flex-direction: column; gap: 6px; align-items: center; overflow-wrap: anywhere; }
.stock-card strong { font-size: 11px; }
.stock-card small { font-size: 9px; color: var(--muted); }
.stock-card[aria-pressed="true"] { border: 2px solid var(--teal); background: #e4f3ec; }
.part-drawing { display: grid; place-items: center; min-height: 42px; width: 100%; max-width: 75px; background: #e0eef8; border: 2px solid #7398ad; font: bold 12px monospace; }
.part-drawing.bag { border-radius: 10px 10px 18px 18px; }
.part-drawing.tube { min-height: 28px; border-radius: 20px; margin: 7px 0; }
.part-drawing.tube { display: flex; justify-content: center; gap: 2px; }
.connector { display: inline-grid; place-items: center; border: 2px solid #48708b; width: 22px; height: 22px; background: white; flex: none; }
.connector.type-A { border-radius: 50%; }
.connector.type-B { border-radius: 2px; }
.damaged-package { border-style: dashed; border-color: #ba692e; background: #ffecd9; }
#stock-detail:empty { display: none; }
#stock-detail { background: #fff7dd; padding: 10px; margin-top: 10px; border-radius: 8px; font-size: 11px; line-height: 1.8; }
#stock-detail button { width: 100%; margin-top: 8px; font-size: 11px; border-color: #b8a367; }
.workbench, .review-scene { padding: 16px; border-top: 1px solid #c9dbd4; background: #f0f7f3; }
.workbench h3, .review-scene h3 { font-size: 14px; margin: 10px 0; }
.workbench p, .review-scene p { font-size: 12px; line-height: 1.9; margin-top: 8px; }
.work-targets, .part-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.work-targets button { font-size: 11px; border-bottom: 3px solid #82a799; }
.work-targets button[aria-pressed="true"] { background: #193b40; color: white; }
.part-actions button { font-size: 12px; }
.inspection-observation { padding: 10px; background: #fff8e8; border-left: 3px solid #c6aa68; }
.assembly-diagram { display: grid; grid-template-columns: 2fr 1fr 2fr; grid-template-rows: auto auto; gap: 6px; margin: 14px 0; max-width: 560px; }
.assembly-diagram button { font-size: 11px; padding: 12px 6px; }
.assembly-bag { grid-column: 1; border: 2px solid #70a99b; border-radius: 18px 18px 24px 24px; background: #d9f0e7; }
.assembly-frame { grid-column: 1; grid-row: 2; border-bottom: 6px solid #798f96; background: #e3eaed; }
.assembly-drive { grid-column: 2; grid-row: 1 / 3; background: #e3eaed; }
.assembly-tubing { grid-column: 3; align-self: center; border: 3px solid #7398ad; border-radius: 24px; background: #e0eef8; }
.assembly-diagram .removed-part { border-style: dashed; background: transparent; color: #7c8c89; }
.review-actions { display: grid; gap: 6px; margin-top: 10px; }
.review-actions:empty { display: none; }
.review-actions button { font-size: 11px; text-align: left; }
.board.workshop-visible { min-height: 510px; }
.component-status { font-size: 10px; padding: 3px; line-height: 1.3; color: #285a70; }
.slot.node small { font-size: 10px; }
.port-cell > .slot .component-status { display: none; }
.install-target { border: 2px dashed #b78111 !important; background: #fff1c7 !important; box-shadow: 0 0 0 3px #e4aa3c20; }
.slot.move-destination { border: 2px dashed #35967d; font-size: 11px; opacity: 1; }
.pipe-tools { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.pipe-tools button { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; font-size: 10px; padding: 6px; max-width: 150px; background: #e5f0f7; border: 2px solid #658d9b; }
.capacity-meter { margin-top: 10px; height: 24px; border: 2px solid #648b9b; border-radius: 7px; overflow: hidden; background: white; }
.capacity-meter span { display: block; height: 100%; background: #4a9cb2; transition: width .15s; }
.capacity-meter.over-capacity { border-color: #b96530; }
.capacity-meter.over-capacity span { background: #c67b44; }
.delivery-route { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; margin-top: 8px; }
.delivery-route span { padding: 10px 2px; text-align: center; font-size: 10px; background: #e1eefa; border: 1px solid #a9bfd6; border-radius: 5px; }
.delivery-route .blocked { background: #fbe7cf; color: #914e25; }
.delivery-route .traveler { background: #126b62; color: white; }
#equipment-library summary { font-size: 11px; cursor: pointer; margin: 10px 0; }
.page-footer { display: flex; justify-content: space-between; gap: 14px; color: #80938e; font-size: 10px; padding-top: 24px; }
@media (max-width: 1250px) { main { padding: 24px 20px; } .workspace { grid-template-columns: 185px minmax(0, 1fr) 220px; gap: 12px; } .run-toolbar > span, .board-toolbar .panel-heading > span { display: none; } .slot { margin: 14px 4px; } .slot.empty { margin: 26px 10px; } .mission-target { max-width: 200px; } }
@media (max-width: 1000px) { .workspace { grid-template-columns: 185px minmax(0, 1fr); } .inspector { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } .inspector > .panel-heading, .next { grid-column: 1 / -1; } .feedback, .equipment-note, .connections-section { margin-top: 0; } .connections-section { grid-column: 1 / -1; } .top-note, .intro-tag, .mission-target { display: none; } }
@media (max-width: 650px) { .topbar { padding: 0 16px; } main { padding: 20px 12px; } .stage-button { padding: 10px 8px; font-size: 10px; gap: 6px; } .step-index { font-size: 14px; } .workspace { display: flex; flex-direction: column; } .panel { width: 100%; } .palette { grid-template-columns: repeat(2, 1fr); } .material-key { display: none; } .board { min-height: 330px; } .slot.node strong { font-size: 9px; } .slot.node svg { width: 36px; } .inspector { display: block; } .equipment-note, .connections-section { margin-top: 18px; } .page-footer > span:nth-child(2) { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.specification-panel { padding: 20px 24px; margin: 0 0 20px; background: #fff9eb; border: 1px solid #e4d6b8; border-radius: 12px; }
.specification-panel h2 { font-size: 16px; margin-bottom: 10px; }
.specification-panel h2 small { display: inline-block; font-size: 10px; color: #8a744a; margin-left: 12px; }
.specification-panel > p { line-height: 1.9; font-size: 12px; }
.pipe.supply-pipe { stroke: #3972aa; stroke-dasharray: 8 4; }
.pipe-label { fill: #193b40; font-size: 11px; font-weight: 700; stroke: white; stroke-width: 4px; paint-order: stroke; stroke-linejoin: round; }
.slot.corridor { background: #e4edf8; border: 1px dashed #839dbf; opacity: 1; font-size: 10px; color: #456584; }
.slot.work-area { border: 2px dashed #bb9d54; background: #fff4d4; color: #7c652f; font-size: 10px; opacity: 1; }
.slot.node.corridor { border: 2px solid #c27843; }
#completion { border: 0; padding: 0; border-radius: 24px; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 40px); box-shadow: 0 24px 90px #062e3660; color: var(--ink); background: #f7fff8; }
#completion::backdrop { background: #102f3bbd; backdrop-filter: blur(5px); }
.completion-card { padding: 36px; text-align: center; background: radial-gradient(circle at 50% 0, #ccedc4, transparent 55%); animation: celebrate .3s ease-out; }
@keyframes celebrate { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
.completion-emblem { display: grid; place-items: center; margin: 0 auto 14px; width: 74px; height: 74px; border-radius: 50%; font-size: 46px; background: #147d72; color: white; box-shadow: 0 0 0 10px #147d7215; }
#completion-title { font: 900 clamp(38px, 5vw, 66px)/1.05 system-ui, sans-serif; letter-spacing: -2px; color: #126b62; }
#completion-mission { margin: 18px 0 24px; font-weight: 700; }
.completion-card h3 { font-size: 13px; margin-bottom: 8px; }
#completion-lesson { line-height: 1.9; font-size: 13px; }
.completion-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
#completion-finale { margin-top: 18px; color: #147d72; font-weight: 700; line-height: 1.8; }
@media (max-width: 1250px) { .board-toolbar { flex-wrap: wrap; } }
@media (max-width: 800px) { .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); } .completion-card { padding: 24px; } }
