/* CSS Design System for settlethecard.golf */

:root {
  /* Color Palette - Premium Country Club Aesthetic */
  --bg-cream-canvas: #FAF8F2;
  --bg-cream-card: #F2EDE2;
  --bg-cream-card-light: #FAF8F5;
  --color-forest: #14321A;
  --color-forest-medium: #1C4825;
  --color-forest-light: #2A6E3B;
  --color-gold: #C2A26A;
  --color-gold-dark: #A5844D;
  --color-charcoal: #2C2B28;
  --color-muted: #7E7C74;
  --color-border: #E3DCCF;
  --color-white: #FFFFFF;
  
  /* Soft Golf Score Indicators */
  --bg-eagle: #DDF0FF;
  --color-eagle: #0D47A1;
  --bg-birdie: #E5F6EB;
  --color-birdie: #1E6B3E;
  --bg-par: transparent;
  --color-par: var(--color-charcoal);
  --bg-bogey: #FDF1ED;
  --color-bogey: #C93B2B;
  --bg-double-bogey: #FAF0F2;
  --color-double-bogey: #9E1B32;

  /* Handicap stroke dots / focus bumps (blue); cell tint + net subscript stay gold */
  --color-stroke-bump: #1e6fd9;

  /* Layout Utility Values */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 4px rgba(28, 27, 24, 0.05);
  --shadow-md: 0 8px 16px rgba(28, 27, 24, 0.08);
  --shadow-lg: 0 16px 32px rgba(28, 27, 24, 0.12);
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Premium Midnight Clubhouse Dark Mode Override Colors */
body.dark-mode {
  --bg-cream-canvas: #0C120E;       /* Pitch-black with premium deep clubhouse slate-emerald backing */
  --bg-cream-card: #152219;         /* Luxurious deep slate-green card */
  --bg-cream-card-light: #1D2E23;   /* High-end forest highlight panel */
  --color-forest: #EAF5EC;          /* High contrast soft-white text */
  --color-forest-medium: #A2D9B1;   /* Pale mint-gold link headers */
  --color-forest-light: #52B273;    /* Bright vibrant green */
  --color-gold: #D4AF37;            /* True metallic clubhouse gold */
  --color-gold-dark: #FFD700;       /* Luminous gold text */
  --color-charcoal: #F5F5F5;        /* Light silver body text */
  --color-muted: #8E9992;           /* Muted slate-gray */
  --color-border: #1C2B20;          /* Subtle deep slate borders */
  --color-white: #121A15;           /* Opaque slate-green backing replacing pure white */

  /* Soft score indicators adapted for dark mode */
  --bg-eagle: #0D3C61;
  --color-eagle: #99CCFF;
  --bg-birdie: #143A23;
  --color-birdie: #7CDB95;
  --bg-bogey: #471A15;
  --color-bogey: #FFA59C;
  --bg-double-bogey: #3D0D19;
  --color-double-bogey: #FF8F9E;

  --color-stroke-bump: #5ca8ff;
}

body.dark-mode .app-header {
  background-color: rgba(12, 18, 14, 0.95) !important;
  border-bottom-color: var(--color-border) !important;
}

body.dark-mode .app-nav {
  background-color: rgba(12, 18, 14, 0.95) !important;
  border-top-color: var(--color-border) !important;
}

body.dark-mode #theme-toggle-btn {
  background: rgba(255,255,255,0.06) !important;
  border-color: rgba(255,255,255,0.1) !important;
  color: var(--color-gold) !important;
}

/* Premium Midnight Clubhouse Dark Mode Structural Overrides */
body.dark-mode .scorecard-table th.col-player, 
body.dark-mode .scorecard-table td.cell-player-info {
  background-color: var(--bg-cream-card) !important;
}

body.dark-mode .scorecard-table td.cell-score {
  background-color: var(--bg-cream-card-light) !important;
  border-color: var(--color-border) !important;
}

/* Premium Dark Mode Scorecard Headers & Totals */
body.dark-mode .scorecard-table th {
  background-color: var(--bg-cream-card) !important;
  color: var(--color-gold) !important;
  border-bottom: 2.5px solid var(--color-border) !important;
}

body.dark-mode .scorecard-table th, 
body.dark-mode .scorecard-table td {
  border-bottom-color: var(--color-border) !important;
}

body.dark-mode .scorecard-table:not(.scorecard-table-vertical) td:last-child {
  background-color: var(--bg-cream-card) !important;
  color: var(--color-charcoal) !important;
  border-left: 1px solid var(--color-border) !important;
  font-weight: 700 !important;
}

body.dark-mode .scorecard-table:not(.scorecard-table-vertical) tr.total-row td:last-child {
  background-color: var(--bg-cream-card-light) !important;
}

/* ==========================================================
   ANTI-WASHOUT INLINE PROTECTION & TEAM HIGHLIGHTS
   ========================================================== */

/* Catch and override light green backgrounds injected by JS strings */
body.dark-mode .scorecard-table tr.row-team-1 td.cell-player-info,
body.dark-mode .scorecard-table tr.bestball-row.team-1-subtotal,
body.dark-mode tr[style*="background-color: #EAF5EC"],
body.dark-mode tr[style*="background-color: #eaf5ec"],
body.dark-mode td[style*="background-color: #EAF5EC"] {
  background-color: #11331A !important; /* Deep forest moss moss */
  color: #A2D9B1 !important; /* Crisp mint text */
}
body.dark-mode .scorecard-table tr.bestball-row.team-1-subtotal td.cell-player-info {
  background-color: #174223 !important;
  border-right: 2px solid #2A6E3B !important;
}

/* Fix Leader and Segment Winner sticky name cards from washing out */
body.dark-mode .scorecard-table tr.is-leader td.cell-player-info,
body.dark-mode .scorecard-table tr.row-winning-front td.cell-player-info,
body.dark-mode .scorecard-table tr.row-winning-back td.cell-player-info {
  background-color: #14271A !important; /* Deep luxury clubhouse green slot */
  color: #A2D9B1 !important; /* High contrast mint text */
}

/* Specific background adjustment for the overall tournament/round winner */
body.dark-mode .scorecard-table tr.row-winning-total td.cell-player-info {
  background-color: #1B3523 !important; /* Slightly distinct deeper green slot */
  color: var(--color-gold) !important; /* Give the overall winner high-visibility gold text */
}

/* Ensure child text elements inside winning player cells retain absolute visibility */
body.dark-mode .scorecard-table tr.is-leader td.cell-player-info .player-info-name,
body.dark-mode .scorecard-table tr.is-leader td.cell-player-info .player-info-hcp,
body.dark-mode .scorecard-table tr.is-leader td.cell-player-info .scorecard-wager-summary {
  color: inherit !important;
}

/* Maintain high-visibility left accent borders for wins without washing backgrounds */
body.dark-mode .scorecard-table tr.row-winning-front td.cell-player-info {
  border-left: 4.5px solid #2A6E3B !important;
}
body.dark-mode .scorecard-table tr.row-winning-back td.cell-player-info {
  border-left: 4.5px solid var(--color-gold) !important;
}
body.dark-mode .scorecard-table tr.row-winning-total td.cell-player-info {
  border-left: 4.5px solid var(--color-gold-dark) !important;
}

/* Catch and override light amber backgrounds injected by JS strings */
body.dark-mode .scorecard-table tr.row-team-2 td.cell-player-info,
body.dark-mode .scorecard-table tr.bestball-row.team-2-subtotal,
body.dark-mode tr[style*="background-color: #FCF5E8"],
body.dark-mode tr[style*="background-color: #fcf5e8"],
body.dark-mode td[style*="background-color: #FCF5E8"] {
  background-color: #2D200E !important; /* Deep matte charcoal amber */
  color: #F3DAB1 !important; /* Muted gold text */
}
body.dark-mode .scorecard-table tr.bestball-row.team-2-subtotal td.cell-player-info {
  background-color: #3B2B15 !important;
  border-right: 2px solid var(--color-gold) !important;
}

/* Safeguard hardcoded text color definitions in Contribution rows */
body.dark-mode td[style*="color:#1C4825"],
body.dark-mode td[style*="color: #1C4825"] {
  color: #A2D9B1 !important;
}
body.dark-mode td[style*="color:var(--color-gold-dark)"],
body.dark-mode td[style*="color: var(--color-gold-dark)"] {
  color: var(--color-gold) !important;
}

/* Fix Vegas / compact special rows from glowing white */
body.dark-mode tr.bestball-row[style*="background-color"],
body.dark-mode tr.vegas-compact-row {
  background-color: rgba(212, 175, 55, 0.03) !important;
}

/* Fix bestball contribution outline grid cells */
body.dark-mode .scorecard-table td.cell-score.is-bestball-used {
  outline: 2px solid var(--color-forest-light) !important;
  background-color: rgba(82, 178, 115, 0.08) !important;
}

/* Settle Tab Raw Balance Tables */
body.dark-mode .raw-balance-table td {
  background-color: var(--bg-cream-card) !important;
  border-bottom-color: var(--color-border) !important;
  color: var(--color-charcoal) !important;
}

body.dark-mode .raw-balance-table tbody tr:hover td {
  background-color: var(--bg-cream-card-light) !important;
}

body.dark-mode .raw-balance-table th {
  background-color: #152219 !important;
  color: var(--color-gold) !important;
  border-bottom: 2px solid var(--color-gold) !important;
}

/* Score Entry Numpad Base Styling Overrides */
body.dark-mode .num-btn, 
body.dark-mode .dot-toggle-btn {
  background-color: var(--bg-cream-card-light) !important;
  border-color: var(--color-border) !important;
  color: var(--color-charcoal) !important;
}

body.dark-mode .num-btn:active, 
body.dark-mode .dot-toggle-btn:active {
  background-color: var(--bg-cream-card) !important;
  border-color: var(--color-gold) !important;
}

/* Deep Clubhouse Green Elements & Text Contrast Fixes */
body.dark-mode .btn-primary, 
body.dark-mode .btn.btn-done, 
body.dark-mode .bg-dark-green, 
body.dark-mode .course-table th, 
body.dark-mode .segment-btn.active, 
body.dark-mode .active-badge, 
body.dark-mode .drawer-score-bubble {
  background-color: #143A23 !important;
  color: #EAF5EC !important;
  border-color: #2A6E3B !important;
}

body.dark-mode .text-forest {
  color: #A2D9B1 !important;
}

/* Dynamic color transitions for premium feels */
body, .view-card, .col-player, .cell-player-info, button, input, select, textarea, .app-header, .app-nav {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, fill 0.3s ease;
}

/* Base Settings & Resets */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: #1C2B21; /* Deep forest outside container for desktop wrapper */
  color: var(--color-charcoal);
  line-height: 1.5;
  display: flex;
  justify-content: center;
  align-items: stretch;
  min-height: 100vh;
  overflow-x: hidden;
}

/* App Shell Container (max-width mobile frame centered on desktop) */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 10% 20%, rgba(30,63,32,0.15) 0%, rgba(0,0,0,0) 80%);
  z-index: -1;
  pointer-events: none;
}

/* Mobile Wrapper */
body > .app-header,
body > .app-main,
body > .app-nav,
body > .drawer-overlay {
  width: 100%;
  max-width: 600px;
}

/* Perfect alignment when wrapper container is used */
body {
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: var(--bg-cream-canvas);
}

.app-header {
  position: fixed;
  top: 0;
  z-index: 100;
  height: 60px;
  background-color: rgba(250, 248, 242, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 1.3rem;
  color: var(--color-forest-medium);
  background-color: var(--bg-cream-card);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--color-gold);
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-forest);
}

.logo-text span {
  font-family: var(--font-sans);
  font-weight: 300;
  color: var(--color-gold-dark);
}

.app-main {
  flex: 1;
  padding: 80px 16px 90px 16px; /* Header & Nav pad */
  overflow-y: auto;
  width: 100%;
}

/* Scorecard tab: extra vertical room — header hidden in grid and focus */
body.scorecard-immersive .app-header {
  display: none;
}

body.scorecard-immersive .app-main {
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
}

/* Nav Bar Fixed Bottom */
.app-nav {
  position: fixed;
  bottom: 0;
  z-index: 100;
  height: 70px;
  background-color: rgba(20, 50, 26, 0.98); /* Deep forest background for nav */
  border-top: 2px solid var(--color-gold);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.nav-item {
  background: none;
  border: none;
  outline: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  gap: 4px;
  width: 33.33%;
  height: 100%;
  cursor: pointer;
  transition: var(--transition);
}

.nav-item i {
  font-size: 1.25rem;
  transition: var(--transition);
}

.nav-item.active {
  color: var(--color-gold);
}

.nav-item.active i {
  transform: translateY(-2px);
  color: var(--color-gold);
}

/* App Views Control */
.app-view {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.app-view.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Premium Card Layout */
.view-card {
  background-color: var(--bg-cream-card-light);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--color-forest);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title i {
  font-size: 1.1rem;
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 16px;
}

.section-title-lg {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--color-forest);
}

.section-subtitle-lg {
  font-size: 0.95rem;
  color: var(--color-muted);
  margin-bottom: 20px;
}

.accent-gold {
  color: var(--color-gold);
}

/* Form Controls */
.form-group {
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-forest-medium);
  margin-bottom: 6px;
}

.form-control {
  font-family: var(--font-sans);
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.95rem;
  color: var(--color-charcoal);
  outline: none;
  transition: var(--transition);
  width: 100%;
}

.form-control:focus {
  border-color: var(--color-forest-light);
  box-shadow: 0 0 0 3px rgba(30, 63, 32, 0.1);
}

.select-dark {
  background-image: url("data:image/svg+xml;utf8,<svg fill='%2314321A' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position-x: 96%;
  background-position-y: 50%;
  appearance: none;
  padding-right: 30px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary {
  background-color: var(--color-forest);
  color: var(--color-white);
}

.btn-primary:hover, .btn-primary:active {
  background-color: var(--color-forest-medium);
}

.btn-secondary {
  background-color: var(--bg-cream-card);
  color: var(--color-forest);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover, .btn-secondary:active {
  background-color: var(--color-border);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-forest-medium);
  border: 1px solid var(--color-forest-medium);
}

.btn-outline:hover, .btn-outline:active {
  background-color: rgba(30, 63, 32, 0.05);
}

.btn-full {
  width: 100%;
}

.btn-xs {
  font-size: 0.75rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}

.icon-btn {
  background: none;
  border: none;
  outline: none;
  color: var(--color-forest);
  font-size: 1.15rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:active {
  background-color: rgba(28, 43, 33, 0.08);
}

/* Helpers */
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.text-center { text-align: center; }
.text-forest { color: var(--color-forest); }
.hidden { display: none !important; }

/* Setup Player Card */
.player-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 14px;
}

.player-item {
  display: grid;
  grid-template-columns: 2fr 1fr 40px;
  align-items: center;
  gap: 10px;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.player-item:focus-within {
  border-color: var(--color-gold);
}

.delete-player-btn {
  color: var(--color-bogey);
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

/* Course specs table */
.course-specs-container {
  width: 100%;
  overflow: hidden;
}

.course-scroll-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.course-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  background-color: var(--color-white);
}

.course-table th, .course-table td {
  padding: 8px 10px;
  text-align: center;
  border: 1px solid var(--color-border);
  min-width: 40px;
  font-weight: 500;
}

.course-table th {
  background-color: var(--color-forest);
  color: var(--color-white);
}

.course-table td.row-label {
  background-color: var(--bg-cream-card);
  color: var(--color-forest-medium);
  font-weight: 600;
  position: sticky;
  left: 0;
  z-index: 10;
  min-width: 50px;
}

.course-table input.course-input {
  width: 100%;
  border: none;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-charcoal);
  padding: 2px 0;
}

.course-table input.course-input:focus {
  outline: 2px solid var(--color-gold);
}

/* Segmented Control Tabs */
.scorecard-controls {
  margin-bottom: 12px;
}

.segmented-control {
  display: flex;
  background-color: var(--bg-cream-card);
  border-radius: var(--radius-md);
  padding: 4px;
  border: 1px solid var(--color-border);
}

.segment-btn {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  padding: 8px 0;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-muted);
  cursor: pointer;
  border-radius: 8px;
  transition: var(--transition);
}

.segment-btn.active {
  background-color: var(--color-forest);
  color: var(--color-white);
  box-shadow: var(--shadow-sm);
}

/* Sticky Scorecard Grid - Premium Clubhouse Redesign */
.scorecard-container {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-top: 8px;
}

.scorecard-wrapper {
  overflow-x: auto;
  position: relative; /* Create isolated scrolling anchor context */
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Vertical scorecard: lock main scroll — only the table wrapper scrolls (banner + switcher stay fixed; legend is inside the wrapper) */
body.scorecard-vertical-main-lock .app-main {
  overflow-y: hidden;
}

body.scorecard-vertical-main-lock #view-scorecard.app-view.active.scorecard-vertical-scroll-layout {
  display: flex;
  flex-direction: column;
  max-height: calc(
    100dvh - 16px - env(safe-area-inset-top, 0px) - 90px - env(safe-area-inset-bottom, 0px)
  );
  overflow: hidden;
}

body.scorecard-vertical-main-lock
  #view-scorecard.app-view.active.scorecard-vertical-scroll-layout
  #grid-scorecard-wrapper {
  flex: 1 1 auto;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.scorecard-vertical-main-lock
  #view-scorecard.app-view.active.scorecard-vertical-scroll-layout
  .scorecard-wrapper {
  flex: 1 1 auto;
  min-height: 200px;
  overflow-x: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

/* Vertical scorecard (scroll layout): stick ribbon row, then Hole + names row — same top offset so Hole stays with names */
#view-scorecard.active.scorecard-vertical-scroll-layout .scorecard-table-vertical {
  --vertical-thead-ribbon-row-height: 72px;
}

#view-scorecard.active.scorecard-vertical-scroll-layout
  .scorecard-table-vertical
  thead
  tr.vertical-thead-ribbons
  th {
  position: sticky;
  top: 0;
  z-index: 9;
  background-color: #faf9f5;
}

#view-scorecard.active.scorecard-vertical-scroll-layout
  .scorecard-table-vertical
  thead
  tr.vertical-thead-ribbons
  th.col-vertical-sticky-hole.vertical-thead-corner {
  z-index: 12;
  left: 0;
  top: 0;
  background: var(--color-white) !important;
  vertical-align: middle;
}

#view-scorecard.active.scorecard-vertical-scroll-layout
  .scorecard-table-vertical
  thead
  tr.vertical-thead-players
  th,
#view-scorecard.active.scorecard-vertical-scroll-layout
  .scorecard-table-vertical
  thead
  tr.vertical-thead-single
  th {
  position: sticky;
  /* Slight overlap with ribbon row hides subpixel seams where tbody would otherwise show through */
  top: calc(var(--vertical-thead-ribbon-row-height) - 1px);
  z-index: 8;
  background-color: #faf9f5;
}

#view-scorecard.active.scorecard-vertical-scroll-layout
  .scorecard-table-vertical
  thead
  tr.vertical-thead-single
  th {
  top: 0;
}

#view-scorecard.active.scorecard-vertical-scroll-layout
  .scorecard-table-vertical
  thead
  tr.vertical-thead-players
  th.col-vertical-sticky-hole,
#view-scorecard.active.scorecard-vertical-scroll-layout
  .scorecard-table-vertical
  thead
  tr.vertical-thead-single
  th.col-vertical-sticky-hole {
  z-index: 11;
  left: 0;
}

#view-scorecard.active.scorecard-vertical-scroll-layout
  .scorecard-table-vertical
  thead
  th.vertical-team-ribbon-1 {
  background: rgba(234, 245, 236, 0.98);
}

#view-scorecard.active.scorecard-vertical-scroll-layout
  .scorecard-table-vertical
  thead
  th.vertical-team-ribbon-2 {
  background: rgba(252, 245, 232, 0.98);
}

body.dark-mode
  #view-scorecard.active.scorecard-vertical-scroll-layout
  .scorecard-table-vertical
  thead
  tr.vertical-thead-ribbons
  th {
  background-color: var(--bg-cream-card);
}

body.dark-mode
  #view-scorecard.active.scorecard-vertical-scroll-layout
  .scorecard-table-vertical
  thead
  tr.vertical-thead-ribbons
  th.col-vertical-sticky-hole.vertical-thead-corner {
  background: var(--bg-cream-card) !important;
}

body.dark-mode
  #view-scorecard.active.scorecard-vertical-scroll-layout
  .scorecard-table-vertical
  thead
  tr.vertical-thead-players
  th,
body.dark-mode
  #view-scorecard.active.scorecard-vertical-scroll-layout
  .scorecard-table-vertical
  thead
  tr.vertical-thead-single
  th {
  background-color: var(--bg-cream-card);
}

body.dark-mode
  #view-scorecard.active.scorecard-vertical-scroll-layout
  .scorecard-table-vertical
  thead
  th.vertical-team-ribbon-1 {
  background: rgba(17, 51, 26, 0.85);
}

body.dark-mode
  #view-scorecard.active.scorecard-vertical-scroll-layout
  .scorecard-table-vertical
  thead
  th.vertical-team-ribbon-2 {
  background: rgba(45, 32, 14, 0.75);
}

/* Vertical thead: corner cell (2v2 ribbon row) aligns hole column */
.scorecard-table-vertical th.vertical-thead-corner {
  border-bottom: 2px solid var(--color-border);
  box-shadow: 4px 0 8px rgba(28, 43, 33, 0.06);
}

/* Vertical player header: Name / Team / Hcp stacked */
.scorecard-table-vertical .vertical-player-head-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
  width: 100%;
}

.scorecard-table-vertical .vertical-player-head-name {
  width: 100%;
  text-align: center;
}

.scorecard-table-vertical .vertical-player-head-team {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  width: 100%;
  min-height: 1.2em;
  line-height: 1.25;
}

.scorecard-table-vertical .vertical-player-head-team-none {
  font-size: 0.68rem;
  font-weight: 600;
  color: rgba(28, 43, 33, 0.2);
}

body.dark-mode .scorecard-table-vertical .vertical-player-head-team-none {
  color: rgba(255, 255, 255, 0.2);
}

/* Long-press scorecard nav: radial layout picker */
.scorecard-radial-root {
  position: fixed;
  inset: 0;
  z-index: 10050;
  pointer-events: none;
}

.scorecard-radial-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: auto;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  background: rgba(12, 18, 14, 0.42);
  -webkit-tap-highlight-color: transparent;
}

body.dark-mode .scorecard-radial-backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.scorecard-radial-shelf {
  position: absolute;
  width: 0;
  height: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.scorecard-radial-option {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: auto;
  box-sizing: border-box;
  width: 54px;
  height: 54px;
  min-width: 54px;
  min-height: 54px;
  padding: 0;
  border: 3px solid var(--bg-cream-canvas);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-forest) 0%, var(--color-forest-medium) 100%);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  color: var(--color-white);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.scorecard-radial-option i {
  font-size: 1.35rem;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1;
}

.scorecard-radial-option:active {
  opacity: 0.92;
  filter: brightness(1.06);
}

.scorecard-radial-option.active {
  border-color: var(--bg-cream-canvas);
  background: var(--color-gold);
  box-shadow: 0 4px 16px rgba(194, 162, 106, 0.45);
}

.scorecard-radial-option.active i {
  color: var(--color-forest);
}

body.dark-mode .scorecard-radial-option {
  background: linear-gradient(135deg, #152219 0%, #1c2b20 100%);
  border-color: #0c120e;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55);
}

body.dark-mode .scorecard-radial-option i {
  color: rgba(255, 255, 255, 0.88);
}

body.dark-mode .scorecard-radial-option.active {
  background: var(--color-gold);
  border-color: var(--bg-cream-canvas);
}

body.dark-mode .scorecard-radial-option.active i {
  color: #121a15;
}

/* Transposed scorecard: one row per hole, columns per player */
.scorecard-table-vertical {
  table-layout: fixed;
  width: 100%;
}

.scorecard-table-vertical .col-vertical-sticky-hole,
.scorecard-table-vertical th.col-vertical-sticky-hole,
.scorecard-table-vertical td.col-vertical-sticky-hole {
  position: sticky;
  left: 0;
  z-index: 6;
  text-align: left !important;
  background: var(--color-white) !important;
  border-right: 2px solid var(--color-border);
  box-shadow: 4px 0 8px rgba(28, 43, 33, 0.06);
  min-width: 36px;
  padding-left: 4px;
  padding-right: 4px;
  font-size: 0.78rem;
}

.scorecard-table-vertical th.col-vertical-sticky-hole {
  font-size: 0.65rem;
  letter-spacing: 0.02em;
  padding-top: 8px;
  padding-bottom: 8px;
}

.scorecard-table-vertical td.col-vertical-sticky-hole .vertical-hole-meta {
  display: block;
  font-size: 0.56rem;
  color: var(--color-muted);
  font-weight: 500;
  line-height: 1.15;
  margin-top: 2px;
  text-transform: none;
  letter-spacing: 0.01em;
}

body.dark-mode .scorecard-table-vertical .col-vertical-sticky-hole,
body.dark-mode .scorecard-table-vertical th.col-vertical-sticky-hole,
body.dark-mode .scorecard-table-vertical td.col-vertical-sticky-hole {
  background: var(--bg-cream-card) !important;
}

.scorecard-table-vertical th.col-vertical-player-head .player-info-hcp {
  font-size: 0.62rem;
}

.scorecard-table-vertical .vertical-td-team1 {
  background: rgba(234, 245, 236, 0.5);
}

.scorecard-table-vertical .vertical-td-team2 {
  background: rgba(252, 245, 232, 0.55);
}

body.dark-mode .scorecard-table-vertical .vertical-td-team1 {
  background: rgba(17, 51, 26, 0.55);
}

body.dark-mode .scorecard-table-vertical .vertical-td-team2 {
  background: rgba(45, 32, 14, 0.45);
}

.scorecard-table-vertical .cell-score {
  min-width: 0;
  width: 100%;
}

/* Vegas 2v2 vertical: narrow gutter column between teammates (pill vertically centered) */
.scorecard-table-vertical th.col-vertical-vegas-between-head {
  min-width: 26px;
  max-width: 36px;
  width: 32px;
  padding: 6px 1px !important;
  vertical-align: middle;
  background: rgba(194, 162, 106, 0.08);
  border-left: 1px dashed rgba(194, 162, 106, 0.28);
  border-right: 1px dashed rgba(194, 162, 106, 0.28);
}

body.dark-mode .scorecard-table-vertical th.col-vertical-vegas-between-head {
  background: rgba(0, 0, 0, 0.18);
}

.scorecard-table-vertical .col-vertical-vegas-between-head-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold-dark);
  font-size: 0.72rem;
  line-height: 1;
  opacity: 0.9;
}

body.dark-mode .scorecard-table-vertical .col-vertical-vegas-between-head-inner {
  color: var(--color-gold);
  opacity: 0.95;
}

.scorecard-table-vertical td.cell-vertical-vegas-gutter {
  vertical-align: middle;
  text-align: center;
  padding: 6px 2px !important;
  min-width: 26px;
  background: rgba(194, 162, 106, 0.05);
  border-left: 1px dashed rgba(194, 162, 106, 0.22);
  border-right: 1px dashed rgba(194, 162, 106, 0.22);
}

.scorecard-table-vertical td.cell-vertical-vegas-gutter.vertical-vegas-gutter--team2 {
  background: rgba(210, 165, 90, 0.07);
}

body.dark-mode .scorecard-table-vertical td.cell-vertical-vegas-gutter {
  background: rgba(0, 0, 0, 0.12);
}

.scorecard-table-vertical .vertical-vegas-gutter-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  min-width: 1.85rem;
  padding: 5px 6px;
  box-sizing: border-box;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.1;
  color: var(--color-gold-dark);
  background: rgba(194, 162, 106, 0.22);
  border: 1px solid rgba(194, 162, 106, 0.5);
  border-radius: 8px;
}

.scorecard-table-vertical .vertical-vegas-gutter-pill--sum {
  min-height: 2.15rem;
  font-size: 0.58rem;
}

.scorecard-table-vertical td.vertical-vegas-gutter--team2 .vertical-vegas-gutter-pill {
  color: var(--color-charcoal);
  background: rgba(210, 165, 90, 0.28);
  border-color: rgba(160, 110, 50, 0.45);
}

body.dark-mode .scorecard-table-vertical td.vertical-vegas-gutter--team2 .vertical-vegas-gutter-pill {
  color: var(--color-gold);
}

.scorecard-table-vertical .vertical-vegas-gutter-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  font-size: 0.75rem;
  font-weight: 300;
  color: rgba(0, 0, 0, 0.12);
}

body.dark-mode .scorecard-table-vertical .vertical-vegas-gutter-empty {
  color: rgba(255, 255, 255, 0.14);
}

.scorecard-table-vertical .vertical-vegas-ribbon-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 100%;
}

.scorecard-table-vertical .vertical-col-vegas-pts {
  font-size: 0.62rem;
  line-height: 1.2;
  color: var(--color-muted);
}

.scorecard-table-vertical .vertical-col-vegas-pts-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 2px;
}

.scorecard-table-vertical .vertical-col-vegas-pts-val {
  font-weight: 800;
  color: var(--color-charcoal);
}

body.dark-mode .scorecard-table-vertical .vertical-col-vegas-pts-val {
  color: var(--color-gold);
}

/* Vertical scorecard: team status ribbon + per-player header row */
.scorecard-table-vertical thead tr.vertical-thead-ribbons th.vertical-team-ribbon {
  text-align: center;
  vertical-align: middle;
  padding: 8px 6px;
  border-bottom: 2px solid var(--color-border);
}

.scorecard-table-vertical thead th.vertical-team-ribbon-1 {
  background: rgba(234, 245, 236, 0.96);
}

.scorecard-table-vertical thead th.vertical-team-ribbon-2 {
  background: rgba(252, 245, 232, 0.96);
}

body.dark-mode .scorecard-table-vertical thead th.vertical-team-ribbon-1 {
  background: rgba(17, 51, 26, 0.78);
}

body.dark-mode .scorecard-table-vertical thead th.vertical-team-ribbon-2 {
  background: rgba(45, 32, 14, 0.68);
}

.scorecard-table-vertical .vertical-ribbon-label {
  display: inline-block;
  margin: 0 auto 4px;
  padding: 3px 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--color-forest) 0%, var(--color-forest-medium) 100%);
  color: var(--color-gold);
  font-family: var(--font-sans);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.15;
}

.scorecard-table-vertical .vertical-ribbon-label--inline {
  display: block;
  margin: 0 auto 4px;
  max-width: 100%;
}

.scorecard-table-vertical .vertical-team-name-chip {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--color-muted);
}

.scorecard-table-vertical .player-info-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
}

.scorecard-table-vertical .vertical-col-wager {
  margin-top: 4px;
  line-height: 1.25;
}

.scorecard-table-vertical thead th.col-vertical-grp-col {
  vertical-align: middle;
}

.scorecard-table-vertical thead tr.vertical-thead-players th {
  border-top: none;
}

.scorecard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.85rem;
}

.scorecard-table th, .scorecard-table td {
  padding: 12px 6px;
  text-align: center;
  border-bottom: 1px solid rgba(227, 220, 207, 0.5);
  min-width: 44px;
  font-family: var(--font-sans);
}

.scorecard-table th {
  background-color: #FAF9F5;
  color: var(--color-forest-medium);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--color-border);
  padding: 10px 4px;
}

.scorecard-table:not(.scorecard-table-vertical) thead th .scorecard-hole-head-meta {
  display: block;
  font-size: 0.58rem;
  font-weight: 500;
  color: var(--color-muted);
  text-transform: none;
  letter-spacing: 0.02em;
  line-height: 1.2;
  margin-top: 2px;
}

/* ==========================================================
   OPTIMIZED SCORECARD SCROLLING
   ========================================================== */

/* 1. Pin the Player / Hole name column to the left (grid scorecard only — vertical uses its own sticky rules) */
.scorecard-table:not(.scorecard-table-vertical) th.col-player,
.scorecard-table:not(.scorecard-table-vertical) td.cell-player-info {
  position: sticky !important;
  left: 0 !important;
  z-index: 30 !important;
  background-color: var(--color-white) !important;
  border-right: 2px solid var(--color-border) !important;
  box-shadow: 4px 0 8px rgba(28, 43, 33, 0.04);
}

/* 2. Remove sticky from the right-most column (horizontal grid totals column only) */
.scorecard-table:not(.scorecard-table-vertical) th:last-child,
.scorecard-table:not(.scorecard-table-vertical) td:last-child {
  position: static !important; /* Forces it to scroll naturally */
  box-shadow: none !important;
  border-left: 1px solid var(--color-border);
}

/* Vertical scorecard: last body column — position:relative for match/skins/drink overlays (thead excluded so sticky headers work when P4 is last th) */
.scorecard-table-vertical tbody td:last-child {
  position: relative !important;
  box-shadow: none !important;
  border-left: 1px solid var(--color-border);
}

.scorecard-table-vertical thead th:last-child {
  border-left: 1px solid var(--color-border);
}

/* 3. Dark Mode Sticky Fix (grid scorecard only) */
body.dark-mode .scorecard-table:not(.scorecard-table-vertical) th.col-player,
body.dark-mode .scorecard-table:not(.scorecard-table-vertical) td.cell-player-info {
  background-color: var(--bg-cream-card) !important;
}

.scorecard-table tr.total-row td.cell-player-info {
  background-color: #F5F1E6;
}

.scorecard-table tr.total-row {
  background-color: #FCFAF5;
  font-weight: 600;
  color: var(--color-forest);
}

.scorecard-table tr.total-row td {
  border-bottom: none;
  font-weight: 700;
}

.player-info-name {
  font-weight: 600;
  color: var(--color-forest);
  font-size: 0.85rem;
  letter-spacing: -0.01em;
}

.player-info-hcp {
  font-size: 0.65rem;
  color: var(--color-muted);
  font-weight: 500;
  margin-top: 2px;
}

.scorecard-table td.cell-score {
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 700;
  position: relative;
  user-select: none;
  background-color: var(--color-white);
  transition: background-color 0.15s ease;
  padding: 8px 4px;
}

.scorecard-table td.cell-score:active {
  background-color: rgba(194, 162, 106, 0.12);
}

/* Beautiful Geometric Shapes for Golf Scores */
.scorecard-table td.cell-score span.score-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  position: relative;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-charcoal);
  border-radius: 50%;
  transition: all 0.2s ease;
}

/* Circle Birdie - Soft Sage Green Pill */
.scorecard-table td.cell-score.is-birdie span.score-wrapper {
  background-color: #E2F0D9;
  color: #385723;
  border: 1.5px solid #385723;
  box-shadow: 0 1px 3px rgba(56, 87, 35, 0.15);
}

/* Double Circle Eagle - Soft Slate Blue */
.scorecard-table td.cell-score.is-eagle span.score-wrapper {
  background-color: #DDEBF7;
  color: #1F4E79;
  border: 1.5px solid #1F4E79;
  box-shadow: 0 1px 3px rgba(31, 78, 121, 0.15);
}
.scorecard-table td.cell-score.is-eagle span.score-wrapper::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  right: 1px;
  bottom: 1px;
  border: 1px solid #1F4E79;
  border-radius: 50%;
}

/* Square Bogey - Soft Coral Red */
.scorecard-table td.cell-score.is-bogey span.score-wrapper {
  background-color: #FCE4D6;
  color: #C65911;
  border: 1.5px solid #C65911;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(198, 89, 17, 0.15);
}

/* Double Square Double Bogey+ - Deep Maroon */
.scorecard-table td.cell-score.is-double-bogey span.score-wrapper {
  background-color: #F8CBAD;
  color: #C00000;
  border: 1.5px solid #C00000;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(192, 0, 0, 0.15);
}
.scorecard-table td.cell-score.is-double-bogey span.score-wrapper::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 1px;
  right: 1px;
  bottom: 1px;
  border: 1px solid #C00000;
  border-radius: 4px;
}

/* Elegant superscribed handicap stroke dots positioned top-left */
.scorecard-table td.cell-score .stroke-dots {
  position: absolute;
  top: 4px;
  left: 4px;
  display: flex;
  gap: 1.5px;
}

.scorecard-table td.cell-score .stroke-dot {
  width: 4.5px;
  height: 4.5px;
  background-color: var(--color-stroke-bump);
  border-radius: 50%;
}

/* Plus handicap: blue + in corner (strokes given) */
.scorecard-table td.cell-score .stroke-dots--give {
  align-items: center;
  gap: 0.5px;
}
.scorecard-table td.cell-score .stroke-bump-plus {
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--color-stroke-bump);
  line-height: 1;
  letter-spacing: -0.05em;
}

/* Highly obvious visual cue for cells where players receive strokes (bumps) */
.scorecard-table td.cell-score.has-bump {
  border-left: 2px solid var(--color-gold) !important;
  background-color: #FCFAF4 !important; /* Soft warm gold/cream tint */
}

.scorecard-table td.cell-score.has-bump-negative {
  border-left-color: var(--color-muted) !important;
  background-color: rgba(124, 146, 168, 0.12) !important;
}

body.dark-mode .scorecard-table td.cell-score.has-bump-negative {
  border-left-color: rgba(142, 153, 146, 0.85) !important;
  background-color: rgba(92, 168, 255, 0.1) !important;
}

.scorecard-table td.cell-score.has-mp-hole-win::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 13px 13px 0;
  border-color: transparent #2A6E3B transparent transparent;
  z-index: 1;
  pointer-events: none;
}

body.dark-mode .scorecard-table td.cell-score.has-mp-hole-win::after {
  border-color: transparent var(--color-forest-light) transparent transparent;
}

/* Dot icons inside scorecard cell for Junk (Greenie, Sandie, Snake) */
.scorecard-table td.cell-score .cell-junk-icons {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.55rem;
  display: flex;
  gap: 1.5px;
  z-index: 3;
}

.scorecard-table td.cell-score .cell-junk-icons i {
  font-size: 0.55rem;
}

.junk-greenie { color: #385723; }
.junk-sandie { color: var(--color-gold-dark); }
.junk-snake { color: #C00000; }

/* Totals column background highlight (horizontal grid only — vertical last col is a player) */
.scorecard-table:not(.scorecard-table-vertical) td:last-child {
  background-color: #FAF9F5;
  font-weight: 700;
  border-left: 1px solid var(--color-border);
}

.scorecard-table:not(.scorecard-table-vertical) tr.total-row td:last-child {
  background-color: #F5F1E6;
}

/* Scorecard Legend styling (inside .scorecard-wrapper so it scrolls with the table in vertical mode) */
.scorecard-wrapper .scorecard-legend {
  flex-shrink: 0;
  padding: 10px 8px 12px;
  margin-top: 0;
  border-top: 1px solid rgba(227, 220, 207, 0.65);
  background: var(--color-white);
}

body.dark-mode .scorecard-wrapper .scorecard-legend {
  background: var(--bg-cream-card);
  border-top-color: rgba(255, 255, 255, 0.08);
}

.scorecard-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--color-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

.legend-shape {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-size: 0.65rem;
  font-weight: 700;
}

.legend-stroke-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-stroke-bump);
  flex-shrink: 0;
}

.legend-stroke-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  font-size: 0.92rem;
  font-weight: 900;
  color: var(--color-stroke-bump);
}

.legend-par-si-sample {
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--color-muted);
  width: 36px;
  text-align: center;
}

.legend-mp-dogear {
  display: inline-block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 10px 10px 0;
  border-color: transparent #2A6E3B transparent transparent;
  vertical-align: top;
  margin-top: 1px;
}
  background-color: #E2F0D9;
  color: #385723;
  border: 1.5px solid #385723;
  border-radius: 50%;
}

.score-normal {
  border: 1px solid var(--color-border);
  border-radius: 50%;
}

.score-square-bogey {
  background-color: #FCE4D6;
  color: #C65911;
  border: 1.5px solid #C65911;
  border-radius: 4px;
}

.score-double-bogey {
  background-color: #F8CBAD;
  color: #C00000;
  border: 1.5px solid #C00000;
  border-radius: 4px;
}

/* Custom Settings Page Switches & toggles */
.game-header-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.game-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--color-forest);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.game-title i {
  color: var(--color-gold);
}

.game-desc {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: 2px;
}

/* Custom CSS iOS-like Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--color-border);
  transition: .3s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  box-shadow: var(--shadow-sm);
}

input:checked + .slider {
  background-color: var(--color-forest-medium);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--color-forest-medium);
}

input:checked + .slider:before {
  transform: translateX(22px);
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}

.game-settings-body {
  transition: var(--transition);
}

/* Custom Checkbox */
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-charcoal);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input {
  display: none;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--color-border);
  border-radius: 4px;
  display: inline-block;
  background-color: var(--color-white);
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
}

.checkbox-label input:checked + .checkbox-custom {
  background-color: var(--color-forest);
  border-color: var(--color-forest);
}

.checkbox-label input:checked + .checkbox-custom::after {
  content: "";
  position: absolute;
  width: 4px;
  height: 8px;
  border: solid var(--color-white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  top: 2px;
  left: 5px;
}

/* Pairings match-up visualizer */
.pairing-setup-card {
  background-color: var(--bg-cream-card);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px dashed var(--color-gold);
}

.pairing-match {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}

.pairing-match:last-child {
  margin-bottom: 0;
}

.vs-badge {
  font-size: 0.7rem;
  font-weight: 700;
  background-color: var(--bg-cream-card);
  color: var(--color-gold-dark);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--color-border);
}

/* Live Standings Panel */
.bg-dark-green {
  background-color: var(--color-forest);
}

.text-light {
  color: var(--bg-cream-canvas);
}

.card-subtitle {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-gold);
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 8px;
}

.live-standings-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Settle tab — live match standings header (title vs badge) */
.live-match-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.live-match-title-cell {
  flex: 1;
  min-width: 0;
}

.live-match-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.live-match-title-icon {
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--color-gold);
  font-size: 0.95rem;
}

.live-match-title-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 0;
}

.live-match-team-line {
  font-weight: 700;
  color: var(--color-gold);
  font-size: 0.92rem;
  line-height: 1.2;
}

.live-match-team-pts {
  font-weight: 800;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.86em;
  margin-left: 3px;
  white-space: nowrap;
}

.live-match-vs {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
}

.live-match-format-note {
  font-size: 0.64rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.48);
  line-height: 1.2;
}

.live-match-title-plain {
  font-weight: 700;
  color: var(--color-gold);
  font-size: 0.95rem;
  line-height: 1.25;
}

.live-match-game-title {
  font-weight: 800;
  color: var(--color-gold);
  font-size: 0.95rem;
  line-height: 1.25;
  margin-bottom: 2px;
}

.live-match-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(255,255,255,0.06);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.match-p1, .match-p2 {
  font-weight: 600;
  min-width: 80px;
}

.match-p1 { text-align: left; }
.match-p2 { text-align: right; }

.match-score-badge {
  flex-shrink: 0;
  font-weight: 700;
  background-color: var(--color-gold);
  color: var(--color-forest);
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  box-sizing: border-box;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 3px;
  min-width: 108px;
  max-width: 46%;
}

.match-score-badge--summary {
  background-color: var(--color-forest);
  color: var(--color-gold);
  border: 1px solid var(--color-gold);
  font-size: 0.78rem;
}

.match-score-badge-names,
.match-score-badge-amt {
  display: block;
  width: 100%;
  text-align: center;
  line-height: 1.15;
}

.match-score-badge-amt {
  font-size: 0.82rem;
  font-weight: 800;
}

.match-score-badge-iconrow {
  font-size: 0.85rem;
  color: var(--color-forest);
  line-height: 1;
}

.match-score-badge.even {
  background-color: rgba(255,255,255,0.15);
  color: var(--color-white);
}

/* Table alignment utilities */
.text-left {
  text-align: left !important;
}
.text-center {
  text-align: center !important;
}
.text-right {
  text-align: right !important;
}

/* Premium Raw Balance Table Redesign */
#raw-balance-table-container {
  width: 100%;
  overflow-x: visible; /* horizontal scroll lives on .raw-balance-table-scroll */
  border-radius: var(--radius-sm);
}

/* Find the .raw-balance-table block and update it */
.raw-balance-table {
  width: 100%;
  min-width: 100%; /* Changed from 580px */
  table-layout: auto; /* Changed from fixed */
  border-collapse: collapse;
  font-size: 0.85rem;
  border: 1px solid var(--color-border);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

/* Remove or update the width percentages to be fluid */
.raw-balance-table th:nth-child(1),
.raw-balance-table td:nth-child(1) { width: auto; text-align: left; }
.raw-balance-table th:not(:nth-child(1)),
.raw-balance-table td:not(:nth-child(1)) { width: auto; text-align: right; }

.raw-balance-table th, .raw-balance-table td {
  padding: 10px 6px !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; /* Safely clip long names with an ellipsis (...) */
}

.raw-balance-table th {
  font-weight: 700;
  color: var(--color-gold);
  background-color: var(--color-forest);
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  border-bottom: 2px solid var(--color-gold);
  white-space: normal !important;
  line-height: 1.15;
}

.raw-balance-table td {
  font-weight: 500;
  border-bottom: 1px solid var(--color-border);
  background-color: white;
  transition: background-color 0.2s ease;
}

.raw-balance-table tbody tr:last-child td {
  border-bottom: none;
}

.raw-balance-table tbody tr:hover td {
  background-color: #FAF8F2; /* Soft cream gold hover background */
}

.raw-balance-table td.player-name {
  font-weight: 700;
  color: var(--color-forest);
  font-size: 0.9rem;
}

.pos-money {
  color: var(--color-birdie);
  font-weight: 700;
}

.neg-money {
  color: var(--color-bogey);
  font-weight: 700;
}

.zero-money {
  color: var(--color-muted);
}

/* Match Play Premium Stat Badges */
.mp-stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  min-width: 50px;
  justify-content: center;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.mp-stat-badge.win {
  background-color: #E2F0D9;
  color: #385723;
  border: 1px solid #C5E0B4;
}

.mp-stat-badge.loss {
  background-color: #FCE4D6;
  color: #C65911;
  border: 1px solid #F8CBAD;
}

.mp-stat-badge.tie {
  background-color: #EDF2F8;
  color: #4A607A;
  border: 1px solid #D6E4F0;
}

.mp-stat-badge .badge-arrow {
  font-size: 0.65rem;
}

/* Premium Payout Result Badges */
.mp-result-badge {
  display: inline-block;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.mp-result-badge.pos-money {
  background-color: #385723;
  color: white !important;
}

.mp-result-badge.neg-money {
  background-color: #FDF2F2;
  color: var(--color-bogey) !important;
  border: 1px solid #F8D7DA;
}

.mp-result-badge.zero-money {
  background-color: #F8F9FA;
  color: var(--color-muted) !important;
  border: 1px solid var(--color-border);
}

/* Final Settlement / Netting Section */
.highlight-card {
  border: 1px solid var(--color-gold);
  background-color: #FCFAF5;
  position: relative;
}

.card-glow {
  position: absolute;
  top: -150px;
  left: 20%;
  width: 60%;
  height: 200px;
  background: radial-gradient(circle, rgba(194, 162, 106, 0.1) 0%, rgba(255,255,255,0) 70%);
  z-index: 0;
  pointer-events: none;
}

.payouts-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.payout-card {
  display: flex;
  align-items: center;
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.payout-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.payout-icon {
  width: 40px;
  height: 40px;
  background-color: var(--bg-birdie);
  color: var(--color-birdie);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
}

.payout-info {
  flex: 1;
  text-align: left;
}

.payout-debtor {
  font-weight: 600;
  color: var(--color-forest);
}

.payout-creditor {
  font-weight: 600;
  color: var(--color-forest-medium);
}

.payout-text {
  font-size: 0.9rem;
  color: var(--color-charcoal);
  margin-top: 1px;
}

.payout-action-btn {
  text-decoration: none;
  background-color: #008CFF; /* Venmo Blue */
  color: white;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  cursor: pointer;
  transition: var(--transition);
}

.payout-action-btn:hover {
  background-color: #0074D4;
}

.venmo-share-box {
  background-color: var(--bg-cream-card);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}

.copy-textarea {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  background-color: var(--color-white);
  resize: none;
  border-color: var(--color-border);
  color: var(--color-forest-medium);
  line-height: 1.4;
}

/* Drawer CSS slide up modal on mobile */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(20, 30, 23, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: flex-end;
}

.drawer-overlay.active {
  display: flex;
}

.drawer-content {
  background-color: var(--bg-cream-canvas);
  width: 100%;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 14px env(safe-area-inset-bottom) 14px;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15);
  border-top: 1px solid var(--color-border);
}

.drawer-overlay.active .drawer-content {
  transform: translateY(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.drawer-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-forest);
}

.drawer-subtitle {
  font-size: 0.8rem;
  color: var(--color-muted);
  font-weight: 500;
}

.drawer-close-btn {
  background: none;
  border: none;
  font-size: 1.8rem;
  color: var(--color-muted);
  cursor: pointer;
  line-height: 0.8;
  padding: 2px;
}

.drawer-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted);
  text-align: center;
}

.drawer-score-bubble {
  width: 60px;
  height: 60px;
  background-color: var(--color-forest);
  color: var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  margin: 8px auto 0 auto;
  border: 2px solid var(--color-gold);
  box-shadow: var(--shadow-md);
}

.drawer-score-bubble.empty {
  background-color: var(--color-white);
  color: var(--color-border);
  border-color: var(--color-border);
  box-shadow: none;
}

/* Custom Numpad Keyboard */
.numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 500px;
  margin: 12px auto 0 auto;
}

.num-btn {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 600;
  padding: 16px 0;
  color: var(--color-forest-medium);
  cursor: pointer;
  outline: none;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.num-btn:active {
  background-color: var(--bg-cream-card);
  transform: scale(0.96);
}

.num-btn-special {
  background-color: var(--bg-cream-card);
  color: var(--color-muted);
  font-size: 1.05rem;
  padding: 16px 0;
}

.divider {
  height: 1px;
  background-color: var(--color-border);
  width: 100%;
}

/* Dots (Junk) strip in bottom drawer */
.dots-toggle-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.dot-toggle-btn {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 14px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: var(--transition);
  font-family: var(--font-sans);
  outline: none;
  box-shadow: var(--shadow-sm);
}

.dot-toggle-btn:active {
  transform: scale(0.96);
}

.dot-icon {
  font-size: 1.1rem;
  color: var(--color-muted);
}

.dot-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-charcoal);
}

/* Active Dots toggled state */
.dot-toggle-btn.active[data-dot="greenie"] {
  border-color: var(--color-birdie);
  background-color: var(--bg-birdie);
}
.dot-toggle-btn.active[data-dot="greenie"] .dot-icon {
  color: var(--color-birdie);
}

.dot-toggle-btn.active[data-dot="sandie"] {
  border-color: var(--color-gold);
  background-color: #FCF7EE;
}
.dot-toggle-btn.active[data-dot="sandie"] .dot-icon {
  color: var(--color-gold-dark);
}

.dot-toggle-btn.active[data-dot="snake"] {
  border-color: var(--color-bogey);
  background-color: var(--bg-bogey);
}
.dot-toggle-btn.active[data-dot="snake"] .dot-icon {
  color: var(--color-bogey);
}

.drawer-nav-actions {
  display: flex;
  gap: 12px;
}

.drawer-nav-actions button {
  flex: 1;
}

/* Animation for custom popup */
@keyframes copyPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

.copy-pop-active {
  animation: copyPop 0.3s ease-in-out;
}

/* Live Leaderboard Row Highlights for Current Segment Leaders */
.scorecard-table tr.is-leader td.cell-player-info {
  background-color: #F3F9F4 !important; /* Soft premium club green leader tint */
}

/* Subtle Row borders and backgrounds for winning each specific side */
.scorecard-table tr.row-winning-front td.cell-player-info {
  border-left: 4.5px solid #385723 !important; /* Sage/forest green accent border */
}
.scorecard-table tr.row-winning-back td.cell-player-info {
  border-left: 4.5px solid var(--color-gold) !important; /* Gold accent border */
}
.scorecard-table tr.row-winning-total td.cell-player-info {
  border-left: 4.5px solid #14321A !important; /* Deep forest accent border */
  background-color: #EEF3EF !important; /* Slightly richer green tint */
}

.scorecard-table tr.is-leader td.cell-player-info .player-info-name::after {
  content: " 🏆";
  font-size: 0.8rem;
  animation: leaderPulse 1.5s infinite ease-in-out;
  display: inline-block;
}

@keyframes leaderPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Premium Player Leader Badges Below Name */
.player-leader-badges {
  display: flex;
  gap: 4px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.leader-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.leader-badge.front-badge {
  background-color: #E2F0D9;
  color: #385723;
  border: 1.5px solid #C5E0B4;
}

.leader-badge.back-badge {
  background-color: #FCF4E5;
  color: var(--color-gold-dark);
  border: 1.5px solid #F6E2C3;
}

.leader-badge.total-badge {
  background-color: var(--bg-birdie);
  color: var(--color-birdie);
  border: 1.5px solid #C5E0B4;
}

/* Summary Totals Cells Highlighting */
.scorecard-table td.cell-summary-leader {
  background-color: #E2F0D9 !important; /* Soft sage green highlight */
  color: #385723 !important;
  font-weight: 700 !important;
  border: 1.5px solid #C5E0B4 !important;
  animation: summaryGlow 2.5s infinite ease-in-out;
}

.scorecard-table td.cell-summary-leader.back-leader-cell {
  background-color: #FCF4E5 !important;
  color: var(--color-gold-dark) !important;
  border: 1.5px solid #F6E2C3 !important;
}

.scorecard-table td.cell-summary-leader.total-leader-cell {
  background-color: var(--bg-birdie) !important;
  color: var(--color-forest) !important;
  border: 1.5px solid #B2DFDB !important;
  font-size: 1.15rem;
}

@keyframes summaryGlow {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* Score Drawer Done Button State Override */
.btn.btn-done {
  background-color: var(--color-forest) !important;
  color: var(--color-white) !important;
  border-color: var(--color-gold) !important;
  box-shadow: 0 4px 10px rgba(20, 50, 26, 0.2) !important;
}

.btn.btn-done i {
  color: var(--color-gold) !important;
}

/* Premium Interactive Games Configurations Selector Bar */
.game-selector-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 10px;
  width: 100%;
}

.game-select-btn {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 2px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.65rem;
  color: var(--color-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
  position: relative;
  box-shadow: var(--shadow-sm);
  border-bottom: 2px solid var(--color-border);
}

.game-select-btn:active {
  transform: scale(0.96);
}

.game-select-btn i {
  font-size: 1.2rem;
  color: var(--color-muted);
  transition: var(--transition);
}

/* Active sub-tab state */
.game-select-btn.active {
  border-color: var(--color-gold) !important;
  border-bottom: 3px solid var(--color-gold) !important;
  background-color: var(--bg-cream-card) !important;
  color: var(--color-forest) !important;
  font-weight: 700;
  box-shadow: var(--shadow-md);
}

.game-select-btn.active i {
  color: var(--color-gold) !important;
  transform: scale(1.1);
}

/* Live game enabled indicator dot & icon highlighting */
.game-select-indicator {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 6px;
  height: 6px;
  background-color: transparent;
  border-radius: 50%;
  transition: var(--transition);
}

.game-select-btn.is-enabled .game-select-indicator {
  background-color: #2A6E3B; /* Fresh active green dot */
  box-shadow: 0 0 4px rgba(42, 110, 59, 0.6);
}

.game-select-btn.is-enabled i {
  color: var(--color-forest-medium) !important;
}

.game-select-btn.active.is-enabled .game-select-indicator {
  background-color: #2A6E3B;
  box-shadow: 0 0 6px rgba(42, 110, 59, 0.9);
}

/* Nested Sub-configurations Panel Display */
.game-config-panel {
  animation: panelFade 0.25s ease-out;
}

.game-config-panel.hidden {
  display: none !important;
}

@keyframes panelFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Active Game Indicator Banner above Scorecard */
.active-game-indicator {
  background-color: var(--bg-cream-card-light);
  border: 1.5px solid var(--color-gold);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--color-forest); /* Premium Clubhouse solid left border */
}

/* Premium Gold Dashed Segment Switcher Container */
.grid-segment-switcher-container {
  background-color: rgba(194, 162, 106, 0.06);
  border: 1.5px dashed var(--color-gold);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

/* Disable hover and cursor modifications in Focus Mode switcher */
.focus-mode-switcher-disable .grid-section-card {
  cursor: default !important;
  transform: none !important;
  box-shadow: var(--shadow-sm) !important;
  border-color: var(--color-border) !important;
}

.focus-mode-switcher-disable .grid-section-card.active {
  border-color: var(--color-gold) !important;
  box-shadow: 0 0 0 1px var(--color-gold), var(--shadow-sm) !important;
}

/* Premium Grid Section Cards */
.grid-section-card {
  flex: 1;
  background-color: var(--bg-cream-card); /* white or creamy off-white */
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.grid-section-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-gold);
  box-shadow: var(--shadow-sm);
}

.grid-section-card.active {
  border-color: var(--color-gold) !important;
  background-color: var(--bg-cream-card-light) !important;
  box-shadow: 0 0 0 1px var(--color-gold), var(--shadow-sm);
}

body.dark-mode .grid-section-card {
  background-color: var(--bg-cream-card) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

body.dark-mode .grid-section-card:hover {
  border-color: var(--color-gold) !important;
}

body.dark-mode .grid-section-card.active {
  border-color: var(--color-gold) !important;
  background-color: var(--bg-cream-card-light) !important;
  box-shadow: 0 0 0 1px var(--color-gold), var(--shadow-sm) !important;
}

body.dark-mode .grid-segment-switcher-container {
  background-color: rgba(21, 34, 25, 0.4) !important;
  border-color: rgba(212, 175, 55, 0.4) !important;
}

body.dark-mode .active-game-indicator {
  background-color: var(--bg-cream-card) !important;
  border-color: var(--color-border) !important;
  border-left: 5px solid var(--color-gold) !important; /* Gold trim in dark mode */
}

body.dark-mode .active-badge {
  background-color: var(--color-gold) !important;
  color: #121A15 !important; /* Premium pitch-black deep slate text for high contrast */
}

body.dark-mode .active-game-title {
  color: var(--color-charcoal) !important;
}

body.dark-mode .active-game-title i {
  color: var(--color-gold) !important;
}

.active-indicator-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.active-badge {
  background-color: var(--color-forest);
  color: var(--color-gold);
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.active-game-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-forest);
  display: flex;
  align-items: center;
  gap: 8px;
}

.active-game-title i {
  font-size: 1.05rem;
  color: var(--color-gold);
}

/* 2v2 Scorecard Team Spacing Spacer Row */
.scorecard-table tr.scorecard-team-spacer td {
  height: 12px;
  background-color: var(--bg-cream-canvas) !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  pointer-events: none;
}

/* 2v2 Team Row Soft Visual Tints */
.scorecard-table tr.row-team-1 td.cell-player-info {
  background-color: #F4FAF5 !important; /* Solid opaque premium soft green to shield scrolling cells */
}
.scorecard-table tr.row-team-2 td.cell-player-info {
  background-color: #FAF6EF !important; /* Solid opaque premium soft gold to shield scrolling cells */
}

/* 2v2 Player Team Badges */
.team-badge {
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.team-badge.team-1-badge {
  background-color: #E2F0D9;
  color: #385723;
  border: 1px solid #C5E0B4;
}

.team-badge.team-2-badge {
  background-color: #FCF4E5;
  color: var(--color-gold-dark);
  border: 1px solid #F6E2C3;
}

/* Premium Rotated Vertical Leader/Winner Bar Styles */
.scorecard-table td.cell-player-info.has-leader-bar {
  padding-left: 32px !important;
  position: sticky;
  left: 0;
}
.scorecard-table td.cell-player-info.team-leader-first {
  z-index: 35 !important; /* Stack above the adjacent teammate cell to prevent background mask overlap */
}

.vertical-leader-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: -1.5px; /* Extend slightly to seamlessly overlay borders between adjacent teammate rows */
  width: 22px;
  background: linear-gradient(180deg, var(--color-forest) 0%, var(--color-forest-medium) 100%);
  border-right: 2px solid var(--color-gold);
  color: var(--color-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 5;
  box-shadow: 1px 0 4px rgba(20, 50, 26, 0.2);
}

.vertical-leader-bar.team-leader-bar {
  bottom: calc(-100% - 2px) !important;
  height: auto !important;
}

.vertical-leader-bar span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-family: var(--font-sans);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  line-height: 1;
}

/* Tactile Score Bubble Bounce Animation */
@keyframes scoreBounce {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}

.score-bounce-active {
  animation: scoreBounce 0.18s ease-in-out;
}

/* Premium Highlighted Team Best Ball Row Styles */
.scorecard-table tr.bestball-row {
  background-color: #F2ECE1 !important;
  color: var(--color-forest) !important;
  font-weight: 700;
}
.scorecard-table tr.bestball-row td {
  border-top: 1.5px solid var(--color-gold) !important;
  border-bottom: 1.5px solid var(--color-gold) !important;
  font-weight: 700;
  padding: 10px 4px;
}
.scorecard-table tr.bestball-row td.cell-player-info {
  background-color: #EADFC9 !important; /* Slightly darker gold/cream for sticky column */
  border-right: 2px solid var(--color-gold) !important;
}

/* Subscript net score style for handicap stroke bumps */
.scorecard-table td.cell-score .cell-net-subscript {
  position: absolute;
  bottom: 2px;
  right: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-gold-dark);
  line-height: 1;
}

/* Premium country-club green square border around scorecard cells used in Best Ball */
.scorecard-table td.cell-score.is-bestball-used {
  outline: 2px solid #2A6E3B !important; /* Rich active green border inside the score box */
  outline-offset: -2px;
  background-color: rgba(42, 110, 59, 0.05) !important; /* Extremely soft green background tint */
}

/* Premium country-club styling for Opponent Group best ball scorecard row */
.scorecard-table tr.opponent-row {
  background-color: rgba(194, 162, 106, 0.04) !important;
  font-weight: 600;
}
.scorecard-table tr.opponent-row td.cell-player-info {
  background-color: #FAF5EA !important;
  border-right: 2px solid var(--color-border) !important;
}

/* Subscript running match play up/down status indicators inside Team Best Ball cells */
.match-status-indicator {
  font-size: 0.62rem;
  font-weight: 700;
  display: block;
  margin-top: 1.5px;
  line-height: 1;
}
.match-status-indicator.status-as {
  color: var(--color-muted);
}
.match-status-indicator.status-up {
  color: #2A6E3B; /* Fresh active sage green for Up status */
}
.match-status-indicator.status-dn {
  color: #C00000; /* Coral red for Down status */
}

/* ===================================================
   MATCH PLAY — Scorecard (wager summary / settlement; no per-hole cell badges)
   =================================================== */

/* Scorecard player cell match summary label */
.mp-summary-up { color: #2A6E3B; font-weight: 700; }
.mp-summary-dn { color: #C00000; font-weight: 700; }
.mp-summary-as { color: var(--color-muted); font-weight: 600; }

/* Settlement view — hole result chips */
.mp-hole-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 800; /* Extra bold for numbers on solid gold background */
  min-width: 25px;
  height: 22px;
  border-radius: 4px;
  padding: 0 4px;
  letter-spacing: 0.02em;
  background-color: var(--color-gold); /* Solid brand gold background matching the wager bubble */
  border: 1px solid var(--color-gold-dark); /* Accent dark-gold border */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); /* Subtle card-like depth */
}
.mp-chip-win {
  color: #1E4E2A !important; /* Deep forest green text for high contrast */
}
.mp-chip-loss {
  color: #990000 !important; /* Deep crimson red text for high contrast */
}
.mp-chip-tie {
  color: #003399 !important; /* Deep sapphire blue text for halved holes */
}
.mp-chip-gray {
  color: #7A7A7F !important; /* Muted gray text for unplayed or post-decided holes */
}

/* Settlement — match play holes: explicit Front / Back rows */
.mp-holes-summary {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.mp-holes-summary-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
  width: 100%;
}

.mp-holes-summary-label {
  flex: 0 0 auto;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.52);
  text-align: center;
}

.mp-holes-summary-chips {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-evenly;
  align-items: center;
  width: 100%;
  max-width: 100%;
  gap: 2px;
  min-width: 0;
  padding: 0 2px 2px;
}

@media (max-width: 360px) {
  .mp-holes-summary-chips {
    justify-content: space-between;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
}

/* PWA Golf Database Search UI */
.api-search-item {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: background-color 0.15s ease;
  color: var(--color-white);
  font-size: 0.8rem;
  text-align: left;
}
.api-search-item:hover {
  background-color: rgba(194, 162, 106, 0.15);
}
.api-search-item:last-child {
  border-bottom: none;
}
.api-search-meta {
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.7); /* High contrast soft white for readability */
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Active Selected Course Badge */
.selected-course-title-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-gold-dark);
  background: rgba(194, 162, 106, 0.08);
  padding: 6px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(194, 162, 106, 0.2);
  margin-top: 8px;
}

/* 2v2 Team Subtotal Rows */
.scorecard-table tr.bestball-row.team-1-subtotal {
  background-color: #EAF5EC !important;
  color: #1C4825 !important;
}
.scorecard-table tr.bestball-row.team-1-subtotal td {
  border-top: 1.5px solid #C5E0B4 !important;
  border-bottom: 1.5px solid #C5E0B4 !important;
}
.scorecard-table tr.bestball-row.team-1-subtotal td.cell-player-info {
  background-color: #D6EDDB !important;
  border-right: 2px solid #C5E0B4 !important;
}

.scorecard-table tr.bestball-row.team-2-subtotal {
  background-color: #FCF5E8 !important;
  color: var(--color-gold-dark) !important;
}
.scorecard-table tr.bestball-row.team-2-subtotal td {
  border-top: 1.5px solid var(--color-gold) !important;
  border-bottom: 1.5px solid var(--color-gold) !important;
}
.scorecard-table tr.bestball-row.team-2-subtotal td.cell-player-info {
  background-color: #F4E8D2 !important;
  border-right: 2px solid var(--color-gold) !important;
}

@media (orientation: landscape) and (max-height: 600px) {
  body > .app-header, 
  body > .app-main, 
  body > .app-nav {
    max-width: 100% !important; /* Stretch components to full viewport width */
  }
  .app-main {
    padding: 55px 12px 65px !important; /* Compress top/bottom padding for short heights */
  }
  .scorecard-wrapper {
    overflow-x: hidden; /* Prevent horizontal scrolling if 9 holes fit completely */
  }
  body.scorecard-vertical-main-lock #view-scorecard.active.scorecard-vertical-scroll-layout .scorecard-wrapper {
    overflow-x: auto; /* Vertical scorecard still needs horizontal scroll for sticky hole column */
  }
}

/* Premium Radar Chart Styling */
.radar-grid-line {
  stroke: var(--color-border);
  stroke-width: 1px;
  stroke-dasharray: 2 2;
  opacity: 0.5;
}
.radar-axis-line {
  stroke: var(--color-border);
  stroke-width: 1.5px;
  opacity: 0.7;
}
.radar-axis-label {
  font-size: 8px;
  font-weight: 700;
  fill: var(--color-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.radar-grid-value-label {
  font-size: 7px;
  fill: var(--color-muted);
  opacity: 0.8;
}
.radar-player-polygon {
  stroke-width: 2.5px;
  stroke-linejoin: round;
  transition: all 0.3s ease;
}
.radar-player-point {
  stroke-width: 1.5px;
  stroke: var(--color-white);
  transition: all 0.3s ease;
}
.radar-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  width: 100%;
}
.radar-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--color-border);
  background: var(--bg-cream-card-light);
  color: var(--color-charcoal);
  transition: var(--transition);
}
.radar-legend-item.inactive {
  opacity: 0.35;
  background: transparent;
  text-decoration: line-through;
}
.radar-legend-color-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
body.dark-mode .radar-legend-item {
  background: var(--bg-cream-card-light);
  color: var(--color-charcoal);
}

/* ===================================================
   PREMIUM CLUBHOUSE LANDING/SPLASH SCREEN
   =================================================== */
.app-splash-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #14321A; /* Deep Country Club Forest Green matching your brand */
  z-index: 9999; /* Forces presentation above everything else */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.5s;
}

.splash-content {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.splash-logo-wrapper {
  width: 140px;
  height: 140px;
  animation: splashPulse 2s infinite ease-in-out;
}

.splash-logo-img {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

/* Elegant minimalist loading bar design instead of generic spinners */
.splash-loading-bar {
  width: 180px;
  height: 3px;
  background-color: rgba(194, 162, 106, 0.15); /* Soft background tint of gold */
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.splash-loading-progress {
  width: 100%;
  height: 100%;
  background-color: #C2A26A; /* Premium Accent Gold */
  position: absolute;
  left: -100%;
  animation: loadingProgress 1.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.splash-tagline {
  font-family: var(--font-sans);
  color: #C2A26A; /* Accent Gold */
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  opacity: 0.7;
  margin: 0;
}

/* Subtle fading states handled by JavaScript class switches */
.app-splash-overlay.fade-away {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Animations */
@keyframes splashPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

@keyframes loadingProgress {
  0% { left: -100%; }
  50% { left: -30%; }
  100% { left: 0%; }
}

/* ===================================================
   PREMIUM CLUBHOUSE UPGRADES (GLASS NAVBAR & TACTILE NUMPAD)
   =================================================== */

/* 1. iOS-Style Glassmorphism Navbar Override */
.app-nav {
  background-color: rgba(20, 50, 26, 0.82) !important; /* Translucent deep forest green mask */
  backdrop-filter: blur(12px) !important; /* Soft blur window layer */
  -webkit-backdrop-filter: blur(12px) !important; /* Safari compatibility rendering */
  border-top: 1.5px solid var(--color-gold) !important;
  box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.25) !important;
}

/* Ensure underlying body elements can bleed slightly past nav boundary context gracefully */
.app-main {
  padding-bottom: 100px !important; /* Added safe padding margin loop */
}

/* 2. Hydraulic Numpad Tap Micro-Interactions */
.num-btn {
  transform: scale(1);
  transition: transform 0.08s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.1s, box-shadow 0.1s !important;
}

/* Tactile depression compression state */
.num-btn:active {
  transform: scale(0.93) translateY(1.5px) !important; /* Soft downward plunge mechanical feel */
  background-color: var(--bg-cream-card) !important;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0,0,0,0.02) !important;
  border-color: var(--color-gold) !important;
}

/* Tactile bounce loop matching the quick actions for dot adjustments */
.dot-toggle-btn {
  transform: scale(1);
  transition: transform 0.08s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.15s !important;
}

.dot-toggle-btn:active {
  transform: scale(0.95) !important;
}

/* ==========================================
   FOCUS SCORE ENTRY MODE STYLES
   ========================================== */

/* Focus Score Entry Container */
.focus-scorecard-container {
  background-color: var(--bg-cream-card);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 16px;
  margin-top: 12px;
  transition: all 0.3s ease;
}

/* Hole Navigation Header */
.focus-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}
.focus-nav-btn {
  background: var(--bg-cream-card-light);
  border: 1px solid var(--color-border);
  color: var(--color-charcoal);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.9rem;
}
.focus-nav-btn:active {
  transform: scale(0.9);
  background-color: var(--color-gold-dark);
  color: var(--bg-cream-canvas);
}
.focus-hole-details {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.focus-hole-select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.focus-hole-select {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-gold-dark);
  background: transparent;
  border: none;
  padding-right: 18px;
  cursor: pointer;
  text-align-last: center;
  font-family: inherit;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.focus-hole-select-wrapper::after {
  content: "▼";
  font-size: 0.55rem;
  color: var(--color-gold-dark);
  position: absolute;
  right: 2px;
  pointer-events: none;
}
.focus-hole-meta {
  font-size: 0.78rem;
  color: var(--color-muted);
  font-weight: 600;
}

/* Live Standings Banner */
.focus-match-banner {
  background-color: rgba(194, 162, 106, 0.05);
  border: 1px dashed var(--color-gold);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-charcoal);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* Player Focus Cards */
.focus-player-card {
  background-color: var(--bg-cream-card-light);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.focus-player-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}
.focus-player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 10px;
}
.focus-player-identity {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
}
.focus-player-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-charcoal);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  row-gap: 4px;
}
.focus-player-subtext {
  font-size: 0.72rem;
  color: var(--color-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.focus-player-card.t1-card {
  border-left: 4px solid var(--bg-birdie);
}
.focus-player-card.t2-card {
  border-left: 4px solid var(--color-gold);
}

/* Handicap bumps after name: blue dots = strokes received; blue + = strokes given (+ hcp) */
.focus-stroke-bump-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 4px;
}
.focus-stroke-bump-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-stroke-bump);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.9),
    0 1px 2px rgba(13, 71, 161, 0.4);
  flex-shrink: 0;
}

.focus-stroke-bump-dots--give {
  gap: 2px;
}

.focus-stroke-bump-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  font-weight: 900;
  color: var(--color-stroke-bump);
  line-height: 1;
  min-width: 0.5em;
}

/* Horizontal Score Strip */
.focus-score-strip {
  display: flex;
  gap: 5px;
  align-items: center;
  flex-shrink: 0;
}
.focus-score-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background-color: var(--bg-cream-card);
  color: var(--color-charcoal);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}
.focus-score-btn:active {
  transform: scale(0.85);
}

/* Color-Coded Tapping Highlights */
.focus-score-btn.is-eagle.active { background-color: var(--bg-eagle) !important; color: var(--color-eagle) !important; border-color: var(--color-eagle) !important; transform: scale(1.1); box-shadow: 0 0 6px rgba(13, 60, 97, 0.3); }
.focus-score-btn.is-birdie.active { background-color: var(--bg-birdie) !important; color: var(--color-birdie) !important; border-color: var(--color-birdie) !important; transform: scale(1.1); box-shadow: 0 0 6px rgba(20, 58, 35, 0.3); }
.focus-score-btn.is-par.active { background-color: var(--color-charcoal) !important; color: var(--bg-cream-card) !important; border-color: var(--color-charcoal) !important; transform: scale(1.1); }
.focus-score-btn.is-bogey.active { background-color: var(--bg-bogey) !important; color: var(--color-bogey) !important; border-color: var(--color-bogey) !important; transform: scale(1.1); box-shadow: 0 0 6px rgba(71, 26, 21, 0.3); }
.focus-score-btn.is-dbl.active { background-color: var(--bg-double-bogey) !important; color: var(--color-double-bogey) !important; border-color: var(--color-double-bogey) !important; transform: scale(1.1); box-shadow: 0 0 6px rgba(61, 13, 25, 0.3); }

/* Custom Adjuster Controls */
.focus-score-btn.btn-adjust {
  background-color: var(--bg-cream-card);
  color: var(--color-charcoal);
  border-color: var(--color-border);
  font-size: 0.95rem;
}
.focus-score-btn.btn-adjust:active {
  background-color: var(--color-gold-dark);
  color: var(--bg-cream-canvas);
  border-color: var(--color-gold-dark);
}

.focus-score-display-custom {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-gold-dark);
  min-width: 22px;
  text-align: center;
}

/* Dots Checklist In-Line */
.focus-dots-strip {
  display: flex;
  gap: 12px;
  border-top: 1px dashed var(--color-border);
  padding-top: 8px;
  margin-top: 4px;
}
.focus-dot-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-charcoal);
  cursor: pointer;
  user-select: none;
}
.focus-dot-checkbox {
  width: 14px;
  height: 14px;
  accent-color: var(--color-gold-dark);
  cursor: pointer;
}

/* Auto-Advance Panel Options */
.focus-footer-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--color-border);
  font-size: 0.78rem;
  color: var(--color-muted);
}
.focus-advance-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.focus-advance-checkbox {
  width: 14px;
  height: 14px;
  accent-color: var(--color-gold-dark);
}

/* Visual Auto-Advance Banner Overlay */
.focus-advance-overlay {
  background: var(--color-gold-dark);
  color: var(--bg-cream-canvas);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 30px;
  text-align: center;
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  z-index: 100;
  animation: slideUpFade 0.2s ease-out;
}

@keyframes slideUpFade {
  from { transform: translate(-50%, 10px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* Tiebreak buttons styling */
.tb-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.85);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tb-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
}
.tb-btn.active {
  background: var(--color-gold) !important;
  border-color: var(--color-gold) !important;
  color: var(--color-forest) !important;
  box-shadow: 0 0 8px rgba(194, 162, 106, 0.3);
}
.dark-mode .tb-btn {
  color: var(--color-cream-canvas);
}

/* ==========================================================================
   PREMIUM CUSTOM SCROLLBAR UTILITIES (Add to style.css)
   ========================================================================== */

/* Universal Scrollbar Definition for Modern Engines (Firefox) */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-muted) rgba(0, 0, 0, 0.02);
}

body.dark-mode * {
  scrollbar-color: var(--color-border) rgba(0, 0, 0, 0.2);
}

/* WebKit Engines Custom Scrollbar Layout (Chrome, Safari, iOS, Android) */
::-webkit-scrollbar {
  width: 6px;  /* Vertical scrollbar width */
  height: 6px; /* Horizontal scrollbar height for scrolling course specs & scorecard tables */
}

/* The background track/trough of the scrollbar */
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
  border-radius: var(--radius-sm);
}

body.dark-mode ::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.15);
}

/* The draggable handle/thumb elements */
::-webkit-scrollbar-thumb {
  background-color: var(--color-muted);
  border-radius: 10px;
  border: 1px solid transparent;
  background-clip: padding-box;
  transition: background-color var(--transition);
}

/* Dark mode thumb adjustments to avoid brightness washouts */
body.dark-mode ::-webkit-scrollbar-thumb {
  background-color: rgba(142, 153, 146, 0.35); /* Soft alpha-muted green slate */
}

/* Interactive hover feedback state for precision desktop tuning */
::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-gold-dark);
}

body.dark-mode ::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-gold);
}

/* Prevent unwanted scroll overflow visual bugs inside premium rounded views */
.course-scroll-wrapper, 
.scorecard-wrapper, 
#api-search-results {
  scrollbar-gutter: stable; /* Keeps layout from shifting when scrollbars snap into view */
}

/* ==========================================================================
   PREMIUM WAGER SETTLEMENT COPY BOX UTILITIES (Add to style.css)
   ========================================================================== */

/* Enhanced Outer Share Box Layout */
.venmo-share-box {
  background: rgba(0, 0, 0, 0.015);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}

.venmo-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}

.venmo-share-action-btn {
  flex: 1 1 140px;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 0.9rem;
}

body.dark-mode .venmo-share-box {
  background: rgba(255, 255, 255, 0.01);
  border-color: rgba(255, 255, 255, 0.05);
}

/* Premium Venmo Textarea Override Frame */
.venmo-share-box textarea.copy-textarea {
  background: var(--bg-cream-canvas) !important;
  color: var(--color-forest) !important;
  font-family: 'Outfit', -apple-system, sans-serif !important;
  font-size: 0.85rem !important; /* Slightly increased text size for legibility */
  font-weight: 500 !important;
  line-height: 1.5 !important;
  letter-spacing: 0.01em !important;
  padding: 16px 14px !important;
  border: 1.5px dashed var(--color-gold) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.03) !important;
  resize: none !important; 
  white-space: pre-wrap !important;
  transition: border-color var(--transition), box-shadow var(--transition);

  /* Height Adjustments */
  height: 220px !important; /* Raised from default row constraints to prevent micro-scrolling */
  min-height: 220px !important;
}

body.dark-mode .venmo-share-box textarea.copy-textarea {
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6) !important;
  border-color: rgba(212, 175, 55, 0.4) !important; /* Subdued gold dash in dark view */
}

/* Focused Highlight Interactions */
.venmo-share-box textarea.copy-textarea:focus {
  outline: none !important;
  border-color: var(--color-forest-light) !important;
  box-shadow: 0 0 0 3px rgba(82, 178, 115, 0.12) !important;
}

body.dark-mode .venmo-share-box textarea.copy-textarea:focus {
  border-color: var(--color-gold) !important;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1) !important;
}

/* Micro Scrollbar adjustments customized just for the Copy Area */
.venmo-share-box textarea.copy-textarea::-webkit-scrollbar {
  width: 5px !important;
  height: 5px !important;
}

.venmo-share-box textarea.copy-textarea::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.01) !important;
  margin: 6px 0 !important;
}

body.dark-mode .venmo-share-box textarea.copy-textarea::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.01) !important;
}

.venmo-share-box textarea.copy-textarea::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.12) !important;
  border-radius: 10px !important;
}

body.dark-mode .venmo-share-box textarea.copy-textarea::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.15) !important;
}

.venmo-share-box textarea.copy-textarea::-webkit-scrollbar-thumb:hover {
  background-color: var(--color-gold) !important;
}

/* ==========================================================================
   PREMIUM SETTLEMENT CARD GAME VERDICT SUMMARY STYLING (Add to style.css)
   ========================================================================= */
.settlement-game-summary-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(42, 110, 59, 0.05); /* Soft premium grass fairway tint */
  border: 1.5px solid var(--color-border);
  border-left: 5px solid var(--color-forest-light); /* Direct green emphasis strip */
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  text-align: left;
  box-shadow: var(--shadow-sm);
}

body.dark-mode .settlement-game-summary-card {
  background: rgba(82, 178, 115, 0.04);
  border-color: var(--color-border);
  border-left-color: var(--color-gold); /* Shifting anchor strip to luxury clubhouse gold */
}

.settlement-game-summary-card .summary-badge-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--color-forest-light);
  color: white;
  font-size: 1.15rem;
  flex-shrink: 0;
}

body.dark-mode .settlement-game-summary-card .summary-badge-icon {
  background: #1C3D24;
  color: var(--color-gold);
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.settlement-game-summary-card .summary-text-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.settlement-game-summary-card .summary-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-gold-dark);
}

body.dark-mode .settlement-game-summary-card .summary-title {
  color: var(--color-gold);
}

.settlement-game-summary-card .summary-subtitle {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-muted);
  line-height: 1.3;
}

body.dark-mode .settlement-game-summary-card .summary-subtitle {
  color: rgba(255, 255, 255, 0.7);
}

/* Settle tab table scrolling: keep headings/labels fixed, scroll only table */
#raw-balance-table-container {
  overflow-x: visible !important;
}

.raw-balance-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE / legacy Edge */
}

.raw-balance-table-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.contributions-scroll-group {
  width: 100%;
}

.contribution-team-label {
  font-weight: 700;
  text-align: left;
  font-size: 0.75rem;
  padding: 6px 10px;
  margin-top: 10px;
  border-radius: 6px;
}

.contribution-team-label.team-1 {
  background-color: #EAF5EC;
  color: #1C4825;
}

.contribution-team-label.team-2 {
  background-color: #FCF5E8;
  color: var(--color-gold-dark);
}

/* ==========================================================================
   SETTLE TAB RAW BALANCE TABLE RESPONSIVE VIEWPORTS (Add to style.css)
   ========================================================================== */

/* 1. Outer shell: no horizontal scroll (tables scroll inside .raw-balance-table-scroll) */
#raw-balance-table-container {
  width: 100% !important;
  overflow-x: visible !important;
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  margin-top: 8px;
}

body.dark-mode #raw-balance-table-container {
  border-color: rgba(255, 255, 255, 0.05);
}

/* 2. Lock down the internal table styling constraints */
.raw-balance-table {
  width: 100% !important;
  min-width: 480px; /* Establishes a comfortable layout footprint preventing column squash */
  margin-top: 0 !important; /* Removes any double border gaps */
  border-collapse: collapse !important;
}

/* 3. Freeze the Player Name Column to the Left Edge during horizontal scrolling */
.raw-balance-table th:first-child,
.raw-balance-table td:first-child {
  position: sticky !important;
  left: 0 !important;
  z-index: 4 !important;
  background-color: var(--bg-cream-card) !important;
  box-shadow: 3px 0 6px rgba(0, 0, 0, 0.04) !important;
}

body.dark-mode .raw-balance-table th:first-child,
body.dark-mode .raw-balance-table td:first-child {
  background-color: #152219 !important;
  box-shadow: 4px 0 8px rgba(0, 0, 0, 0.25) !important;
}

/* 4. Freeze the Final Net Column securely to the Far Right Edge 
.raw-balance-table th:last-child,
.raw-balance-table td:last-child {
  position: sticky !important;
  right: 0 !important;
  z-index: 4 !important;
  font-weight: 700 !important;
  background-color: var(--bg-cream-card-light) !important;
  border-left: 1.5px solid var(--color-border) !important;
  box-shadow: -3px 0 6px rgba(0, 0, 0, 0.04) !important;
}*/

body.dark-mode .raw-balance-table th:last-child,
body.dark-mode .raw-balance-table td:last-child {
  background-color: #1A291E !important;
  border-left-color: var(--color-border) !important;
  box-shadow: -4px 0 8px rgba(0, 0, 0, 0.25) !important;
}

/* 5. Ensure overarching team header breaks bypass sticky clipping masks */
.raw-balance-table tr.contrib-team-1-header td,
.raw-balance-table tr.contrib-team-2-header td,
.raw-balance-table tr[style*="background-color"] td {
  position: relative !important;
  z-index: 1 !important;
}

/* ==========================================================================
   CENTERED MATCH PLAY HOLE RESULT CHIPS (Add to style.css)
   ========================================================================== */

/* Target the wrapper row containing the dynamic chip layout spans */
.live-match-block div[style*="display:flex"],
.live-match-block div[style*="display:flex; gap:4px; flex-wrap:wrap;"] {
  justify-content: center !important; /* Forces horizontal alignment centering */
  margin-left: auto !important;
  margin-right: auto !important;
  max-width: 100% !important;
}

/* Fallback anchor for the hole result container class layout inside Settle tab blocks */
#nassau-live-details div[style*="display:flex"] {
  justify-content: center !important;
  gap: 6px !important; /* Slightly expands touch targets for clean mobile layout tap grids */
}

/* ==========================================================================
   NASSAU MP — SCORECARD PRESS LINES + SETTLE PER-BET BOXES
   ========================================================================== */
.nassau-mp-scorecard-lines {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
}

.nassau-mp-scorecard-line {
  font-size: 0.62rem;
  font-weight: 650;
  line-height: 1.28;
  text-align: left;
  width: 100%;
  padding: 3px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.07);
  color: var(--color-charcoal);
}

.nassau-mp-scorecard-line:last-child {
  border-bottom: none;
}

body.dark-mode .nassau-mp-scorecard-line {
  border-bottom-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
}

.nassau-mp-scorecard-line-label {
  color: var(--color-muted);
  font-weight: 800;
  font-size: 0.54rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 4px;
}

.nassau-mp-bet-boxes {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.nassau-mp-bet-box {
  position: relative;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md, 8px);
  padding: 12px 12px 12px 12px;
  min-height: 44px;
}

.nassau-mp-bet-box-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
  padding-right: 92px;
  line-height: 1.25;
  margin-bottom: 6px;
}

.nassau-mp-bet-wager-note {
  color: var(--color-gold-dark, #b8955c);
  font-weight: 600;
}

.nassau-mp-bet-wager-note--rolled {
  font-style: italic;
  font-weight: 600;
  color: rgba(232, 218, 188, 0.95);
  cursor: help;
}

.nassau-mp-bet-box-status {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.3;
}

.nassau-mp-bet-corner {
  position: absolute;
  top: 8px;
  right: 8px;
  max-width: 46%;
  text-align: right;
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1.15;
}

.nassau-mp-bet-corner-names {
  display: block;
  font-size: 0.55rem;
  font-weight: 700;
  opacity: 0.85;
}

.nassau-mp-bet-corner-amt {
  display: block;
  font-size: 0.72rem;
}

.nassau-mp-bet-corner--s1 .nassau-mp-bet-corner-amt {
  color: #9fd4a8;
}

.nassau-mp-bet-corner--s2 .nassau-mp-bet-corner-amt {
  color: #f0c896;
}

.nassau-mp-bet-corner--even {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.7rem;
}

.nassau-mp-bet-tiebreak {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(255, 255, 255, 0.15);
}

.nassau-mp-bet-tiebreak-label {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 8px;
  line-height: 1.3;
}

.nassau-mp-bet-tiebreak-wager {
  font-weight: 700;
  color: rgba(212, 175, 55, 0.75);
}

.nassau-mp-bet-tiebreak-btns {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ==========================================================================
   PREMIUM FLOATING CENTER ACTION NAV TRAY REDESIGN (Add to style.css)
   ========================================================================== */

/* Establish structural layout containment for the nav tray */
.app-nav {
  display: flex !important;
  justify-content: space-between !important;
  align-items: flex-end !important; /* Forces layout anchors to lean down for safe areas */
  padding-bottom: env(safe-area-inset-bottom) !important;
  overflow: visible !important; /* Allows the center circle button to break past the boundary */
}

/* Isolate the elevated center navigation button */
.nav-item.center-action-btn {
  position: relative !important;
  top: -14px; /* Raises the button above the top frame border line */
  height: calc(100% + 14px) !important;
  overflow: visible !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
}

/* Build the floating golf-brand accent circle casing */
.action-circle-wrapper {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, var(--color-forest) 0%, var(--color-forest-medium) 100%);
  border: 3px solid var(--bg-cream-canvas); /* Mask ring that matches your cream canvas base */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  margin-bottom: 2px;
  transition: transform 0.1s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

/* Force inner graphic icons to anchor down inside the floating element */
.nav-item.center-action-btn .action-circle-wrapper i {
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 1.35rem !important;
  transform: none !important;
}

/* Adjust text labels to line up cleanly beneath the floating circle wrapper */
.nav-item.center-action-btn span {
  margin-top: 1px !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
}

/* Active Highlight Status State Tracker toggles */
.nav-item.center-action-btn.active .action-circle-wrapper {
  background: var(--color-gold) !important;
  box-shadow: 0 4px 14px rgba(194, 162, 106, 0.4);
  border-color: var(--bg-cream-canvas) !important;
}

.nav-item.center-action-btn.active .action-circle-wrapper i {
  color: var(--color-forest) !important; /* High contrast drop-shadow text swap */
}

.nav-item.center-action-btn.active span {
  color: var(--color-gold) !important;
}

/* --- HYDRAULIC TAP MICRO-INTERACTIONS --- */
.nav-item.center-action-btn:active .action-circle-wrapper {
  transform: scale(0.9) translateY(2px); /* Soft downward depression click feel */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* --- MIDNIGHT CLUBHOUSE DARK MODE OVERRIDES --- */
body.dark-mode .action-circle-wrapper {
  background: linear-gradient(135deg, #152219 0%, #1c2b20 100%);
  border-color: #0C120E !important; /* Swaps the ring mask color to match pitch-black dark mode canvas */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

body.dark-mode .nav-item.center-action-btn .action-circle-wrapper i {
  color: var(--color-charcoal) !important;
}

body.dark-mode .nav-item.center-action-btn.active .action-circle-wrapper {
  background: var(--color-gold) !important;
}

body.dark-mode .nav-item.center-action-btn.active .action-circle-wrapper i {
  color: #121A15 !important; /* Pitch black slate font inversion */
}

#contributions-section-container, 
#contributions-section-container .section-title {
  position: static !important; /* Prevents drifting */
  width: 100%;
}

/* --- Settle tab: denser layout so more ledger tables fit on screen --- */
#view-settlement .view-card {
  padding: 12px 14px;
}

#view-settlement .view-card.mb-4 {
  margin-bottom: 10px;
}

#view-settlement .section-title {
  font-size: clamp(0.95rem, 2.8vw + 0.4rem, 1.15rem);
  line-height: 1.2;
}

#view-settlement .section-subtitle {
  font-size: clamp(0.68rem, 2vw + 0.3rem, 0.8rem);
  margin-bottom: 8px;
  line-height: 1.35;
}

#view-settlement .section-title-lg {
  font-size: clamp(1.15rem, 3.2vw + 0.45rem, 1.45rem);
  line-height: 1.2;
}

#view-settlement .section-subtitle-lg {
  font-size: clamp(0.75rem, 2.2vw + 0.32rem, 0.92rem);
  margin-bottom: 12px;
  line-height: 1.35;
}

#view-settlement .live-standings-grid {
  gap: 6px;
}

#view-settlement .live-standings-grid.mt-2 {
  margin-top: 6px !important;
}

#view-settlement .live-standings-grid.mt-3 {
  margin-top: 6px !important;
}

#view-settlement .drink-hole-in-match-card {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#view-settlement .drink-hole-in-match-kicker {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.42);
}

#view-settlement .drink-hole-in-match-kicker .fa-beer-mug-empty {
  font-size: 0.68rem;
  color: rgba(212, 175, 55, 0.45);
}

#view-settlement .drink-hole-in-match-grid {
  gap: 4px !important;
  margin-top: 0 !important;
}

#view-settlement .drink-hole-match-row {
  padding: 5px 8px !important;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035) !important;
  font-size: 0.72rem;
  line-height: 1.25;
}

#view-settlement .drink-hole-match-row .dh-hole {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.48);
  flex-shrink: 0;
}

#view-settlement .drink-hole-match-row .dh-buyer {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-weight: 600;
  color: rgba(220, 195, 120, 0.82);
  text-align: right;
}

#view-settlement .drink-hole-match-row .dh-buy-icon {
  font-size: 0.78rem;
  color: rgba(212, 175, 85, 0.88);
  flex-shrink: 0;
}

#view-settlement .drink-hole-match-row .dh-pending {
  font-style: italic;
  font-weight: 500;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.38);
  text-align: right;
}

#view-settlement .card-subtitle {
  font-size: clamp(0.7rem, 2vw + 0.28rem, 0.82rem);
  padding-bottom: 5px;
}

#view-settlement .live-match-header-row {
  margin-bottom: 8px;
}

#view-settlement #raw-balance-table-container {
  margin-top: 6px !important;
  min-width: 0;
  width: 100%;
}

#view-settlement .nassau-segment-rolled {
  color: var(--color-muted);
  font-weight: 600;
  cursor: help;
  letter-spacing: 0.03em;
}

#view-settlement .nassau-push-footnote {
  margin: 8px 0 0;
  padding: 8px 10px;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--color-muted);
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-sm);
  border-left: 3px solid rgba(212, 175, 55, 0.45);
}

#view-settlement .nassau-push-footnote .fa-right-left {
  margin-right: 6px;
  color: rgba(82, 115, 90, 0.75);
  font-size: 0.7rem;
}

body.dark-mode #view-settlement .nassau-push-footnote {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.55);
}

body.dark-mode #view-settlement .nassau-push-footnote .fa-right-left {
  color: rgba(212, 175, 85, 0.55);
}

#view-settlement #raw-balance-table-container.mt-3 {
  margin-top: 6px !important;
}

#view-settlement .raw-balance-table-scroll {
  width: 100%;
  min-width: 0;
}

/* Fit full table width: no forced min-width, fixed layout, fluid type */
#view-settlement .raw-balance-table {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100%;
  table-layout: fixed;
  font-size: clamp(0.58rem, 2.4vw + 0.35rem, 0.82rem);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  font-variant-numeric: tabular-nums;
}

#view-settlement .raw-balance-table th,
#view-settlement .raw-balance-table td {
  padding: clamp(2px, 0.8vw, 5px) clamp(2px, 1.2vw, 6px) !important;
}

#view-settlement .raw-balance-table th:first-child,
#view-settlement .raw-balance-table td:first-child {
  width: 20%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

#view-settlement .raw-balance-table th:not(:first-child),
#view-settlement .raw-balance-table td:not(:first-child) {
  white-space: nowrap;
  width: auto;
  text-align: right;
  padding-left: 2px !important;
  padding-right: clamp(2px, 1vw, 6px) !important;
}

#view-settlement .raw-balance-table th {
  font-size: clamp(0.48rem, 1.6vw + 0.28rem, 0.68rem);
  letter-spacing: 0.02em;
  line-height: 1.15;
  padding-top: clamp(2px, 0.6vw, 4px) !important;
  padding-bottom: clamp(2px, 0.6vw, 4px) !important;
  border-bottom-width: 1px;
}

#view-settlement .raw-balance-table td.player-name {
  font-size: clamp(0.58rem, 2.2vw + 0.32rem, 0.84rem);
}

#view-settlement .payouts-container.mt-4 {
  margin-top: 1rem !important;
}

#view-settlement .venmo-share-box.mt-4 {
  margin-top: 1rem !important;
}

.contributions-section-title {
  font-family: var(--font-serif);
  font-size: clamp(0.82rem, 2vw + 0.35rem, 0.95rem);
  font-weight: 700;
  color: var(--color-gold-dark);
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0 5px;
  line-height: 1.2;
}

#view-settlement .contribution-team-label {
  padding: 3px clamp(6px, 2vw, 10px);
  margin-top: 5px;
  font-size: clamp(0.6rem, 1.8vw + 0.25rem, 0.72rem);
  border-radius: 4px;
}