/* ============================================================
   BUCKET GOLF — visual system
   turf + chalk + bucket orange
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=Archivo:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
  --turf:        #1B4D2E;
  --turf-deep:   #0E2A1A;
  --turf-line:   #2C6B41;
  --chalk:       #F2F0E6;
  --chalk-dim:   #B9C4B6;
  --bucket:      #FF6B1A;
  --sky:         #4FC3E8;
  --sun:         #FFD23F;
  --flag:        #E85D75;

  --display: 'Archivo Black', 'Arial Black', sans-serif;
  --body:    'Archivo', system-ui, sans-serif;
  --mono:    'Space Mono', ui-monospace, monospace;

  --r: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--turf-deep);
  color: var(--chalk);
  font-family: var(--body);
  -webkit-text-size-adjust: 100%;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.022) 0 40px, transparent 40px 80px);
}

.wrap { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; padding: 18px 16px 96px; }

/* ---------- type ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: -.01em; margin: 0; }
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--chalk-dim);
}
.num { font-family: var(--mono); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- masthead ---------- */
.mast {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 6px 0 18px;
  border-bottom: 2px solid var(--turf-line);
  margin-bottom: 20px;
}
.mast h1 { font-size: clamp(20px, 6vw, 28px); line-height: 1; text-transform: uppercase; }
.mast .who {
  font-family: var(--mono); font-size: 12px; text-align: right; color: var(--chalk-dim);
  white-space: nowrap;
}
.mast .who b { display: block; color: var(--chalk); font-size: 14px; }

/* ---------- cards ---------- */
.card {
  background: var(--turf);
  border: 2px solid var(--turf-line);
  border-radius: var(--r);
  padding: 18px;
  margin-bottom: 16px;
}

/* ---------- buttons ---------- */
button, .btn {
  font-family: var(--body);
  font-weight: 700;
  font-size: 16px;
  border: 2px solid var(--turf-line);
  background: var(--turf);
  color: var(--chalk);
  border-radius: 10px;
  padding: 13px 18px;
  cursor: pointer;
  transition: transform .08s ease, background .15s ease, border-color .15s ease;
}
button:active { transform: scale(.97); }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.btn-primary { background: var(--bucket); border-color: var(--bucket); color: #24140A; }
.btn-primary:hover { background: #ff7f38; }
.btn-ghost { background: transparent; }
.btn-danger { border-color: var(--flag); color: var(--flag); background: transparent; }
button[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }

input, select {
  font-family: var(--body); font-size: 16px;
  background: var(--turf-deep);
  color: var(--chalk);
  border: 2px solid var(--turf-line);
  border-radius: 10px;
  padding: 12px 14px;
  width: 100%;
}
label.field { display: block; margin-bottom: 12px; }
label.field span { display: block; margin-bottom: 6px; font-size: 13px; color: var(--chalk-dim); font-weight: 600; }

/* ============================================================
   SIGNATURE: the bucket counter
   ============================================================ */
.hole-head { text-align: center; margin-bottom: 4px; }
.hole-head .holeno {
  font-family: var(--display);
  font-size: clamp(56px, 22vw, 104px);
  line-height: .85;
  letter-spacing: -.04em;
}
.hole-head .parline { font-family: var(--mono); font-size: 14px; color: var(--sun); letter-spacing: .1em; }
.hole-head .holename { font-size: 15px; color: var(--chalk-dim); margin-top: 4px; font-style: italic; }

.bucket-stage {
  display: grid;
  place-items: center;
  padding: 18px 0 6px;
}
.bucket {
  position: relative;
  width: 190px; height: 150px;
  clip-path: polygon(8% 0, 92% 0, 78% 100%, 22% 100%);
  background: #143A22;
  border: 0;
  display: grid; place-items: center;
  overflow: hidden;
}
.bucket .fill {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, var(--bucket), #d64f0a);
  transition: height .25s cubic-bezier(.34,1.4,.5,1);
}
.bucket .rim {
  position: absolute; top: 0; left: 0; right: 0; height: 10px;
  background: var(--chalk); opacity: .9;
}
.bucket .count {
  position: relative;
  font-family: var(--display);
  font-size: 62px;
  color: var(--chalk);
  text-shadow: 0 3px 0 rgba(0,0,0,.35);
}
.bucket-ctrl { display: flex; align-items: center; gap: 14px; justify-content: center; margin-top: 14px; }
.bucket-ctrl button {
  width: 66px; height: 66px; border-radius: 50%;
  font-size: 30px; font-family: var(--display); line-height: 1; padding: 0;
}
.verdict {
  text-align: center; margin-top: 14px; min-height: 26px;
  font-family: var(--display); font-size: 20px; text-transform: uppercase; letter-spacing: .04em;
}
.verdict.under { color: var(--sun); }
.verdict.over  { color: var(--flag); }
.verdict.even  { color: var(--chalk-dim); }

/* ---------- hole strip ---------- */
.strip { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: thin; }
.strip button {
  flex: 0 0 auto; width: 46px; height: 46px; padding: 0;
  font-family: var(--mono); font-weight: 700; font-size: 14px;
  border-radius: 8px;
}
.strip button.done { background: var(--turf-line); }
.strip button.now  { border-color: var(--bucket); color: var(--bucket); }

/* ---------- scorecard table ---------- */
.tblwrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-family: var(--mono); font-size: 13px; }
th, td { padding: 8px 6px; text-align: center; border-bottom: 1px solid var(--turf-line); white-space: nowrap; }
th { font-size: 11px; letter-spacing: .08em; color: var(--chalk-dim); text-transform: uppercase; }
td.name, th.name { text-align: left; font-family: var(--body); font-weight: 700; position: sticky; left: 0; background: var(--turf); }
.pill { display: inline-block; min-width: 44px; padding: 3px 8px; border-radius: 999px; font-weight: 700; }
.pill.under { background: var(--sun); color: #2A2205; }
.pill.over  { background: var(--flag); color: #2A0A10; }
.pill.even  { background: var(--turf-line); color: var(--chalk); }

.chip { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; }

/* ---------- misc ---------- */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(140%);
  background: var(--chalk); color: var(--turf-deep);
  font-weight: 700; padding: 12px 20px; border-radius: 999px;
  z-index: 50; transition: transform .25s ease; max-width: 90vw; text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--flag); color: #fff; }

.empty { text-align: center; color: var(--chalk-dim); padding: 28px 10px; }
.empty b { display: block; font-family: var(--display); color: var(--chalk); font-size: 18px; margin-bottom: 6px; }

footer.site {
  position: relative; z-index: 1;
  text-align: center; padding: 26px 16px 34px;
  font-family: var(--mono); font-size: 12px; color: var(--chalk-dim);
  border-top: 2px solid var(--turf-line); margin-top: 24px;
}
footer.site a { color: var(--bucket); text-decoration: none; }
footer.site a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
