:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  background: #050505;
  color: #f4f4f4;
  --rule: #292929;
  --muted: #a3a3a3;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }
.shell { width: min(930px, 100% - 52px); margin: 0 auto; }
.mast, footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mast { height: 64px; border-bottom: 1px solid var(--rule); }
.mast, .frame-head, .stats span, .pace, .overlay > span, .notes span, footer {
  font: 600 11px/1.35 var(--mono);
  letter-spacing: .11em;
  color: var(--muted);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: #f4f4f4; }
.intro { padding: 34px 0 24px; }
h1, p { margin: 0; }
h1 { font-size: clamp(54px, 9vw, 105px); line-height: .95; letter-spacing: -.078em; }
h1 span { color: #818181; }
.intro p { margin-top: 13px; color: #b6b6b6; font-size: 15px; }
.game { display: grid; grid-template-columns: minmax(0, 1fr) 248px; border: 1px solid var(--rule); }
.arena { min-width: 0; background: #080808; }
.frame-head { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; border-bottom: 1px solid var(--rule); }
.frame-head i { display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: #eee; vertical-align: 2px; }
.screen { position: relative; width: min(100%, 510px); margin: 0 auto; touch-action: none; user-select: none; }
.board { display: grid; grid-template-columns: repeat(18, 1fr); width: 100%; aspect-ratio: 1; background: #0b0b0b; border-left: 1px solid #161616; border-top: 1px solid #161616; }
.cell { min-width: 0; min-height: 0; position: relative; border-right: 1px solid #191919; border-bottom: 1px solid #191919; }
.cell.body::before, .cell.head::before, .cell.food::before { position: absolute; content: ""; }
.cell.body::before { inset: 1px; background: #cfcfcf; }
.cell.head::before { inset: 1px; background: #fff; }
.cell.head::after { content: ""; position: absolute; width: 18%; height: 18%; top: 41%; left: 41%; border-radius: 50%; background: #222; }
.cell.food::before { inset: 28%; border: 2px solid #fff; border-radius: 50%; }
.overlay { position: absolute; left: 50%; top: 34%; transform: translate(-50%,-50%); display: grid; justify-items: center; width: min(230px, 78%); padding: 14px 12px; background: #0a0a0af5; border: 1px solid #383838; box-shadow: 0 12px 40px #000b; }
.overlay[hidden] { display: none; }
.overlay strong { margin: 3px 0 9px; text-align: center; font-size: clamp(19px, 4vw, 29px); letter-spacing: -.045em; }
.overlay button { padding: 6px 10px; background: #f4f4f4; color: #060606; border: 0; font-size: 13px; font-weight: 700; }
.overlay button span { margin-left: 4px; }
.panel { border-left: 1px solid var(--rule); padding: 19px; background: #0c0c0c; }
.stats { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--rule); padding-bottom: 16px; }
.stats > div + div { padding-left: 12px; border-left: 1px solid var(--rule); }
.stats strong { display: block; margin-top: 5px; font: 700 30px/1 var(--mono); color: #f4f4f4; }
.pace { padding: 17px 0; }
.pace > div:first-child { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.pace strong { color: #e8e8e8; letter-spacing: 0; }
.meter { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; margin-top: 8px; }
.meter span { height: 3px; background: #323232; }
.meter span.active { background: #ededed; }
.panel-controls { display: flex; gap: 7px; }
.action, .restart { min-height: 42px; border: 1px solid #3b3b3b; font-weight: 690; }
.action { flex: 1; background: #f3f3f3; color: #080808; border-color: #f3f3f3; }
.action:hover, .overlay button:hover { background: #d3d3d3; }
.restart, .pad button { color: #eee; background: #151515; }
.restart { width: 42px; font-size: 19px; }
.restart:hover, .pad button:hover { background: #272727; }
.status { min-height: 3.3em; padding-top: 8px; color: #b3b3b3; font-size: 12px; line-height: 1.4; }
.keys { border-top: 1px solid var(--rule); padding-top: 13px; display: grid; gap: 8px; }
.keys div { display: flex; gap: 3px; align-items: center; }
.keys div > span { margin-left: auto; color: var(--muted); font-size: 11px; }
kbd { padding: 3px 5px; border: 1px solid #383838; font: 11px var(--mono); color: #ddd; }
.pad { display: none; grid-template-columns: repeat(3, 46px); gap: 5px; justify-content: center; }
.pad button { height: 44px; border: 1px solid #3b3b3b; font-size: 20px; touch-action: manipulation; }
.pad button:first-child { grid-column: 2; }
.pad button:nth-child(2) { grid-column: 1; }
.notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; border-bottom: 1px solid var(--rule); padding: 20px 0; }
.notes p { color: #c5c5c5; font-size: 13px; line-height: 1.4; margin-top: 6px; }
footer { padding: 19px 0 24px; }
footer span:last-child { letter-spacing: 0; font: 12px system-ui, sans-serif; }
@media (max-width: 720px) {
  .shell { width: calc(100% - 26px); }
  .intro { padding: 22px 0 17px; }
  .game { grid-template-columns: 1fr; }
  .panel { border-left: 0; border-top: 1px solid var(--rule); padding: 12px; }
  .stats { padding-bottom: 9px; }
  .stats strong { font-size: 23px; }
  .pace { padding: 10px 0; }
  .notes { gap: 10px; }
}
@media (max-width: 720px), (pointer: coarse) {
  .keys { display: none; }
  .pad { display: grid; }
}
