/*
Theme Name: Cue Club Theme
Description: Hand-coded theme for Cue Club Management — table booking, tournaments, leaderboard.
Author: Cue Club Management
Version: 1.1.0
*/

:root {
	--ccm-felt: #1f5c3c;
	--ccm-felt-dark: #143f29;
	--ccm-wood: #3a2418;
	--ccm-wood-dark: #241208;
	--ccm-gold: #c9a24b;
	--ccm-gold-light: #e4c979;
	--ccm-cream: #f5efe0;
	--ccm-ink: #171310;
	--ccm-bg: #0e1f17;
	--ccm-card: #163826;
	--ccm-card-hover: #1b4430;
	--ccm-border: rgba(201, 162, 75, 0.25);
	--ccm-red: #b94a3b;
	--ccm-silver: #c7cdd6;
	--ccm-bronze: #c98a4b;
	--ccm-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
	--ccm-font-display: 'Playfair Display', 'Georgia', serif;
	--ccm-font-body: 'Inter', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--ccm-bg);
	color: var(--ccm-cream);
	font-family: var(--ccm-font-body);
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	animation: ccmFadeIn 0.5s ease both;
}

@keyframes ccmFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes ccmFloat {
	0%, 100% { transform: translateY(0) rotate(0deg); }
	50% { transform: translateY(-14px) rotate(6deg); }
}

@keyframes ccmPulseGold {
	0%, 100% { box-shadow: 0 0 0 0 rgba(201, 162, 75, 0.55); }
	50% { box-shadow: 0 0 0 9px rgba(201, 162, 75, 0); }
}

@keyframes ccmSpin {
	to { transform: rotate(360deg); }
}

/* Scroll reveal */
.ccm-reveal {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 0.6s ease, transform 0.6s ease;
}
.ccm-reveal.is-visible { opacity: 1; transform: translateY(0); }
.ccm-reveal-stagger > * {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity 0.5s ease, transform 0.5s ease;
}
.ccm-reveal-stagger.is-visible > * { opacity: 1; transform: translateY(0); }
.ccm-reveal-stagger.is-visible > *:nth-child(2) { transition-delay: 0.08s; }
.ccm-reveal-stagger.is-visible > *:nth-child(3) { transition-delay: 0.16s; }
.ccm-reveal-stagger.is-visible > *:nth-child(4) { transition-delay: 0.24s; }
.ccm-reveal-stagger.is-visible > *:nth-child(5) { transition-delay: 0.32s; }

a { color: var(--ccm-gold-light); text-decoration: none; transition: color 0.15s ease; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
	font-family: var(--ccm-font-display);
	color: var(--ccm-gold-light);
	margin-top: 0;
	line-height: 1.25;
}

.ccm-wrap {
	max-width: 1080px;
	margin: 0 auto;
	padding: 0 24px;
}

/* Header */
.ccm-header {
	background: var(--ccm-wood-dark);
	border-bottom: 3px solid var(--ccm-gold);
	position: sticky;
	top: 0;
	z-index: 50;
}
.ccm-header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 24px;
	max-width: 1080px;
	margin: 0 auto;
	gap: 20px;
}
.ccm-logo {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-family: var(--ccm-font-display);
	font-size: 1.4rem;
	font-weight: 700;
	color: var(--ccm-gold-light);
	letter-spacing: 0.3px;
	flex-shrink: 0;
}
.ccm-logo:hover { text-decoration: none; }
.ccm-logo-ball { color: var(--ccm-gold); display: inline-flex; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4)); }

.ccm-nav-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	background: none;
	border: 1px solid var(--ccm-border);
	border-radius: 6px;
	width: 40px;
	height: 36px;
	cursor: pointer;
	padding: 0;
}
.ccm-nav-toggle span {
	display: block;
	height: 2px;
	width: 18px;
	margin: 0 auto;
	background: var(--ccm-gold-light);
}

.ccm-nav { flex: 1; display: flex; justify-content: center; }
.ccm-nav ul {
	display: flex;
	gap: 28px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.ccm-nav a {
	color: var(--ccm-cream);
	font-size: 0.95rem;
	font-weight: 500;
	padding: 6px 2px;
	border-bottom: 2px solid transparent;
}
.ccm-nav a:hover { color: var(--ccm-gold-light); text-decoration: none; }
.ccm-nav .current-menu-item a,
.ccm-nav .current_page_item a {
	color: var(--ccm-gold-light);
	border-bottom-color: var(--ccm-gold);
}
.ccm-header-auth a { font-size: 0.9rem; font-weight: 500; }
.ccm-header-auth--desktop a + a { margin-left: 16px; }
.ccm-header-auth--mobile { display: none; }
.ccm-header-auth--mobile a { display: block; margin-bottom: 8px; }

/* Hero */
.ccm-hero {
	position: relative;
	overflow: hidden;
	background:
		radial-gradient(circle at 20% 15%, rgba(201,162,75,0.12), transparent 40%),
		radial-gradient(circle at top, var(--ccm-felt) 0%, var(--ccm-felt-dark) 70%);
	padding: 80px 24px;
	text-align: center;
	border-bottom: 4px solid var(--ccm-gold);
}
.ccm-hero-content { position: relative; z-index: 2; }
.ccm-hero h1 {
	font-size: 2.8rem;
	margin-bottom: 14px;
}
.ccm-hero p {
	font-size: 1.15rem;
	color: var(--ccm-cream);
	max-width: 560px;
	margin: 0 auto 30px;
	opacity: 0.9;
}
.ccm-hero-art {
	position: absolute;
	inset: 0;
	z-index: 1;
	pointer-events: none;
}
.ccm-hero-table {
	position: absolute;
	right: -60px;
	bottom: -40px;
	width: 380px;
	opacity: 0.9;
}
.ccm-float-ball {
	position: absolute;
	width: var(--size, 26px);
	height: var(--size, 26px);
	border-radius: 50%;
	background: radial-gradient(circle at 32% 28%, #fff 0%, var(--c) 45%, var(--c) 100%);
	box-shadow: 0 6px 14px rgba(0,0,0,0.35);
	animation: ccmFloat 5s ease-in-out infinite;
	opacity: 0.85;
}
@media (max-width: 760px) {
	.ccm-hero-table { width: 260px; right: -50px; bottom: -30px; opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
	.ccm-float-ball, body { animation: none; }
	.ccm-reveal, .ccm-reveal-stagger > * { opacity: 1; transform: none; }
}

/* Buttons */
.ccm-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--ccm-gold);
	color: var(--ccm-ink);
	border: none;
	padding: 12px 26px;
	border-radius: 7px;
	font-family: var(--ccm-font-body);
	font-weight: 600;
	cursor: pointer;
	font-size: 0.95rem;
	transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.ccm-btn:hover { background: var(--ccm-gold-light); text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(201,162,75,0.25); }
.ccm-btn--ghost {
	background: transparent;
	border: 1px solid var(--ccm-gold);
	color: var(--ccm-gold-light);
}
.ccm-btn--ghost:hover { background: rgba(201,162,75,0.1); }
.ccm-btn.is-loading { opacity: 0.75; cursor: wait; pointer-events: none; }
.ccm-btn.is-loading::after {
	content: '';
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 2px solid rgba(23,19,16,0.3);
	border-top-color: var(--ccm-ink);
	animation: ccmSpin 0.6s linear infinite;
}
.ccm-link-btn {
	background: none;
	border: none;
	color: var(--ccm-red);
	text-decoration: underline;
	cursor: pointer;
	font-size: 0.85rem;
	padding: 0;
}

/* Sections */
.ccm-section { padding: 60px 24px; }
.ccm-section--alt { background: var(--ccm-wood-dark); }
.ccm-section h2 { font-size: 1.8rem; }

.ccm-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 20px;
	margin-top: 28px;
}
.ccm-card {
	background: var(--ccm-card);
	border: 1px solid var(--ccm-border);
	border-radius: 12px;
	padding: 24px;
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.ccm-card:hover { transform: translateY(-3px); box-shadow: var(--ccm-shadow); border-color: var(--ccm-gold); }
.ccm-card-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: rgba(201,162,75,0.15);
	color: var(--ccm-gold-light);
	margin-bottom: 14px;
	font-size: 20px;
}
.ccm-card h3 { font-size: 1.15rem; }

/* Notices */
.ccm-notice {
	padding: 12px 16px;
	border-radius: 8px;
	margin-bottom: 20px;
	font-size: 0.95rem;
}
.ccm-notice--ok { background: rgba(31, 92, 60, 0.4); border: 1px solid var(--ccm-felt); }
.ccm-notice--error { background: rgba(185, 74, 59, 0.25); border: 1px solid var(--ccm-red); }

/* Booking */
.ccm-date-picker {
	margin-bottom: 26px;
	display: flex;
	gap: 10px;
	align-items: center;
	flex-wrap: wrap;
}
.ccm-date-picker label { font-weight: 500; font-size: 0.9rem; }
.ccm-date-picker input {
	padding: 9px 10px;
	border-radius: 7px;
	border: 1px solid var(--ccm-border);
	background: var(--ccm-card);
	color: var(--ccm-cream);
	font-family: inherit;
}
.ccm-table-card {
	background: var(--ccm-card);
	border: 1px solid var(--ccm-border);
	border-radius: 12px;
	padding: 22px;
	margin-bottom: 18px;
	transition: border-color 0.15s ease;
}
.ccm-table-card:hover { border-color: var(--ccm-gold); }
.ccm-table-art { display: block; width: 100%; max-width: 160px; height: auto; margin-bottom: 14px; border-radius: 6px; }
.ccm-table-card h3 {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 1.1rem;
	font-family: var(--ccm-font-body);
	font-weight: 600;
	color: var(--ccm-cream);
}
.ccm-table-icon { color: var(--ccm-gold-light); display: inline-flex; flex-shrink: 0; vertical-align: middle; }
.ccm-tag {
	display: inline-block;
	background: var(--ccm-felt);
	color: var(--ccm-cream);
	font-size: 0.72rem;
	padding: 3px 10px;
	border-radius: 999px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	vertical-align: middle;
	font-weight: 600;
}
.ccm-slots {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 14px;
}
.ccm-slot-form { display: inline-block; }
.ccm-slot {
	display: inline-block;
	padding: 8px 14px;
	border-radius: 7px;
	font-size: 0.85rem;
	font-weight: 500;
	border: 1px solid var(--ccm-border);
	cursor: default;
	transition: background 0.15s ease, transform 0.15s ease;
}
.ccm-slot--open {
	background: var(--ccm-felt);
	color: var(--ccm-cream);
	cursor: pointer;
	border: none;
}
.ccm-slot--open:hover { background: var(--ccm-gold); color: var(--ccm-ink); transform: translateY(-1px); }
.ccm-slot--taken {
	background: transparent;
	color: rgba(245, 239, 224, 0.3);
	text-decoration: line-through;
}

/* Forms */
.ccm-form {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-top: 18px;
	max-width: 440px;
}
.ccm-form label {
	display: flex;
	flex-direction: column;
	gap: 5px;
	font-size: 0.9rem;
	font-weight: 500;
}
.ccm-form input, .ccm-form select, .ccm-form textarea {
	padding: 10px 12px;
	border-radius: 7px;
	border: 1px solid var(--ccm-border);
	background: var(--ccm-bg);
	color: var(--ccm-cream);
	font-family: inherit;
	transition: border-color 0.15s ease;
}
.ccm-form input:focus, .ccm-form select:focus, .ccm-form textarea:focus {
	outline: none;
	border-color: var(--ccm-gold);
}
.ccm-create-tournament summary {
	list-style: none;
	margin-bottom: 8px;
	cursor: pointer;
}
.ccm-create-tournament summary::-webkit-details-marker { display: none; }

/* Tournaments */
.ccm-tournament-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 18px;
	margin-top: 24px;
}
.ccm-tournament-card {
	display: block;
	background: var(--ccm-card);
	border: 1px solid var(--ccm-border);
	border-radius: 12px;
	padding: 22px;
	color: var(--ccm-cream);
	transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.ccm-tournament-card:hover { border-color: var(--ccm-gold); text-decoration: none; transform: translateY(-3px); box-shadow: var(--ccm-shadow); }
.ccm-tournament-card h3 { font-size: 1.2rem; margin-bottom: 6px; }
.ccm-status {
	display: inline-block;
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	padding: 3px 10px;
	border-radius: 999px;
	margin-top: 10px;
}
.ccm-status--upcoming { background: var(--ccm-gold); color: var(--ccm-ink); }
.ccm-status--ongoing { background: var(--ccm-felt); color: var(--ccm-cream); }
.ccm-status--completed { background: rgba(245,239,224,0.15); color: var(--ccm-cream); }

.ccm-tournament-detail {
	margin-top: 40px;
	padding-top: 28px;
	border-top: 1px solid var(--ccm-border);
}
.ccm-tournament-detail h2 { display: flex; align-items: center; gap: 10px; }
.ccm-trophy-icon { flex-shrink: 0; }
.ccm-entry-list { padding-left: 20px; }
.ccm-match-table {
	width: 100%;
	border-collapse: collapse;
	margin: 16px 0;
}
.ccm-match-table td, .ccm-match-table th {
	padding: 12px;
	border-bottom: 1px solid var(--ccm-border);
	text-align: left;
}

/* Leaderboard */
.ccm-game-tabs { display: flex; gap: 10px; margin-bottom: 22px; flex-wrap: wrap; }
.ccm-tab {
	padding: 8px 18px;
	border-radius: 999px;
	border: 1px solid var(--ccm-border);
	color: var(--ccm-cream);
	font-weight: 500;
	font-size: 0.9rem;
	transition: background 0.15s ease;
}
.ccm-tab:hover { text-decoration: none; border-color: var(--ccm-gold); }
.ccm-tab.is-active { background: var(--ccm-gold); color: var(--ccm-ink); border-color: var(--ccm-gold); }
.ccm-leaderboard-table {
	width: 100%;
	border-collapse: collapse;
}
.ccm-leaderboard-table th, .ccm-leaderboard-table td {
	padding: 13px 12px;
	border-bottom: 1px solid var(--ccm-border);
	text-align: left;
}
.ccm-leaderboard-table thead th {
	color: var(--ccm-gold-light);
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.4px;
}
.ccm-leaderboard-table tbody tr { transition: background 0.15s ease; }
.ccm-leaderboard-table tbody tr:hover { background: rgba(201,162,75,0.06); }
.ccm-rank {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	font-weight: 700;
	font-size: 0.8rem;
	background: rgba(245,239,224,0.08);
	color: var(--ccm-cream);
}
.ccm-rank--1 { background: var(--ccm-gold); color: var(--ccm-ink); animation: ccmPulseGold 2.6s ease-in-out infinite; }
.ccm-rank--2 { background: var(--ccm-silver); color: var(--ccm-ink); }
.ccm-rank--3 { background: var(--ccm-bronze); color: var(--ccm-ink); }
.ccm-player {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}
.ccm-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--ccm-felt);
	color: var(--ccm-cream);
	font-size: 0.75rem;
	font-weight: 700;
	flex-shrink: 0;
}

/* Dashboard */
.ccm-dash-welcome {
	display: flex;
	align-items: center;
	gap: 18px;
	flex-wrap: wrap;
	background: var(--ccm-card);
	border: 1px solid var(--ccm-border);
	border-radius: 14px;
	padding: 22px 26px;
	margin-bottom: 36px;
}
.ccm-avatar--lg { width: 54px; height: 54px; font-size: 1.1rem; }
.ccm-dash-welcome h2 { font-size: 1.4rem; margin-bottom: 2px; }
.ccm-dash-welcome-sub { margin: 0; opacity: 0.7; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.5px; }
.ccm-dash-actions { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

.ccm-dashboard-section { margin-bottom: 40px; }
.ccm-dashboard-section h2 {
	font-size: 1.3rem;
	margin-bottom: 16px;
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: var(--ccm-font-body);
	font-weight: 600;
	color: var(--ccm-gold-light);
}
.ccm-dashboard-section h2 .dashicons { font-size: 1.2rem; width: 1.2rem; height: 1.2rem; }
.ccm-empty { opacity: 0.75; }
.ccm-booking-list { padding-left: 0; list-style: none; }
.ccm-booking-list li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 0;
	border-bottom: 1px solid var(--ccm-border);
}
.ccm-stat-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 16px;
}
.ccm-stat-card {
	background: var(--ccm-card);
	border: 1px solid var(--ccm-border);
	border-radius: 12px;
	padding: 18px;
	transition: transform 0.15s ease, border-color 0.15s ease;
}
.ccm-stat-card:hover { transform: translateY(-2px); border-color: var(--ccm-gold); }
.ccm-stat-card h4 { margin: 8px 0 4px; font-family: var(--ccm-font-body); font-size: 0.95rem; color: var(--ccm-cream); }
.ccm-stat-points { font-size: 1.5rem; font-weight: 700; color: var(--ccm-gold-light); margin: 0; }
.ccm-stat-record { margin: 4px 0 0; font-size: 0.8rem; opacity: 0.75; }

.ccm-login-prompt {
	background: var(--ccm-card);
	border: 1px solid var(--ccm-border);
	border-radius: 12px;
	padding: 28px;
	text-align: center;
}

/* Auth (login / register) */
.ccm-auth {
	display: flex;
	min-height: calc(100vh - 140px);
}
.ccm-auth-art {
	position: relative;
	overflow: hidden;
	flex: 1 1 45%;
	background:
		radial-gradient(circle at 20% 20%, rgba(201,162,75,0.15), transparent 40%),
		radial-gradient(circle at top, var(--ccm-felt) 0%, var(--ccm-felt-dark) 75%);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 48px;
}
.ccm-auth-art-copy { position: relative; z-index: 2; max-width: 360px; text-align: center; }
.ccm-auth-art-copy h2 { font-size: 2.2rem; margin-bottom: 10px; }
.ccm-auth-art-copy p { opacity: 0.9; }
.ccm-auth-form-wrap {
	flex: 1 1 55%;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 48px 24px;
	background: var(--ccm-bg);
}
.ccm-auth-form { width: 100%; max-width: 380px; }
.ccm-auth-form h1 { font-size: 2rem; margin-bottom: 6px; }
.ccm-auth-sub { opacity: 0.75; margin-bottom: 20px; }
.ccm-auth-form .ccm-form { max-width: none; }
.ccm-auth-form .ccm-btn { margin-top: 6px; width: 100%; justify-content: center; }
.ccm-auth-links { margin-top: 16px; font-size: 0.9rem; }
.ccm-form-checkbox { flex-direction: row !important; align-items: center; gap: 8px; }
.ccm-form-checkbox input { width: auto !important; }

@media (max-width: 760px) {
	.ccm-auth { flex-direction: column; min-height: auto; }
	.ccm-auth-art { padding: 36px 24px; }
}

/* Footer */
.ccm-footer {
	background: var(--ccm-wood-dark);
	border-top: 3px solid var(--ccm-gold);
	padding: 30px 24px;
	text-align: center;
	color: rgba(245, 239, 224, 0.6);
	font-size: 0.85rem;
}

@media (max-width: 760px) {
	.ccm-nav-toggle { display: flex; order: 3; }
	.ccm-header-inner { flex-wrap: wrap; }
	.ccm-nav {
		order: 4;
		flex-basis: 100%;
		display: none;
		flex-direction: column;
		align-items: flex-start;
		background: var(--ccm-wood-dark);
		border-top: 1px solid var(--ccm-border);
		margin-top: 12px;
		padding-top: 12px;
	}
	.ccm-nav.is-open { display: flex; }
	.ccm-nav ul { flex-direction: column; gap: 14px; width: 100%; }
	.ccm-header-auth--desktop { display: none; }
	.ccm-header-auth--mobile { display: block; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--ccm-border); width: 100%; }
	.ccm-hero { padding: 56px 20px; }
	.ccm-hero h1 { font-size: 2.1rem; }
	.ccm-booking-list li { flex-wrap: wrap; gap: 6px; }
}
