:root {
  color-scheme: light;
  --ink: #253331;
  --ink-soft: #40524f;
  --paper: #fffefa;
  --paper-soft: #fbfffd;
  --deep: #173b3b;
  --teal: #2f8f70;
  --sand: #e6c984;
  --muted: #667572;
  --line: #dce9e4;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; background: var(--paper-soft); }
body { color: var(--ink); background: radial-gradient(circle at 50% 12%, rgba(142,223,193,.14), transparent 25%), linear-gradient(180deg, #fff 0%, #fbfffd 48%, #f6fbf8 100%); line-height: 1.8; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a:focus-visible, button:focus-visible, input:focus-visible, canvas:focus-visible, summary:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.site-header, .site-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; width: min(1080px, calc(100% - 32px)); margin-inline: auto; padding: 18px 0 8px; color: var(--muted); background: transparent; }
.site-logo, .site-nav a, .site-footer a { color: inherit; text-decoration: none; }
.site-logo { color: var(--teal); font-size: 1rem; font-weight: 900; letter-spacing: .08em; }
.site-nav, .site-footer { display: flex; flex-wrap: wrap; }
.site-nav { justify-content: flex-end; gap: 8px 16px; font-size: .92rem; }
.site-nav a:hover, .site-footer a:hover { color: var(--teal); }
.site-footer { justify-content: center; font-size: .92rem; border-top: 1px solid #edf5f2; padding: 32px 0 40px; }
.site-header a, .site-footer a { display: inline-flex; align-items: center; min-height: 44px; }
.page-shell { width: 100%; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; width: min(1080px, calc(100% - 32px)); margin-inline: auto; min-height: 38px; padding: 9px 0; color: var(--muted); font-size: .75rem; }
.breadcrumb a { color: var(--teal); }
.app-shell { padding: 32px 16px 36px; background: transparent; }
.game-inner { max-width: 1080px; margin-inline: auto; }
.page-shell > .game-comment-section { width: min(1080px, calc(100% - 32px)); margin-inline: auto; }
.site-head { margin-bottom: 32px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 18px; font-size: 3rem; line-height: 1.15; letter-spacing: 0; }
.eyebrow, .panel-kicker, .usage-kicker { margin-bottom: 8px; color: var(--teal); font-size: .78rem; font-weight: 900; letter-spacing: .1em; }
.lead { margin-bottom: 10px; color: var(--ink-soft); font-size: 1.08rem; line-height: 1.8; }
.prototype-tag { display: inline-block; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .7rem; background: #fbfffd; }
.game-hud { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.metric { min-width: 0; padding: 12px 16px; border: 1px solid #e7f1ed; border-radius: 8px; background: #fbfffd; }
.metric span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .76rem; }
.metric strong { font-size: clamp(1rem, 2vw, 1.35rem); font-variant-numeric: tabular-nums; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; align-items: start; gap: 16px; }
.canvas-wrap { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #758173; box-shadow: 0 18px 45px rgba(45,92,78,.12); }
#sea-canvas { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; touch-action: none; cursor: crosshair; }
.control-panel, .ventral-panel, .result-panel { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,.9); box-shadow: 0 18px 45px rgba(45,92,78,.08); }
#goal-copy { margin-bottom: 12px; font-size: 1rem; line-height: 1.6; }
#status-line { min-height: 44px; margin-bottom: 12px; color: #216f59; font-size: .82rem; line-height: 1.6; overflow-wrap: anywhere; }
.action-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#start-button.canvas-start { position: absolute; z-index: 1; left: 50%; top: 50%; transform: translate(-50%, -50%); min-width: 140px; min-height: 52px; box-shadow: 0 4px 18px rgba(0,0,0,.25); }
.button { min-width: 0; min-height: 46px; padding: 9px 7px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: #fff; font-size: .8rem; font-weight: 900; cursor: pointer; }
.button:hover:not(:disabled), .button.is-pressed { border-color: #78cfb0; background: #effbf6; }
.button:active:not(:disabled) { background: #d9f3e8; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button-primary { color: #216f59; border-color: #78cfb0; background: #effbf6; }
.steer-controls { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 20px; }
.steer-controls button, .eat-button { touch-action: none; user-select: none; -webkit-user-select: none; }
.eat-button { position: absolute; z-index: 1; right: 12px; bottom: 12px; width: 138px; min-height: 48px; margin: 0; color: #216f59; background: #effbf6; border-color: #78cfb0; box-shadow: 0 3px 12px rgba(0,0,0,.2); }
.eat-button:disabled { opacity: 1; color: #65706b; background: #e3e9e5; border-color: #c5cec7; box-shadow: none; }
.result-overlay { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; background: rgba(13,32,29,.48); }
.result-card { width: min(380px, calc(100% - 24px)); max-height: calc(100% - 16px); overflow-y: auto; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fbfffd; box-shadow: 0 8px 32px rgba(0,0,0,.22); text-align: center; }
.result-card h2 { margin: 0 0 8px; color: #216f59; font-size: 1.5rem; line-height: 1.25; }
.result-card p { margin: 0 0 8px; color: var(--ink-soft); font-size: .85rem; line-height: 1.5; }
#result-stats { font-weight: 700; font-variant-numeric: tabular-nums; }
#retry-button { min-width: 160px; min-height: 46px; }
.key-help { margin: 12px 0 6px; color: var(--muted); font-size: .77rem; line-height: 1.75; }
.check-row { display: flex; align-items: center; gap: 9px; min-height: 44px; color: var(--muted); font-size: .8rem; cursor: pointer; }
.check-row input { width: 20px; height: 20px; accent-color: var(--teal); }
.ventral-panel, .result-panel { margin-top: 16px; }
.ventral-panel h2, .result-panel h2 { margin-bottom: 8px; font-size: 1.1rem; }
.ventral-panel p, .result-panel p { margin-bottom: 0; color: var(--muted); font-size: .85rem; line-height: 1.7; }
#ventral-canvas { display: block; width: 100%; height: clamp(260px, 48vw, 440px); margin-top: 12px; border-radius: 8px; background: var(--deep); }
.error-box { margin: 16px 0 0; padding: 16px; border: 1px solid #d79b80; border-radius: 10px; color: #ffe1d0; background: #4c302a; overflow-wrap: anywhere; }
.usage-section, .info-section { width: min(1080px, calc(100% - 32px)); margin-inline: auto; padding: 44px 0 24px; color: var(--ink); }
.usage-kicker { color: #397d79; }
.usage-section h2 { margin-bottom: 26px; font-size: clamp(1.35rem, 2.4vw, 1.8rem); }
.usage-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }
.usage-grid article { min-width: 0; padding-top: 14px; border-top: 1px solid #9db1aa; }
.usage-grid h3 { margin-bottom: 7px; font-size: 1.02rem; }
.usage-grid p, .info-section p { color: var(--ink-soft); line-height: 1.8; }
.info-section { padding-top: 16px; padding-bottom: 40px; }
.info-section details { border-top: 1px solid #b0c2b8; }
.info-section summary { min-height: 48px; padding: 14px 0; font-weight: 700; cursor: pointer; }
.info-section a { color: #25645c; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .control-panel { padding: 16px; }
  .steer-controls { margin-top: 12px; }
}
@media (max-width: 820px) { h1 { font-size: 1.75rem; } }
@media (max-width: 600px) {
  .site-header { align-items: flex-start; flex-direction: column; gap: 0; }
  .site-nav { justify-content: flex-start; }
  .app-shell { padding: 22px 14px 28px; }
  .game-hud { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .metric { padding: 10px 12px; }
  .usage-section, .info-section { width: calc(100% - 28px); }
  .page-shell > .game-comment-section { width: calc(100% - 28px); }
  .usage-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .usage-section { padding-top: 32px; }
  .site-footer { gap: 4px 18px; }
}
