/* golf-super-coach — clubhouse theme
   Palette: deep fairway green, cream, sand, gold. System fonts only (CSP
   style-src 'self'); no external assets. */

:root {
	--fairway: #1b5e3a;
	--fairway-dark: #103d26;
	--fairway-mid: #24764a;
	--fairway-light: #e4f0e8;
	--sand: #e7dcc2;
	--sand-dark: #cdbd97;
	--cream: #fbf9f3;
	--paper: #ffffff;
	--ink: #16241c;
	--muted: #5c6b60;
	--line: #e2e0d5;
	--sky: #2b6cb0;
	--gold: #c9a227;
	--gold-dark: #8a6d0b;
	--danger: #b3261e;
	--danger-bg: #fdecea;
	--notice-bg: #e7f5ec;
	--notice-fg: #14532d;
	--shadow: 0 1px 2px rgba(16, 61, 38, 0.06), 0 6px 20px rgba(16, 61, 38, 0.06);
	--radius: 14px;

	/* Back-compat aliases used by older templates. */
	--bg: var(--cream);
	--fg: var(--ink);
	--border: var(--line);
	--accent: var(--fairway);
	--accent-fg: #ffffff;
}

* {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	color: var(--ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.55;
	background-color: var(--cream);
	background-image:
		radial-gradient(circle at 1px 1px, rgba(27, 94, 58, 0.05) 1px, transparent 1.5px),
		linear-gradient(180deg, #f4f7f2 0%, var(--cream) 22rem);
	background-size: 22px 22px, 100% 100%;
	background-attachment: fixed;
}

a {
	color: var(--fairway-mid);
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

a:hover {
	color: var(--fairway-dark);
}

/* ── Header ─────────────────────────────────────────────────────────── */

.nav {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	gap: 0.35rem;
	flex-wrap: wrap;
	padding: 0.65rem 1.25rem;
	color: #fff;
	background: linear-gradient(120deg, var(--fairway-dark), var(--fairway) 55%, var(--fairway-mid));
	box-shadow: 0 6px 18px rgba(16, 61, 38, 0.18);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	margin-right: 0.75rem;
	color: #fff;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 1.15rem;
	font-weight: 700;
	letter-spacing: 0.2px;
	text-decoration: none;
}

.brand:hover {
	color: #fff;
}

.brand-mark {
	width: 26px;
	height: 26px;
	flex: none;
}

.nav-links {
	display: flex;
	align-items: center;
	gap: 0.25rem;
	flex-wrap: wrap;
}

.nav a:not(.brand),
.nav .nav-link {
	padding: 0.35rem 0.7rem;
	border-radius: 999px;
	color: rgba(255, 255, 255, 0.92);
	text-decoration: none;
	font-size: 0.925rem;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.nav a:not(.brand):hover,
.nav .nav-link:hover {
	background: rgba(255, 255, 255, 0.16);
	color: #fff;
}

.nav form {
	margin: 0;
}

.nav-user {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.3rem 0.75rem;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 0.875rem;
}

.nav .link-button {
	color: rgba(255, 255, 255, 0.92);
	text-decoration: none;
	border: 1px solid rgba(255, 255, 255, 0.4);
	border-radius: 999px;
	padding: 0.3rem 0.7rem;
	font-size: 0.875rem;
}

.nav .link-button:hover {
	background: rgba(255, 255, 255, 0.16);
	color: #fff;
}

/* ── Layout ─────────────────────────────────────────────────────────── */

.container {
	max-width: 64rem;
	margin: 0 auto;
	padding: 1.75rem 1.25rem 4rem;
}

h1,
h2,
h3 {
	font-family: Georgia, "Times New Roman", serif;
	letter-spacing: -0.01em;
	line-height: 1.2;
}

h1 {
	font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem);
	margin: 0 0 1rem;
}

h2 {
	font-size: 1.3rem;
	margin: 2rem 0 0.75rem;
}

h3 {
	font-size: 1.05rem;
	margin: 1.25rem 0 0.5rem;
}

hr {
	border: none;
	border-top: 1px solid var(--line);
	margin: 2rem 0;
}

/* ── Hero ───────────────────────────────────────────────────────────── */

.hero {
	position: relative;
	overflow: hidden;
	padding: clamp(1.75rem, 1rem + 4vw, 3.25rem);
	border-radius: calc(var(--radius) + 6px);
	color: #fff;
	background:
		radial-gradient(120% 140% at 88% 8%, rgba(201, 162, 39, 0.35), transparent 42%),
		linear-gradient(135deg, var(--fairway-dark), var(--fairway) 58%, var(--fairway-mid));
	box-shadow: var(--shadow);
	margin-bottom: 1.75rem;
}

.hero::after {
	content: "";
	position: absolute;
	right: -70px;
	bottom: -110px;
	width: 320px;
	height: 320px;
	border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.16), transparent 60%);
}

.hero h1 {
	color: #fff;
	margin-bottom: 0.5rem;
}

.hero p {
	max-width: 42rem;
	margin: 0 0 1.25rem;
	color: rgba(255, 255, 255, 0.9);
	font-size: 1.05rem;
}

.hero .button {
	background: #fff;
	color: var(--fairway-dark);
}

.hero .button:hover {
	color: var(--fairway-dark);
}

.hero .button-secondary {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	border-color: rgba(255, 255, 255, 0.6);
}

.hero .button-secondary:hover {
	background: rgba(255, 255, 255, 0.22);
}

/* ── Cards, grids, toolbars ─────────────────────────────────────────── */

.card {
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 1.35rem;
	margin: 1rem 0;
}

.card > h2:first-child,
.card > h3:first-child {
	margin-top: 0;
}

.grid {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}

.toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	margin: 0 0 1rem;
}

.stack {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.subtle {
	color: var(--muted);
	font-size: 0.9rem;
}

.empty {
	padding: 1.5rem;
	text-align: center;
	color: var(--muted);
	background: repeating-linear-gradient(45deg, #faf8f1, #faf8f1 12px, #f4f1e6 12px, #f4f1e6 24px);
	border: 1px dashed var(--sand-dark);
	border-radius: var(--radius);
}

/* ── Forms ──────────────────────────────────────────────────────────── */

form.card {
	display: block;
}

label {
	display: block;
	font-weight: 600;
	font-size: 0.9rem;
	margin: 0.6rem 0 0.25rem;
}

input[type="email"],
input[type="password"],
input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
	width: 100%;
	padding: 0.6rem 0.7rem;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: #fff;
	color: var(--ink);
	font: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
	outline: none;
	border-color: var(--fairway-mid);
	box-shadow: 0 0 0 3px rgba(36, 118, 74, 0.18);
}

textarea {
	min-height: 7rem;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.9rem;
}

button,
.button {
	display: inline-block;
	padding: 0.55rem 1.05rem;
	border: 1px solid transparent;
	border-radius: 999px;
	background: linear-gradient(180deg, var(--fairway-mid), var(--fairway));
	color: #fff;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	width: fit-content;
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.15) inset, 0 4px 12px rgba(16, 61, 38, 0.16);
	transition: transform 0.08s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

button:hover,
.button:hover {
	transform: translateY(-1px);
	color: #fff;
	box-shadow: 0 6px 16px rgba(16, 61, 38, 0.22);
}

button:active,
.button:active {
	transform: translateY(0);
}

.button-secondary {
	background: #fff;
	color: var(--fairway);
	border-color: var(--fairway-mid);
	box-shadow: none;
}

.button-secondary:hover {
	background: var(--fairway-light);
	color: var(--fairway-dark);
	box-shadow: none;
}

.button-danger {
	background: linear-gradient(180deg, #cf3b32, var(--danger));
}

.link-button {
	background: none;
	border: none;
	color: var(--fairway-mid);
	padding: 0;
	text-decoration: underline;
	box-shadow: none;
	font-weight: 500;
}

.link-button:hover {
	transform: none;
	box-shadow: none;
	color: var(--fairway-dark);
}

.hint {
	color: var(--muted);
	font-size: 0.85rem;
	margin: 0.35rem 0 0;
}

/* ── Banners & badges ───────────────────────────────────────────────── */

.banner {
	padding: 0.7rem 0.95rem;
	border-radius: 10px;
	margin-bottom: 1rem;
	border-left: 4px solid;
}

.banner-notice {
	background: var(--notice-bg);
	color: var(--notice-fg);
	border-color: var(--fairway-mid);
}

.banner-error {
	background: var(--danger-bg);
	color: var(--danger);
	border-color: var(--danger);
}

.badge {
	display: inline-block;
	padding: 0.1rem 0.55rem;
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	background: var(--sand);
	color: var(--gold-dark);
}

.badge-green {
	background: var(--fairway-light);
	color: var(--fairway-dark);
}

.badge-locked {
	background: #f3e6c8;
	color: var(--gold-dark);
}

.badge-open {
	background: var(--fairway-light);
	color: var(--fairway-dark);
}

.captain {
	display: inline-block;
	padding: 0.1rem 0.5rem;
	border-radius: 999px;
	background: linear-gradient(180deg, #f1d77a, var(--gold));
	color: #4a3a05;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}

.stat {
	font-family: Georgia, "Times New Roman", serif;
	font-size: 2rem;
	font-weight: 700;
	color: var(--fairway-dark);
	line-height: 1;
}

.stat-label {
	color: var(--muted);
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

/* ── Tables / leaderboards ──────────────────────────────────────────── */

.table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow);
}

.table th,
.table td {
	text-align: left;
	padding: 0.65rem 0.85rem;
	border-bottom: 1px solid var(--line);
	vertical-align: middle;
}

.table thead th {
	background: linear-gradient(180deg, #f3f6f1, #e9efe8);
	color: var(--fairway-dark);
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.table tbody tr:nth-child(even) {
	background: #fcfbf6;
}

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

.table tbody tr:hover {
	background: var(--fairway-light);
}

.table td.num,
.table th.num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.rank {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.75rem;
	height: 1.75rem;
	border-radius: 50%;
	background: var(--fairway-light);
	color: var(--fairway-dark);
	font-weight: 700;
	font-size: 0.85rem;
}

.rank-1 {
	background: linear-gradient(180deg, #f6e08a, var(--gold));
	color: #4a3a05;
}

.rank-2 {
	background: linear-gradient(180deg, #e8e8e8, #c2c6c8);
	color: #333;
}

.rank-3 {
	background: linear-gradient(180deg, #e8c9a8, #c98f5a);
	color: #40260c;
}

.actions {
	display: flex;
	gap: 0.4rem;
	align-items: center;
	flex-wrap: wrap;
}

.actions form {
	margin: 0;
}

.actions button,
.actions .button {
	padding: 0.35rem 0.7rem;
	font-size: 0.85rem;
}

/* ── Footer ─────────────────────────────────────────────────────────── */

.footer {
	max-width: 64rem;
	margin: 0 auto;
	padding: 1.5rem 1.25rem 2.5rem;
	color: var(--muted);
	font-size: 0.85rem;
	text-align: center;
}

.footer .brand-mark {
	width: 18px;
	height: 18px;
	opacity: 0.7;
	vertical-align: -4px;
}

@media (max-width: 640px) {
	.nav-user {
		margin-left: 0;
		order: 3;
		width: 100%;
		justify-content: center;
	}
	.container {
		padding: 1.25rem 0.9rem 3rem;
	}
	.table th,
	.table td {
		padding: 0.5rem 0.55rem;
	}
}
