/* Golf Party Scorer — dark, high contrast, big touch targets */
:root {
  --bg: #0c1512;
  --bg-2: #12201b;
  --card: #16261f;
  --line: #244034;
  --text: #eaf5ef;
  --muted: #7fa291;
  --green: #3ddc84;
  --green-dim: #1f7a4d;
  --amber: #ffc857;
  --red: #ff6b6b;
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: ui-sans-serif, system-ui, 'Segoe UI', Roboto, sans-serif; }
#app { max-width: 640px; margin: 0 auto; padding: 12px 12px calc(20px + env(safe-area-inset-bottom)); min-height: 100vh; }

h1 { font-size: 1.5rem; margin: .2em 0 .4em; letter-spacing: -.02em; }
h2 { font-size: 1.05rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 1em 0 .5em; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  padding: 14px 18px; border-radius: var(--radius); font-size: 1rem; font-weight: 600;
  cursor: pointer; user-select: none; transition: transform .06s, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--green); color: #04150c; border-color: transparent; }
.btn.big { width: 100%; font-size: 1.25rem; padding: 18px; }
.btn.danger { color: var(--red); }
.btn.small { padding: 9px 13px; font-size: .9rem; border-radius: 10px; }
.btn:disabled { opacity: .4; pointer-events: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

input[type=text], input[type=number] {
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 12px; font-size: 1rem; width: 100%;
}
input:focus { outline: 2px solid var(--green-dim); }

.pill { padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; font-weight: 600; font-size: .95rem; }
.pill.active { background: var(--green); color: #04150c; border-color: transparent; }

/* player rows */
.player-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.player-row:last-child { border-bottom: none; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #04150c; flex-shrink: 0; }
.score-big { font-size: 1.7rem; font-weight: 800; min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.score-big.under { color: var(--green); } .score-big.over { color: var(--red); }

/* stroke counter button */
.stroke-btn {
  width: 100%; aspect-ratio: 2.6/1; font-size: 3.4rem; font-weight: 900;
  background: linear-gradient(180deg, #46e892, #2bb56b); color: #04150c;
  border: none; border-radius: 22px; cursor: pointer; user-select: none;
  box-shadow: 0 6px 0 #157a45; touch-action: manipulation;
}
.stroke-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #157a45; }

/* numpad */
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.numpad .btn { aspect-ratio: 2/1; font-size: 1.4rem; }

/* scorecard table */
table.scorecard { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .85rem; }
.scorecard th, .scorecard td { border: 1px solid var(--line); padding: 5px 3px; text-align: center; min-width: 26px; }
.scorecard th { background: var(--bg-2); color: var(--muted); font-weight: 600; }
.scorecard td.par { color: var(--muted); }
.scorecard td.tot { background: var(--bg-2); font-weight: 700; }
.scorecard td.under { color: var(--green); } .scorecard td.over { color: var(--red); }

/* leaderboard */
.lb-row { display: flex; align-items: center; gap: 12px; padding: 14px; border-bottom: 1px solid var(--line); }
.lb-rank { font-size: 1.2rem; font-weight: 800; width: 34px; text-align: center; color: var(--muted); }
.lb-name { flex: 1; font-weight: 700; font-size: 1.05rem; }
.lb-total { font-size: 1.6rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.lb-vs { font-size: .85rem; color: var(--muted); text-align: right; line-height: 1.2; }

.hole-nav { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 10px 0 6px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hole-title { font-size: 1.15rem; font-weight: 800; white-space: nowrap; }
.hole-par { color: var(--muted); font-size: .95rem; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

.muted { color: var(--muted); }
.center { text-align: center; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.hidden { display: none !important; }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: var(--card); border: 1px solid var(--line); padding: 10px 18px; border-radius: 999px; font-size: .9rem; animation: fadeout 2.2s forwards; z-index: 99; }
@keyframes fadeout { 0%,70% { opacity: 1; } 100% { opacity: 0; } }

/* brand header + language toggle */
.brand { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 10px; }
.brand-name { font-weight: 800; font-size: 1.05rem; letter-spacing: -.01em; }
.brand-name span { color: var(--green); }
.brand-tag { font-size: .85rem; margin-top: -6px; }
.lang-toggle { display: flex; gap: 4px; }
.pill.tiny { padding: 5px 11px; font-size: .8rem; border-radius: 8px; font-weight: 800; }

/* join code (big) */
.code-big { font-size: 3.4rem; font-weight: 900; letter-spacing: .35em; text-align: center; margin: 6px 0; color: var(--green); font-variant-numeric: tabular-nums; }
#qr { background: #fff; border-radius: 10px; }
