Back to Find the Invisible Cow
SOURCE / PINNED RELEASE

Made of little things.

Find the Invisible Cow

Release
e48b3dced31c…
Author-recorded commit
cf79302f143d…
License
LICENSE
Author’s source reference
nostr://npub1p8rxwea4e0l4jml0q53n5mvh3n7pywq523jk3lm336v04r8ny9jqtq7ttf/wss%3A%2F%2Fgit.napplet.soy%2F/n-3b179f1d7df

Archive hash verified: f8e300eb672b5ee8…. The source-to-build association is the author’s claim; it has not been independently rebuilt.

src/styles.css
/*
 * Find the Invisible Cow — visual direction: "midnight pasture".
 *
 * Character: a calm, slightly goofy night-time hide-and-seek. The dark field
 * keeps the cow truly invisible (no texture can leak its position) and the
 * warm amber HUD reads like lantern light over the fence. Everything is
 * app-owned; the host theme is deliberately not followed.
 *
 * Tokens: --night-* field, --cream text, --amber lantern accent, --cold/--warm
 * hint scale. Type is a system stack; buttons are chunky 48px targets.
 * The demo palette, panes and density that shipped with the boilerplate are
 * fully replaced. The iframe is the viewport; resize and touch stay usable.
 */
:root {
  --night-0: #0b1026;
  --night-1: #14203f;
  --night-2: #1d2f56;
  --moss: #0e1f2e;
  --cream: #f4ead2;
  --cream-dim: rgba(244, 234, 210, 0.72);
  --amber: #ffb648;
  --amber-deep: #e28a2b;
  --cold: #5aa7d8;
  --warm: #ff8c42;
  --ink: #1d1405;
  --card-bg: rgba(13, 19, 40, 0.94);
  --control-h: 48px;
  --napplet-text-selection: none;
  color-scheme: dark;
  box-sizing: border-box;
}

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

html,
body,
#app {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Trebuchet MS', 'Segoe UI', Verdana, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--cream);
  background: var(--night-0);
  -webkit-user-select: var(--napplet-text-selection, none);
  user-select: var(--napplet-text-selection, none);
  overflow: hidden;
}

.app {
  position: relative;
  overflow: hidden;
}

/* ---------- Field ---------- */

.field {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% -10%, var(--night-2) 0%, var(--night-1) 46%, var(--night-0) 100%);
  cursor: crosshair;
  touch-action: none;
}

.field::after {
  /* Faded ground fog along the bottom edge, purely decorative. */
  content: '';
  position: absolute;
  inset: auto 0 0 0;
  height: 12%;
  background: linear-gradient(to top, rgba(9, 14, 30, 0.9), rgba(9, 14, 30, 0));
  pointer-events: none;
}

.stars,
.grass {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.stars {
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(244, 234, 210, 0.85) 49%, transparent 51%),
    radial-gradient(1px 1px at 34% 9%, rgba(244, 234, 210, 0.6) 49%, transparent 51%),
    radial-gradient(1.5px 1.5px at 58% 15%, rgba(244, 234, 210, 0.75) 49%, transparent 51%),
    radial-gradient(1px 1px at 71% 6%, rgba(244, 234, 210, 0.5) 49%, transparent 51%),
    radial-gradient(2px 2px at 86% 20%, rgba(244, 234, 210, 0.8) 49%, transparent 51%),
    radial-gradient(1px 1px at 22% 32%, rgba(244, 234, 210, 0.45) 49%, transparent 51%),
    radial-gradient(1px 1px at 47% 27%, rgba(244, 234, 210, 0.5) 49%, transparent 51%),
    radial-gradient(1.5px 1.5px at 92% 34%, rgba(244, 234, 210, 0.6) 49%, transparent 51%);
}

.grass {
  background-image:
    radial-gradient(14px 26px at 8% 100%, var(--moss) 60%, transparent 61%),
    radial-gradient(18px 30px at 17% 100%, #12283a 60%, transparent 61%),
    radial-gradient(12px 24px at 31% 100%, var(--moss) 60%, transparent 61%),
    radial-gradient(20px 34px at 44% 100%, #12283a 60%, transparent 61%),
    radial-gradient(13px 26px at 57% 100%, var(--moss) 60%, transparent 61%),
    radial-gradient(17px 30px at 69% 100%, #12283a 60%, transparent 61%),
    radial-gradient(14px 28px at 82% 100%, var(--moss) 60%, transparent 61%),
    radial-gradient(19px 32px at 93% 100%, #12283a 60%, transparent 61%);
  background-repeat: no-repeat;
}

.fireflies i {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 214, 130, 0.75);
  box-shadow: 0 0 8px 2px rgba(255, 182, 72, 0.35);
  opacity: 0.5;
  animation: drift 9s ease-in-out infinite alternate;
}

.fireflies i:nth-child(1) { left: 14%; top: 58%; animation-delay: 0s; }
.fireflies i:nth-child(2) { left: 78%; top: 44%; animation-delay: -2.2s; }
.fireflies i:nth-child(3) { left: 36%; top: 76%; animation-delay: -4.1s; }
.fireflies i:nth-child(4) { left: 62%; top: 68%; animation-delay: -5.7s; }
.fireflies i:nth-child(5) { left: 88%; top: 82%; animation-delay: -7.3s; }
.fireflies i:nth-child(6) { left: 25%; top: 38%; animation-delay: -3.4s; }

@keyframes drift {
  from { transform: translate(0, 0); opacity: 0.25; }
  50% { opacity: 0.8; }
  to { transform: translate(14px, -18px); opacity: 0.3; }
}

.probe {
  position: absolute;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 2px solid rgba(244, 234, 210, 0.9);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(244, 234, 210, 0.18), 0 0 14px rgba(244, 234, 210, 0.25);
  display: none;
  pointer-events: none;
}

.probe.active { display: block; }

.probe::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  background: var(--cream);
}

/* ---------- Visual hints (NAP-CONFIG assistance) ---------- */

.hint-meter-wrap {
  position: absolute;
  left: 50%;
  bottom: 52px;
  transform: translateX(-50%);
  width: min(300px, 62%);
  height: 10px;
  border-radius: 999px;
  background: rgba(9, 14, 30, 0.72);
  border: 1px solid rgba(244, 234, 210, 0.22);
  overflow: hidden;
  display: none;
  pointer-events: none;
}

.hint-meter-wrap.on { display: block; }

.hint-meter {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  /* Cold → warm gradient plus a length change, so the cue is not color-only. */
  background: linear-gradient(90deg, var(--cold), var(--warm));
}

.hint-arrow {
  position: absolute;
  left: 50%;
  bottom: 70px;
  width: 26px;
  height: 26px;
  margin-left: -13px;
  color: var(--amber);
  opacity: 0;
  display: none;
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(255, 182, 72, 0.5));
}

.hint-arrow.on { display: block; }

/* ---------- Cow reveal ---------- */

.cow-reveal {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: none;
  animation: pop 0.5s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}

.cow {
  width: clamp(72px, 14vw, 120px);
  height: auto;
  display: block;
}

.cow-body, .cow-head, .cow-ear, .cow-leg { fill: #f7f3e8; }
.cow-patch { fill: #35302a; }
.cow-muzzle { fill: #eda3b4; }
.cow-nostril { fill: #b95f76; }
.cow-eye { fill: #26221d; }
.cow-horn { fill: none; stroke: #e5dcc4; stroke-width: 4; stroke-linecap: round; }
.cow-shadow { fill: rgba(5, 8, 18, 0.55); }

@keyframes pop {
  from { transform: translate(-50%, -100%) scale(0.3); opacity: 0; }
  to { transform: translate(-50%, -100%) scale(1); opacity: 1; }
}

/* ---------- HUD ---------- */

.hud {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.hud-readout {
  display: flex;
  align-items: baseline;
  gap: 12px;
  background: rgba(9, 14, 30, 0.72);
  border: 1px solid rgba(244, 234, 210, 0.18);
  border-radius: 999px;
  padding: 8px 16px;
  font-variant-numeric: tabular-nums;
}

.timer {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.moo-count {
  color: var(--cream-dim);
  font-size: 0.85rem;
}

.sound-toggle {
  pointer-events: auto;
  min-width: var(--control-h);
  min-height: var(--control-h);
  border-radius: 50%;
  border: 1px solid rgba(244, 234, 210, 0.25);
  background: rgba(9, 14, 30, 0.72);
  color: var(--cream);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.sound-toggle .icon { width: 22px; height: 22px; }
.sound-toggle .icon-off { display: none; }
.sound-toggle[aria-pressed='false'] .icon-on { display: none; }
.sound-toggle[aria-pressed='false'] .icon-off { display: block; }
.sound-toggle[aria-pressed='false'] { color: var(--cream-dim); }

.sound-toggle:focus-visible,
.primary:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

.coach {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  margin: 0;
  width: max-content;
  max-width: calc(100% - 24px);
  text-align: center;
  font-size: 0.85rem;
  color: var(--cream-dim);
  text-shadow: 0 1px 3px rgba(5, 8, 18, 0.8);
  pointer-events: none;
}

.notice {
  position: absolute;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  max-width: calc(100% - 24px);
  padding: 9px 16px;
  border-radius: 12px;
  background: rgba(43, 26, 8, 0.92);
  border: 1px solid rgba(255, 182, 72, 0.5);
  color: var(--cream);
  font-size: 0.85rem;
  text-align: center;
  z-index: 40;
}

/* ---------- Overlays ---------- */

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(6, 9, 22, 0.62);
  backdrop-filter: blur(3px);
  z-index: 50;
}

.overlay[hidden] { display: none; }

.card {
  background: var(--card-bg);
  border: 1px solid rgba(255, 182, 72, 0.38);
  border-radius: 20px;
  box-shadow: 0 18px 48px rgba(3, 5, 14, 0.6);
  padding: clamp(16px, 4vmin, 30px);
  max-width: 540px;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  text-align: center;
}

.logo {
  margin: 0 0 12px;
  font-size: clamp(1.7rem, 7vw, 2.9rem);
  line-height: 1.06;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--amber);
  text-shadow: 0 2px 0 rgba(226, 138, 43, 0.35), 0 0 24px rgba(255, 182, 72, 0.28);
}

.pitch {
  margin: 0 auto 14px;
  max-width: 44ch;
  color: var(--cream-dim);
}

.howto {
  margin: 0 auto 18px;
  max-width: 52ch;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--cream-dim);
}

.howto strong {
  color: var(--cream);
  font-weight: 700;
}

.primary {
  min-height: var(--control-h);
  padding: 10px 30px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--amber), var(--amber-deep));
  color: var(--ink);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(255, 182, 72, 0.3);
}

.primary:active { transform: translateY(1px); }

.tip {
  margin: 12px auto 0;
  font-size: 0.78rem;
  color: rgba(244, 234, 210, 0.55);
}

.win-title {
  margin: 4px 0 14px;
  font-size: clamp(1.5rem, 6vw, 2.2rem);
  font-weight: 800;
  color: var(--amber);
}

.results {
  display: flex;
  justify-content: center;
  gap: clamp(14px, 4vw, 34px);
  margin: 0 0 10px;
}

.result dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cream-dim);
}

.result dd {
  margin: 2px 0 0;
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.spot {
  margin: 0 auto 16px;
  font-size: 0.88rem;
  color: var(--cream-dim);
}

/* ---------- Small frames ---------- */

@media (max-width: 480px), (max-height: 460px) {
  body { font-size: 14px; }
  .hud-readout { padding: 6px 12px; gap: 8px; }
  .timer { font-size: 1rem; }
}

@media (max-height: 340px) {
  .pitch, .tip { display: none; }
  .howto { margin-bottom: 12px; }
  .logo { margin-bottom: 8px; }
  .coach { display: none; }
  .card { border-radius: 14px; }
}

@media (max-height: 240px) {
  .howto { display: none; }
  .logo { font-size: 1.4rem; }
  .win-title { font-size: 1.2rem; margin: 0 0 10px; }
  .results { margin-bottom: 8px; }
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .fireflies i { animation: none; opacity: 0.4; }
  .cow-reveal { animation: none; }
  .primary:active { transform: none; }
}