:root {
	--bg: #0c0d12;
	--panel: #15151c;
	--panel2: #1d1b22;
	--line: #353039;
	--ink: #eee9df;
	--dim: #9a9290;
	--copper: #d77b46;
	--fire: #ff9d3d;
	--acid: #afd65f;
	--bone: #7fd2d8;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-width: 100%; min-height: 100%; }
body { color: var(--ink); background: radial-gradient(circle at 50% -20%, #31251d 0, var(--bg) 38rem); font: 13px/1.5 "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif; }
button, select, input { font: inherit; }
button, select { color: var(--ink); background: #211e24; border: 1px solid var(--line); border-radius: 7px; padding: 7px 11px; }
button { cursor: pointer; }
button:hover { background: #2b2528; border-color: #655354; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--fire); outline-offset: 2px; }
.eyebrow { margin: 0; color: var(--copper); font: 650 10px/1.2 ui-monospace, SFMono-Regular, monospace; letter-spacing: .18em; }

#boot { position: fixed; inset: 0; display: grid; place-items: center; text-align: center; background: #0c0d12; }
#boot h1 { margin: 8px 0 5px; font-size: 27px; }
#boot p:last-child { margin: 0; color: var(--dim); }

#app { min-height: 100vh; display: grid; grid-template-rows: 58px 1fr 34px; }
.topbar { display: flex; align-items: center; gap: 30px; padding: 0 18px; background: #101015e8; border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 240px; }
.brand b, .brand small { display: block; }
.brand small { color: var(--dim); font-size: 10px; }
.brand-mark { width: 27px; height: 19px; border: 2px solid var(--copper); border-radius: 50% 65% 45% 50%; transform: rotate(-8deg); box-shadow: 9px 1px 0 -6px var(--fire), 16px 2px 0 -7px #ffcf72; }
nav { display: flex; align-self: stretch; }
nav a { display: grid; place-items: center; padding: 0 13px; color: var(--dim); text-decoration: none; border-bottom: 2px solid transparent; }
nav a.on { color: var(--ink); border-bottom-color: var(--copper); }
.run { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: 11px; }
.run b { color: #d7c7b9; font: 11px ui-monospace, monospace; }

main { width: min(1460px, 100%); margin: 0 auto; padding: 22px 24px 16px; }
.intro { display: grid; grid-template-columns: minmax(280px, .75fr) 1fr; align-items: end; gap: 34px; margin-bottom: 16px; }
.intro h1 { margin: 3px 0 0; font-size: clamp(22px, 3vw, 34px); font-weight: 680; letter-spacing: -.02em; }
.intro > p { max-width: 640px; margin: 0 0 3px; color: #b6aca5; }
.species-picker { margin-bottom: 12px; padding: 7px; background: #121116b8; border: 1px solid #302a31; border-radius: 11px; }
.species { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.species button { position: relative; min-width: 0; padding: 9px 9px 8px 15px; text-align: left; overflow: hidden; }
.species button::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 6px; background: var(--species-color); }
.species button b, .species button small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.species button b { font-size: 11px; }.species button small { color: var(--dim); font-size: 9px; }
.species button.on { color: #160d08; background: var(--species-accent); border-color: var(--species-accent); }
.species button.on small { color: #402d22; }

.models { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.model { min-width: 0; overflow: hidden; background: linear-gradient(145deg, #1c191c, #121218); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 38px #0005; }
.model-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid #302b31; }
.model-index { display: grid; place-items: center; width: 25px; height: 25px; color: #160d08; background: var(--copper); border-radius: 50%; font: 750 12px ui-monospace, monospace; }
.model h2 { margin: 0; font-size: 14px; }
.model-note { margin: 1px 0 0; color: var(--dim); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metrics { display: flex; gap: 13px; color: var(--dim); font: 10px ui-monospace, monospace; }
.metrics b { color: #ded1c4; font-weight: 500; }
.tank { position: relative; aspect-ratio: 16 / 6.7; background: #08090d; cursor: crosshair; touch-action: none; }
.tank canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; }
.tank::after { content: "押して削る"; position: absolute; right: 9px; bottom: 7px; color: #b5a59a88; font-size: 9px; pointer-events: none; }

.console { position: sticky; bottom: 8px; z-index: 3; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; margin-top: 12px; padding: 9px 12px; background: #17151bea; border: 1px solid #42383c; border-radius: 11px; box-shadow: 0 12px 38px #0009; backdrop-filter: blur(15px); }
.transport, .events, .views { display: flex; align-items: center; gap: 8px; }
.transport label { display: flex; align-items: center; gap: 6px; color: var(--dim); font-size: 11px; }
.icon { width: 35px; height: 33px; padding: 0; }
.primary { min-width: 118px; color: #170c05; background: var(--copper); border-color: var(--copper); font-weight: 750; }
.primary:hover { background: #e38a55; }
.events { justify-content: center; }
.fire { color: #241007; background: linear-gradient(#ffbd57, #f17a31); border-color: #ffb14c; font-weight: 750; box-shadow: 0 0 18px #f2762933; }
.fire:hover { background: linear-gradient(#ffd073, #ff9145); }
.views { justify-content: flex-end; color: var(--dim); }
.views label { cursor: pointer; }
.views input { accent-color: var(--copper); }

footer { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 0 18px; color: #817a79; background: #101015; border-top: 1px solid #262329; font-size: 10px; }
.mouse { display: inline-block; width: 9px; height: 12px; margin-right: 6px; vertical-align: -2px; border: 1px solid #817a79; border-radius: 5px; }

@media (max-width: 960px) {
	#app { grid-template-rows: auto 1fr auto; }
	.topbar { min-height: 58px; flex-wrap: wrap; gap: 10px 20px; padding-block: 8px; }
	.brand { min-width: 0; }.run { margin-left: 0; } nav { order: 3; width: 100%; height: 34px; }
	main { padding: 16px; }.models { grid-template-columns: 1fr; }
	.species { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.console { grid-template-columns: 1fr; gap: 8px; }.transport, .events, .views { justify-content: center; }
	footer { flex-wrap: wrap; padding-block: 7px; }
}

@media (max-width: 600px) {
	.intro { grid-template-columns: 1fr; gap: 5px; }
	.species { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.model-note { white-space: normal; }
	.model-head { grid-template-columns: auto 1fr; }.metrics { grid-column: 2; }
	.transport { flex-wrap: wrap; }.views { display: none; }
}
