Back to winniegolf
SOURCE / PINNED RELEASE

Made of little things.

winniegolf

Release
017b791c0f4b…
Author-recorded commit
612845c125fd…
License
LICENSE
Author’s source reference
nostr://npub18weq5jzw27gkhwcuf6gu57alcptjdvh78nlulgpkz8s7pnlxfnnspc00s9/wss%3A%2F%2Fgit.napplet.soy%2F/n-2d501957e21

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

src/styles.css
/*
  "Sunday broadcast" — top-down mini golf with televised-golf overlay graphics.
  Scene tokens live in src/game/palette.ts and are mirrored here for the HUD so
  the course and the chrome read as one world. These colours are app-owned:
  FOLLOW_HOST_THEME stays false, so a shell theme never recolours the course or
  the score states. The iframe is the viewport; preserve resize and touch.
*/

:root {
  /* Interface */
  --bg: #101a24;
  --fg: #f6f2e7;
  --hud-bg: rgba(13, 21, 30, 0.9);
  --hud-fg: #f6f2e7;
  --hud-dim: rgba(246, 242, 231, 0.62);
  --brass: #e6b45a;
  --accent: #e8433f;
  --under-par: #ff7f70;
  --over-par: #94a8be;
  --even: #f6f2e7;
  --focus: #e6b45a;
  /* Card surface (light) */
  --card: #f6f2e7;
  --card-ink: #16202b;
  --card-dim: #5f6b7a;
  --card-line: rgba(22, 32, 43, 0.16);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 18px;
  --control-h: 44px;
  --radius: 12px;
  --hud-fs: 14px;
  --napplet-text-selection: none;
  font:
    14px/1.45 ui-sans-serif,
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
}

* {
  box-sizing: border-box;
}

:where(html, body, body *) {
  -webkit-user-select: var(--napplet-text-selection, none);
  user-select: var(--napplet-text-selection, none);
}

[hidden] {
  display: none !important;
}

html,
body,
#app {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--fg);
}

button {
  font: inherit;
  min-height: var(--control-h);
  padding: 0 18px;
  border: 1.5px solid var(--card-line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--card-ink);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  transition:
    transform 120ms ease,
    background 120ms ease,
    border-color 120ms ease;
}

button:hover:not(:disabled) {
  border-color: rgba(22, 32, 43, 0.42);
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Frame ─────────────────────────────────────────────────────────────── */

.app {
  position: relative;
  container-type: inline-size;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

#course {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
  outline: none;
}

#course:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
}

/* Broadcast bar ─────────────────────────────────────────────────────── */

.hud {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 8px;
  background: linear-gradient(
    180deg,
    var(--hud-bg) 0%,
    rgba(13, 21, 30, 0.78) 62%,
    rgba(13, 21, 30, 0) 100%
  );
  color: var(--hud-fg);
  font-size: var(--hud-fs);
  pointer-events: none;
}

.hud-group {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.hud-hole {
  margin-right: auto;
}

.hud-total {
  margin-left: auto;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  line-height: 1;
}

.hud-label {
  font-size: 0.7em;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--hud-dim);
  white-space: nowrap;
}

.hud-big {
  font-size: 1.85em;
  font-weight: 900;
  line-height: 1;
  color: var(--brass);
  font-variant-numeric: tabular-nums;
}

.hud-sub {
  font-size: 0.8em;
  font-weight: 700;
  color: var(--hud-dim);
  white-space: nowrap;
}

.hud-total-value {
  font-size: 1.4em;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.hud-total-value[data-state='under'] {
  color: var(--under-par);
}

.hud-total-value[data-state='over'] {
  color: var(--over-par);
}

.hud-total-value[data-state='even'] {
  color: var(--even);
}

.badge {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 26px;
  padding: 0 7px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 0.82em;
  font-weight: 900;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.hole-name {
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-button {
  pointer-events: auto;
  display: grid;
  place-items: center;
  width: var(--control-h);
  height: var(--control-h);
  min-height: var(--control-h);
  padding: 0;
  flex: 0 0 auto;
  border: 1px solid rgba(246, 242, 231, 0.24);
  border-radius: 10px;
  background: rgba(13, 21, 30, 0.72);
  color: var(--hud-fg);
}

.icon-button:hover:not(:disabled) {
  background: rgba(13, 21, 30, 0.95);
  border-color: var(--brass);
}

.glyph-pause {
  position: relative;
  display: block;
  width: 15px;
  height: 16px;
}

.glyph-pause::before,
.glyph-pause::after {
  content: '';
  position: absolute;
  top: 0;
  width: 4px;
  height: 16px;
  border-radius: 1.5px;
  background: currentColor;
}

.glyph-pause::before {
  left: 1px;
}

.glyph-pause::after {
  right: 1px;
}

/* Bottom dock: aim on the course, power and Putt live here ─────────── */

.dock {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(
    0deg,
    var(--hud-bg) 0%,
    rgba(13, 21, 30, 0.82) 58%,
    rgba(13, 21, 30, 0) 100%
  );
  pointer-events: none;
}

.dock > * {
  pointer-events: auto;
}

.dock-power {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: var(--control-h);
  padding: 0 4px;
  touch-action: none;
  cursor: pointer;
  border-radius: 10px;
}

.dock-power:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.power-track {
  position: relative;
  flex: 1 1 auto;
  height: 12px;
  border-radius: 999px;
  background: rgba(246, 242, 231, 0.18);
}

.power-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 45%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brass), var(--accent));
}

.power-thumb {
  position: absolute;
  top: 50%;
  left: 45%;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--fg);
  border: 3px solid var(--brass);
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.power-value {
  min-width: 3.6ch;
  text-align: right;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--hud-fg);
}

.putt-button {
  flex: 0 0 auto;
  min-width: 92px;
  min-height: var(--control-h);
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.putt-button:hover:not(:disabled) {
  background: #f05a55;
  border-color: #f05a55;
}

.putt-button:disabled {
  opacity: 0.4;
  cursor: default;
  transform: none;
}

/* Transient bars ────────────────────────────────────────────────────── */

.bar {
  position: absolute;
  left: 50%;
  bottom: 10px;
  z-index: 3;
  transform: translateX(-50%);
  max-width: calc(100% - 20px);
  margin: 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(13, 21, 30, 0.9);
  color: var(--hud-fg);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}

.bar-alert {
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

/* Screens ───────────────────────────────────────────────────────────── */

.overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  pointer-events: none;
}

.screen {
  grid-area: 1 / 1;
  display: grid;
  place-content: center;
  place-content: safe center;
  place-items: center;
  padding: var(--space-3);
  overflow: auto;
  background: rgba(8, 14, 20, 0.66);
  pointer-events: auto;
}

.card {
  width: min(430px, calc(100vw - 24px));
  padding: clamp(16px, 4.5vw, 28px);
  border-radius: 18px;
  background: var(--card);
  color: var(--card-ink);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.card-narrow {
  width: min(340px, calc(100vw - 24px));
}

.logo-mark {
  position: relative;
  display: block;
  width: 46px;
  height: 32px;
  margin: 0 auto 2px;
}

.logo-mark::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  width: 3px;
  height: 32px;
  border-radius: 2px;
  background: var(--card-ink);
}

.logo-mark::after {
  content: '';
  position: absolute;
  left: 9px;
  top: 1px;
  width: 28px;
  height: 16px;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 38%, 0 100%);
}

.logo {
  margin: 4px 0 2px;
  font-size: clamp(28px, 8vw, 42px);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1.02;
}

.kicker {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--card-dim);
}

.blurb {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--card-dim);
}

.screen-title {
  margin: 2px 0 12px;
  font-size: clamp(22px, 6.5vw, 32px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.score-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 10px 14px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: rgba(22, 32, 43, 0.06);
}

.score-label {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--card-dim);
}

.score-value {
  font-size: 21px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.fine-print {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--card-dim);
}

.controls-hint {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--card-dim);
}

.result-strokes {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 7px;
  margin: 0 0 4px;
}

.result-strokes strong {
  font-size: clamp(38px, 12vw, 56px);
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.result-strokes span {
  font-size: 13px;
  font-weight: 800;
  color: var(--card-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.result-vs {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 800;
  color: var(--card-dim);
}

.result-vs[data-state='under'] {
  color: #c0392f;
}

.result-vs[data-state='over'] {
  color: #4a5a6d;
}

/* Shared top-3 board ───────────────────────────────────────────────── */

.leaderboard {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(22, 32, 43, 0.06);
  text-align: left;
}

.leader-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--card-dim);
}

.leader-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 4px;
}

.leader-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.leader-rank {
  flex: none;
  width: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  color: var(--card-dim);
}

.leader-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-score {
  flex: none;
  font-variant-numeric: tabular-nums;
  color: var(--card-dim);
}

.leader-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--card-dim);
}

.button-stack {
  display: grid;
  gap: var(--space-2);
}

.primary {
  width: 100%;
  background: var(--card-ink);
  border-color: var(--card-ink);
  color: var(--fg);
}

.primary:hover:not(:disabled) {
  background: #22303f;
  border-color: #22303f;
}

.ghost {
  background: transparent;
}

/* Minimum size notice ───────────────────────────────────────────────── */

.too-small {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
  text-align: center;
  background: var(--bg);
}

.too-small-title {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
}

.too-small-body {
  margin: 0;
  max-width: 36ch;
  justify-self: center;
  font-size: 13px;
  line-height: 1.5;
  color: var(--hud-dim);
}

/* Tiers ─────────────────────────────────────────────────────────────── */

/* compact: drop the hole name and label text, keep every control */
@container (max-width: 419px) {
  .hud {
    gap: 6px;
    padding: 4px 6px;
  }

  .hole-name,
  .hud-label,
  .hud-sub {
    display: none;
  }

  .badge {
    min-width: 34px;
    height: 24px;
  }

  .hud-big {
    font-size: 1.6em;
  }

  .dock {
    gap: 8px;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  .putt-button {
    min-width: 72px;
  }
}

/* regular: labels return */
@container (min-width: 420px) {
  .hud {
    padding: 6px 10px;
    gap: var(--space-2);
  }
}

/* wide: the broadcast bar can breathe */
@container (min-width: 900px) {
  .hud {
    --hud-fs: 16px;
    padding: 8px 14px;
    gap: var(--space-3);
  }
}

/* short frames: shed the transient bars and tighten the card */
@media (max-height: 360px) {
  .bar {
    display: none;
  }

  .hud {
    padding-top: 3px;
    padding-bottom: 3px;
  }

  .card {
    padding: 14px 18px;
  }

  .blurb,
  .controls-hint {
    display: none;
  }

  .dock {
    padding-top: 6px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-height: 300px) {
  .score-row,
  .fine-print,
  .leaderboard {
    display: none;
  }
}

/* Touch: keep the hit areas generous without changing the visual density */
@media (pointer: coarse) {
  button {
    min-height: 48px;
  }

  .icon-button {
    width: 48px;
    height: 48px;
    min-height: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  button {
    transition: none;
  }
}