@font-face {
  font-family: "Inter Name";
  src: url("/fonts/inter-name.v1.woff2") format("woff2");
  font-weight: 900;
  font-display: block;
}
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.v1.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --bg: #1721B7;
  --ink: #FFFFFF;
  /* safe areas (notch, rounded corners), read by game.js */
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --dot: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 28 28'><defs><radialGradient id='g'><stop offset='0' stop-color='%23fff' stop-opacity='.5'/><stop offset='.65' stop-color='%23fff' stop-opacity='.4'/><stop offset='1' stop-color='%23fff' stop-opacity='0'/></radialGradient></defs><circle cx='14' cy='14' r='13' fill='url(%23g)'/></svg>") 14 14;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
  font-weight: 400;
  font-size: 12px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

#board {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: block;
  /* waiting: a pinch can still zoom the page; playing: every touch is the bar */
  touch-action: pinch-zoom;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
body.playing #board { touch-action: none; }
/* while you play, the cursor turns into a soft see-through dot, like a
   fingertip in Chrome's mobile view, so you always know where it is,
   footer included */
body.playing #board { cursor: var(--dot), none; }
body.playing .foot,
body.playing .foot * { cursor: var(--dot), auto; }
/* autoplay: the computer has the bar, so the normal cursor comes back */
body.playing.auto #board { cursor: default; }
body.playing.auto .foot, body.playing.auto .foot * { cursor: auto; }
body.playing.auto .foot button { cursor: pointer; }
#board:focus-visible { outline: 2px solid var(--ink); outline-offset: -4px; }
/* the ring is for people who Tab to the game, not for mouse and touch players pressing Escape */
#board[data-pointer]:focus-visible { outline: none; }

/* footer: links on the left, sound, autoplay and reset on the right.
   One spacing value (--pad) on all four sides, so the first link starts
   exactly as far from the left edge as the last icon ends from the right, and
   the row sits with equal space above and below. Only the links and the
   buttons take taps; the rest of the footer lets them through to the bar. */
.foot {
  --pad: 14px;
  --type: 9px;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;               /* the two sides never touch, even on the narrowest phone */
  padding:
    var(--pad)
    calc(var(--pad) + env(safe-area-inset-right))
    calc(var(--pad) + env(safe-area-inset-bottom))
    calc(var(--pad) + env(safe-area-inset-left));
  background: transparent;  /* the ball falls behind the footer, not under a panel */
  pointer-events: none;
  touch-action: manipulation;
  font-size: var(--type);
  line-height: 1;
  cursor: auto;
}

.links, .tools { pointer-events: auto; }

/* Claylodge • LinkedIn: one line at every width (it is short enough to fit
   beside the icons on the smallest phone), with a quiet dot between. The gap
   matches the 8px between the icons, so both sides of the footer feel the same. */
.links { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.sep { opacity: 0.45; }

/* each link: a quiet underline that firms up on hover. The padding and the
   matching negative margin give it a bigger tap area without moving it; the
   areas reach into the gap around the dot but never overlap. */
.out {
  padding: 10px 2px;
  margin: -10px -2px;
  color: color-mix(in srgb, var(--ink) 75%, transparent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, var(--ink) 30%, transparent);
  transition: color 140ms ease, text-decoration-color 140ms ease;
}
.out:hover { color: var(--ink); text-decoration-color: var(--ink); }
.out:active { color: color-mix(in srgb, var(--ink) 60%, transparent); }

/* icons sit flush: no box around them, so nothing adds hidden space.
   A larger invisible hit area keeps them easy to tap. */
.tools { display: flex; align-items: center; gap: 8px; }
.tools button {
  position: relative;
  display: block;
  padding: 0;
  font: inherit;
  line-height: 1;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 120ms;
}
/* the two hit areas meet halfway across the gap and never overlap */
.tools button::after { content: ""; position: absolute; inset: -10px -4px; }
.tools button:hover { opacity: 1; }
/* autoplay on: the robot stays bright, with a small dot under it */
.tools .auto[aria-pressed="true"] { opacity: 1; }
.tools .auto[aria-pressed="true"]::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 3px;
  height: 3px;
  margin-left: -1.5px;
  border-radius: 50%;
  background: var(--ink);
}
.tools .emoji { display: block; font-size: calc(var(--type) * 1.25); line-height: 1; }
@media (prefers-reduced-motion: no-preference) {
  .tools .emoji { transition: transform 300ms ease; }
  .tools .reset:hover .emoji { transform: rotate(-180deg); }
  .tools button:active .emoji { transform: scale(0.85); }
}

.out:focus-visible, .tools button:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; opacity: 1; }

/* touch: taller tap areas, so a thumb lands on the link it means */
@media (pointer: coarse) {
  .tools button::after { inset: -14px -4px; }
  .out { padding: 14px 3px; margin: -14px -3px; }
}

/* without JavaScript, the name still shows */
.nojs {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: var(--sat) var(--sar) 0 var(--sal);
  font: 900 13vw/0.9 "Inter Name", "Inter", "Helvetica Neue", Arial, sans-serif;
  text-transform: uppercase;
  text-align: center;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* 404 */
body.lost { overflow: auto; }
.lost-main {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px calc(14px + var(--sar)) 28px calc(14px + var(--sal));
  text-align: center;
}
.lost-title { font: 900 clamp(96px, 30vw, 320px)/0.8 "Inter Name", "Inter", "Helvetica Neue", Arial, sans-serif; letter-spacing: -0.02em; }
.lost-text { font-size: 12px; }
.lost-home { font-size: 12px; }
