:root {
  color-scheme: light;
  --background: #fafafa;
  --ink: #212121;
  --muted: #616161;
  --green: #558b2f;
  --light-green: #aed581;
}
* { box-sizing: border-box; }
html.snake-page { overscroll-behavior-y: none; }
html.snake-playing.snake-page-fits, .snake-playing .game { touch-action: pinch-zoom; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(20px, 3svh, 32px);
  padding: 0 clamp(16px, 3vw, 32px) clamp(16px, 3vw, 32px);
  background: radial-gradient(ellipse at 50% 44%, #fff 0%, #fdfdfa 65%, #f6f8f3 100%);
  color: var(--ink);
  font: 11px/1.5 "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  -webkit-font-smoothing: antialiased;
}
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .2; background-image: radial-gradient(#558b2f55 .55px, transparent .55px); background-size: 19px 19px; }
.profile-header { --portrait-width: 210px; position: relative; flex: none; display: grid; grid-template-columns: var(--portrait-width) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); width: min(880px, 100%); height: 200px; isolation: isolate; }
.profile-header::before { content: ""; position: absolute; inset-block: 0; left: 50%; width: 100vw; transform: translateX(-50%); background: #edf5e4; z-index: -1; pointer-events: none; }
.profile-header::after { content: ""; position: absolute; top: 100%; left: 50%; width: 100vw; transform: translateX(-50%); height: 1px; background: #33691e12; z-index: -1; pointer-events: none; }
.profile-photo-frame { min-width: 0; min-height: 0; height: 100%; padding: 12px 20px; }
.profile-photo { height: 100%; overflow: hidden; border-radius: 10px; background: #edf5e4; }
.profile-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.profile-copy { align-self: center; min-width: 0; padding: 12px 32px; }
.profile-copy h1, .legal-header a { margin: 0; color: #33691e; font: 700 clamp(28px, 3.5vw, 42px)/1.1 "Arial Narrow", "Helvetica Neue", Arial, sans-serif; letter-spacing: -1.2px; text-transform: uppercase; }
.job-title { margin: 8px 0 2px; font-size: 14px; color: var(--muted); }
.profile-links { display: flex; flex-wrap: wrap; gap: 0 22px; }
.profile-links a { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--green); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.profile-links a:hover { color: #33691e; }
.profile-links a:focus-visible, .site-footer a:focus-visible, .legal-header a:focus-visible, .legal-content a:focus-visible { outline: none; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.game { position: relative; flex: none; width: min(420px, 100%, max(220px, calc(100svh - 414px))); margin: auto 0; }
.scores { display: flex; align-items: center; justify-content: space-between; padding: 0 14px; font-size: 12px; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.best { color: var(--muted); font-size: 10px; }
.field { position: relative; aspect-ratio: 1; margin: 10px 0 4px; }
canvas { display: block; width: 100%; height: 100%; border-radius: 12px; border: 1px solid #558b2f35; touch-action: pinch-zoom; }
button { font: inherit; cursor: pointer; border: 0; color: inherit; background: transparent; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:hover { color: var(--green); }
button:focus-visible { outline: none; text-decoration: underline; text-underline-offset: 4px; }
canvas:focus-visible { outline: 1px dotted var(--green); outline-offset: 5px; }
[hidden] { display: none !important; }
.instructions { text-align: center; color: var(--muted); min-height: 65px; }
#start { min-height: 44px; padding: 8px 15px; letter-spacing: .2px; }
#playing-hint { display: block; padding: 14px 0 10px; }
.legend { display: block; font-size: 9px; letter-spacing: .2px; }
.laptop { vertical-align: -3px; }
.result { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; border-radius: 12px; background: #fafafaf5; text-align: center; }
.result p { margin: 15px 0 4px; font-size: 30px; letter-spacing: -1px; }
.result span { color: var(--muted); font-size: 10px; }
#result-tag { font-size: 8px; letter-spacing: .8px; }
.result h2 { margin: 10px 0; font-size: clamp(16px, 3.6vw, 23px); letter-spacing: -.7px; font-weight: 400; }
#result-message { max-width: 78%; font-size: 10px; line-height: 1.7; }
#restart, #resume { min-height: 44px; margin-top: 13px; color: var(--green); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
noscript { display: block; text-align: center; }
.site-footer { flex: none; display: flex; justify-content: center; flex-wrap: wrap; gap: 0 24px; width: min(880px, 100%); text-align: center; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); text-underline-offset: 4px; }
.legal-header { position: relative; isolation: isolate; flex: none; width: min(880px, 100%); padding: 32px 20px; }
.legal-header::before { content: ""; position: absolute; inset-block: 0; left: 50%; width: 100vw; transform: translateX(-50%); background: #edf5e4; z-index: -1; pointer-events: none; }
.legal-header a { display: inline-block; text-decoration: none; }
.legal-content { width: min(880px, 100%); padding: 0 20px; font-size: 14px; line-height: 1.7; }
.legal-content h1 { margin: 0 0 28px; font: 700 32px/1.2 "Helvetica Neue", Arial, sans-serif; }
.legal-content h2 { margin: 36px 0 16px; font-size: 24px; }
.legal-content h3 { margin: 24px 0 8px; font-size: 16px; }
.legal-content address { font-style: normal; }
.legal-content p { margin: 0 0 12px; }
.legal-content a { color: var(--green); text-underline-offset: 4px; overflow-wrap: anywhere; }
.legal-content + .site-footer { margin-top: auto; }
.site-footer a:hover, .legal-content a:hover { color: #33691e; }
@media (max-width: 960px) {
  .profile-header { --portrait-width: 180px; height: 180px; }
  .profile-copy { padding-inline: 24px; }
  .game { width: min(420px, 100%, max(220px, calc(100svh - 394px))); }
}
@media (max-width: 600px) {
  body { padding: 0 16px 16px; gap: 20px; }
  .profile-header { --portrait-width: clamp(100px, 26vw, 140px); width: calc(100% + 32px); height: 160px; }
  .profile-photo-frame { padding: 12px 8px; }
  .profile-copy { padding: 10px 16px; }
  .profile-copy h1, .legal-header a { font-size: clamp(24px, 5.8vw, 32px); letter-spacing: -.7px; }
  .job-title { margin-top: 7px; font-size: 12px; }
  .profile-links { gap: 0 14px; font-size: 10px; }
}
@media (min-width: 601px) {
  .profile-copy { padding-left: 32px; }
}
@media (max-height: 480px) {
  .instructions { min-height: 48px; }
  .field { margin-top: 4px; }
  .legend { display: none; }
  .result h2 { margin: 5px 0; font-size: 13px; }
  #result-tag, #result-message { display: none; }
  .result p { margin-top: 4px; font-size: 23px; }
  #restart { margin-top: 2px; }
}
