/* game colours */
:root {
  --bg: #10171e;
  --accent: #96c8a2;
  --lcd: #a7bd83;
  --ink: #233c23;
  --cursor-default:url("../assets/rat.png") 5 5, auto;
  /* --cursor-pointer:url("assets/rat.png"), pointer; */
  --cursor-pointer:pointer;
  font-family: 'DM Mono', 'Cascadia Code', 'Courier New', monospace;
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color: #e2eae7;
  background: var(--bg);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 88px 16px 24px;
}
.game { width: min(100%, 420px); }
.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
h1 { margin: 0; font-size: 20px; font-weight: 400; color: var(--accent); }
.scores { display: flex; gap: 18px; font-size: 10px; color: #a4b4b9; }
.scores span { display: flex; flex-direction: column; gap: 5px; }
output { color: #e2eae7; font-size: 15px; font-variant-numeric: tabular-nums; }
.board-wrap { position: relative; border: 2px solid #456252; background: var(--lcd); }
canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; image-rendering: pixelated; touch-action: none; }
.screen-message {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  background: #a7bd83ef;
  color: var(--ink);
}
.screen-message[hidden] { display: none; }
.screen-message strong { font-size: 26px; font-weight: 400; }
button {
  font: inherit;
  font-size: 12px;
  color: var(--accent);
  background: #172b4d;
  border: 1px solid #344b5e;
  padding: 12px 20px;
  min-height: 44px;
  cursor: pointer;
  touch-action: manipulation;
}
button:hover { border-color: var(--accent); }
button:disabled { opacity: .35; cursor: default; }
:is(button, canvas):focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; }
.screen-message button { background: var(--ink); border-color: var(--ink); color: var(--lcd); min-width: 100px; }
.screen-message button:focus-visible { outline-color: var(--ink); }
.controls { display: flex; gap: 10px; margin-top: 14px; }
.controls button { flex: 1; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); }




/* same cursor behavior as the home page, with the local rat asset path above */
@media (hover: hover) and (pointer: fine) {
  html[data-custom-cursor="on"] body { cursor: var(--cursor-default); }
  html[data-custom-cursor="on"] :is(a, button, summary) { cursor: var(--cursor-pointer); }
}

/* reserve room for the header and controls in short and landscape viewports */
body { padding: 88px 16px 16px; }
.game { width: min(100%, 420px, max(180px, calc(100svh - 232px))); }
.game-header { gap: 12px; margin-bottom: 16px; }
.scores { font-size: var(--meta-size); line-height: var(--meta-leading); gap: 16px; }
output { font-size: var(--body-size); line-height: var(--body-leading); }
button { font-size: var(--control-size); line-height: var(--control-leading); padding: 12px 16px; }
.controls { gap: 8px; margin-top: 16px; }
@media (max-height: 500px) and (min-width: 600px) {
  body { padding-block: 16px; padding-inline: 96px 16px; }
  .game { width: min(100%, 420px, max(180px, calc(100svh - 152px))); }
}

/* Controls decorative motion; snake gameplay keeps its normal timing. */
.motion-toggle { font-size: var(--meta-size); line-height: var(--meta-leading); display: block; margin: 8px auto 0; padding: 8px; background: none; border: 0; color: #a4b4b9; }
