/* Golf Tournament Manager – Public Styles */
:root {
    --gtm-green: #2c5f2e;
    --gtm-gold: #c9a84c;
    --gtm-red: #c0392b;
    --gtm-blue: #1a5276;
    --gtm-bg: #f8f9fa;
    --gtm-border: #dee2e6;
}

/* ── REGISTRATION FORM ─────────────────────────────────────── */
.gtm-registration-form { max-width: 600px; margin: 0 auto; }
.gtm-registration-form h3 { color: var(--gtm-green); border-bottom: 3px solid var(--gtm-gold); padding-bottom: 10px; }
.gtm-form-row { display: flex; gap: 16px; margin-bottom: 16px; }
.gtm-form-col { flex: 1; }
.gtm-form-col label { display: block; font-weight: 600; margin-bottom: 4px; }
.gtm-form-col input { width: 100%; padding: 8px 12px; border: 1px solid var(--gtm-border); border-radius: 4px; font-size: 15px; box-sizing: border-box; }
.gtm-form-col input:focus { outline: none; border-color: var(--gtm-green); box-shadow: 0 0 0 2px rgba(44,95,46,.2); }
@media (max-width: 480px) { .gtm-form-row { flex-direction: column; } }

/* ── BUTTONS ────────────────────────────────────────────────── */
.gtm-btn { display: inline-block; padding: 10px 24px; border: none; border-radius: 4px; cursor: pointer; font-size: 15px; font-weight: 700; transition: background .2s; }
.gtm-btn-primary { background: var(--gtm-green); color: #fff; }
.gtm-btn-primary:hover { background: #1e4520; }

/* ── ENABLE PUSH BUTTON ──────────────────────────────────────── */
.gtm-enable-push-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.gtm-enable-push-btn:disabled { opacity: .6; cursor: default; }
@media (max-width: 480px) {
    .gtm-enable-push-btn { left: 20px; right: 20px; bottom: 16px; width: auto; text-align: center; }
}

/* ── NOTICES ─────────────────────────────────────────────────── */
.gtm-notice { padding: 12px 16px; border-radius: 4px; margin-bottom: 16px; }
.gtm-success { background: #d4edda; border: 1px solid #c3e6cb; color: #155724; }
.gtm-error   { background: #f8d7da; border: 1px solid #f5c6cb; color: #721c24; }

/* ── SCOREBOARD ──────────────────────────────────────────────── */
.gtm-scoreboard-wrap { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; max-width: 900px; }
.gtm-scoreboard-header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.gtm-scoreboard-header h2 { margin: 0; color: var(--gtm-green); }
.gtm-course { color: #777; font-size: 14px; }
.gtm-live-badge { background: #e74c3c; color: #fff; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 10px; animation: gtm-pulse 1.5s ease-in-out infinite; }
@keyframes gtm-pulse { 0%,100%{opacity:1} 50%{opacity:.5} }
/* Last refresh failed: stop pulsing and go grey so a stale board is recognisable. */
.gtm-live-badge.gtm-stale { background: #999; animation: none; }
.gtm-last-updated { font-size: 12px; color: #999; margin-left: auto; }

.gtm-scoreboard-table-wrap { overflow-x: auto; }
.gtm-scoreboard-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.gtm-scoreboard-table th { background: var(--gtm-green); color: #fff; padding: 10px 12px; text-align: center; font-size: 12px; letter-spacing: .5px; }
.gtm-scoreboard-table td { padding: 9px 12px; text-align: center; border-bottom: 1px solid #eee; transition: background .3s; }
.gtm-scoreboard-table .gtm-col-player { text-align: left; font-weight: 600; }
.gtm-player-row:hover td { background: rgba(128,128,128,.12); }
/* Translucent so the highlight never fights the theme's text colour — see the
   note on the chipping leader row. */
.gtm-leader td { background: rgba(201,168,76,.16); }
.gtm-leader td:first-child { border-left: 4px solid var(--gtm-gold); }

.gtm-under { color: var(--gtm-red); font-weight: 700; }
.gtm-over  { color: var(--gtm-blue); }
.gtm-even  { font-weight: 700; }
.gtm-no-data { padding: 40px; color: #999; font-style: italic; }
.gtm-refresh-note { font-size: 12px; color: #aaa; text-align: right; margin-top: 6px; }
.gtm-limit-note { font-size: 12px; color: #888; text-align: right; margin-top: 8px; margin-bottom: 0; }

/* Score move animations */
.gtm-moved-up   { animation: gtm-flash-up   .6s ease; }
.gtm-moved-down { animation: gtm-flash-down .6s ease; }
@keyframes gtm-flash-up   { 0%{background:#d4edda} 100%{background:transparent} }
@keyframes gtm-flash-down { 0%{background:#f8d7da} 100%{background:transparent} }

/* ── TEE SHEET ───────────────────────────────────────────────── */
/* The round pills share the .gtm-round-tab class name with the score entry
   tabs further down; both are scoped to their container so neither rule
   set bleeds into the other. */
.gtm-round-nav { display: flex; gap: 8px; margin: 10px 0 16px; flex-wrap: wrap; }
.gtm-round-nav .gtm-round-tab { padding: 6px 14px; border: 1px solid var(--gtm-border); border-radius: 20px; font-size: 13px; font-weight: 600; text-decoration: none; color: var(--gtm-green); background: #fff; }
.gtm-round-nav .gtm-round-tab:hover { background: var(--gtm-bg); }
.gtm-round-nav .gtm-round-tab.is-active { background: var(--gtm-green); border-color: var(--gtm-green); color: #fff; }
.gtm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.gtm-table th, .gtm-table td { padding: 8px 12px; border: 1px solid var(--gtm-border); }
.gtm-table thead th { background: var(--gtm-green); color: #fff; }
.gtm-table tbody tr:nth-child(even) { background: var(--gtm-bg); }

/* ── SCORECARD ───────────────────────────────────────────────── */
.gtm-par-row td, .gtm-par-row th { background: #e8f5e9; font-size: 12px; }
.gtm-scorecard-table td.gtm-eagle  { background: #ffd700; color: #000; font-weight: 700; border-radius: 50%; }
.gtm-scorecard-table td.gtm-birdie { background: #fff3cd; font-weight: 700; }
.gtm-scorecard-table td.gtm-bogey  { background: #f8d7da; }
.gtm-scorecard-table td.gtm-double { background: #f5c6cb; font-weight: 700; }

/* ── MAGIC LINK AUTH FORM ────────────────────────────────────── */
.gtm-auth-wrap { max-width: 420px; margin: 0 auto; padding: 16px; }
.gtm-auth-card { background: #fff; border-radius: 16px; padding: 32px 28px; box-shadow: 0 4px 24px rgba(0,0,0,.10); text-align: center; }
.gtm-auth-icon { font-size: 48px; margin-bottom: 12px; }
.gtm-auth-card h3 { color: var(--gtm-green); margin: 0 0 10px; font-size: 20px; }
.gtm-auth-card p  { color: #555; font-size: 15px; margin: 0 0 20px; }
.gtm-auth-field   { text-align: left; margin-bottom: 14px; }
.gtm-auth-field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.gtm-auth-field input { width: 100%; padding: 12px 14px; border: 1px solid var(--gtm-border); border-radius: 8px; font-size: 16px; box-sizing: border-box; }
.gtm-auth-field input:focus { outline: none; border-color: var(--gtm-green); box-shadow: 0 0 0 3px rgba(44,95,46,.15); }
.gtm-btn-full { width: 100%; text-align: center; padding: 14px; font-size: 16px; border-radius: 8px; }
.gtm-auth-status { margin-top: 14px; padding: 12px; border-radius: 8px; font-size: 14px; }
.gtm-auth-status.ok  { background: #d4edda; color: #155724; }
.gtm-auth-status.err { background: #f8d7da; color: #721c24; }

/* ── MOBILE SCORE ENTRY ──────────────────────────────────────── */
.gtm-score-entry-wrap { max-width: 600px; margin: 0 auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

.gtm-se-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--gtm-green); color: #fff; border-radius: 12px 12px 0 0; }
.gtm-se-player-info { display: flex; align-items: center; gap: 10px; }
.gtm-se-avatar { font-size: 28px; }
.gtm-se-player-info strong { display: block; font-size: 16px; }
.gtm-se-hdcp { font-size: 12px; opacity: .8; }
.gtm-logout-link { color: rgba(255,255,255,.8); font-size: 13px; text-decoration: none; }
.gtm-logout-link:hover { color: #fff; }

.gtm-round-tabs { display: flex; background: #f0f0f0; }
.gtm-round-tabs .gtm-round-tab { flex: 1; padding: 12px 6px; border: none; background: transparent; font-size: 14px; font-weight: 600; cursor: pointer; color: #555; border-bottom: 3px solid transparent; transition: all .2s; }
.gtm-round-tabs .gtm-round-tab.active { color: var(--gtm-green); border-bottom-color: var(--gtm-green); background: #fff; }
.gtm-round-panel { display: none; padding: 16px; background: #fff; }
.gtm-round-panel.active { display: block; }

/* Player selector pills */
.gtm-player-selector { margin-bottom: 16px; }
.gtm-selector-label  { font-size: 13px; color: #666; margin: 0 0 8px; }
.gtm-player-pills    { display: flex; flex-wrap: wrap; gap: 8px; }
.gtm-player-pill { padding: 7px 16px; border: 2px solid var(--gtm-border); border-radius: 20px; background: #f8f8f8; cursor: pointer; font-size: 14px; font-weight: 600; transition: all .15s; }
.gtm-player-pill.active { background: var(--gtm-green); color: #fff; border-color: var(--gtm-green); }

/* Hole cards grid */
.gtm-holes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
@media (max-width: 380px) { .gtm-holes-grid { grid-template-columns: repeat(2, 1fr); } }

.gtm-hole-card { border: 2px solid var(--gtm-border); border-radius: 12px; padding: 12px 10px; text-align: center; transition: all .2s; background: #fff; }
.gtm-hole-meta { display: flex; justify-content: space-between; margin-bottom: 10px; }
.gtm-hole-num  { font-size: 13px; font-weight: 700; color: #333; }
.gtm-hole-par-badge { font-size: 11px; background: #eee; border-radius: 8px; padding: 2px 7px; color: #555; }

.gtm-hole-input-wrap { display: flex; align-items: center; justify-content: center; gap: 6px; }
.gtm-stroke-btn { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--gtm-border); background: #f5f5f5; font-size: 20px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; line-height: 1; transition: all .15s; user-select: none; }
.gtm-stroke-btn:active { transform: scale(.9); background: #e0e0e0; }
.gtm-hole-score, .gtm-team-hole-score { width: 48px; text-align: center; font-size: 24px; font-weight: 700; border: none; outline: none; background: transparent; -moz-appearance: textfield; }
.gtm-hole-score::-webkit-outer-spin-button,
.gtm-hole-score::-webkit-inner-spin-button,
.gtm-team-hole-score::-webkit-outer-spin-button,
.gtm-team-hole-score::-webkit-inner-spin-button { -webkit-appearance: none; }

.gtm-hole-label { font-size: 11px; font-weight: 700; margin-top: 6px; text-transform: uppercase; letter-spacing: .5px; }

/* Score colour states */
.gtm-hole-card.score-eagle  { border-color: #f0c040; background: #fffbe6; }
.gtm-hole-card.score-eagle  .gtm-hole-label { color: #b8860b; }
.gtm-hole-card.score-birdie { border-color: #82c882; background: #f0faf0; }
.gtm-hole-card.score-birdie .gtm-hole-label { color: var(--gtm-green); }
.gtm-hole-card.score-par    { border-color: #aac; background: #f8f8ff; }
.gtm-hole-card.score-bogey  { border-color: #f4a8a8; background: #fff5f5; }
.gtm-hole-card.score-bogey  .gtm-hole-label { color: var(--gtm-red); }
.gtm-hole-card.score-double { border-color: var(--gtm-red); background: #fff0f0; }
.gtm-hole-card.score-double .gtm-hole-label { color: var(--gtm-red); font-size: 13px; }

/* Totals bar */
.gtm-totals-bar { display: flex; background: var(--gtm-green); color: #fff; border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.gtm-total-item { flex: 1; text-align: center; padding: 10px 6px; border-right: 1px solid rgba(255,255,255,.2); }
.gtm-total-item:last-child { border-right: none; }
.gtm-total-label { display: block; font-size: 11px; opacity: .75; margin-bottom: 2px; text-transform: uppercase; letter-spacing: .5px; }
.gtm-total-val   { display: block; font-size: 20px; font-weight: 700; }

/* Save indicator */
.gtm-save-indicator { min-height: 24px; font-size: 13px; text-align: center; padding: 4px; }
.gtm-save-indicator.saving { color: #888; }
.gtm-save-indicator.saved  { color: var(--gtm-green); }
.gtm-save-indicator.error  { color: var(--gtm-red); }

/* Inline leaderboard */
.gtm-lb-title { margin: 0 0 12px; color: var(--gtm-green); font-size: 16px; }
.gtm-lb-mini  { width: 100%; border-collapse: collapse; font-size: 14px; }
.gtm-lb-mini th { background: var(--gtm-green); color: #fff; padding: 8px 10px; text-align: left; }
.gtm-lb-mini td { padding: 8px 10px; border-bottom: 1px solid #eee; }
.gtm-lb-mini .gtm-my-row td { background: #fffbe6; font-weight: 700; }


/* ── LOCKED ROUND (score entry) ──────────────────────────────── */
.gtm-locked-notice { background: #e2e3e5; color: #383d41; border: 1px solid #d3d6d8; font-weight: 600; }
.gtm-round-locked .gtm-hole-score, .gtm-round-locked .gtm-team-hole-score { background: #f4f4f4; color: #666; cursor: not-allowed; }
.gtm-round-locked .gtm-hole-card { opacity: .85; }

/* ── SEASON STANDINGS ────────────────────────────────────────── */
.gtm-standings-wrap { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; max-width: 900px; }
.gtm-standings-header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.gtm-standings-header h2 { margin: 0; color: inherit; }

.gtm-standings-table-wrap { overflow-x: auto; }
.gtm-standings-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.gtm-standings-table th { background: var(--gtm-green); color: #fff; padding: 10px 12px; text-align: center; font-size: 12px; letter-spacing: .5px; }
.gtm-standings-table td { padding: 9px 12px; text-align: center; border-bottom: 1px solid #eee; }
.gtm-standings-table .gtm-col-player { text-align: left; font-weight: 600; }
/* currentColor rather than --gtm-green: this sits on the page background,
   which the theme owns and may have made dark. */
.gtm-standings-table .gtm-col-points { font-weight: 700; font-size: 16px; color: inherit; }
.gtm-standings-row:hover td { background: rgba(128,128,128,.12); }
.gtm-standings-table .gtm-leader td { background: rgba(201,168,76,.16); }
.gtm-standings-table .gtm-leader td:first-child { border-left: 4px solid var(--gtm-gold); }

.gtm-standings-events { margin-top: 18px; font-size: 13px; }
.gtm-standings-events h3 { color: var(--gtm-green); margin: 0 0 8px; font-size: 15px; }
.gtm-standings-events ul { list-style: none; margin: 0; padding: 0; }
.gtm-standings-events li { padding: 5px 0; border-bottom: 1px solid #f0f0f0; display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.gtm-event-name { font-weight: 600; }
.gtm-event-date { color: #888; }
.gtm-event-multiplier { background: var(--gtm-gold); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 10px; }
.gtm-event-pending { color: #aaa; font-style: italic; }

@media (max-width: 600px) {
    .gtm-standings-table .gtm-col-events,
    .gtm-standings-table .gtm-col-best { display: none; }
}

/* ── CHIPPING CONTEST ────────────────────────────────────────── */
.gtm-chip-entry { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; max-width: 560px; }
.gtm-chip-entry h3 { color: var(--gtm-green); border-bottom: 3px solid var(--gtm-gold); padding-bottom: 10px; }
.gtm-chip-instructions { background: var(--gtm-bg); border-left: 4px solid var(--gtm-green); padding: 10px 14px; }
.gtm-chip-picker { margin-bottom: 16px; }
.gtm-chip-picker select, .gtm-chip-unlock input { padding: 8px 12px; border: 1px solid var(--gtm-border); border-radius: 4px; font-size: 16px; }

.gtm-chip-name-label { display: block; font-weight: 600; margin-bottom: 18px; }
/* 16px minimum stops iOS zooming the page when the field is focused. */
.gtm-chip-name { width: 100%; padding: 12px; font-size: 16px; border: 1px solid var(--gtm-border); border-radius: 4px; box-sizing: border-box; }

.gtm-chip-shot { border: 0; border-top: 1px solid var(--gtm-border); margin: 0 0 14px; padding: 12px 0 0; }
.gtm-chip-shot legend { font-weight: 700; color: var(--gtm-green); font-size: 14px; padding: 0 8px 0 0; }
.gtm-chip-zones { display: flex; flex-wrap: wrap; gap: 8px; }
/* Radios stay in the DOM for keyboard and screen-reader use; the label is the
   visible tap target. Not display:none, which removes them from focus order. */
.gtm-chip-zones input[type="radio"] { position: absolute; opacity: 0; width: 1px; height: 1px; }
.gtm-chip-zones label {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    min-width: 84px; min-height: 56px; padding: 8px 12px; cursor: pointer;
    border: 2px solid var(--gtm-border); border-radius: 8px; background: #fff;
    transition: background .15s, border-color .15s, transform .1s;
}
.gtm-chip-zones label:active { transform: scale(.96); }
.gtm-chip-zone-label { font-weight: 600; font-size: 14px; }
.gtm-chip-zone-points { font-size: 12px; color: #777; }
.gtm-chip-zones input:checked + label { background: var(--gtm-green); border-color: var(--gtm-green); color: #fff; }
.gtm-chip-zones input:checked + label .gtm-chip-zone-points { color: rgba(255,255,255,.85); }
.gtm-chip-zones input:focus-visible + label { outline: 3px solid var(--gtm-gold); outline-offset: 2px; }

.gtm-chip-total { display: flex; align-items: baseline; gap: 12px; margin: 18px 0; padding: 14px; background: var(--gtm-bg); border-radius: 6px; font-size: 18px; }
.gtm-chip-total-value { font-size: 30px; color: var(--gtm-green); }
.gtm-chip-progress { margin-left: auto; font-size: 13px; color: #888; }
.gtm-chip-ready .gtm-chip-progress { color: var(--gtm-green); font-weight: 700; }
.gtm-chip-save { width: 100%; padding: 16px; font-size: 17px; }

/* Leaderboard */
.gtm-chip-board-wrap { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; max-width: 900px; }
.gtm-chip-board-header { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
/* Inherit the theme's heading colour rather than forcing --gtm-green. A site
   can redefine that variable to its own brand colour, and if that colour
   happens to match the page background the heading vanishes. */
.gtm-chip-board-header h2 { margin: 0; color: inherit; font-size: 26px; }
.gtm-chip-division { background: var(--gtm-gold); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 10px; }
.gtm-chip-board-table-wrap { overflow-x: auto; }
.gtm-chip-board-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.gtm-chip-board-table th { background: var(--gtm-green); color: #fff; padding: 12px; text-align: center; font-size: 13px; letter-spacing: .5px; }
/* Grey at 30% reads as a divider on both light and dark backgrounds; a fixed
   #eee is a bright line on a dark theme. */
.gtm-chip-board-table td { padding: 13px 12px; text-align: center; border-bottom: 1px solid rgba(128,128,128,.3); }
.gtm-chip-board-table .gtm-col-player { text-align: left; font-weight: 600; font-size: 17px; }
/* currentColor, not --gtm-green: this cell sits on the page background, whose
   colour we don't control. Emphasis comes from size and weight instead, which
   works on any theme. */
.gtm-chip-board-table .gtm-col-total { font-weight: 700; font-size: 21px; color: inherit; }
/* Secondary columns are de-emphasised by size, not by a fixed grey — #777 is
   near-invisible on a dark background. */
.gtm-chip-board-table .gtm-col-try,
.gtm-chip-board-table .gtm-col-shots,
.gtm-chip-board-table .gtm-col-when { font-size: 14px; }
/* A card keyed in from paper has no shots to show. Italic and faded so it reads
   as "no shot detail here", not as a shot list that failed to load. */
.gtm-chip-board-table .gtm-col-shots.gtm-chip-manual { font-style: italic; opacity: .6; }
.gtm-chip-row:hover td { background: rgba(128,128,128,.12); }

/* Translucent gold, not opaque cream. A see-through tint layers over whatever
   the page background is, so inherited text keeps its contrast on a light or a
   dark theme. An opaque highlight would force us to hardcode a text colour,
   which then breaks on the theme we guessed wrong about. */
.gtm-chip-board-table .gtm-leader td { background: rgba(201,168,76,.16); }
.gtm-chip-board-table .gtm-leader td:first-child { border-left: 4px solid var(--gtm-gold); }
.gtm-chip-board-table .gtm-leader:hover td { background: rgba(201,168,76,.24); }
/* A target with a water hazard can put a total below zero. Mid-tone red so it
   reads on both light and dark backgrounds at this size. */
.gtm-chip-board-table .gtm-chip-negative { color: #e0533f; }
.gtm-chip-entry .gtm-chip-negative { color: var(--gtm-red); }

/* ── PRIZE POT ───────────────────────────────────────────────── */
/* Same translucent gold as the leader row, and for the same reason: a tint
   layers over whatever the page background is, so the inherited text keeps its
   contrast on a light or a dark theme. The gold border is what ties this band
   to the leader it is describing. */
.gtm-chip-pot { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; margin: 0 0 14px; padding: 12px 16px; background: rgba(201,168,76,.16); border-left: 4px solid var(--gtm-gold); border-radius: 4px; }
.gtm-chip-pot-label { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; opacity: .8; }
/* Inherit, not --gtm-green: this sits on the page background, whose colour we
   don't control. The figure earns its emphasis from size and weight, which
   works on any theme. */
.gtm-chip-pot-value { font-size: 30px; font-weight: 700; line-height: 1; color: inherit; }
/* flex-basis 100% keeps the working ("12 entries × $5") on its own line, so the
   figure above it never has to compete for the eye. Opacity rather than a fixed
   grey, which would vanish on a dark theme. */
.gtm-chip-pot-note { font-size: 13px; opacity: .75; flex: 1 1 100%; }

@media (max-width: 600px) {
    .gtm-chip-board-table .gtm-col-shots,
    .gtm-chip-board-table .gtm-col-when { display: none; }
    .gtm-chip-zones label { min-width: 72px; flex: 1 1 calc(50% - 8px); }
    .gtm-chip-pot-value { font-size: 26px; }
}

/* ── COURSE INFO ─────────────────────────────────────────────── */
/* Every colour is drawn from the plugin palette, and each background is paired
   with a foreground from that same palette. The card is an opaque light
   surface, so text inside must be set explicitly — inheriting a dark theme's
   light text would give light-on-light. A site that remaps --gtm-green /
   --gtm-gold / --gtm-bg to its own brand gets this card in its own colours
   with no extra CSS. */
.gtm-course-wrap { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; max-width: 1100px; }
.gtm-course-title { margin: 0 0 14px; color: inherit; }

.gtm-course-table-wrap {
    overflow-x: auto;
    background: var(--gtm-bg);
    border: 2px solid var(--gtm-green);
    border-radius: 16px;
}
.gtm-course-table { width: 100%; min-width: 680px; border-collapse: collapse; }
.gtm-course-table th,
.gtm-course-table td {
    padding: 11px 8px; text-align: center; font-size: 15px;
    color: var(--gtm-green);
    border-right: 1px solid rgba(128,128,128,.18);
}
.gtm-course-table th:first-child,
.gtm-course-table td:first-child { text-align: left; padding-left: 16px; white-space: nowrap; }
.gtm-course-rowlabel { font-weight: 800; font-size: 13px; letter-spacing: .5px; }

/* Hole-number bar: dark surface, light type. */
.gtm-course-head th {
    background: var(--gtm-green);
    color: var(--gtm-bg);
    font-weight: 700; letter-spacing: .5px; text-transform: uppercase; font-size: 14px;
}
/* Subtotal column runs the full height in the accent colour. */
.gtm-course-table .gtm-course-sub {
    background: var(--gtm-gold);
    color: var(--gtm-green);
    font-weight: 800;
    border-right: 0;
}
.gtm-course-par td, .gtm-course-par th { font-weight: 800; font-size: 16px; }
.gtm-course-yards td, .gtm-course-index td { font-weight: 500; }

/* Summary bar closes the card. */
.gtm-course-foot td {
    background: var(--gtm-green);
    color: var(--gtm-bg);
    text-align: right;
    padding: 14px 18px;
    border-right: 0;
}
.gtm-course-foot-label { font-size: 13px; letter-spacing: 1px; text-transform: uppercase; opacity: .6; margin-right: 14px; }
.gtm-course-foot-par { font-weight: 800; font-size: 18px; text-transform: uppercase; letter-spacing: .5px; }
.gtm-course-foot-yds { font-weight: 800; font-size: 18px; text-transform: uppercase; letter-spacing: .5px; color: var(--gtm-gold); margin-left: 14px; }

.gtm-course-index .gtm-course-rowlabel { cursor: help; }
.gtm-course-note { margin: 8px 0 0; font-size: 12px; opacity: .6; }

@media (max-width: 600px) {
    .gtm-course-table th, .gtm-course-table td { padding: 9px 5px; font-size: 14px; }
    .gtm-course-foot-par, .gtm-course-foot-yds { font-size: 16px; }
}

/* ── CLUBHOUSE CHAT ─────────────────────────────────────────── */
.gtm-chat-wrap { max-width: 600px; margin: 0 auto; border: 1px solid var(--gtm-border); border-radius: 8px; overflow: hidden; background: #fff; }
.gtm-chat-messages { max-height: 420px; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--gtm-bg); }
.gtm-chat-message { max-width: 80%; padding: 8px 12px; border-radius: 12px; background: #fff; border: 1px solid var(--gtm-border); align-self: flex-start; }
.gtm-chat-message.gtm-chat-mine { align-self: flex-end; background: var(--gtm-green); color: #fff; border-color: var(--gtm-green); }
.gtm-chat-message.gtm-chat-mine .gtm-chat-author { color: rgba(255,255,255,.8); }
.gtm-chat-author { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; opacity: .6; margin-bottom: 2px; }
.gtm-chat-body { font-size: 15px; word-wrap: break-word; white-space: pre-wrap; }
.gtm-chat-compose { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--gtm-border); }
.gtm-chat-input-wrap { position: relative; flex: 1; }
.gtm-chat-compose input { width: 100%; padding: 10px 14px; border: 1px solid var(--gtm-border); border-radius: 20px; font-size: 15px; box-sizing: border-box; }
.gtm-chat-compose input:focus { outline: none; border-color: var(--gtm-green); }
.gtm-chat-error { padding: 8px 14px; font-size: 13px; color: #b3261e; }

/* @mention pill — gold rather than the sender bubble's green/white so a
   mention reads as a distinct, tappable-looking reference either way. */
.gtm-chat-mention { display: inline-block; background: var(--gtm-gold); color: #3a2f0b; font-weight: 700; padding: 1px 8px; border-radius: 10px; font-size: 14px; }
.gtm-chat-message.gtm-chat-mine .gtm-chat-mention { background: #fff; color: var(--gtm-gold); }

/* @mention autocomplete dropdown, anchored under the compose input. */
.gtm-mention-dropdown { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; background: #fff; border: 1px solid var(--gtm-border); border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.12); max-height: 200px; overflow-y: auto; z-index: 20; }
.gtm-mention-option { padding: 9px 14px; font-size: 14px; cursor: pointer; }
.gtm-mention-option.is-active, .gtm-mention-option:hover { background: var(--gtm-bg); }
.gtm-mention-option:first-child { border-radius: 10px 10px 0 0; }
.gtm-mention-option:last-child { border-radius: 0 0 10px 10px; }

/* ── MATCH PLAY: THE DRAW ───────────────────────────────────── */
.gtm-bracket-wrap { margin: 0 auto; }
.gtm-bracket { display: flex; gap: 18px; overflow-x: auto; padding: 8px 0 12px; align-items: stretch; -webkit-overflow-scrolling: touch; }
.gtm-bracket-round { flex: 0 0 230px; display: flex; flex-direction: column; justify-content: space-around; gap: 14px; }
.gtm-bracket-round h4 { margin: 0 0 4px; text-align: center; color: var(--gtm-green); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.gtm-bm { border: 2px solid var(--gtm-border); border-radius: 10px; background: #fff; overflow: hidden; font-size: 14px; }
.gtm-bm.is-live  { border-color: var(--gtm-gold); }
.gtm-bm.is-final { border-color: var(--gtm-green); }
.gtm-bm.is-bye   { border-style: dashed; }
.gtm-bm-side { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid #eee; }
.gtm-bm-side:last-child { border-bottom: none; }
.gtm-bm-seed { min-width: 18px; font-size: 11px; color: #888; text-align: right; }
.gtm-bm-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gtm-bm-members { display: block; font-size: 11px; color: #777; white-space: normal; }
.gtm-bm-score { font-weight: 700; font-size: 12px; white-space: nowrap; color: #333; }
.gtm-bm-score small { font-weight: 400; color: #888; }
.gtm-bm-side.is-winner .gtm-bm-name { font-weight: 700; color: var(--gtm-green); }
.gtm-bm-side.is-loser { color: #999; }
.gtm-bm-side.is-mine { background: #fffbe6; }
.gtm-bm-side.is-tbd .gtm-bm-name { color: #aaa; font-style: italic; }
.gtm-bracket-champion { text-align: center; padding: 12px; background: #fffbe6; border: 2px solid var(--gtm-gold); border-radius: 10px; margin-bottom: 12px; font-weight: 700; color: #8a6d1a; font-size: 16px; }

/* ── MATCH PLAY: THE CARD ───────────────────────────────────── */
.gtm-match-card { background: #fff; }
.gtm-mp-head { padding: 16px 14px; text-align: center; background: var(--gtm-bg); border-bottom: 1px solid var(--gtm-border); }
.gtm-mp-vs { font-size: 15px; color: #444; }
.gtm-mp-vs strong { color: var(--gtm-green); }
.gtm-mp-status { font-size: 28px; font-weight: 800; margin-top: 4px; letter-spacing: .02em; }
.gtm-mp-status.is-up   { color: var(--gtm-green); }
.gtm-mp-status.is-down { color: var(--gtm-red); }
.gtm-mp-status.is-as   { color: var(--gtm-blue); }
.gtm-mp-sub { color: #666; font-size: 13px; margin-top: 2px; }
.gtm-mp-holes { padding: 6px 12px; }
.gtm-mp-row { display: grid; grid-template-columns: 62px 1fr 56px; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid #f0f0f0; }
.gtm-mp-row.is-extra .gtm-mp-hole { color: var(--gtm-gold); }
.gtm-mp-hole { font-weight: 700; color: #555; font-size: 13px; }
.gtm-mp-btns { display: flex; gap: 6px; }
.gtm-mp-btn { flex: 1; padding: 9px 4px; border: 2px solid var(--gtm-border); border-radius: 8px; background: #fafafa; font-weight: 700; font-size: 13px; cursor: pointer; color: #444; transition: all .15s; }
.gtm-mp-btn.active.won    { background: var(--gtm-green); border-color: var(--gtm-green); color: #fff; }
.gtm-mp-btn.active.halved { background: var(--gtm-blue);  border-color: var(--gtm-blue);  color: #fff; }
.gtm-mp-btn.active.lost   { background: var(--gtm-red);   border-color: var(--gtm-red);   color: #fff; }
.gtm-mp-btn:disabled { opacity: .55; cursor: default; }
.gtm-mp-run { text-align: right; font-weight: 700; font-size: 13px; color: #555; }
.gtm-mp-closed { margin: 12px; padding: 12px; border-radius: 8px; text-align: center; font-weight: 700; }
.gtm-mp-closed.won  { background: #f0faf0; color: var(--gtm-green); border: 1px solid #b8e0b8; }
.gtm-mp-closed.lost { background: #fff5f5; color: var(--gtm-red);   border: 1px solid #f4c0c0; }
.gtm-mp-undo { margin: 8px 12px 12px; }
.gtm-mp-btn-undo { background: #f0f0f0; color: #444; font-size: 13px; padding: 8px 14px; }
.gtm-mp-save { text-align: center; font-size: 12px; color: #666; padding: 4px 0 10px; min-height: 18px; }
.gtm-mp-save.saved { color: var(--gtm-green); }
.gtm-mp-save.error { color: var(--gtm-red); }
@media (max-width: 480px) {
    .gtm-mp-row { grid-template-columns: 52px 1fr 44px; }
    .gtm-mp-btn { padding: 9px 2px; font-size: 12px; }
}
