:root{
	--bg:#fbfaf8;
	--card:#ffffff;
	--muted:#6b6b6b;
	--accent:#0b6d44; /* green */
	--accent-strong:#05512f;
	--accent-soft:#e6f4ef;
	--danger:#e06;
	--nav-bg:#063b23;
	--nav-text:#ffffff;
	--touch-size:48px;
	--btn-success:#4CAF50;
	--btn-success-hover:#43a047;
	--btn-action:#2196F3;
	--btn-action-hover:#1976D2;
}

/* Casual mode theme - navy blue */
html[data-mode="casual"] {
  --accent: #2a6496;
  --accent-strong: #1d5280;
  --accent-soft: #e6eef4;
  --nav-bg: #1a3a5c;
}

/* Typography inspired by golf club sites: clear headings, roomy body */
body{font-family: 'Source Sans Pro', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial; margin:0;background:var(--bg);color:#111;display:flex;flex-direction:column;min-height:100vh}
main{margin:0 auto;padding:0;box-sizing:border-box;width:100%;max-width:min(980px, calc(100vw - 4px));overflow:hidden;flex:1}
header,h1,h2,h3,h4,h5,h6{font-family:'Montserrat', 'Segoe UI', sans-serif;margin:0 0 0 0}
section{margin-bottom:14px}
input,select{margin-right:8px;font-size:14px}
button{font-size: 14px;}
table{width:100%;border-collapse:collapse;max-width:100%}
td,th{padding:8px;border-bottom:1px solid #eee;text-align:left}
a{color:var(--accent);text-decoration:underline}
a:hover{text-decoration:none}
a:visited{color:var(--accent-strong);text-decoration:underline}

/* Horizontal overflow helpers (prefer wrapping tables instead of main) */
.table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}
.table-scroll > table{width:max(100%, 400px)}

/* Navigation */
.topnav{display:flex;flex-wrap:wrap;gap:4px;padding:0 4px 0 0;background:var(--nav-bg);color:var(--nav-text);border-radius:0;margin-bottom:6px;align-items:center;max-width:100%;overflow:visible;min-height:56px}
.topnav a{color:var(--nav-text);text-decoration:none;padding:8px 6px;border-radius:6px;background:transparent;font-weight:500;font-family:inherit;font-size:14px;line-height:1.2}
.topnav a:hover{background:rgba(255,255,255,0.06)}
.topnav a.active{background:rgba(255,255,255,0.15);font-weight:700;border-bottom:3px solid var(--accent-soft)}
.topnav > a{display:flex;align-items:center}
.topnav a.nav-logo-link{padding:0 4px 0 2px;display:flex;align-items:center;height:56px}
.topnav a.nav-logo-link:hover{background:rgba(255,255,255,0.06)}
.nav-logo{height:100%;width:auto;display:block;object-fit:contain}
#league-nav-slot{display:flex;align-items:center}
.nav-dropdown{display:flex;align-items:center}
.nav-dropdown-btn.settings-btn {
  min-width: var(--touch-size);
  min-height: var(--touch-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}
.settings-icon {
  width: 28px;
  height: 28px;
}
.settings-logout {
  color: var(--danger) !important;
}
.settings-btn + .nav-dropdown-content {
  left: auto;
  right: 0;
}

/* Simulated date selector in settings dropdown */
.sim-today-dropdown {
  padding: 10px 16px;
  border-bottom: 1px solid #eee;
}
.sim-today-dropdown .sim-today-label-row {
  font-size: 12px;
  color: #666;
  margin-bottom: 8px;
  font-weight: 500;
}
.sim-today-dropdown .sim-today-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}
.sim-today-dropdown input[type="date"] {
  flex: 1;
  min-width: 0;
  height: 28px;
  font-size: 12px;
  padding: 4px 6px;
}
.sim-today-dropdown button {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 4px;
  white-space: nowrap;
}
.sim-today-dropdown button.secondary {
  background: #888;
}
.nav-role{display:inline-block;padding:3px 10px;border-radius:999px;background:var(--accent-soft);color:var(--accent);font-size:12px;font-weight:700;line-height:1.2;white-space:nowrap}

/* Dropdown menu */
.nav-dropdown{position:relative}
.nav-dropdown-btn{color:var(--nav-text);background:transparent;border:none;padding:8px 6px;border-radius:6px;cursor:pointer;font-weight:500;display:flex;align-items:center;gap:4px;font-family:inherit;font-size:14px;line-height:1.2}
.nav-dropdown-btn:hover{background:rgba(255,255,255,0.06)}
.nav-dropdown-btn.active{background:rgba(255,255,255,0.15);font-weight:700}
.nav-dropdown-content{display:none;position:absolute;top:100%;left:0;background:#fff;border:1px solid #ddd;border-radius:6px;box-shadow:0 4px 12px rgba(0,0,0,0.15);min-width:150px;margin-top:4px;z-index:1000}
.nav-dropdown-content a{display:block;color:#333;padding:10px 16px;text-decoration:none;font-weight:500}
.nav-dropdown-content a:hover{background:#f0f0f0}
.nav-dropdown-content a.active{background:var(--accent-soft);color:var(--accent);font-weight:700}
.nav-dropdown.open .nav-dropdown-content{display:block}

/* Mobile: keep dropdown button; show a vertical menu */
@media (max-width:640px){
  .nav-dropdown-btn{display:flex}
  .nav-dropdown-content{position:absolute;left:0;right:0;min-width:unset;width:calc(100vw - 24px);max-width:calc(100vw - 24px)}
  .nav-dropdown-content a{color:#333;background:#fff}
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open {
  display: flex;
}

.modal-content {
  background: var(--card);
  padding: 10px;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* Wide modal variant (player pickers, multi-column forms) */
.modal-content.modal-wide {
  max-width: 980px;
}

/* For modals that provide their own header/body/footer regions. */
.modal-content.modal-structured {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 20px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #999;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #333;
}

/* Confirm dialog button styling (touch-friendly modal buttons) */
.btn-confirm-dialog {
  min-height: 48px;
  min-width: 80px;
  font-size: 16px;
}

/* Modal message text */
.modal-message {
  margin-bottom: 20px;
  font-size: 16px;
  line-height: 1.5;
}

/* Footnote text (smaller explanatory text) */
.text-footnote {
  font-size: 13px;
}

/* Help text (instructions, hints) */
.text-help {
  font-size: 14px;
}

/* Buttons and cards */
.card{padding:6px;margin-bottom:8px;border-radius:6px;background:linear-gradient(180deg,#fff,#fafafa);border:1px solid #8ac88697;font-size: 16px;}
.bigbtn{display:inline-block;background:var(--accent);color:#fff;padding:2px 12px;border-radius:6px;text-decoration:none;font: size 14px;}
.card-title{margin-bottom:12px;border-bottom:2px solid #e0e0e0;padding-bottom:8px}

/* --- Page template utilities (use for new/updated pages) --- */
.page-header{margin:0 0 16px 0}
.page-header h1{margin:0 0 6px 0}
.page-subtitle{margin:0;color:var(--muted);font-size:14px}

.section-header{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:10px}
.section-actions{display:flex;gap:8px;align-items:center}

/* Use flex gap for spacing inside section actions (avoid double-spacing from global button margins). */
.section-actions button{margin-right:0}


.toolbar{display:flex;gap:12px;align-items:flex-end;margin:12px 0;flex-wrap:wrap}

/* Toolbars commonly pair inputs with action buttons; keep controls visually aligned. */
.toolbar .section-actions{align-items:flex-end}

.two-column{display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start}
@media (max-width:600px){.two-column{grid-template-columns:1fr}}

.panel-title{margin-top:0}

.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}
@media (max-width:600px){.form-grid{grid-template-columns:1fr}}

.form-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:12px}

.muted{color:var(--muted)}
.stack > * + *{margin-top:10px}

/* Utility: prevent wrapping (dates/times, compact labels, etc.) */
.nowrap{white-space:nowrap}

/* Utility: small text (14px) for secondary content */
.text-sm{font-size:14px}

/* Utility: summary stat bar - horizontal flex row of stats */
.stat-bar{display:flex;gap:24px;font-size:14px;align-items:center;flex-wrap:wrap}

/* Utility: help icon button (circular ? icon) */
.help-icon-btn{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;border:1.5px solid var(--muted);color:var(--muted);font-size:12px;font-weight:700;cursor:pointer;user-select:none;line-height:1}

/* Utility: disclaimer/note text below content */
.disclaimer{margin-top:8px;font-size:14px;color:var(--muted)}

/* Page title bar — consistent header across all pages */
.page-title-bar {
  background: #e3f2fd;
  border-left: 4px solid var(--btn-action);
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  border-radius: 4px;
}
.page-title-bar h1 {
  font-size: 1.05em;
  font-weight: 600;
  margin: 0;
}
.page-title-bar .page-subtitle {
  font-size: 0.85em;
  color: var(--muted);
  margin: 2px 0 0 0;
}
.page-title-bar .title-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.form-group.inline label{display:block;font-size:12px;color:var(--muted);margin-bottom:4px}
button{background:var(--accent);color:#fff;border:0;padding:4px 12px;border-radius:6px}
button.secondary{background:#888}
button.small{font-size:12px;padding:2px 8px}
button.danger{background:#c0392b}
button.danger:hover{background:#a93226}
button+button{margin-left:8px}

/* Inputs and touch targets */
input:not([type="checkbox"]):not([type="radio"]),select{padding:6px;border-radius:6px;border:1px solid #ddd}
input.invalid{border:2px solid var(--danger)}
input[type="checkbox"],input[type="radio"]{width:auto;height:auto;margin:0;padding:0;border:none;vertical-align:middle;}

.hole-row{display:flex;align-items:center;gap:10px;padding:8px 4px;border-bottom:1px solid #f0f0f0}
.hole-player{flex:1;font-weight:600}
.hole-total{width:84px;text-align:right;color:var(--muted)}
input[type=number]{width:44px;padding:6px;border-radius:6px}

/* Hide number input spinner arrows for score inputs */
.score-input-no-spinner::-webkit-outer-spin-button,
.score-input-no-spinner::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.score-input-no-spinner{height:44px;width:60px;padding:6px;font-size:24px;text-align:center;border:2px solid #ccc;border-radius:6px;box-sizing:border-box}

/* Score adjustment buttons (+/-) - circular outline icons, 48px for outdoor touch targets */
.score-adjust-btn{width:48px;height:48px;min-width:48px;min-height:48px;font-size:30px;font-weight:600;background:transparent;cursor:pointer;display:flex;align-items:center;justify-content:center;touch-action:manipulation;border-radius:50%;transition:background-color 0.15s,border-color 0.15s}
.score-adjust-btn:disabled{cursor:not-allowed;opacity:0.4}
.score-adjust-btn.decrement{color:#388e3c;border:2px solid #81c784}
.score-adjust-btn.decrement:hover:not(:disabled){background:rgba(129,199,132,0.15);border-color:#388e3c}
.score-adjust-btn.decrement:active:not(:disabled){background:rgba(129,199,132,0.3);border-color:#2e7d32}
.score-adjust-btn.increment{color:#d32f2f;border:2px solid #e57373;margin: 0;}
.score-adjust-btn.increment:hover:not(:disabled){background:rgba(229,115,115,0.15);border-color:#d32f2f}
.score-adjust-btn.increment:active:not(:disabled){background:rgba(229,115,115,0.3);border-color:#c62828}

/* ===== Player Row (Scoring Pages) ===== */
.player-row {
  display: grid;
  align-items: center;
  padding: 6px;
  background: #f9f9f9;
  border-radius: 6px;
  border: 2px solid #e0e0e0;
}
.player-row.team-a { border-color: #4CAF50; }
.player-row.team-b { border-color: #2196F3; }

.player-row .player-name {
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 2px;
}
.player-row.team-a .player-name { color: #2e7d32; }
.player-row.team-b .player-name { color: #1565c0; }

.player-row .player-stats {
  font-size: 16px;
  color: #666;
}

.score-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Score highlight classes for inputs */
.score-birdie { border-color: #4caf50 !important; background: #e8f5e9 !important; }
.score-bogey  { border-color: #f44336 !important; background: #ffebee !important; }
.score-par    { border-color: #2196F3 !important; background: #f0f8ff !important; }

.par-header{background:var(--accent-soft);font-weight:700;text-align:center}

/* Save all */
.save-all-button{margin-left:12px}

/* Accessibility */
button:focus, a:focus, input:focus{outline:3px solid rgba(10,100,60,0.15);outline-offset:2px}

/* Mobile layout */
@media (max-width:640px){
  .topnav{overflow:visible}
	.hole-row{flex-direction:row;gap:8px}
	td,th{padding:4px}
	.bigbtn{width:100%;text-align:center}
	.page-title-bar .title-actions { width: 100%; }
	.page-title-bar .title-actions select { width: 100%; }
}

/* Form Styles (Restored) */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  color: #333;
  font-size: 14px;
}

.form-group input:not([type="checkbox"]):not([type="radio"]),
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 16px;
  box-sizing: border-box; /* Critical for layout */
  transition: border-color 0.2s;
}

.form-group input:focus:not([type="checkbox"]):not([type="radio"]),
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* Container */
.container {
  width: calc(100% - 8px);
  margin: 0 4px;
  /* max-width is handled by main, but if container is inside main, it just fills it */
}

/* Utility */
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }

/* Tabs */
.tabs, .tab-container {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 8px;
}
.tab {
  padding: 12px 12px;
  background: #d0d0d0;
  border: none;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  border-radius: 6px 6px 0 0;
  transition: all 0.2s;
  color: #ffffff;
}
.tab:hover {
  background: #b0b0b0;
}
.tab.active {
  background: #4CAF50;
  color: white;
  font-weight: bold;
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}
@media print {
  .tab { display: none; }
  .tabs, .tab-container { border: none; }
}

/* Participant List */
.participant-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.participant-card { background: #f9f9f9; padding: 10px; border-radius: 4px; border: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }

/* ===== Utility Classes for Common Inline Style Patterns ===== */

/* Spacing utilities */
.m-0 { margin: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-10 { margin-bottom: 10px; }
.mt-4 { margin-top: 4px; }
.mt-6 { margin-top: 6px; }
.mt-8 { margin-top: 8px; }
.mt-10 { margin-top: 10px; }

/* Flex utilities */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; }
.flex-center-gap-8 { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-between-gap-12 { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.flex-col { display: flex; flex-direction: column; }
.flex-col-gap-12 { display: flex; flex-direction: column; gap: 12px; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }

/* Input utilities */
.search-input { padding: 6px; width: 200px; }
.search-input-full { padding: 6px; margin-bottom: 8px; width: 100%; }
.input-padding { padding: 6px; }
.checkbox-inline { width: auto; margin: 0; }

/* Text utilities */
.text-center { text-align: center; }
.text-muted { color: #666; }
.text-muted-light { color: #999; }
.text-uppercase { text-transform: uppercase; }
.font-14 { font-size: 14px; }

/* Display utilities */
.hidden { display: none; }

/* Empty state message utility */
.empty-state { color: #999; text-align: center; padding: 20px; }

/* Hint/label text pattern (appears in drag-drop interfaces) */
.hint-text { font-size: 14px; margin-bottom: 8px; color: #666; }

/* ===== Casual Page Component & Utility Classes ===== */

/* Button color variants */
.btn-success { background: var(--btn-success); color: #fff; }
.btn-success:hover { background: var(--btn-success-hover); }
.btn-action { background: var(--btn-action); color: #fff; }
.btn-action:hover { background: var(--btn-action-hover); }

/* Back navigation link */
.back-link { color: var(--muted); text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* Drag-drop player selection boxes */
.drop-zone-available {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  min-height: 220px;
  background: #f9f9f9;
}
.drop-zone-selected {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px;
  min-height: 220px;
  background: #f0fff0;
}

/* Player cards inside drop zones (click/drag items) */
.player-card {
  display: block;
  padding: 8px 12px;
  margin: 4px 0;
  background: white;
  border: 1px solid #ddd;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}
.player-card:hover {
  background: #f0f0f0;
  border-color: #999;
}
.player-card.highlight {
  border-color: #2196F3;
  box-shadow: 0 0 0 2px rgba(33,150,243,0.18);
}

/* Player picker two-column grid — aligns available/selected columns.
   The "selected" column gets a spacer that matches the search input height
   so both drop zones start at the same vertical position. */
.player-picker-grid {
  align-items: start;
}
.player-picker-spacer {
  /* Match .search-input-full height: input padding (6+6) + font ~16 + border (1+1) + margin-bottom 8 = ~38px.
     Use the same height as the search input wrapper to keep drop zones aligned. */
  height: 38px;
}

/* Player picker must stay two-column on mobile (never collapse like .form-grid) */
@media (max-width: 600px) {
  .player-picker-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Mobile: compact player picker drop zones and cards */
@media (max-width: 640px) {
  .drop-zone-available,
  .drop-zone-selected {
    padding: 8px 4px;
    min-height: 150px;
  }
  .drop-zone-available .player-card,
  .drop-zone-selected .player-card {
    padding: 5px 6px;
    margin-bottom: 4px;
    font-size: 14px;
  }
  .player-picker-grid {
    gap: 6px;
  }
}

/* Radio/checkbox label with inline flex */
.radio-label { display: flex; align-items: center; gap: 6px; }
.radio-label-gap-8 { display: flex; align-items: center; gap: 8px; }

/* Active game info bar (scoring page) */
.active-game-bar {
  background: #e3f2fd;
  border-left: 4px solid var(--btn-action);
  padding: 6px 12px;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}
.active-game-bar .game-hole { font-size: 18px; font-weight: bold; color: #1565c0; text-align: right; white-space: nowrap; }
.active-game-bar .game-name { font-size: 18px; font-weight: bold; margin: 0; }
.active-game-bar .game-par { font-size: 16px; color: #000; }
.active-game-bar .game-course { font-size: 14px; color: var(--muted); margin-top: 2px; }
.active-game-bar .change-btn {
  background: white; color: #1565c0; border: 1px solid #1565c0;
  padding: 4px 8px; font-size: 11px; cursor: pointer;
}

/* Press info alert bar */
.press-info-bar {
  background: #fff3e0;
  border-left: 4px solid #ff9800;
  padding: 10px 12px;
  margin-top: 8px;
  border-radius: 4px;
}

/* Label hint text (inline within labels) */
.label-hint { font-size: 12px; color: var(--muted); font-weight: normal; }

/* Teams auto-fit grid */
.teams-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* Font weight */
.font-bold { font-weight: bold; }

/* Additional spacing utilities */
.mb-0 { margin-bottom: 0; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mt-0 { margin-top: 0; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }

/* ===== Status Messages (User Feedback) ===== */
:root {
  --status-success-bg: #d4edda;
  --status-success-text: #155724;
  --status-success-border: #c3e6cb;

  --status-error-bg: #f8d7da;
  --status-error-text: #721c24;
  --status-error-border: #f5c6cb;

  --status-info-bg: #d1ecf1;
  --status-info-text: #0c5460;
  --status-info-border: #bee5eb;

  --status-warning-bg: #fff3cd;
  --status-warning-text: #856404;
  --status-warning-border: #ffeaa7;
}

.status-message {
  display: flex;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  position: relative;
}

.status-message:not(.visible) {
  display: none;
}

.status-message.visible {
  opacity: 1;
}

.status-message.success {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border-color: var(--status-success-border);
}

.status-message.error {
  background: var(--status-error-bg);
  color: var(--status-error-text);
  border-color: var(--status-error-border);
}

.status-message.info {
  background: var(--status-info-bg);
  color: var(--status-info-text);
  border-color: var(--status-info-border);
}

.status-message.warning {
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
  border-color: var(--status-warning-border);
}

.status-icon {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 18px;
}

.status-message.success .status-icon::before {
  content: '\2713';
}

.status-message.error .status-icon::before {
  content: '\2715';
}

.status-message.info .status-icon::before {
  content: '\2139';
}

.status-message.warning .status-icon::before {
  content: '\26A0';
}

.status-text {
  flex: 1;
}

.status-close {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.status-close:hover {
  opacity: 1;
}

/* App Footer */
.app-footer {
  background: var(--nav-bg);
  color: var(--nav-text);
  padding: 20px 16px;
  text-align: center;
  margin-top: auto;
  border-top: 3px solid var(--accent);
}

.footer-content {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-links {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.app-footer a {
  color: var(--nav-text);
  text-decoration: none;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
}

.app-footer a:hover {
  background: rgba(255,255,255,0.1);
  text-decoration: underline;
}

.footer-separator {
  color: rgba(255,255,255,0.4);
}

.footer-copyright {
  font-size: 14px;
  opacity: 0.8;
}

@media (max-width: 640px) {
  .app-footer {
    padding: 16px 12px;
    font-size: 13px;
  }
  .footer-content {
    font-size: 13px;
  }
}

/* Search + paging row — search on left, pagination on right; stacks on mobile */
.search-paging-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}
@media (max-width: 600px) {
  .search-paging-row {
    flex-direction: column;
    align-items: stretch;
  }
  .search-paging-row input {
    max-width: 100% !important;
  }
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
  gap: 10px;
}

.btn-primary {
  display: inline-block;
  padding: 6px 12px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--accent-strong);
  color: white;
  text-decoration: none;
}

/* Help popover content (consistent styling for help popovers) */
.help-popover-content {
  font-size: 14px;
  line-height: 1.5;
}

/* Help popover box (extends .help-popover-content) */
.help-popover-box {
  display: none;
  position: relative;
  background: var(--card, #fff);
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.help-popover-box.open { display: block; }

/* Button variants */
.btn-danger { background: #ff5252; color: #fff; border: none; }
.btn-danger:hover { background: #e04848; }

/* Code preview areas (email template pages) */
.code-preview {
  padding: 10px;
  background: #f5f5f5;
  border-radius: 4px;
  font-family: monospace;
}
.code-preview--wrap { white-space: pre-wrap; line-height: 1.5; }
.code-preview--break { word-break: break-all; }

/* Scorecard table */
.scorecard-table {
  border: 2px solid #ddd;
  border-radius: 8px;
  margin-bottom: 8px;
  border-collapse: collapse;
}
.scorecard-cell {
  font-size: 14px;
  border: 1px solid #e0e0e0;
  padding: 2px;
  text-align: center;
}
.scorecard-cell--header {
  color: #333;
  font-weight: bold;
  text-align: left;
}
.scorecard-cell--muted {
  font-size: 12px;
  color: #666;
}
.scorecard-cell--bold {
  font-weight: bold;
}
.scorecard-cell--score {
  position: relative;
  padding: 4px;
}
.scorecard-stroke-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

/* ===== Games List Card Layout (Mobile) ===== */
/* On desktop, games-table shows as normal table */
#game-table thead { display: table-header-group; }
#game-table tbody tr { display: table-row; }
#game-table td { display: table-cell; }

/* Data labels for mobile card view - hidden on desktop */
#game-table td::before { display: none; }

/* Mobile card layout for games list */
@media (max-width: 640px) {
  #game-table thead { display: none; }

  #game-table tbody tr {
    display: block;
    background: var(--card);
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
    margin-bottom: 10px;
    padding: 8px 10px;
  }

  #game-table tbody tr.game-empty-row {
    text-align: center;
    padding: 20px;
  }

  #game-table td {
    display: block;
    border-bottom: none;
    padding: 4px 0;
    text-align: left;
  }

  /* Game name - prominent display */
  #game-table td.game-name-cell {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
  }

  /* Date and Course - stacked below name */
  #game-table td.game-date-cell,
  #game-table td.game-course-cell {
    font-size: 14px;
    color: var(--muted);
  }

  /* Show data labels on mobile */
  #game-table td.game-date-cell::before,
  #game-table td.game-course-cell::before {
    display: inline;
    font-weight: 500;
    color: #666;
    margin-right: 4px;
  }

  #game-table td.game-date-cell::before { content: "Date: "; }
  #game-table td.game-course-cell::before { content: "Course: "; }

  /* Actions - row at bottom with compact buttons */
  #game-table td.game-actions-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    text-align: left;
  }

  #game-table td.game-actions-cell button {
    min-width: 34px;
    min-height: 34px;
    padding: 6px 12px;
    font-size: 13px;
    flex: 1;
    max-width: calc(50% - 3px);
  }
}

/* ===== Shared Results / Vegas Table Utilities ===== */
/* Used by renderers-vegas.js (shared between scoring & results pages) */

/* Table utility classes */
.w-full { width: 100%; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.font-13 { font-size: 13px; }
.font-16 { font-size: 16px; }
.font-18 { font-size: 18px; }
.col-hole { text-align: center; width: 60px; }
.col-running-total { text-align: center; width: 120px; }
.bg-white { background: white; }

/* Dynamic text colors */
.text-team1 { color: #4CAF50; }
.text-team2 { color: #2196F3; }
.text-neutral { color: #666; }

/* Team-match hole-winner row tints */
.results-row--team1-win { background: #f1f8f4; }
.results-row--team2-win { background: #f0f7fd; }

/* Hole table cells (bold centered) */
.results-hole-cell {
  text-align: center;
  font-weight: bold;
}
.results-score-winner {
  font-weight: bold;
}
.results-score-winner span {
  display: inline-block;
  width: 24px;
  height: 24px;
  line-height: 24px;
  border-radius: 50%;
  border: 2px solid #333;
  text-align: center;
}

/* Segment containers (Sixes / Vegas) */
.results-segment {
  border: 2px solid #2196F3;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 24px;
  background: #f9fafe;
}
.results-segment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e0e0e0;
}
.results-segment-title {
  margin: 0;
  color: #2196F3;
  font-size: 16px;
}

/* Result badges */
.results-badge {
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 14px;
  color: white;
  white-space: nowrap;
}
.results-badge--team1 { background: #4CAF50; }
.results-badge--team2 { background: #2196F3; }
.results-badge--tied  { background: #9E9E9E; }

/* Team info grid */
.results-team-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.results-team-card {
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
}
.results-team-card--team1 {
  background: #e8f5e9;
  border-left: 4px solid #4CAF50;
}
.results-team-card--team2 {
  background: #e3f2fd;
  border-left: 4px solid #2196F3;
}

/* Hole match result cell */
.results-hole-match {
  text-align: center;
  font-size: 13px;
}

/* Mobile responsive for shared results components */
@media (max-width: 640px) {
  .results-team-grid {
    grid-template-columns: 1fr;
  }
  .results-segment {
    padding: 10px;
    margin-bottom: 16px;
  }
  .results-badge {
    font-size: 12px;
    padding: 5px 10px;
  }
}
