:root {
  --golf-bg: #0c1222;
  --golf-bg-card: #1a2332;
  --golf-bg-input: #243044;
  --golf-border: #3d5266;
  --golf-border-focus: #34d399;
  --golf-text: #f1f5f9;
  --golf-text-muted: #cbd5e1;
  --golf-text-label: #a7f3d0;
  --golf-accent: #059669;
  --golf-accent-hover: #047857;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.golf-app {
  font-family: 'Outfit', system-ui, sans-serif;
  background: linear-gradient(180deg, #0f172a 0%, #052e16 100%);
  background-attachment: fixed;
  color: var(--golf-text);
  -webkit-font-smoothing: antialiased;
}

.golf-main {
  max-width: 32rem;
  margin: 0 auto;
  padding: 1rem 1rem 5.5rem;
  min-height: 100vh;
  color: var(--golf-text);
}

.golf-main--auth {
  padding-bottom: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.golf-main h1,
.golf-main h2,
.golf-main h3 {
  color: #ffffff;
}

.golf-main p,
.golf-main li {
  color: var(--golf-text-muted);
}

.golf-card {
  background: var(--golf-bg-card);
  border: 1px solid var(--golf-border);
  border-radius: 1rem;
  padding: 1rem;
  color: var(--golf-text);
}

.golf-card .font-medium,
.golf-card strong {
  color: #ffffff;
}

/* All form fields — high contrast, overrides Tailwind / browser defaults */
.golf-app input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]):not([type="button"]),
.golf-app select,
.golf-app textarea,
.golf-input {
  width: 100%;
  border-radius: 0.625rem;
  border: 1.5px solid var(--golf-border);
  background-color: var(--golf-bg-input) !important;
  color: #ffffff !important;
  padding: 0.625rem 0.75rem;
  font-size: 1rem;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
}

.golf-app select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23a7f3d0'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 1.1rem;
  padding-right: 2.25rem;
}

.golf-app select option {
  background-color: #1e293b;
  color: #ffffff;
}

.golf-app input::placeholder,
.golf-app textarea::placeholder {
  color: #94a3b8;
  opacity: 1;
}

.golf-app input:focus,
.golf-app select:focus,
.golf-app textarea:focus,
.golf-input:focus {
  outline: none;
  border-color: var(--golf-border-focus);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.35);
}

.golf-app input:disabled,
.golf-app select:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.golf-app label {
  color: var(--golf-text-label);
  font-weight: 500;
}

.golf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border-radius: 0.625rem;
  padding: 0.75rem 1rem;
  font-weight: 600;
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
}

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

.golf-btn-primary {
  background: var(--golf-accent);
  color: #ffffff !important;
  border: none;
}

.golf-btn-primary:hover {
  background: var(--golf-accent-hover);
}

.golf-btn-secondary {
  background: var(--golf-bg-input);
  border: 1.5px solid var(--golf-border);
  color: #ffffff !important;
}

.golf-btn-secondary:hover {
  border-color: var(--golf-border-focus);
}

.golf-score-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.8125rem;
  color: #f1f5f9;
}

.golf-score-table th,
.golf-score-table td {
  border: 1px solid var(--golf-border);
  padding: 0.45rem 0.35rem;
  text-align: center;
  vertical-align: middle;
  min-width: 2rem;
  white-space: nowrap;
}

.golf-score-table thead th {
  background: #14532d;
  color: #ecfdf5;
  font-weight: 600;
}

.golf-score-table tbody th {
  background: #1e3a2f;
  color: #d1fae5;
  font-weight: 600;
  text-align: left;
  padding-left: 0.5rem;
  min-width: 3.25rem;
  position: sticky;
  left: 0;
  z-index: 2;
}

.golf-score-table tr.golf-score-row--me th {
  color: #6ee7b7;
}

.golf-score-table tr.golf-score-row--me td {
  background: rgba(6, 78, 59, 0.25);
}

.golf-score-table tbody td {
  background: var(--golf-bg-card);
  color: var(--golf-text);
}

.golf-scorecard-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 -0.25rem 1rem;
  padding: 0 0.25rem 0.5rem;
}

.golf-score-table .golf-score-cell--great { color: #6ee7b7; font-weight: 700; }
.golf-score-table .golf-score-cell--good { color: #a7f3d0; font-weight: 600; }
.golf-score-table .golf-score-cell--ok { color: #e2e8f0; }
.golf-score-table .golf-score-cell--high { color: #fca5a5; }

.golf-score-table .golf-score-diff {
  display: block;
  font-size: 0.625rem;
  opacity: 0.85;
  margin-top: 0.1rem;
}

.golf-score-table input {
  width: 2.5rem;
  min-height: 2.25rem;
  text-align: center;
  background-color: var(--golf-bg-input) !important;
  border: 1.5px solid var(--golf-border) !important;
  border-radius: 0.375rem;
  color: #ffffff !important;
  padding: 0.2rem;
  font-size: 0.875rem;
  display: block;
  margin: 0 auto 0.15rem;
}

.golf-scorecard-preview {
  max-height: 40vh;
  object-fit: contain;
  width: 100%;
  border-radius: 0.75rem;
  background: #000;
  border: 1px solid var(--golf-border);
}

.golf-bottom-nav {
  background: #0a1628 !important;
  border-top-color: var(--golf-border) !important;
}

.golf-bottom-nav a {
  color: var(--golf-text-muted) !important;
}

.golf-bottom-nav a.text-emerald-300 {
  color: #6ee7b7 !important;
}

/* Tailwind utility overrides for readability on dark bg */
.golf-app .text-slate-400 {
  color: #cbd5e1 !important;
}

.golf-app .text-slate-500 {
  color: #94a3b8 !important;
}

.golf-app .text-emerald-100,
.golf-app .text-emerald-300 {
  color: #a7f3d0 !important;
}

.golf-app a.text-emerald-300 {
  color: #6ee7b7 !important;
}

.golf-app .text-red-300 {
  color: #fca5a5 !important;
}

.golf-is-hidden {
  display: none !important;
}

.golf-upload-zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  cursor: pointer;
  border: 2px dashed #3d5266;
  overflow: hidden;
  min-height: 9rem;
  text-align: center;
}

.golf-upload-zone--ready {
  border-color: #34d399;
  background: rgba(6, 78, 59, 0.35);
}

/* Cover tap area — do NOT use display:none (breaks iOS camera pickers) */
.golf-file-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  font-size: 0;
  z-index: 2;
}

.golf-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.golf-spinner {
  width: 3rem;
  height: 3rem;
  border: 3px solid rgba(52, 211, 153, 0.2);
  border-top-color: #34d399;
  border-radius: 50%;
  animation: golf-spin 0.8s linear infinite;
}

@keyframes golf-spin {
  to { transform: rotate(360deg); }
}
