:root {
  --bg: #000;
  --ink-dim: #b9cbe6;      /* caption: 12.7:1 on black, at least 4.9:1 even over a white seam through its 92% black pill */
  --focus: #60a5fa;        /* focus ring on black: 7.9:1 */
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

/* The component fills the whole screen; the field is height-normalised, so wider screens show more cells. */
.ferro {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  margin: 0;
  background:
    radial-gradient(120% 80% at 30% 30%, #0b2a6f 0%, #020617 55%, #000 100%);
  cursor: crosshair;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: none; /* full screen: a held finger plays the effect instead of scrolling or zooming */
  -webkit-touch-callout: none;
  user-select: none;
  -webkit-user-select: none;
}

.ferro:focus { outline: none; }
.ferro:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -4px; /* inside the screen edge, so it stays visible */
}

.ferro__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.ferro__fallback {
  position: absolute;
  inset: auto 16px 16px;
  font-size: 14px;
  color: #dbeafe;
}

.hint {
  position: absolute;
  left: 50%;
  bottom: max(16px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.92); /* keeps the caption readable over the field */
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: var(--ink-dim);
  text-align: center;
  white-space: nowrap;
  pointer-events: none; /* never interrupts the hover */
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
