* { box-sizing: border-box; }
:root { color: #183344; background: #e6eef3; font-family: Inter, system-ui, sans-serif; color-scheme: light; }
body { margin: 0; overscroll-behavior: none; }
main { width: min(100%, 560px); margin: auto; padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
h1 { margin: 0; font-size: clamp(2rem, 8vw, 3rem); font-weight: 900; letter-spacing: -.06em; line-height: 1; }
h1 span { color: #a74410; }
header p, #hint { font-size: .78rem; margin: 6px 0 10px; line-height: 1.45; }
canvas { display: block; width: 100%; height: clamp(190px, 57vh, 570px); height: clamp(190px, 57dvh, 570px); border-radius: 18px; touch-action: none; }
.controls { padding: 10px; border-radius: 14px; background: #f5f9fb; }
.buttons { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 6px; }
button { min-height: 44px; padding: 0 3px; border: 1px solid #c5d5df; border-radius: 9px; background: #e6eef3; color: inherit; font: 800 .72rem system-ui, sans-serif; cursor: pointer; touch-action: manipulation; user-select: none; }
#start { background: #203d50; color: white; }
button:disabled { opacity: .65; cursor: default; }
button:focus-visible, input:focus-visible { outline: 3px solid #a74410; outline-offset: 2px; }
.settings { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.sensitivity { flex: 1; min-width: 0; }
label, .ticks { display: flex; justify-content: space-between; font-size: .64rem; font-weight: 750; }
input { display: block; width: 100%; height: 28px; margin: 0; accent-color: #a74410; }
#pad:not([hidden]) { display: grid; grid-template-columns: repeat(3, 44px); gap: 3px; }
#pad button { touch-action: none; font-size: 1.2rem; }
#pad button:first-child { grid-column: 2; }
#pad button:nth-child(2) { grid-column: 1; }
#pad button:active { background: #b7cfdd; }
@media (orientation: landscape) and (max-height: 590px) {
  main { width: min(100%, 880px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, .65fr); gap: 8px 14px; }
  header { grid-column: 2; align-self: end; }
  .play { grid-column: 1; grid-row: 1 / 3; }
  canvas { height: clamp(145px, 74dvh, 440px); }
  .controls { align-self: start; }
  .settings { flex-wrap: wrap; }
}