/* Koło Fortuny – motywy: nowoczesny (kf-theme-modern) i dziecięcy (kf-theme-kids) */

.kf-app {
	/* Wartości domyślne – nadpisywane z panelu (Koło Fortuny → Wygląd). */
	--kf-bg-1: #15152a; --kf-bg-2: #2a1838; --kf-deco-1: #1d1d38; --kf-deco-2: #2f1b40; --kf-shadow: #0a0a1e;
	--kf-title-1: #ffc400; --kf-title-2: #ff2d55; --kf-text: #f4f4fb; --kf-muted: #b5b5cc; --kf-prize: #ffc400;
	--kf-error: #ff6b81; --kf-success: #2fd18b;
	--kf-accent: #ff2d55; --kf-btn-text: #ffffff; --kf-input-bg: #24243c; --kf-input-border: #4a4a66;
	--kf-chip-bg: #2c2c46; --kf-coupon-bg: #23233a; --kf-coupon-border: #ffc400;
	--kf-rim: #101020; --kf-rim-stroke: #ffc400; --kf-rim-inner: #2b2b44; --kf-sep: #8a8aa3;
	--kf-light-on: #ffe066; --kf-light-off: #5a4a10; --kf-hub-outer: #ffc400; --kf-hub-inner: #15152a; --kf-hub-text: #ffc400;
	--kf-pointer: #ff2d55; --kf-pointer-stroke: #ffffff; --kf-win-outline: #ffffff;
	--kf-card-radius: 20px;
	--kf-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	position: relative;
	max-width: 560px;
	margin: 24px auto;
	font-family: var(--kf-font);
	color: var(--kf-text);
	box-sizing: border-box;
}
.kf-app *, .kf-app *::before, .kf-app *::after { box-sizing: border-box; }
.kf-app [hidden] { display: none !important; }

.kf-theme-kids {
	--kf-bg-1: #fff0f6; --kf-bg-2: #e7f5ff; --kf-deco-1: #fff6d6; --kf-deco-2: #e0f7ff; --kf-shadow: #e3d5ff;
	--kf-title-1: #3d2c5e; --kf-title-2: #3d2c5e; --kf-text: #3d2c5e; --kf-muted: #7b6a99; --kf-prize: #7b61ff;
	--kf-error: #d6336c; --kf-success: #099268;
	--kf-accent: #ff6fa5; --kf-btn-text: #ffffff; --kf-input-bg: #ffffff; --kf-input-border: #d9c8ff;
	--kf-chip-bg: #ffffff; --kf-coupon-bg: #ffffff; --kf-coupon-border: #ff8fab;
	--kf-rim: #ffffff; --kf-rim-stroke: #ff8fab; --kf-rim-inner: #ffffff; --kf-sep: #ffffff;
	--kf-light-on: #ff4d94; --kf-light-off: #ffd6e5; --kf-hub-outer: #ffd166; --kf-hub-inner: #ff8fab; --kf-hub-text: #ffffff;
	--kf-pointer: #7b61ff; --kf-pointer-stroke: #ffffff; --kf-win-outline: #7b61ff;
	--kf-card-radius: 32px;
	--kf-font: "Fredoka", "Baloo 2", "Nunito", "Comic Sans MS", "Chalkboard SE", system-ui, sans-serif;
}

.kf-card {
	position: relative;
	background:
		radial-gradient(circle at 18% 12%, var(--kf-deco-1) 0 17%, transparent 17.5%),
		radial-gradient(circle at 88% 88%, var(--kf-deco-2) 0 21%, transparent 21.5%),
		linear-gradient(160deg, var(--kf-bg-1) 0%, var(--kf-bg-2) 100%);
	border-radius: var(--kf-card-radius);
	padding: 28px 24px 24px;
	text-align: center;
	box-shadow: 0 20px 50px color-mix(in srgb, var(--kf-shadow) 45%, transparent);
	overflow: hidden;
}
.kf-theme-kids .kf-card { box-shadow: 0 14px 0 var(--kf-shadow), 0 24px 40px color-mix(in srgb, var(--kf-shadow) 60%, transparent); border: 4px solid var(--kf-rim); }

.kf-title { margin: 0 0 6px; font-size: clamp(22px, 5vw, 30px); font-weight: 800; line-height: 1.2; letter-spacing: -.01em; background: linear-gradient(90deg, var(--kf-title-1), var(--kf-title-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.kf-theme-modern .kf-title { text-transform: uppercase; }
.kf-subtitle { margin: 0 0 14px; color: var(--kf-muted); font-size: 15px; }

.kf-sound {
	position: absolute; top: 12px; right: 12px; z-index: 2;
	width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
	background: var(--kf-chip-bg); color: var(--kf-text); font-size: 18px; line-height: 38px; padding: 0;
}
.kf-theme-kids .kf-sound { box-shadow: 0 3px 0 var(--kf-shadow); }

/* ---------- koło ---------- */

.kf-stage { position: relative; margin: 0 auto; max-width: 440px; }
.kf-wheel { display: block; width: 100%; height: auto; overflow: visible; user-select: none; -webkit-user-select: none; }

.kf-rim { fill: var(--kf-rim); stroke: var(--kf-rim-stroke); stroke-width: 4; }
.kf-theme-kids .kf-rim { stroke-width: 10; }
.kf-rim-inner { fill: var(--kf-rim-inner); }

.kf-seg-path { stroke: none; transition: opacity .4s ease, filter .4s ease; }
.kf-seg-sep { stroke: var(--kf-sep); stroke-width: 2; }
.kf-theme-kids .kf-seg-sep { stroke-width: 4; stroke-linecap: round; }
.kf-seg-text { font-family: var(--kf-font); font-weight: 800; letter-spacing: .01em; pointer-events: none; paint-order: stroke; }
.kf-theme-modern .kf-seg-text { text-transform: uppercase; }
.kf-seg.kf-dim .kf-seg-path, .kf-seg.kf-dim .kf-seg-text { opacity: .35; }
.kf-win-outline { fill: none; stroke: var(--kf-win-outline); stroke-width: 6; stroke-linejoin: round; animation: kf-pulse 1s ease-in-out infinite; pointer-events: none; }

.kf-light { fill: var(--kf-light-off); animation: kf-blink 1.2s steps(1) infinite; }
.kf-light.kf-odd { animation-direction: reverse; }
.kf-app.is-spinning .kf-light { animation: kf-chase .5s linear infinite; }
.kf-app.is-done .kf-light { animation: kf-blink .35s steps(1) infinite; }

.kf-hub-outer { fill: var(--kf-hub-outer); }
.kf-hub-inner { fill: var(--kf-hub-inner); }
.kf-hub-text { fill: var(--kf-hub-text); font-family: var(--kf-font); font-weight: 900; font-size: 18px; letter-spacing: .08em; pointer-events: none; }
.kf-theme-kids .kf-hub-text { font-size: 36px; }
.kf-app.is-ready .kf-hub { cursor: pointer; }
.kf-app.is-ready .kf-hub-outer { animation: kf-hub 1.2s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }

.kf-pointer { transform-box: fill-box; transform-origin: 50% 12%; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .4)); }
.kf-pointer-body { fill: var(--kf-pointer); stroke: var(--kf-pointer-stroke); stroke-width: 4; }
.kf-pointer-dot { fill: var(--kf-pointer-stroke); }
.kf-pointer.kf-flick { animation: kf-flick .12s ease-out; }

/* ---------- formularz ---------- */

.kf-banner {
	display: inline-block; margin: 6px auto 0; padding: 8px 16px; border-radius: 999px;
	background: var(--kf-chip-bg); font-weight: 700; font-size: 15px;
}
.kf-theme-kids .kf-banner { box-shadow: 0 3px 0 var(--kf-shadow); }

.kf-form { margin-top: 14px; }
.kf-label { display: block; font-size: 13px; font-weight: 700; color: var(--kf-muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .06em; }
.kf-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.kf-input {
	flex: 1 1 200px; max-width: 280px; min-height: 48px; padding: 10px 14px;
	border-radius: 12px; border: 2px solid var(--kf-input-border); background: var(--kf-input-bg);
	color: var(--kf-text); font: 700 18px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	letter-spacing: .12em; text-align: center; text-transform: uppercase; outline: none;
}
.kf-input:focus { border-color: var(--kf-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--kf-accent) 30%, transparent); }

.kf-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 48px; padding: 10px 22px; border: 0; border-radius: 12px; cursor: pointer;
	background: linear-gradient(180deg, var(--kf-accent), color-mix(in srgb, var(--kf-accent) 75%, #000));
	color: var(--kf-btn-text) !important; font: 800 16px/1.2 var(--kf-font); text-decoration: none !important;
	box-shadow: 0 4px 0 color-mix(in srgb, var(--kf-accent) 60%, #000); transition: transform .08s ease, filter .2s;
}
.kf-btn:hover { filter: brightness(1.08); }
.kf-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 color-mix(in srgb, var(--kf-accent) 60%, #000); }
.kf-btn:disabled { opacity: .6; cursor: wait; }
.kf-theme-kids .kf-btn { border-radius: 999px; }
.kf-btn-spin { min-height: 58px; font-size: 20px; padding: 12px 34px; text-transform: uppercase; animation: kf-hub 1.4s ease-in-out infinite; }
.kf-btn-small { min-height: 38px; padding: 6px 14px; font-size: 14px; }
.kf-btn-ghost { background: transparent; color: var(--kf-text) !important; box-shadow: inset 0 0 0 2px var(--kf-input-border); }
.kf-link { background: none; border: 0; color: var(--kf-muted); text-decoration: underline; cursor: pointer; font: inherit; font-size: 14px; margin-top: 10px; padding: 6px; }

.kf-actions { margin-top: 14px; display: flex; flex-direction: column; align-items: center; }
.kf-msg { min-height: 22px; margin-top: 10px; font-size: 15px; font-weight: 600; }
.kf-msg-error { color: var(--kf-error); }
.kf-msg-ok { color: var(--kf-success); }

/* ---------- wynik ---------- */

.kf-result { margin-top: 12px; animation: kf-pop .45s cubic-bezier(.2, 1.4, .4, 1); }
.kf-result-lead { margin: 0; color: var(--kf-muted); font-weight: 700; }
.kf-result-prize { margin: 4px 0 12px; font-size: clamp(24px, 6vw, 34px); font-weight: 900; line-height: 1.15; }
.kf-result-prize { color: var(--kf-prize); }
.kf-theme-modern .kf-result-prize { text-shadow: 0 0 18px color-mix(in srgb, var(--kf-prize) 45%, transparent); }
.kf-result-empty .kf-result-prize { color: var(--kf-text); text-shadow: none; }
.kf-result-text { color: var(--kf-muted); }

.kf-coupon { margin: 0 auto; max-width: 420px; padding: 16px; border: 2px dashed var(--kf-coupon-border); border-radius: 14px; background: var(--kf-coupon-bg); }
.kf-coupon-label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--kf-muted); font-weight: 700; }
.kf-coupon-row { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 8px 0; }
.kf-coupon-code { font: 800 clamp(20px, 5vw, 26px)/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .08em; background: none; color: var(--kf-text); padding: 0; user-select: all; }
.kf-coupon-desc { margin: 6px 0; font-size: 14px; color: var(--kf-muted); }
.kf-coupon-exp { margin: 6px 0 0; font-size: 14px; }
.kf-coupon-status { margin: 8px 0 0; font-weight: 800; color: var(--kf-error); }
.kf-result-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.kf-apply-msg { min-height: 20px; font-size: 14px; font-weight: 600; margin: 10px 0 0; }
.kf-apply-msg a { color: inherit; }

.kf-confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 99999; display: none; }

/* ---------- animacje ---------- */

@keyframes kf-blink { 0% { fill: var(--kf-light-on); } 50% { fill: var(--kf-light-off); } }
@keyframes kf-chase { 0%, 100% { fill: var(--kf-light-off); } 50% { fill: var(--kf-light-on); } }
@keyframes kf-pulse { 0%, 100% { stroke-opacity: 1; } 50% { stroke-opacity: .35; } }
@keyframes kf-hub { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes kf-flick { 0% { transform: rotate(0); } 40% { transform: rotate(-14deg); } 100% { transform: rotate(0); } }
@keyframes kf-pop { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: scale(1); } }

@media (max-width: 480px) {
	.kf-card { padding: 22px 14px 18px; }
	.kf-btn-spin { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
	.kf-app *, .kf-app *::before, .kf-app *::after { animation: none !important; transition: none !important; }
}
