* { box-sizing: border-box; }
body { margin: 0; font-family: "Trebuchet MS", system-ui, sans-serif; background: #1d2b3a; color: #fff; -webkit-tap-highlight-color: transparent; }
.bar { display: flex; align-items: center; gap: 1rem; padding: 0.6rem 1rem; background: #14202c; }
.bar h1 { font-size: 1.3rem; margin: 0; }
.home { color: #ffd76a; text-decoration: none; font-weight: bold; }
button { font: inherit; border: 2px solid #ffd76a; background: #14202c; color: #fff; border-radius: 999px; padding: .45rem 1rem; cursor: pointer; }
button.active, button:hover { background: #ffd76a; color: #14202c; }
.menu { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; padding: .7rem; background: #26394d; }
.hud { display: flex; justify-content: center; gap: 1.4rem; padding: .5rem; font-size: 1.1rem; flex-wrap: wrap; }
.wrap { position: relative; width: min(96vw, 640px, 72vh); margin: 0 auto; }
canvas#c { width: 100%; display: block; border-radius: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.5); touch-action: none; }
.pad { display: grid; grid-template-columns: repeat(3, 64px); grid-template-rows: repeat(2, 64px); gap: 6px; justify-content: center; margin: 1rem auto; }
.pad button { font-size: 1.6rem; padding: 0; border-radius: 16px; }
.pad .u { grid-column: 2; } .pad .l { grid-row: 2; grid-column: 1; } .pad .d { grid-row: 2; grid-column: 2; } .pad .rt { grid-row: 2; grid-column: 3; }
.over { position: absolute; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; border-radius: 14px; }
.over[hidden] { display: none; }
.card { background: #fff7dd; color: #3a2a10; text-align: center; border-radius: 18px; padding: 1.2rem 1.6rem; border: 4px solid #ffd76a; max-width: 90%; }
.card h2 { margin: 0 0 .4rem; }
.card button { margin: .3rem; background: #ffd76a; color: #14202c; font-weight: bold; }
.card input { font: inherit; padding: .3rem .6rem; border-radius: 8px; border: 2px solid #ffd76a; width: 10rem; text-align: center; }
.scores { max-width: 420px; margin: 1rem auto 2rem; padding: 0 1rem; }
.scores h3 { text-align: center; margin: .3rem; }
.scores ol { margin: 0; padding-left: 1.5rem; }