/* mono.css — shared visual language. "the lobby": grand-hotel pastel.
   norns bones (dot-grid field, dial, LED grid, brightness ramps) kept;
   reskinned light & symmetric, Jost throughout, deadpan microcopy. */
/* self-hosted Jost (variable, latin subset) — no external font request */
@font-face {
  font-family: 'Jost'; font-style: normal; font-weight: 300 700; font-display: swap;
  src: url('fonts/jost.woff2') format('woff2');
}
:root {
  /* foundation — warm cream ground + cocoa ink */
  --bg: #efdfca;        /* warm cream ground */
  --bg2: #f8efe0;       /* raised surface (cards, keys) */
  --faint: #dcc6aa;     /* lines / borders */
  --dim: #a08b75;       /* secondary text */
  --fg: #3c302a;        /* cocoa ink — primary text */
  /* brand primary — each game overrides --accent / --on-accent */
  --accent: #cf8a9b;    /* dusty rose; hub + default */
  --on-accent: #3c302a; /* ink on a filled accent surface */
  /* feedback — muted manuscript pigments, tuned for the light ground */
  --good: #6f9277;      /* verdigris */
  --bad: #c25b4e;       /* red ochre */
  --early: #c79a3e;     /* gold ochre */
  --late: #6d79ab;      /* woad / indigo */
  --blue: #5e89a6;      /* azurite */
  --radius: 14px;
  --mono: "Jost", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; }
body { min-height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  align-items: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overscroll-behavior: none;
  /* dot-grid field */
  background-image: radial-gradient(circle, #e3cdb0 1px, transparent 1px);
  background-size: 22px 22px;
}
.app { width: 100%; max-width: 520px; padding: 14px 16px 40px; display: flex; flex-direction: column; min-height: 100%; }

/* header — symmetric, centred title with a deadpan Nº tag */
header.bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 8px 0 16px; }
header.bar a.home { color: var(--dim); text-decoration: none; font-size: 16px; justify-self: start; }
header.bar a.home:hover { color: var(--fg); }
header.bar h1 {
  grid-column: 2; justify-self: center; text-align: center;
  font-size: 16px; font-weight: 600; letter-spacing: .34em; text-transform: uppercase;
  color: var(--fg); font-family: var(--sans); animation: settle .9s ease-out;
}
/* heading slide-in: letters tighten (no opacity fade — stays visible if unanimated) */
@keyframes settle { from { letter-spacing: .55em; } to { letter-spacing: .34em; } }
header.bar .tag {
  grid-column: 3; justify-self: end; color: var(--dim); font-size: 11px;
  letter-spacing: .26em; text-transform: uppercase; font-family: var(--sans);
  border: 1px solid var(--faint); border-radius: 999px; padding: 3px 11px; white-space: nowrap;
}
/* a single deadpan line, centred */
.poem { color: var(--dim); font-size: 13px; margin: 0 auto 20px; text-align: center; max-width: 30ch; letter-spacing: .02em; white-space: pre-line; text-wrap: pretty; }
.stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; min-height: 320px; }

/* soft keys */
.keys { display: flex; gap: 10px; width: 100%; }
button.key {
  flex: 1; padding: 14px 8px; font: inherit; font-size: 14px; font-weight: 500; letter-spacing: .03em;
  background: linear-gradient(#fdf6ea, #f3e8d6); color: var(--fg);
  border: 1px solid var(--faint); border-radius: var(--radius);
  /* soft seated key: gentle top sheen + low shadow */
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 1px 0 rgba(120,95,70,.12), 0 3px 7px rgba(120,95,70,.12);
  cursor: pointer;
  transition: background .08s, border-color .08s, color .08s, transform .06s, box-shadow .08s;
}
@media (hover: hover) { button.key:hover { border-color: var(--dim); } }
button.key:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
button.key:active {
  transform: translateY(1px);
  box-shadow: inset 0 2px 4px rgba(120,95,70,.22);
}
button.key.lit { border-color: var(--accent); color: var(--accent); }
button.key.good { border-color: var(--good); color: var(--good); }
button.key.bad { border-color: var(--bad); color: var(--bad); }
button.key:disabled { opacity: .4; cursor: default; box-shadow: none; }
button.key.primary {
  background: linear-gradient(color-mix(in srgb, var(--accent) 88%, #fff), var(--accent));
  color: var(--on-accent); border-color: var(--accent); font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 2px 8px color-mix(in srgb, var(--accent) 32%, transparent);
}

/* tap pad — the clear, addressable target for tap-along games (rest, clave, call) */
.tappad {
  width: 100%; max-width: 420px; min-height: 104px; border-radius: var(--radius);
  background: linear-gradient(#fdf6ea, #f3e8d6); border: 1px solid var(--faint);
  display: flex; align-items: center; justify-content: center;
  color: var(--dim); font-family: var(--sans); font-size: 12px; font-weight: 500;
  letter-spacing: .26em; text-transform: uppercase;
  cursor: pointer; touch-action: none; -webkit-user-select: none; user-select: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 3px 7px rgba(120,95,70,.12);
  transition: transform .05s, background .1s, color .1s, opacity .2s, border-color .2s;
  opacity: .45;  /* resting: visible but waiting — your turn brightens it */
}
.tappad.armed { opacity: 1; border-color: color-mix(in srgb, var(--accent) 55%, var(--faint)); }
.tappad.armed:active { transform: scale(.98); background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

/* big numeric readout — Jost light */
.readout { font-size: 64px; font-weight: 300; letter-spacing: .01em; font-variant-numeric: tabular-nums; font-family: var(--mono); color: var(--fg); line-height: 1; }
.readout small { font-size: 16px; color: var(--dim); font-weight: 400; margin-left: 6px; letter-spacing: .08em; }
.sub { color: var(--dim); font-size: 13px; text-align: center; min-height: 1.4em; letter-spacing: .02em; }
.sub b { color: var(--fg); font-weight: 600; }
.sub .acc { color: var(--accent); }

/* LED grid (monome) */
.grid { display: grid; gap: 8px; touch-action: none; }
.pad {
  width: 100%; aspect-ratio: 1; border-radius: 8px;
  background: var(--bg2); border: 1px solid var(--faint);
  transition: background .07s, box-shadow .15s, border-color .07s;
}
.pad.l1 { background: #f1e2cd; }
.pad.l2 { background: #e7d2b6; }
.pad.lit { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 45%, transparent); }
.pad.good { background: var(--good); border-color: var(--good); }
.pad.bad { background: var(--bad); border-color: var(--bad); }

/* dial / arc ring host */
.ring { touch-action: none; cursor: grab; }
.ring:active { cursor: grabbing; }

/* progress dots (rounds) */
.dots { display: flex; gap: 8px; justify-content: center; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); transition: background .2s; }
.dots span.on { background: var(--accent); }
.dots span.good { background: var(--good); }
.dots span.bad { background: var(--bad); }

/* start gate + result panel */
.gate, .panel {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(6px); z-index: 50; padding: 24px; text-align: center;
}
/* standalone gate/panel buttons must not inherit .keys' flex:1 */
.gate > button.key, .panel > button.key { flex: 0 0 auto; }
.panel .big { font-size: 22px; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--fg); }
.gate .big { font-size: 30px; font-weight: 600; letter-spacing: .01em; color: var(--fg); }
.gate-back { position: absolute; top: 16px; left: 18px; color: var(--dim); text-decoration: none;
  font-size: 24px; line-height: 1; padding: 6px 10px; border-radius: 10px; transition: color .15s, background .15s; }
.gate-back:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 8%, transparent); }
.gate-shape { width: 68px; height: 68px; opacity: .92; }
.gate-shape svg { width: 100%; height: 100%; display: block; }
.panel .share-grid { font-size: 20px; line-height: 1.3; white-space: pre; }
.panel .stats { color: var(--dim); font-size: 13px; letter-spacing: .04em; }
.hidden { display: none !important; }


@media (max-width: 420px) { .readout { font-size: 52px; } }

/* keyboard focus — visible only for keyboard users */
.pad:focus-visible, .ring:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* honour reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
