/* Golf Card - Main Stylesheet */
/* Dark, high-contrast outdoor theme using Barlow Condensed + Inter */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;600;700;800&family=Inter:wght@400;500;600&display=swap');

/* ===== VARIABLES ===== */
:root {
    --green: #4caf6f;
    --green-dark: #2d5a27;
    --green-deep: #1a3a18;
    --gold: #f5c842;
    --gold-dark: #c9a000;
    --bg: #0d1a0d;
    --bg-card: #162016;
    --bg-card2: #1e2e1e;
    --bg-input: #243024;
    --text: #e8f0e8;
    --text-dim: #8aaa8a;
    --text-muted: #5a7a5a;
    --border: #2d452d;
    --border-light: #3d5f3d;
    --red: #e05252;
    --orange: #f5a623;
    --blue: #4a9eff;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 16px rgba(0,0,0,0.5);
    --transition: all 0.18s ease;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    max-width: 480px;
    margin: 0 auto;
    overflow-x: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input, select, textarea { font-family: inherit; font-size: 1rem; }
a { color: var(--green); }

/* ===== SCREENS ===== */
#app { min-height: 100vh; }
.screen {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding-bottom: 24px;
}

/* ===== HOME SCREEN ===== */
.home-screen { padding: 0 0 24px; }
.home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 12px;
    border-bottom: 1px solid var(--border);
}
.home-logo { display: flex; align-items: center; gap: 10px; }
.home-logo h1 {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: 0.02em;
}
.logo-svg { width: 40px; height: 40px; }

.player-card {
    margin: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.player-info { display: flex; align-items: center; gap: 12px; }
.player-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.3rem; font-weight: 800; color: #fff;
    flex-shrink: 0;
}
.avatar-mini {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.9rem; font-weight: 700; color: #fff;
}
.avatar-tiny { width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: #fff; flex-shrink: 0; }
.player-name { font-weight: 600; font-size: 1rem; }
.player-code-row { display: flex; align-items: center; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.player-code { font-family: 'Barlow Condensed', sans-serif; font-size: 1rem; font-weight: 700; color: var(--gold); letter-spacing: 0.05em; }
.player-hcp-pill { font-size: 0.78rem; color: var(--text-dim); background: var(--bg-card2); padding: 2px 8px; border-radius: 10px; }
.player-code-display { text-align: center; background: var(--bg-card2); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 14px; font-size: 0.88rem; color: var(--text-dim); }
.player-code-display strong { color: var(--gold); font-family: 'Barlow Condensed', sans-serif; font-size: 1.1rem; letter-spacing: 0.08em; }

.setup-prompt {
    margin: 16px;
    background: var(--bg-card);
    border: 1px dashed var(--border-light);
    border-radius: var(--radius);
    padding: 20px;
    display: flex; align-items: center; gap: 12px;
    color: var(--text-dim); cursor: pointer;
}
.setup-prompt:active { background: var(--bg-card2); }
.setup-icon { font-size: 1.5rem; }
.setup-prompt .arrow { margin-left: auto; color: var(--green); }

.home-actions { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }

/* ===== BUTTONS ===== */
.btn-primary {
    background: var(--green);
    color: #fff;
    border-radius: var(--radius);
    padding: 14px 20px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-primary:active { background: #3d9a60; transform: scale(0.98); }
.btn-primary.btn-large {
    padding: 18px 20px;
    font-size: 1.05rem;
    border-radius: 14px;
}
.btn-primary.btn-large small { font-size: 0.8rem; opacity: 0.85; display: block; font-weight: 400; }
.btn-icon-l { font-size: 1.5rem; }
.btn-secondary {
    background: var(--bg-card2);
    color: var(--text);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-weight: 500;
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center; gap: 8px; flex: 1;
}
.btn-secondary:active { background: #263626; }
.btn-outline {
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    font-weight: 500;
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center; gap: 8px; flex: 1;
}
.btn-outline:active { background: var(--bg-card); }
.btn-ghost {
    background: transparent;
    color: var(--text-dim);
    padding: 10px 16px;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-danger {
    background: var(--red);
    color: #fff; border-radius: var(--radius);
    padding: 12px 20px; font-weight: 600;
    transition: var(--transition);
}
.btn-danger:active { filter: brightness(0.88); }
.btn-full { width: 100%; }
.btn-row { display: flex; gap: 10px; }
.last-code-hint { text-align: center; font-size: 0.8rem; color: var(--text-dim); padding: 4px 0; cursor: pointer; }
.last-code-hint:hover { color: var(--text); }
.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn-back {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    font-size: 0.85rem;
}
.btn-icon { background: transparent; padding: 4px; }
.btn-icon-sm {
    background: var(--green); color: #fff;
    border-radius: var(--radius-sm);
    padding: 10px 14px; font-size: 1rem;
}
.btn-link { background: transparent; color: var(--green); font-size: 0.85rem; padding: 0 4px; text-decoration: underline; }
.btn-nav {
    background: var(--bg-card); color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px; padding: 8px 14px;
    font-size: 1.2rem;
}

/* ===== TOP BAR ===== */
.top-bar {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    position: sticky; top: 0; z-index: 10;
}
.top-title {
    flex: 1;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.3rem; font-weight: 700;
    text-align: center;
}

/* ===== FORMS ===== */
.form-card { background: var(--bg-card); border-radius: var(--radius); margin: 16px; padding: 20px; border: 1px solid var(--border); }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-group label { font-size: 0.82rem; color: var(--text-dim); font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 11px 14px;
    font-size: 0.95rem;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--green);
    outline: none;
}
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; min-width: 0; }

.toggle-group { display: flex; gap: 6px; }
.toggle-btn {
    flex: 1; padding: 9px; border-radius: var(--radius-sm);
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-dim); font-size: 0.88rem;
    transition: var(--transition);
}
.toggle-btn.active { background: var(--green-dark); border-color: var(--green); color: var(--text); }
.toggle-group.small .toggle-btn { padding: 7px 10px; font-size: 0.8rem; }

/* Avatar */
.avatar-picker { display: flex; gap: 10px; justify-content: center; margin-bottom: 12px; flex-wrap: wrap; }
.color-swatch { width: 34px; height: 34px; border-radius: 50%; cursor: pointer; border: 3px solid transparent; transition: var(--transition); }
.color-swatch.selected { border-color: #fff; transform: scale(1.15); }
.avatar-preview {
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 2rem; font-weight: 800; color: #fff;
    margin: 0 auto 16px;
}

/* ===== COURSE CARDS ===== */
.search-bar { display: flex; gap: 8px; margin: 12px 16px; }
.search-bar input {
    flex: 1;
    background: var(--bg-input); border: 1px solid var(--border-light);
    border-radius: var(--radius-sm); color: var(--text);
    padding: 11px 14px; font-size: 0.95rem;
}
.search-bar input:focus { border-color: var(--green); outline: none; }

.course-list { padding: 0 16px; }
.course-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: var(--transition);
}
.course-card:active { background: var(--bg-card2); }
.course-name { font-weight: 600; margin-bottom: 4px; }
.course-meta { display: flex; gap: 10px; font-size: 0.8rem; color: var(--text-dim); flex-wrap: wrap; }
.source-badge { padding: 1px 6px; border-radius: 4px; font-size: 0.72rem; }
.source-osm { background: #1a3a5a; color: #7ab8f5; }
.source-db { background: #1a3a1a; color: var(--green); }
.source-manual { background: #3a2a1a; color: var(--orange); }
.source-gcapi  { background: #2a1a3a; color: #ce93d8; }

/* ===== COURSE SETUP ===== */
.course-header-card {
    margin: 16px; background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px;
}
.course-header-card h2 { font-family: 'Barlow Condensed', sans-serif; font-size: 1.4rem; font-weight: 700; }
.course-loc, .course-par { color: var(--text-dim); font-size: 0.85rem; margin-top: 4px; }
.course-attribution { color: var(--text-muted); font-size: 0.75rem; margin-top: 4px; }
.section-title {
    font-size: 0.78rem; font-weight: 600;
    color: var(--text-muted); text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 12px 16px 4px;
}
.tee-grid { display: flex; gap: 8px; padding: 0 16px; flex-wrap: wrap; }
.tee-card {
    flex: 1; min-width: 80px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 10px;
    text-align: center; cursor: pointer; transition: var(--transition);
}
.tee-card.selected { border-color: var(--green); background: var(--green-deep); }
.tee-dot { width: 24px; height: 24px; border-radius: 50%; margin: 0 auto 6px; }
.tee-name { font-size: 0.88rem; font-weight: 600; }
.tee-rating { font-size: 0.72rem; color: var(--text-dim); margin-top: 3px; }
.info-banner {
    margin: 8px 16px;
    background: #2a2a16;
    border: 1px solid #5a5a30;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #d4d460;
}
.hole-par-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; padding: 8px 16px; }
.par-cell { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.par-cell label { font-size: 0.72rem; color: var(--text-dim); }
.par-cell select { background: var(--bg-input); border: 1px solid var(--border); color: var(--text); border-radius: 4px; padding: 4px; font-size: 0.8rem; width: 100%; }
.mt-16 { margin-top: 16px; }

/* ===== SCORECARD ===== */
.scorecard-header {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}
.sc-title { flex: 1; }
.sc-course { font-family: 'Barlow Condensed', sans-serif; font-size: 1.1rem; font-weight: 700; }
.sc-meta { font-size: 0.78rem; color: var(--text-dim); }
.sc-weather { font-size: 1.1rem; }

.score-summary-bar {
    display: flex;
    background: var(--bg-card2);
    border-bottom: 1px solid var(--border);
}
.ss-stat { flex: 1; text-align: center; padding: 10px 4px; }
.ss-stat span { display: block; font-family: 'Barlow Condensed', sans-serif; font-size: 1.4rem; font-weight: 800; }
.ss-stat small { font-size: 0.7rem; color: var(--text-dim); }

.live-banner {
    background: #3a0a0a; color: #ff6b6b;
    text-align: center; padding: 8px;
    font-size: 0.85rem; font-weight: 600;
    border-bottom: 1px solid #6a1a1a;
    cursor: pointer;
}

.hole-list { }
.hole-row {
    display: grid;
    grid-template-columns: 36px 80px 1fr 48px;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
}
.hole-row:active { background: var(--bg-card); }
.hole-row.current { background: var(--green-deep); border-left: 3px solid var(--green); }
.hole-num { font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 0.95rem; }
.hole-par-dist { display: flex; flex-direction: column; }
.hp-par { font-size: 0.82rem; color: var(--text-dim); }
.hp-dist { font-size: 0.7rem; color: var(--text-muted); margin-top: 1px; }
.hole-score-cell { display: flex; align-items: center; justify-content: center; }
.hole-sf { font-size: 0.78rem; color: var(--text-muted); text-align: right; }
.hole-running { text-align: right; font-family: 'Barlow Condensed', sans-serif; font-size: 0.9rem; font-weight: 700; color: var(--text-muted); }
.score-empty { color: var(--text-muted); font-size: 0.9rem; }

.sc-footer {
    display: flex; gap: 10px; padding: 14px 16px;
    background: var(--bg-card); border-top: 1px solid var(--border);
    position: sticky; bottom: 0;
}

/* ===== SCORE CHIPS ===== */
.score-chip {
    display: inline-block; min-width: 40px;
    padding: 4px 8px; border-radius: 6px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.05rem; font-weight: 700;
    text-align: center; line-height: 1.1;
}
.score-chip small { font-size: 0.62rem; font-weight: 400; display: block; }
.score-chip-sm { display: inline-block; min-width: 28px; padding: 2px 5px; border-radius: 4px; font-weight: 700; font-size: 0.9rem; text-align: center; }
.eagle { background: #1a3a5a; color: #7ab8f5; border: 1px solid #2a5a8a; }
.birdie { background: #1a3a1a; color: #7ae87a; border: 1px solid #2a6a2a; }
.par { background: #243024; color: var(--green); border: 1px solid var(--border-light); }
.bogey { background: #2a1e10; color: #f5a623; border: 1px solid #4a3a20; }
.double-bogey { background: #2a1414; color: #e05252; border: 1px solid #4a2424; }
.triple-plus { background: #3a0a0a; color: #ff3333; border: 1px solid #6a1010; }
.no-score { color: var(--text-muted); }
.under-par { color: #7ae87a; }
.over-par { color: var(--red); }

/* ===== HOLE SCORE SCREEN ===== */
.hole-screen { background: var(--bg); }
.hole-header {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}
.hole-title { flex: 1; text-align: center; }
.hole-title h2 { font-family: 'Barlow Condensed', sans-serif; font-size: 1.5rem; font-weight: 800; }
.hole-par-badge {
    display: inline-block;
    background: var(--bg-card2);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 2px 12px;
    font-size: 0.82rem;
    color: var(--text-dim);
    margin-top: 2px;
}
.hole-nav { display: flex; gap: 6px; }

.stroke-counter {
    display: flex; align-items: center; gap: 0;
    background: var(--bg-card); margin: 16px;
    border-radius: 16px; border: 1px solid var(--border-light);
    overflow: hidden;
}
.stroke-btn {
    width: 70px; height: 80px;
    font-size: 2.2rem; font-weight: 300;
    background: var(--bg-card2); color: var(--text);
    transition: var(--transition);
    flex-shrink: 0;
}
.stroke-btn:active { background: var(--green-dark); }
.stroke-btn.minus { border-right: 1px solid var(--border); }
.stroke-btn.plus { border-left: 1px solid var(--border); }
.stroke-display { flex: 1; text-align: center; padding: 12px 8px; }
.stroke-num {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 3.5rem; font-weight: 800; line-height: 1;
    color: var(--text);
    transition: transform 0.15s;
}
.stroke-num.bump { transform: scale(1.15); }
.stroke-label { font-size: 0.78rem; color: var(--text-dim); margin-top: 2px; }

.hole-extras { margin: 0 16px; }
.extra-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.extra-row label { font-size: 0.9rem; color: var(--text-dim); }
.mini-counter { display: flex; align-items: center; gap: 10px; }
.mini-counter button {
    width: 32px; height: 32px;
    background: var(--bg-card2); border: 1px solid var(--border);
    border-radius: 8px; font-size: 1.1rem; color: var(--text);
}
.mini-counter button:active { background: var(--green-dark); }
.mini-counter span { font-family: 'Barlow Condensed', sans-serif; font-size: 1.3rem; font-weight: 700; min-width: 24px; text-align: center; }

.shot-tracker-panel {
    margin: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 14px;
}
.shot-tracker-title { font-size: 0.85rem; font-weight: 600; color: var(--text-dim); margin-bottom: 8px; }
.shot-list { margin-bottom: 8px; }
.hole-notes { margin: 8px 16px; }
.hole-notes textarea {
    width: 100%; background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    padding: 10px 14px; font-size: 0.88rem; resize: none; height: 64px;
}

.hole-detail-table { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 8px; }
.hdt-header { display: grid; grid-template-columns: 32px 1fr 2fr 1fr; gap: 8px; padding: 7px 12px; background: var(--bg-card2); font-size: 0.72rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; }
.hdt-row { display: grid; grid-template-columns: 32px 1fr 2fr 1fr; gap: 8px; padding: 5px 12px; border-top: 1px solid var(--border); align-items: center; background: var(--bg-card); }
.hdt-even { background: var(--bg-card2); }
.hdt-num { font-size: 0.82rem; color: var(--text-dim); font-weight: 600; }
.hdt-totals { display: grid; grid-template-columns: 32px 1fr 2fr 1fr; gap: 8px; padding: 7px 12px; border-top: 2px solid var(--border-light); background: var(--bg-card2); font-size: 0.82rem; font-weight: 700; color: var(--green); }
.hdt-sel { width: 100%; background: var(--bg-input); border: 1px solid var(--border); border-radius: 4px; color: var(--text); padding: 4px 3px; font-size: 0.82rem; }
.hdt-inp { width: 100%; background: var(--bg-input); border: 1px solid var(--border); border-radius: 4px; color: var(--text); padding: 4px 5px; font-size: 0.82rem; }
.hdt-sel:focus, .hdt-inp:focus { border-color: var(--green); outline: none; }
.edit-hint { font-size: 0.72rem; color: var(--text-muted); font-weight: 400; text-transform: none; }
.hole-dist-label { font-size: 0.75rem; color: var(--green); margin-top: 2px; }
.hole-action-row { display: flex; gap: 8px; padding: 12px 16px; align-items: center; }
.hole-num-big { font-family: 'Barlow Condensed', sans-serif; font-size: 1.6rem; font-weight: 800; line-height: 1; }
.hole-par-line { font-size: 0.95rem; color: var(--text-dim); margin-top: 2px; }
.hole-dist-line { font-size: 0.8rem; color: var(--green); margin-top: 1px; }
.hole-title { flex: 1; text-align: center; }
.hole-running { width: 40px; text-align: right; font-family: 'Barlow Condensed', sans-serif; font-size: 0.95rem; font-weight: 700; color: var(--text-muted); }
.recent-course-select { width: 100%; background: var(--bg-input); border: 1px solid var(--border-light); border-radius: var(--radius-sm); color: var(--text); padding: 10px 14px; font-size: 0.95rem; font-family: inherit; }
.recent-course-select:focus { border-color: var(--green); outline: none; }
.help-footer { text-align: center; padding: 24px 16px 32px; }
.bmac-btn { display: inline-block; background: #FFDD00; color: #000; border-radius: 20px; padding: 10px 22px; font-weight: 700; font-size: 0.95rem; text-decoration: none; margin-bottom: 16px; }
.bmac-btn:hover { filter: brightness(0.95); }
.help-contact { color: var(--text-dim); font-size: 0.82rem; margin-bottom: 6px; }
.help-contact a { color: var(--green); }
.help-version { color: var(--text-muted); font-size: 0.72rem; }
.hole-action-row .btn-primary { flex: 1; }

/* ===== ROUND SUMMARY ===== */
.summary-header { text-align: center; padding: 24px 16px 16px; }
.summary-header h2 { font-family: 'Barlow Condensed', sans-serif; font-size: 2rem; font-weight: 800; }
.summary-header p { color: var(--text-dim); margin-top: 4px; }
.date-small { font-size: 0.82rem; color: var(--text-muted); }
.summary-grid {
    display: flex; margin: 0 16px 10px;
    background: var(--bg-card); border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
}
.sum-stat { flex: 1; text-align: center; padding: 14px 8px; border-right: 1px solid var(--border); }
.sum-stat:last-child { border-right: none; }
.sum-stat span { display: block; font-family: 'Barlow Condensed', sans-serif; font-size: 1.6rem; font-weight: 800; }
.sum-stat small { font-size: 0.72rem; color: var(--text-dim); }
.hole-summary-table { margin: 0 16px 16px; }
.hst-header, .hst-row { display: grid; grid-template-columns: 40px 40px 1fr 50px; padding: 8px 12px; font-size: 0.85rem; }
.hst-header { color: var(--text-muted); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; }
.hst-row { border-bottom: 1px solid var(--border); background: var(--bg-card); }
.hst-row:nth-child(even) { background: var(--bg-card2); }
.hst-total { font-weight: 700; background: var(--bg-card2) !important; border-top: 2px solid var(--border-light); }
.summary-actions { display: flex; gap: 10px; padding: 8px 16px; flex-wrap: wrap; }
.summary-actions button { flex: 1; min-width: 100px; }

/* ===== HISTORY ===== */
.history-actions { padding: 10px 16px 0; display: flex; justify-content: flex-end; }
.round-list { padding: 8px 16px; }
.round-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 16px;
    margin-bottom: 8px; cursor: pointer; transition: var(--transition);
}
.round-card:active { background: var(--bg-card2); }
.rc-main { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.rc-course { font-weight: 600; }
.rc-date { font-size: 0.8rem; color: var(--text-dim); }
.rc-scores { display: flex; gap: 16px; }
.rc-stat strong { display: block; font-size: 1.1rem; font-family: 'Barlow Condensed', sans-serif; }
.rc-stat small { font-size: 0.7rem; color: var(--text-dim); }
.rc-tee { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--text-dim); margin-top: 4px; }
.tee-dot-sm { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.2); }
.sync-badge { background: var(--orange); color: #000; border-radius: 10px; padding: 1px 6px; font-size: 0.72rem; font-weight: 700; margin-left: 4px; }

/* ===== STATS ===== */
.stats-card { margin: 10px 16px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stats-grid-4, .stats-grid-3 { display: grid; gap: 8px; }
.stats-grid-4 { grid-template-columns: repeat(4, 1fr); }
.stats-grid-3 { grid-template-columns: repeat(3, 1fr); }
.stat-box { text-align: center; background: var(--bg-card2); border-radius: var(--radius-sm); padding: 12px 8px; }
.stat-box span { display: block; font-family: 'Barlow Condensed', sans-serif; font-size: 1.5rem; font-weight: 800; }
.stat-box small { font-size: 0.7rem; color: var(--text-dim); }
.stats-section-title { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }
.mini-round-list { display: flex; flex-direction: column; gap: 6px; }
.mini-round { display: flex; gap: 8px; align-items: center; font-size: 0.85rem; padding: 6px 0; border-bottom: 1px solid var(--border); }
.mr-date { color: var(--text-muted); width: 80px; flex-shrink: 0; }
.mr-course { flex: 1; }
.mr-score { font-family: 'Barlow Condensed', sans-serif; font-size: 1.1rem; font-weight: 700; color: var(--gold); }

/* ===== MULTIPLAYER ===== */
.info-card { margin: 16px; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 16px; }
.info-card h3 { font-family: 'Barlow Condensed', sans-serif; font-size: 1.3rem; margin-bottom: 6px; }
.info-card p { color: var(--text-dim); font-size: 0.88rem; line-height: 1.5; }

.join-code-form { padding: 20px 16px; }
.code-input {
    width: 100%; text-align: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 2.5rem; font-weight: 800; letter-spacing: 0.2em;
    background: var(--bg-input); border: 2px solid var(--border-light);
    border-radius: var(--radius); color: var(--text);
    padding: 16px; margin-bottom: 14px;
}
.code-input:focus { border-color: var(--green); outline: none; }

.lobby-card { margin: 16px; background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 20px; text-align: center; }
.join-code-display { margin-bottom: 12px; }
.code-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.code-big { font-family: 'Barlow Condensed', sans-serif; font-size: 3rem; font-weight: 800; letter-spacing: 0.25em; color: var(--gold); }
.lobby-info p { color: var(--text-dim); font-size: 0.88rem; margin-top: 4px; }
.player-list { padding: 0 16px; }
.lobby-player { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.lp-name { flex: 1; font-weight: 500; }
.lp-code { font-family: 'Barlow Condensed', sans-serif; color: var(--gold); font-size: 0.88rem; font-weight: 700; letter-spacing: 0.05em; }
.lp-hcp { font-size: 0.8rem; color: var(--text-dim); }
.lobby-hint { text-align: center; color: var(--text-muted); font-size: 0.85rem; padding: 12px 16px; }
.lobby-wait { text-align: center; color: var(--text-dim); padding: 12px; background: var(--bg-card); margin: 0 16px; border-radius: var(--radius-sm); }
.live-pill { background: #3a0a0a; color: #ff6b6b; text-align: center; padding: 6px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.1em; }

/* ===== SCOREBOARD ===== */
.scoreboard-wrap { overflow-x: auto; margin: 12px 0; }
.scoreboard-table {
    width: 100%; border-collapse: collapse;
    font-size: 0.78rem;
    min-width: 320px;
}
.scoreboard-table th {
    background: var(--bg-card2);
    color: var(--text-dim); font-weight: 600;
    padding: 8px 4px; text-align: center;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.72rem;
}
.scoreboard-table td { padding: 7px 4px; text-align: center; border-bottom: 1px solid var(--border); }
.my-row { background: var(--green-deep); }
.sb-player { display: flex; align-items: center; gap: 5px; text-align: left; white-space: nowrap; }
.sb-cell { font-weight: 600; }
.sb-total { font-family: 'Barlow Condensed', sans-serif; font-size: 1rem; font-weight: 800; }
.sb-pts { color: var(--gold); font-weight: 600; }
.sb-empty { color: var(--text-muted); }
.sb-actions { display: flex; gap: 10px; padding: 12px 16px; }
.sb-actions button { flex: 1; }

/* ===== HELP ===== */
.help-intro { padding: 12px 16px; color: var(--text-dim); font-size: 0.9rem; }
.help-list { padding: 0 16px; }
.help-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; overflow: hidden; }
.help-q { display: flex; align-items: center; gap: 10px; padding: 14px 16px; cursor: pointer; font-weight: 500; }
.help-q:active { background: var(--bg-card2); }
.help-icon { font-size: 1.2rem; flex-shrink: 0; }
.help-q span:nth-child(2) { flex: 1; }
.help-arrow { color: var(--green); font-size: 1.2rem; transition: var(--transition); }
.help-a {
    max-height: 0; overflow: hidden;
    padding: 0 16px; color: var(--text-dim);
    font-size: 0.88rem; line-height: 1.6;
    transition: max-height 0.3s ease, padding 0.2s;
    border-top: 0 solid var(--border);
}
.help-a.open {
    max-height: 400px; padding: 14px 16px;
    border-top: 1px solid var(--border);
}

/* ===== TOAST ===== */
#toast-container { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); z-index: 1000; pointer-events: none; width: min(440px, 92vw); }
.toast {
    background: var(--bg-card2);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 0.88rem;
    margin-bottom: 6px;
    opacity: 0; transform: translateY(10px);
    transition: all 0.25s ease;
    text-align: center;
    pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-success { border-color: var(--green); color: var(--green); }
.toast-error { border-color: var(--red); color: var(--red); }
.toast-warning { border-color: var(--orange); color: var(--orange); }
.toast-info { border-color: var(--blue); color: var(--blue); }

/* ===== OFFLINE BAR ===== */
.offline-bar {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: min(480px, 100%);
    background: #2a1e10; color: var(--orange);
    padding: 8px 16px; font-size: 0.82rem; font-weight: 500;
    justify-content: center; align-items: center; gap: 8px;
    border-top: 1px solid #4a3a20;
    z-index: 100;
}

/* ===== UTILITY ===== */
.empty-state { text-align: center; color: var(--text-muted); padding: 40px 20px; font-size: 0.9rem; }
.loading { text-align: center; color: var(--text-muted); padding: 40px 20px; }
.loading-inline { color: var(--text-muted); padding: 10px 16px; font-size: 0.85rem; }
.loading::after { content: ''; display: block; width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--green); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 12px auto 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== RESUME BANNER ===== */
.resume-banner {
    margin: 0 16px 4px;
    background: var(--green-dark);
    border: 1px solid var(--green);
    border-radius: var(--radius);
    padding: 12px 16px;
    display: flex; align-items: center; justify-content: space-between;
    cursor: pointer;
}
.resume-banner:active { filter: brightness(0.9); }
.game-over-banner { background: #1a2a1a; border-color: var(--gold); }
.game-over-banner .resume-arrow { color: var(--gold); }
.resume-info { display: flex; align-items: center; gap: 10px; }
.resume-icon { font-size: 1.4rem; }
.resume-course { font-weight: 600; font-size: 0.95rem; }
.resume-holes { font-size: 0.78rem; color: var(--text-dim); margin-top: 2px; }
.resume-arrow { color: var(--green); font-size: 1.2rem; }

/* ===== HOLE ROW WITH DISTANCE ===== */
.hole-par-dist { display: flex; flex-direction: column; width: 70px; }
.hp-par { font-size: 0.85rem; color: var(--text-dim); }
.hp-dist { font-size: 0.72rem; color: var(--text-muted); margin-top: 1px; }

/* ===== RANKING TABLE ===== */
.ranking-table { margin: 0 16px 8px; display: flex; flex-direction: column; gap: 6px; }
.rank-row {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 10px 14px;
}
.rank-me { background: var(--green-deep); border-color: var(--green); }
.rank-pos { font-family: 'Barlow Condensed', sans-serif; font-size: 1.4rem; font-weight: 800; width: 24px; text-align: center; color: var(--gold); }
.rank-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; flex-shrink: 0; }
.rank-info { flex: 1; }
.rank-name { font-weight: 600; font-size: 0.95rem; }
.rank-you { background: var(--green); color: #fff; font-size: 0.65rem; padding: 1px 5px; border-radius: 8px; vertical-align: middle; margin-left: 4px; }
.rank-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.rank-scores { text-align: right; flex-shrink: 0; }
.rank-strokes { font-family: 'Barlow Condensed', sans-serif; font-size: 1.5rem; font-weight: 800; line-height: 1; }
.rank-pts { font-size: 0.72rem; color: var(--gold); }
.rank-nett { font-size: 0.8rem; font-weight: 400; color: var(--text-dim); }

/* ===== SCOREBOARD TABLE ===== */
.sb-holes-table { width: 100%; }
.sb-hole-col { width: 32px; text-align: center !important; font-weight: 700; }
.sb-dist-col { width: 44px; text-align: center !important; font-size: 0.75rem; color: var(--text-dim); }
.sb-par-col { width: 32px; text-align: center !important; }
.sb-player-col { min-width: 52px; text-align: center !important; }
.sb-ph { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 0.65rem; }
.sb-row-even { background: var(--bg-card2); }
.sb-totals-row { background: var(--bg-card2); font-weight: 700; border-top: 2px solid var(--border-light); }
.sb-pts-row { background: var(--bg-card); font-size: 0.82rem; }
.sb-total-label { font-size: 0.75rem; color: var(--text-dim); padding-left: 8px; }
.sb-course-name { text-align: center; font-family: 'Barlow Condensed', sans-serif; font-size: 1.1rem; font-weight: 700; color: var(--text-dim); padding: 4px 16px 8px; }
.owner-badge { background: var(--gold); color: #000; font-size: 0.65rem; padding: 1px 5px; border-radius: 8px; vertical-align: middle; margin-left: 4px; font-weight: 700; }
/* ===== AUTH SCREENS ===== */
.auth-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.about-strip { width: 100%; max-width: 400px; margin-top: 16px; border-top: 1px solid var(--border); padding-top: 12px; }
.about-toggle { width: 100%; display: flex; align-items: center; justify-content: space-between; background: none; color: var(--text-muted); font-size: 0.78rem; padding: 4px 0; letter-spacing: 0.03em; }
.about-toggle:hover { color: var(--text-dim); }
.about-features { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0 8px; }
.about-feat { display: flex; align-items: center; gap: 7px; font-size: 0.75rem; color: var(--text-muted); }
.about-feat span:first-child { font-size: 0.9rem; flex-shrink: 0; }
.about-desc { font-size: 0.75rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 8px; }
.about-links { font-size: 0.72rem; color: var(--text-muted); }
.about-links a { color: var(--text-muted); }
.auth-app-name { font-family: 'Barlow Condensed', sans-serif; font-size: 1.8rem; font-weight: 800; color: var(--text); margin-top: 8px; letter-spacing: 0.04em; }
.auth-card { background: var(--bg-card); border: 1px solid var(--border-light); border-radius: 16px; padding: 24px; width: 100%; max-width: 400px; }
.auth-title { font-family: 'Barlow Condensed', sans-serif; font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.auth-sub { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 20px; }
.auth-error { background: #2a1414; border: 1px solid #5a2424; border-radius: var(--radius-sm); color: var(--red); padding: 9px 12px; font-size: 0.82rem; margin-bottom: 12px; }
.auth-success { background: #1a3a1a; border: 1px solid #2a6a2a; border-radius: var(--radius-sm); color: #7ae87a; padding: 9px 12px; font-size: 0.82rem; margin-bottom: 12px; }
.auth-footer { text-align: center; margin-top: 16px; color: var(--text-dim); font-size: 0.85rem; }
.sn-wrap { position: relative; display: flex; align-items: center; gap: 8px; }
.sn-wrap input { flex: 1; }
.sn-status { font-size: 0.75rem; white-space: nowrap; }
.sn-good { color: var(--green); }
.sn-bad { color: var(--red); }
.field-hint { font-size: 0.7rem; color: var(--text-muted); font-weight: 400; margin-left: 4px; }
.profile-account-info { text-align: center; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.pai-email { color: var(--text-dim); font-size: 0.82rem; }
.pai-sn { color: var(--green); font-family: 'Barlow Condensed', sans-serif; font-size: 1.1rem; font-weight: 700; margin-top: 2px; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: min(480px, 100%);
    background: var(--bg-card);
    border-top: 1px solid var(--border-light);
    display: flex; align-items: stretch;
    z-index: 200;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-btn {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 8px 4px 10px;
    background: transparent; color: var(--text-muted);
    font-size: 0.62rem; font-weight: 500;
    gap: 3px; transition: var(--transition);
    border-top: 2px solid transparent;
}
.nav-btn:active { background: var(--bg-card2); }
.nav-btn.active { color: var(--green); border-top-color: var(--green); }
.nav-icon { font-size: 1.2rem; line-height: 1; }
.nav-label { font-size: 0.6rem; letter-spacing: 0.02em; }
#app { padding-bottom: 64px; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

/* ===== TEE DROPDOWN ===== */
.tee-dropdown {
    width: 100%; padding: 10px 12px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text);
    font-size: 0.95rem; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
    cursor: pointer;
}
.tee-dropdown:focus { border-color: var(--green); outline: none; }

/* ===== WHS / DIFFERENTIAL ===== */
.whs-banner {
    margin: 0 16px 12px;
    background: #1a3a1a;
    border: 1px solid var(--green-dark);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.whs-diff { font-size: 0.88rem; color: var(--text); }
.whs-diff strong { color: var(--green); font-size: 1rem; }
.whs-calc-panel { padding: 4px 0; }
.whs-calc-panel h4 { font-size: 0.95rem; }
.whs-grid { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.whs-diff-row { display: flex; justify-content: space-between; align-items: center; background: var(--bg-card2); padding: 6px 10px; border-radius: var(--radius-sm); font-size: 0.82rem; gap: 8px; }
.whs-diff-row span:first-child { color: var(--text-dim); flex-shrink: 0; }
.whs-diff-row span:nth-child(2) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whs-suggestion { background: var(--green-deep); border: 1px solid var(--green-dark); border-radius: var(--radius-sm); padding: 10px 14px; margin: 0 0 10px; font-size: 0.9rem; }
.whs-suggestion strong { color: var(--green); font-size: 1.1rem; }

/* ===== HOLE TIP ===== */
.hole-tip-bar {
    display: flex; align-items: center; gap: 8px;
    background: #1e2a1e; border-top: 1px solid var(--border);
    padding: 8px 16px; cursor: pointer; font-size: 0.82rem; color: var(--text-dim);
}
.hole-tip-bar:active { background: var(--bg-card2); }
.tip-icon { font-size: 0.9rem; flex-shrink: 0; }
.tip-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tip-edit { color: var(--green); flex-shrink: 0; opacity: 0.7; }

/* ===== SPECTATOR ===== */
.spec-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}
.spec-course { font-family: 'Barlow Condensed', sans-serif; font-size: 1.1rem; font-weight: 700; }
.spec-badge { background: #1a2a3a; color: #7ab8f5; font-size: 0.72rem; padding: 3px 8px; border-radius: 10px; }
.rank-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.rank-stat { text-align: right; }
.rank-stat strong { display: block; font-family: 'Barlow Condensed', sans-serif; font-size: 1.3rem; font-weight: 800; line-height: 1; }
.rank-stat small { font-size: 0.65rem; color: var(--text-muted); }

/* ===== NUMPAD ===== */
.numpad-area { padding: 8px 16px; }
.numpad-display {
    text-align: center; margin-bottom: 10px;
}
.numpad-score {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 3.2rem; font-weight: 800; line-height: 1;
    transition: color 0.15s;
}
.numpad-score.eagle { color: var(--gold); }
.numpad-score.birdie { color: var(--green); }
.numpad-score.par { color: var(--text); }
.numpad-score.bogey { color: var(--orange); }
.numpad-score.double-bogey, .numpad-score.triple-plus { color: var(--red); }
.numpad-label {
    font-size: 0.8rem; color: var(--text-dim); margin-top: 2px;
    font-family: 'Barlow Condensed', sans-serif; letter-spacing: 0.04em; text-transform: uppercase;
}
.numpad-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
}
/* 12 buttons = 3 rows × 4 columns, no clear button needed */
.numpad-btn {
    background: var(--bg-card2); color: var(--text);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 1.5rem; font-weight: 700;
    padding: 13px 0; cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    -webkit-tap-highlight-color: transparent;
}
.numpad-btn:active { background: var(--bg-input); }
.numpad-btn.active {
    background: var(--green-dark); border-color: var(--green);
    color: #fff;
}
.numpad-clear { color: var(--red); border-color: var(--red); grid-column: span 1; }
.numpad-clear.active { background: var(--red); color: #fff; }

/* ===== HANDICAP STROKE INDICATORS ===== */
.si-dots { color: var(--gold); font-size: 0.5rem; vertical-align: super; margin-left: 3px; letter-spacing: 1px; }
.si-dots-sm { color: var(--gold); font-size: 0.42rem; vertical-align: super; margin-left: 2px; }

/* ===== RUNNING SCORE BAR (hole screen) ===== */
.hole-running-bar {
    background: var(--bg-card); border-bottom: 1px solid var(--border);
    padding: 6px 16px; font-size: 0.82rem; color: var(--text-dim);
    text-align: center;
}
.hole-running-bar strong { font-size: 0.9rem; }

/* ===== PERSONAL BEST ===== */
.course-personal-best {
    font-size: 0.8rem; color: var(--gold); margin-top: 2px; min-height: 16px;
}

/* ===== SCOREBOARD TABS ===== */
.sb-tabs {
    display: flex; gap: 4px; padding: 8px 16px;
    border-bottom: 1px solid var(--border); background: var(--bg-card);
}
.sb-tab {
    flex: 1; background: var(--bg-card2); color: var(--text-dim);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 0.82rem; font-weight: 600; padding: 7px 4px;
    transition: var(--transition);
}
.sb-tab.active { background: var(--green-dark); border-color: var(--green); color: #fff; }
.sb-match-status { font-size: 0.72rem; color: var(--text-dim); white-space: nowrap; }
.match-status-card {
    margin: 12px 16px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px; text-align: center;
}
.match-status-tie { font-family: 'Barlow Condensed', sans-serif; font-size: 1.6rem; font-weight: 800; color: var(--text-dim); }
.match-status-lead { font-family: 'Barlow Condensed', sans-serif; font-size: 1.2rem; font-weight: 700; }
.match-status-lead span { color: var(--green); font-size: 1.8rem; margin-left: 6px; }
