/*
Theme Name:        KlickFan
Theme URI:         https://github.com/justinbaden9/WM-Game
Author:            Justin Baden
Description:       Helles, freundliches Fan-Theme für klickfan.de – das kostenlose WM-2026-Tippspiel. Weißer Hintergrund, knallige Akzente in Grün, Gold und Pink, mobile-first, mit fertiger Landingpage, öffentlichem Spielplan und Anbindung an das Plugin "WM Tippspiel 2026".
Version:           1.5.1
Requires at least: 6.0
Requires PHP:      7.4
License:           GPL-2.0-or-later
Text Domain:       klickfan
*/

:root {
	--kf-bg: #ffffff;
	--kf-bg2: #f4f6fb;
	--kf-card: #ffffff;
	--kf-card2: #eef2f9;
	--kf-line: #e2e8f0;
	--kf-text: #0f172a;
	--kf-muted: #5b6b81;
	--kf-green: #16a34a;
	--kf-green2: #15803d;
	--kf-green-soft: #e8f8ee;
	--kf-gold: #b45309;
	--kf-pink: #db2777;
	--kf-radius: 18px;
	--kf-shadow: 0 4px 16px rgba(15, 23, 42, .07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	background:
		radial-gradient(800px 420px at 90% -5%, rgba(34, 197, 94, .08), transparent 60%),
		radial-gradient(640px 380px at -10% 20%, rgba(219, 39, 119, .06), transparent 60%),
		var(--kf-bg);
	color: var(--kf-text);
	line-height: 1.6;
	font-size: 16.5px;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}

img { max-width: 100%; height: auto; }
a { color: var(--kf-green2); }

.kf-wrap { max-width: 1040px; margin: 0 auto; padding: 0 18px; }

/* ---------- Header ---------- */
.kf-header {
	position: sticky; top: 0; z-index: 100;
	background: rgba(255, 255, 255, .92);
	backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
	border-bottom: 1px solid var(--kf-line);
}
.kf-header-in {
	display: flex; align-items: center; justify-content: space-between;
	gap: 14px; padding: 12px 0; min-height: 62px;
}
.kf-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.kf-brand img.custom-logo { width: 42px; height: 42px; border-radius: 11px; }
.kf-brand-text { font-size: 22px; font-weight: 900; letter-spacing: -.02em; color: var(--kf-text); }
.kf-brand-text em { font-style: normal; color: var(--kf-green); }
.kf-brand-ball { font-size: 22px; }

.kf-header-cta {
	display: none; padding: 10px 18px; border-radius: 99px;
	background: linear-gradient(135deg, #22c55e, var(--kf-green2));
	color: #fff; font-weight: 800; font-size: 14px; text-decoration: none;
	box-shadow: 0 4px 14px rgba(22, 163, 74, .3);
}

.kf-burger {
	width: 46px; height: 46px; border: 1px solid var(--kf-line); border-radius: 12px;
	background: var(--kf-card); cursor: pointer; position: relative; z-index: 130;
	display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
	box-shadow: var(--kf-shadow);
}
.kf-burger span { display: block; width: 20px; height: 2.5px; background: var(--kf-text); border-radius: 2px; transition: transform .25s, opacity .2s; }
.kf-burger.open span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.kf-burger.open span:nth-child(2) { opacity: 0; }
.kf-burger.open span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.kf-nav-overlay {
	/* Bewusst UNTER dem Header (z-index 100), damit der Burger-Button zum Schließen klickbar bleibt. */
	position: fixed; inset: 0; z-index: 95;
	padding-top: 70px;
	background: rgba(255, 255, 255, .98);
	backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
	opacity: 0; pointer-events: none; transition: opacity .22s;
}
.kf-nav-overlay.open { opacity: 1; pointer-events: auto; }
.kf-nav-overlay ul { list-style: none; text-align: center; }
.kf-nav-overlay li { margin: 4px 0; }
.kf-nav-overlay a {
	display: inline-block; padding: 12px 22px;
	font-size: 26px; font-weight: 900; letter-spacing: -.02em;
	color: var(--kf-text); text-decoration: none; border-radius: 14px;
}
.kf-nav-overlay a:hover, .kf-nav-overlay .current-menu-item a { color: var(--kf-green2); }
.kf-nav-overlay .kf-nav-cta a {
	margin-top: 14px; background: linear-gradient(135deg, #22c55e, var(--kf-green2));
	color: #fff; font-size: 20px; padding: 14px 30px; border-radius: 99px;
	box-shadow: 0 6px 18px rgba(22, 163, 74, .3);
}

/* ---------- Buttons ---------- */
.kf-btn {
	display: inline-block; padding: 16px 30px; border-radius: 99px;
	background: linear-gradient(135deg, #22c55e, var(--kf-green2));
	color: #fff; font-weight: 900; font-size: 17px; text-decoration: none;
	box-shadow: 0 8px 24px rgba(22, 163, 74, .35);
	transition: transform .12s, box-shadow .2s; border: none; cursor: pointer;
}
.kf-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(22, 163, 74, .45); color: #fff; }
.kf-btn-ghost {
	background: var(--kf-card); color: var(--kf-green2);
	border: 1.5px solid #b5e6c8; box-shadow: var(--kf-shadow);
}
.kf-btn-ghost:hover { border-color: var(--kf-green); color: var(--kf-green2); }

/* ---------- Hero ---------- */
.kf-hero { text-align: center; padding: 64px 0 40px; position: relative; overflow: hidden; }
.kf-hero-logo { width: 124px; height: 124px; border-radius: 28px; box-shadow: 0 14px 40px rgba(15, 23, 42, .18); margin-bottom: 22px; }
.kf-hero h1 {
	font-size: clamp(34px, 7vw, 58px); font-weight: 900; line-height: 1.08; letter-spacing: -.03em;
	margin-bottom: 16px; color: var(--kf-text);
}
.kf-hero h1 .grad {
	background: linear-gradient(90deg, var(--kf-green), var(--kf-gold), var(--kf-pink));
	-webkit-background-clip: text; background-clip: text; color: transparent;
}
.kf-hero p.kf-sub { font-size: clamp(16px, 3vw, 20px); color: var(--kf-muted); max-width: 560px; margin: 0 auto 28px; }
.kf-hero-btns { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.kf-hero-flags { margin-top: 26px; font-size: 30px; letter-spacing: 10px; }

/* ---------- Sektionen ---------- */
.kf-section { padding: 36px 0; }
.kf-section-title {
	text-align: center; font-size: clamp(24px, 5vw, 34px); font-weight: 900;
	letter-spacing: -.02em; margin-bottom: 8px; color: var(--kf-text);
}
.kf-section-sub { text-align: center; color: var(--kf-muted); margin-bottom: 28px; font-size: 15.5px; }

.kf-card {
	background: var(--kf-card);
	border: 1px solid var(--kf-line); border-radius: var(--kf-radius);
	padding: 22px; box-shadow: var(--kf-shadow);
}

/* ---------- Countdown ---------- */
.kf-count-card {
	max-width: 620px; margin: 0 auto; text-align: center;
	border-color: #b5e6c8;
	box-shadow: 0 8px 30px rgba(22, 163, 74, .12);
}
.kf-count-label { font-size: 12.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--kf-gold); margin-bottom: 14px; }
.kf-count-teams { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.kf-count-team { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 90px; }
.kf-count-team .flag { font-size: 46px; line-height: 1; }
.kf-count-team .name { font-size: 14.5px; font-weight: 800; color: var(--kf-text); }
.kf-count-vs { font-size: 18px; font-weight: 900; color: var(--kf-muted); }
.kf-countdown { display: flex; justify-content: center; gap: 10px; }
.kf-count-box { background: var(--kf-card2); border: 1px solid var(--kf-line); border-radius: 14px; padding: 10px 0; width: 72px; }
.kf-count-box b { display: block; font-size: 28px; font-weight: 900; color: var(--kf-green2); font-variant-numeric: tabular-nums; }
.kf-count-box small { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--kf-muted); }
.kf-count-meta { margin-top: 14px; font-size: 13.5px; color: var(--kf-muted); font-weight: 600; }

/* ---------- Nächste Spiele ---------- */
.kf-next-grid { display: grid; gap: 12px; grid-template-columns: 1fr; max-width: 620px; margin: 0 auto; }
.kf-next-match { display: flex; align-items: center; gap: 10px 14px; padding: 16px 18px; flex-wrap: wrap; }
.kf-next-match .teams {
	flex: 1; min-width: 0;
	display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap;
	font-weight: 800; font-size: 15px; color: var(--kf-text);
}
/* Flagge + Name sind eine untrennbare Einheit – bricht nur als Ganzes um. */
.kf-next-match .team { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.kf-next-match .flag { font-size: 26px; line-height: 1; flex-shrink: 0; }
.kf-next-match .tname { line-height: 1.3; }
.kf-next-match .vs { color: var(--kf-muted); font-weight: 700; font-size: 12.5px; flex-shrink: 0; }
.kf-next-match .when { margin-left: auto; text-align: right; font-size: 13px; color: var(--kf-muted); font-weight: 700; white-space: nowrap; }
.kf-next-match .when b { display: block; color: var(--kf-gold); font-size: 14px; }

/* ---------- Top 10 ---------- */
.kf-board { max-width: 620px; margin: 0 auto; padding: 10px 18px; }
.kf-board-row { display: flex; align-items: center; gap: 14px; padding: 12px 4px; border-bottom: 1px solid var(--kf-line); }
.kf-board-row:last-child { border-bottom: none; }
.kf-board-rank { width: 36px; text-align: center; font-weight: 900; font-size: 16px; color: var(--kf-muted); flex-shrink: 0; }
.kf-board-rank.medal { font-size: 23px; }
.kf-board-name { flex: 1; font-weight: 800; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--kf-text); }
.kf-board-pts { font-weight: 900; font-size: 17px; color: var(--kf-green2); white-space: nowrap; }
.kf-board-pts small { color: var(--kf-muted); font-size: 11px; font-weight: 700; }
.kf-board-empty { text-align: center; color: var(--kf-muted); padding: 18px 0; }

/* ---------- Features ---------- */
.kf-features { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.kf-feature { text-align: center; padding: 26px 20px; }
.kf-feature .ico { font-size: 38px; display: block; margin-bottom: 10px; }
.kf-feature h3 { font-size: 17px; font-weight: 900; margin-bottom: 6px; color: var(--kf-text); }
.kf-feature p { font-size: 14.5px; color: var(--kf-muted); }

/* ---------- Schritte ---------- */
.kf-steps { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.kf-step { position: relative; padding: 24px 20px 20px; }
.kf-step .num {
	display: inline-flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; border-radius: 50%;
	background: linear-gradient(135deg, var(--kf-pink), #f59e0b);
	color: #fff; font-weight: 900; font-size: 18px; margin-bottom: 12px;
}
.kf-step h3 { font-size: 16.5px; font-weight: 900; margin-bottom: 6px; color: var(--kf-text); }
.kf-step p { font-size: 14.5px; color: var(--kf-muted); }

/* ---------- CTA-Band ---------- */
.kf-cta-band {
	text-align: center; padding: 48px 22px; margin: 40px 0 0;
	background:
		radial-gradient(500px 200px at 50% 0%, rgba(34, 197, 94, .12), transparent 70%),
		var(--kf-bg2);
	border-top: 1px solid var(--kf-line);
}
.kf-cta-band h2 { font-size: clamp(24px, 5vw, 36px); font-weight: 900; letter-spacing: -.02em; margin-bottom: 10px; color: var(--kf-text); }
.kf-cta-band p { color: var(--kf-muted); margin-bottom: 24px; }

/* ---------- Inhaltsseiten ---------- */
.kf-page { padding: 44px 0 64px; }
.kf-page-title { font-size: clamp(28px, 6vw, 42px); font-weight: 900; letter-spacing: -.02em; text-align: center; margin-bottom: 28px; color: var(--kf-text); }
.kf-content { max-width: 720px; margin: 0 auto; font-size: 16.5px; }
.kf-content h2 { font-size: 24px; font-weight: 900; margin: 32px 0 10px; letter-spacing: -.01em; color: var(--kf-text); }
.kf-content h3 { font-size: 19px; font-weight: 800; margin: 24px 0 8px; color: var(--kf-text); }
.kf-content p, .kf-content ul, .kf-content ol { margin-bottom: 14px; color: #334155; }
.kf-content ul, .kf-content ol { padding-left: 22px; }
.kf-content li { margin-bottom: 6px; }
.kf-content strong { color: var(--kf-text); }

/* ---------- Footer ---------- */
.kf-footer { border-top: 1px solid var(--kf-line); background: var(--kf-bg2); padding: 30px 0 40px; margin-top: 50px; text-align: center; }
.kf-footer-menu ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; margin-bottom: 12px; }
.kf-footer-menu a { color: var(--kf-muted); text-decoration: none; font-size: 14px; font-weight: 700; }
.kf-footer-menu a:hover { color: var(--kf-green2); }
.kf-footer p { color: var(--kf-muted); font-size: 13px; }

/* ---------- Cookie-Hinweis ---------- */
.kf-cookie {
	position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
	z-index: 110; width: calc(100% - 24px); max-width: 680px;
	display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
	background: var(--kf-card); border: 1px solid var(--kf-line);
	border-radius: 16px; padding: 14px 18px;
	box-shadow: 0 12px 36px rgba(15, 23, 42, .18);
	animation: kf-cookie-in .35s ease;
}
/* Wichtig: display:flex wuerde das hidden-Attribut aushebeln – hier explizit ausblenden. */
.kf-cookie[hidden] { display: none !important; }
.kf-cookie.bye { opacity: 0; transform: translateX(-50%) translateY(14px); transition: opacity .25s, transform .25s; }
.kf-cookie-text { flex: 1; min-width: 220px; font-size: 13.5px; color: var(--kf-muted); line-height: 1.5; }
.kf-cookie-text strong { color: var(--kf-text); }
.kf-cookie-text a { color: var(--kf-green2); font-weight: 700; }
.kf-cookie-btn {
	padding: 10px 20px; border-radius: 99px; border: none; cursor: pointer;
	background: linear-gradient(135deg, #22c55e, var(--kf-green2));
	color: #fff; font-weight: 800; font-size: 14px;
	box-shadow: 0 4px 14px rgba(22, 163, 74, .3);
}
@keyframes kf-cookie-in { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }

/* ---------- Animationen ---------- */
@keyframes kf-float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-14px) rotate(2deg); } }
@keyframes kf-float2 { 0%, 100% { transform: translateY(-8px) rotate(3deg); } 50% { transform: translateY(8px) rotate(-3deg); } }
@keyframes kf-gradient { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes kf-pop { 0% { transform: scale(.96); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes kf-pulse { 0%, 100% { box-shadow: 0 8px 24px rgba(22, 163, 74, .35); } 50% { box-shadow: 0 8px 34px rgba(22, 163, 74, .55); } }

/* Scroll-Reveal (wird per JS aktiviert, nur Desktop) */
.kf-reveal { opacity: 0; transform: translateY(26px); transition: opacity .6s ease, transform .6s ease; }
.kf-reveal.kf-visible { opacity: 1; transform: none; }

/* ---------- Desktop ---------- */
@media (min-width: 768px) {
	.kf-header-cta { display: inline-block; }
	.kf-hero { padding: 90px 0 60px; }
	.kf-next-grid { max-width: 720px; }

	/* Hero lebt: schwebendes Logo, wandernder Farbverlauf, schwebende Bälle */
	.kf-hero-logo { animation: kf-float 6s ease-in-out infinite; }
	.kf-hero h1 .grad { background-size: 220% 220%; animation: kf-gradient 6s ease infinite; }
	.kf-hero h1, .kf-hero .kf-sub, .kf-hero-btns, .kf-hero-flags { animation: kf-pop .7s ease both; }
	.kf-hero .kf-sub { animation-delay: .12s; }
	.kf-hero-btns { animation-delay: .24s; }
	.kf-hero-flags { animation-delay: .36s; }
	.kf-hero::before, .kf-hero::after {
		content: '⚽'; position: absolute; font-size: 54px; opacity: .14; pointer-events: none;
	}
	.kf-hero::before { left: 8%; top: 22%; animation: kf-float 7s ease-in-out infinite; }
	.kf-hero::after { content: '🏆'; right: 9%; top: 58%; font-size: 64px; animation: kf-float2 8s ease-in-out infinite; }

	/* Karten und Listen reagieren auf die Maus */
	.kf-card, .kf-feature, .kf-step, .kf-next-match {
		transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
	}
	.kf-card:hover { transform: translateY(-5px); box-shadow: 0 14px 34px rgba(15, 23, 42, .12); border-color: #cbd5e1; }
	.kf-feature:hover .ico, .kf-step:hover .num { transform: scale(1.15) rotate(-4deg); }
	.kf-feature .ico, .kf-step .num { transition: transform .2s ease; }
	.kf-board-row { transition: background .15s ease; }
	.kf-board-row:hover { background: var(--kf-green-soft); }

	/* CTA pulsiert dezent */
	.kf-cta-band .kf-btn, .kf-hero-btns .kf-btn:first-child { animation: kf-pulse 2.6s ease-in-out infinite; }

	/* Countdown-Sekunden ticken sichtbar */
	.kf-count-box b { transition: transform .15s ease; }
	.kf-count-box.tick b { transform: scale(1.18); color: var(--kf-green); }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
	.kf-reveal { opacity: 1; transform: none; }
}
