:root {
  --bg-deep: #07190E;
  --bg-turf: #0B2616;
  --bg-card: #10331F;
  --bg-card-elevated: #164229;
  --bg-input: #091E12;

  --gold-light: #F7DF8B;
  --gold-primary: #D4AF37;
  --gold-dark: #9B7B18;
  --gold-glow: rgba(212, 175, 55, 0.25);
  --gold-border: rgba(212, 175, 55, 0.45);

  --text-main: #F4F7F5;
  --text-muted: #A1B8AA;
  --text-dim: #6C8777;

  --eagle-gold: #F5C542;
  --birdie-red: #E5484D;
  --par-green: #2ECC71;
  --bogey-blue: #3B82F6;
  --double-purple: #8B5CF6;

  --danger: #EF4444;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --font-serif: 'Cinzel', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.45;
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 84px; /* Space for bottom nav */
  background: radial-gradient(circle at top, #123D24 0%, var(--bg-deep) 70%);
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(7, 25, 14, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gold-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pga-crest {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-sub {
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  color: var(--gold-primary);
  font-weight: 700;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  background: var(--bg-card);
  border: 1px solid var(--gold-border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gold-light);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--par-green);
  box-shadow: 0 0 8px var(--par-green);
}

/* Main Content & Views */
.main-content {
  flex: 1;
  padding: 16px;
}

.view-section {
  display: none;
  flex-direction: column;
  gap: 16px;
  animation: fadeIn 0.18s ease-out;
}

.view-section.active {
  display: flex;
}

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

.hidden {
  display: none !important;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.gold-border-card {
  border: 1px solid var(--gold-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(247, 223, 139, 0.15);
}

.card-header {
  margin-bottom: 16px;
}

.card-header h2 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--gold-light);
  letter-spacing: 0.03em;
}

.subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Resume Banner */
.resume-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.18), rgba(16, 51, 31, 0.9));
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 18px;
}

.badge-gold {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  background: var(--gold-primary);
  color: #05140B;
  padding: 2px 7px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.resume-info h3 {
  font-size: 1rem;
  color: var(--text-main);
}

.resume-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Forms */
.setup-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  font-size: 0.96rem;
  font-family: var(--font-sans);
  color: var(--text-main);
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-control:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-control-sm {
  padding: 9px 10px;
  font-size: 0.88rem;
}

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

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: end;
}

/* Course Preview Pill */
.course-preview-box {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--bg-input);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
}

.course-preview-stat {
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.course-preview-stat:last-child {
  border-right: none;
}

.cp-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.06em;
}

.cp-val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

.gold-text {
  color: var(--gold-light) !important;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.92rem;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: transform 0.1s, filter 0.15s, background 0.15s;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-primary) 55%, var(--gold-dark) 100%);
  color: #06150C;
  box-shadow: 0 4px 14px rgba(212, 175, 55, 0.3);
}

.btn-gold:hover {
  filter: brightness(1.06);
}

.btn-secondary {
  background: var(--bg-card-elevated);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-large {
  padding: 15px 22px;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.8rem;
}

.btn-xs {
  padding: 5px 10px;
  font-size: 0.74rem;
}

.btn-full {
  width: 100%;
}

.btn-link {
  background: none;
  border: none;
  color: var(--gold-light);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
}

/* Drawer */
.drawer {
  background: var(--bg-card-elevated);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.drawer-header h4 {
  color: var(--gold-light);
  font-size: 0.92rem;
}

/* Modal for Custom Course */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header, .modal-footer {
  padding: 14px 18px;
  background: var(--bg-input);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-family: var(--font-serif);
  color: var(--gold-light);
  font-size: 1.05rem;
}

.modal-body {
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.hole-editor-label {
  font-size: 0.8rem;
  color: var(--gold-light);
  font-weight: 600;
}

.custom-holes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.custom-hole-cell {
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ch-top {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-light);
}

.ch-inputs {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 5px;
}

.ch-inputs select, .ch-inputs input {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 4px;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  text-align: center;
}

/* ==========================================
   VIEW 2: LIVE PLAY (HOLE & SHOT TRACKER)
   ========================================== */
.live-status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
}

.live-player-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.live-course-name {
  font-size: 0.72rem;
  color: var(--gold-primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-player-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-score-cluster {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.live-score-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ls-label {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 700;
}

.ls-val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
}

/* Quick Hole Strip */
.hole-strip-wrapper {
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 -4px;
  padding: 2px 4px;
}

.hole-strip-wrapper::-webkit-scrollbar {
  display: none;
}

.hole-ribbon {
  display: flex;
  gap: 6px;
}

.hole-pill {
  min-width: 42px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
}

.hole-pill .hp-num {
  font-size: 0.72rem;
  font-weight: 700;
}

.hole-pill .hp-score {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
}

.hole-pill.active {
  background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
  color: #06150C;
  border-color: var(--gold-light);
  transform: translateY(-1px);
}

.hole-pill.active .hp-score {
  color: #06150C;
}

.hole-pill.scored {
  border-color: rgba(212, 175, 55, 0.5);
}

/* Hole Hero Card */
.hole-hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #133E25 0%, #0B2516 100%);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.hole-nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-input);
  border: 1px solid var(--gold-border);
  color: var(--gold-light);
  font-size: 1.6rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hole-nav-btn:active {
  transform: scale(0.93);
}

.hole-hero-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.hole-number-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hole-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--gold-light);
  letter-spacing: 0.06em;
}

.stroke-pop-badge {
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid var(--gold-primary);
  color: var(--gold-light);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.hole-specs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hole-spec-item strong {
  color: var(--text-main);
  font-family: var(--font-mono);
}

.editable-spec {
  border-bottom: 1px dashed var(--gold-primary);
  cursor: pointer;
}

/* Hole Visual Yardage Map & Live Shot Plotter */
.hole-visual-card {
  padding: 14px;
  background: linear-gradient(180deg, #0D2E1B 0%, #091E12 100%);
}

.hole-visual-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.hv-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  color: var(--gold-light);
}

.hv-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.hv-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.hv-actions a {
  text-decoration: none;
}

.hole-map-body {
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.32);
  background: #071A0F;
}

.hole-svg-container {
  width: 100%;
  display: flex;
  justify-content: center;
}

.hole-svg-container svg {
  width: 100%;
  max-height: 250px;
  display: block;
}

/* Primary Counter Controls */
.counter-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.counter-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.counter-title {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.score-term-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: 0.06em;
  background: rgba(46, 204, 113, 0.2);
  color: var(--par-green);
}

.big-stepper-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin: 4px 0;
}

.stepper-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--gold-primary);
  background: var(--bg-input);
  color: var(--gold-light);
  font-size: 2rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  transition: transform 0.1s, background 0.15s;
}

.stepper-btn.plus {
  background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
  color: #06150C;
}

.stepper-btn:active {
  transform: scale(0.92);
}

.stepper-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 90px;
}

.stepper-number {
  font-family: var(--font-mono);
  font-size: 3.3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-main);
}

.stepper-sub {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Quick Score Chips */
.quick-score-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  width: 100%;
}

.quick-chip {
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 8px 4px;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.12s;
}

.quick-chip .qc-num {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
}

.quick-chip .qc-lbl {
  font-size: 0.64rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.quick-chip.active {
  border-color: var(--gold-primary);
  background: rgba(212, 175, 55, 0.2);
}

.card-divider {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 16px 0;
}

/* Putts & Penalties */
.sub-counters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.mini-counter-box {
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.mini-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.mini-stepper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mini-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--gold-border);
  background: var(--bg-card);
  color: var(--gold-light);
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
}

.mini-val {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 700;
  min-width: 24px;
  text-align: center;
}

/* FIR / GIR / Sand controls */
.tour-stats-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.seg-btn {
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--bg-input);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
}

.seg-btn.active {
  background: rgba(212, 175, 55, 0.22);
  border-color: var(--gold-primary);
  color: var(--gold-light);
}

.stat-toggles-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.toggle-pill-btn {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: var(--bg-input);
  color: var(--text-muted);
  font-size: 0.84rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.toggle-pill-btn.active {
  background: rgba(46, 204, 113, 0.18);
  border-color: var(--par-green);
  color: var(--text-main);
}

/* Shot-by-Shot Tracker Card */
.shot-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.shot-card-header h3 {
  font-size: 1rem;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-count {
  background: var(--gold-primary);
  color: #06150C;
  font-size: 0.75rem;
  padding: 1px 8px;
  border-radius: 999px;
  font-family: var(--font-mono);
}

.shot-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.shot-entry-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 1.25fr 0.75fr auto;
  gap: 8px;
  align-items: end;
  background: var(--bg-input);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.shot-field label {
  font-size: 0.68rem;
  display: block;
  margin-bottom: 4px;
}

.btn-add-shot {
  padding: 9px 14px;
  height: 38px;
  white-space: nowrap;
}

.hole-shots-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-input);
  border-left: 3px solid var(--gold-primary);
  padding: 8px 12px;
  border-radius: 6px;
}

.shot-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shot-num-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--bg-card-elevated);
  color: var(--gold-light);
  padding: 3px 7px;
  border-radius: 4px;
}

.shot-club-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.shot-meta-pill {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.shot-dist-pill {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--gold-light);
  font-weight: 600;
}

.hole-footer-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px;
}

.finish-round-bar {
  margin-top: 4px;
}

.locked-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(212, 175, 55, 0.16);
  border: 1px solid var(--gold-primary);
  border-radius: var(--radius-md);
  color: var(--gold-light);
  font-size: 0.84rem;
  font-weight: 700;
}

.controls-locked {
  opacity: 0.6;
  pointer-events: none;
  user-select: none;
}

/* ==========================================
   VIEW 3: OFFICIAL PGA SCORECARD
   ========================================== */
.scorecard-official-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  padding-bottom: 14px;
  margin-bottom: 16px;
}

.official-stamp {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--gold-primary);
}

.scorecard-official-header h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--text-main);
  margin-top: 2px;
}

.sc-meta-line {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.sc-Rating-pills {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.sc-pill {
  font-size: 0.74rem;
  font-family: var(--font-mono);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.sc-pill.gold {
  border-color: var(--gold-primary);
  color: var(--gold-light);
  font-weight: 700;
}

.sc-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.sc-kpi-box {
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.sc-kpi-label {
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.sc-kpi-val {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  margin: 2px 0;
}

.sc-kpi-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.nine-heading {
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  color: var(--gold-light);
  margin: 12px 0 6px;
}

.table-scroll {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(212, 175, 55, 0.3);
}

.pga-scorecard-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  text-align: center;
  background: var(--bg-input);
}

.pga-scorecard-table th,
.pga-scorecard-table td {
  padding: 8px 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 38px;
}

.pga-scorecard-table th {
  background: #0D2D1B;
  color: var(--gold-light);
  font-weight: 700;
}

.pga-scorecard-table .row-label {
  text-align: left;
  padding-left: 10px;
  font-family: var(--font-sans);
  font-weight: 700;
  color: var(--text-muted);
  background: #0A2214;
  min-width: 68px;
}

.pga-scorecard-table .summary-col {
  background: rgba(212, 175, 55, 0.12);
  font-weight: 800;
  color: var(--gold-light);
  min-width: 48px;
}

/* Official Golf Score Symbols (Circles & Squares) */
.score-cell-inner {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  font-weight: 700;
  cursor: pointer;
}

.score-cell-inner.birdie {
  border: 2px solid var(--birdie-red);
  border-radius: 50%;
  color: #FF8B8E;
}

.score-cell-inner.eagle {
  border: 2px double var(--eagle-gold);
  border-radius: 50%;
  background: rgba(245, 197, 66, 0.18);
  color: var(--gold-light);
}

.score-cell-inner.bogey {
  border: 2px solid var(--bogey-blue);
  color: #93C5FD;
}

.score-cell-inner.double {
  border: 2px solid var(--double-purple);
  box-shadow: inset 0 0 0 2px var(--bg-input), inset 0 0 0 3.5px var(--double-purple);
  color: #C4B5FD;
}

.stroke-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-primary);
}

/* Scorecard Legend */
.scorecard-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sym-demo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
}

.sym-demo.eagle { border: 2px double var(--eagle-gold); border-radius: 50%; color: var(--gold-light); }
.sym-demo.birdie { border: 2px solid var(--birdie-red); border-radius: 50%; }
.sym-demo.bogey { border: 2px solid var(--bogey-blue); }
.sym-demo.double { border: 2px solid var(--double-purple); }
.stroke-dot-demo { color: var(--gold-primary); font-size: 1.2rem; line-height: 1; }

/* Attestation Box */
.attestation-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 18px 0;
  padding: 12px 14px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(212, 175, 55, 0.35);
}

.sig-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sig-label {
  font-size: 0.64rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.sig-line {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  color: var(--gold-light);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 3px;
}

.scorecard-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ==========================================
   VIEW 4: TOUR STATS & ARCHIVE
   ========================================== */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-metric-card {
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sm-title {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.06em;
}

.sm-big {
  font-family: var(--font-mono);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--gold-light);
}

.sm-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.sm-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-primary), var(--par-green));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.sm-sub {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.section-sub-heading {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  margin: 18px 0 10px;
}

.scoring-dist-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.dist-pill {
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.dist-pill .dp-val {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
}

.dist-pill .dp-lbl {
  font-size: 0.66rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.par-avg-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.par-avg-box {
  background: var(--bg-input);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.pa-label {
  font-size: 0.66rem;
  color: var(--text-muted);
  font-weight: 700;
}

.pa-val {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2px;
}

.club-stats-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.club-stat-chip {
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.csc-name {
  font-weight: 700;
  font-size: 0.85rem;
}

.csc-shots {
  font-size: 0.7rem;
  color: var(--text-muted);
  display: block;
}

.csc-avg {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--gold-light);
  font-size: 0.95rem;
}

/* Round History List */
.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  gap: 10px;
}

.backup-actions {
  display: flex;
  gap: 6px;
}

.file-label {
  cursor: pointer;
  margin: 0;
}

.round-history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  gap: 10px;
}

.hi-left h4 {
  font-size: 0.95rem;
  color: var(--gold-light);
}

.hi-left p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.hi-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hi-score-box {
  text-align: right;
  font-family: var(--font-mono);
}

.hi-gross {
  font-size: 1.2rem;
  font-weight: 800;
}

.hi-net {
  font-size: 0.75rem;
  color: var(--gold-primary);
  display: block;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  background: rgba(7, 25, 14, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--gold-border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  max-width: 720px;
  margin: 0 auto;
  z-index: 60;
}

.nav-tab {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: color 0.15s;
}

.ui-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}

.nav-icon svg {
  width: 22px;
  height: 22px;
}

.nav-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.nav-tab.active {
  color: var(--gold-light);
  background: radial-gradient(circle at bottom, rgba(212, 175, 55, 0.2), transparent 70%);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 82px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--gold-light), var(--gold-primary));
  color: #06150C;
  font-weight: 700;
  font-size: 0.86rem;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 200;
}

/* Mobile Responsive Adjustments */
@media (max-width: 560px) {
  .shot-entry-bar {
    grid-template-columns: 1fr 1fr;
  }
  .btn-add-shot {
    grid-column: span 2;
  }
  .sc-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .analytics-grid {
    grid-template-columns: 1fr;
  }
  .custom-holes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-row-2, .form-row-3 {
    grid-template-columns: 1fr;
  }
}

@media print {
  .app-header, .bottom-nav, .scorecard-actions {
    display: none !important;
  }
  body, .app-container, .card {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
  }
}
