/* ComputerLeap Learning blocks. Uses theme colors when available, with safe fallbacks. */
.c4k-island {
	--k-ink: var(--wp--preset--color--ink, #1B1A3A);
	--k-grape: var(--wp--preset--color--grape, #0E7C7B);
	--k-grape-soft: var(--wp--preset--color--grape-soft, #DDF3F1);
	--k-sky: var(--wp--preset--color--sky, #2563EB);
	--k-sky-soft: var(--wp--preset--color--sky-soft, #E3ECFF);
	--k-sun: var(--wp--preset--color--sunshine, #FFC93C);
	--k-sun-soft: var(--wp--preset--color--sunshine-soft, #FFF5D6);
	--k-coral: var(--wp--preset--color--coral, #E04F38);
	--k-coral-soft: var(--wp--preset--color--coral-soft, #FCE7E1);
	--k-mint: var(--wp--preset--color--mint, #12B886);
	--k-mint-soft: var(--wp--preset--color--mint-soft, #DDF8EE);
	--k-line: #E6E4F5;
	--k-display: var(--wp--preset--font-family--display, inherit);
	--k-bounce: cubic-bezier(.34, 1.56, .64, 1);
	font-size: 1rem;
}
.c4k-island h2, .c4k-island h3 { font-family: var(--k-display); margin: 0; font-size: 1.5rem; line-height: 1.15; }
.screen-reader-text { border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; word-wrap: normal !important; }

/* ---------- Shared bits ---------- */
.c4k-btn {
	display: inline-flex;
	align-items: center;
	gap: .4em;
	font: 700 1.05rem/1.2 var(--k-display);
	padding: .75em 1.4em .65em;
	border-radius: 999px;
	border: 3px solid var(--k-ink);
	background: var(--k-grape);
	color: #fff;
	box-shadow: 0 5px 0 var(--k-ink);
	cursor: pointer;
	text-decoration: none;
	transition: transform .2s var(--k-bounce), box-shadow .2s, background .2s;
}
.c4k-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 0 var(--k-ink); color: #fff; }
.c4k-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--k-ink); }
.c4k-btn.is-ghost { background: #fff; color: var(--k-ink); }
.c4k-btn.is-ghost:hover { background: var(--k-grape-soft); color: var(--k-ink); }
.c4k-btn.is-small { font-size: .9rem; padding: .5em 1em .45em; box-shadow: 0 3px 0 var(--k-ink); border-width: 2px; }
.c4k-btn.is-big { font-size: 1.3rem; padding: .9em 1.8em .8em; }
.c4k-btn:disabled { opacity: .6; cursor: wait; }
.c4k-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1rem; }
.c4k-row.is-center { justify-content: center; }
.c4k-hint { color: var(--wp--preset--color--muted, #5B5A7A); font-weight: 600; font-size: .95rem; }
.c4k-progress { height: 14px; border-radius: 999px; background: var(--k-grape-soft); overflow: hidden; border: 2px solid var(--k-ink); flex: 1 1 100%; }
.c4k-progress > span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--k-mint), var(--k-sky)); transition: width .5s var(--k-bounce); }
.c4k-progress.is-big { height: 22px; margin-top: .5rem; }
.c4k-chip-score { font: 800 1rem var(--k-display); background: var(--k-sun-soft); border: 2px solid var(--k-ink); padding: .1em .8em; border-radius: 999px; margin-left: auto; }
.c4k-chip-score:empty { display: none; }
.c4k-game-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }

/* Game shell (quiz, sort, password, checklist) */
.c4k-quiz, .c4k-sort-game, .c4k-password-power, .c4k-checklist {
	background: #fff;
	border: 3px solid var(--k-ink);
	border-radius: 28px;
	box-shadow: 0 8px 0 var(--k-ink);
	padding: clamp(1.25rem, 3vw, 2rem);
	margin-block: 2rem;
}
.c4k-q { font: 800 clamp(1.3rem, 2.4vw, 1.7rem)/1.25 var(--k-display); margin: .25rem 0 1rem; }
.c4k-q-count { font-weight: 800; color: var(--k-grape); text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; margin: 0; }
.c4k-final-emoji { font-size: 4rem; line-height: 1; margin: 0 0 .5rem; animation: c4k-pop .6s var(--k-bounce); }
.c4k-stars-row { font-size: 2rem; letter-spacing: .1em; color: var(--k-sun); }
.c4k-feedback { margin-top: 1rem; display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; }
.c4k-feedback:empty { display: none; }
.c4k-feedback p { margin: 0; padding: .8rem 1.1rem; border-radius: 18px; font-weight: 700; animation: c4k-pop .4s var(--k-bounce); }
.c4k-feedback .is-good { background: var(--k-mint-soft); }
.c4k-feedback .is-oops { background: var(--k-sun-soft); }

/* ---------- Quiz ---------- */
.c4k-options { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.c4k-option {
	display: flex; align-items: center; gap: .75rem;
	text-align: left;
	font: 700 1.05rem/1.3 inherit;
	font-family: inherit;
	padding: .9rem 1rem;
	border-radius: 18px;
	border: 3px solid var(--k-line);
	background: #fff;
	color: var(--k-ink);
	cursor: pointer;
	transition: transform .2s var(--k-bounce), border-color .2s, background .2s;
}
.c4k-option:hover:not(:disabled) { border-color: var(--k-grape); transform: translateY(-3px); background: var(--k-grape-soft); }
.c4k-letter { flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--k-grape-soft); color: var(--k-grape); font-family: var(--k-display); font-weight: 800; }
.c4k-option.is-right { border-color: var(--k-mint); background: var(--k-mint-soft); }
.c4k-option.is-right .c4k-letter { background: var(--k-mint); color: #fff; }
.c4k-option.is-wrong { border-color: var(--k-coral); background: var(--k-coral-soft); animation: c4k-shake .4s; }
.c4k-option:disabled { cursor: default; }

/* ---------- Sorting game ---------- */
.c4k-sort-stage { text-align: center; }
.c4k-sort-stage:focus { outline: none; }
.c4k-sort-intro { padding: 1rem 0; }
.c4k-sort-card {
	max-width: 560px;
	margin: 0 auto 1.25rem;
	padding: 1.75rem 1.5rem;
	border-radius: 24px;
	background: var(--k-sky-soft);
	border: 3px solid var(--k-ink);
	box-shadow: 0 6px 0 var(--k-ink);
	animation: c4k-deal .45s var(--k-bounce);
	transition: transform .5s var(--k-bounce), background .3s;
}
.c4k-sort-text { font: 700 clamp(1.15rem, 2.2vw, 1.45rem)/1.35 var(--k-display); margin: .5rem 0 0; }
.c4k-sort-card.is-right { background: var(--k-mint-soft); }
.c4k-sort-card.is-wrong { background: var(--k-coral-soft); }
.c4k-sort-card.fly-left { transform: rotate(-3deg) translateX(-8px); }
.c4k-sort-card.fly-right { transform: rotate(3deg) translateX(8px); }
.c4k-sort-btns { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.c4k-sort-btn {
	display: flex; flex-direction: column; align-items: center; gap: .2rem;
	min-width: 150px;
	padding: 1rem 1.4rem;
	border-radius: 22px;
	border: 3px solid var(--k-ink);
	box-shadow: 0 6px 0 var(--k-ink);
	font: 800 1.2rem var(--k-display);
	color: var(--k-ink);
	cursor: pointer;
	transition: transform .2s var(--k-bounce), box-shadow .2s;
}
.c4k-sort-btn.is-left { background: var(--k-mint-soft); }
.c4k-sort-btn.is-right { background: var(--k-coral-soft); }
.c4k-sort-btn:hover:not(:disabled) { transform: translateY(-4px) scale(1.03); box-shadow: 0 10px 0 var(--k-ink); }
.c4k-sort-btn:disabled { opacity: .55; cursor: default; }
.c4k-sort-btn.is-right:disabled.is-right, .c4k-sort-btn.is-wrong { opacity: 1; }
.c4k-sort-btn.is-wrong { animation: c4k-shake .4s; }
.c4k-sort-emoji { font-size: 2rem; line-height: 1; }
.c4k-sort-stage .c4k-feedback { align-items: center; }

/* ---------- Password ---------- */
.c4k-pw-row { display: flex; gap: .6rem; align-items: center; }
.c4k-pw-input {
	flex: 1;
	min-width: 0;
	font: 700 1.25rem var(--k-display);
	padding: .8rem 1.1rem;
	border-radius: 18px;
	border: 3px solid var(--k-ink);
	background: var(--k-cloud, #F6F6FD);
}
.c4k-pw-input:focus { outline: 3px solid var(--k-sun); outline-offset: 2px; }
.c4k-pw-meter { height: 20px; margin-top: 1rem; border-radius: 999px; background: var(--k-grape-soft); border: 2px solid var(--k-ink); overflow: hidden; }
.c4k-pw-meter span { display: block; height: 100%; width: 0; transition: width .5s var(--k-bounce), background .3s; }
.c4k-pw-verdict { font: 800 1.4rem var(--k-display); margin: .75rem 0 0; }
.c4k-pw-crack { font-weight: 700; color: var(--wp--preset--color--muted, #5B5A7A); min-height: 1.5em; }
.c4k-pw-rules { list-style: none; padding: 0; display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.c4k-pw-rules li { padding: .55rem .9rem .55rem 2.6rem; border-radius: 14px; background: #F6F6FD; position: relative; font-weight: 600; transition: background .3s; }
.c4k-pw-rules li::before { content: "○"; position: absolute; left: .9rem; font-weight: 900; color: #B9B6D6; }
.c4k-pw-rules li.is-ok { background: var(--k-mint-soft); }
.c4k-pw-rules li.is-ok::before { content: "✓"; color: var(--k-mint); }

/* ---------- Typing ---------- */
.c4k-typing { display: grid; gap: 1rem; }
.c4k-typing-tabs { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }
.c4k-tab {
	font: 700 1rem var(--k-display);
	padding: .55em 1.1em .45em;
	border-radius: 999px;
	border: 2px solid var(--k-ink);
	background: #fff;
	color: var(--k-ink);
	cursor: pointer;
}
.c4k-tab.is-on { background: var(--k-ink); color: #fff; }
.c4k-typing-pad {
	position: relative;
	border-radius: 28px;
	border: 3px solid var(--k-ink);
	box-shadow: 0 8px 0 var(--k-ink);
	background: #fff;
	padding: 2rem 1rem 2.4rem;
	text-align: center;
	cursor: text;
	transition: box-shadow .2s, transform .2s;
}
.c4k-typing-pad.is-focus { box-shadow: 0 8px 0 var(--k-ink), 0 0 0 6px var(--k-sun); }
.c4k-typing-hint { margin: 0 0 1rem; font-weight: 800; color: var(--k-grape); }
.c4k-typing-line { font: 700 clamp(1.6rem, 4.5vw, 2.8rem)/1.3 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .04em; word-break: break-all; }
.c4k-typing-line.is-shake { animation: c4k-shake .3s; }
.c4k-ch { display: inline-block; min-width: .62em; padding: 0 .04em; border-radius: 8px; color: #B9B6D6; transition: color .1s, background .1s; }
.c4k-ch.is-done { color: var(--k-mint); }
.c4k-ch.is-current { color: var(--k-ink); background: var(--k-sun); animation: c4k-blink 1s infinite; }
.c4k-ch.is-space { opacity: .55; }
.c4k-typing-done { font: 800 clamp(1.1rem, 2.5vw, 1.5rem) var(--k-display); color: var(--k-ink); }
.c4k-typing-capture { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; left: 50%; bottom: 0; }
.c4k-typing-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.c4k-typing-stats > div { background: var(--k-sky-soft); border-radius: 18px; padding: .7rem; text-align: center; border: 2px solid var(--k-line); }
.c4k-typing-stats b { display: block; font: 800 1.8rem/1 var(--k-display); }
.c4k-typing-stats small { font-weight: 800; text-transform: uppercase; letter-spacing: .08em; font-size: .7rem; color: var(--wp--preset--color--muted, #5B5A7A); }
.c4k-finger { text-align: center; font: 700 1.15rem var(--k-display); margin: 0; min-height: 1.6em; display: flex; justify-content: center; align-items: center; gap: .5rem; }
.c4k-finger-dot { width: 1rem; height: 1rem; border-radius: 50%; display: inline-block; border: 2px solid var(--k-ink); }
.c4k-kb { display: grid; gap: .4rem; justify-content: center; padding: 1rem; border-radius: 24px; background: var(--k-ink); position: relative; overflow: hidden; }
.c4k-hands { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.c4k-hand-palm { fill: var(--hand); stroke: var(--hand-edge); stroke-width: 1.5; stroke-linejoin: round; }
.c4k-hand-edge, .c4k-hand-skin { fill: none; stroke-linecap: round; }
.c4k-hand-edge { stroke: var(--hand-edge); }
.c4k-hand-edge.is-active { stroke: var(--k-sun); filter: drop-shadow(0 0 5px var(--k-sun)); }
.c4k-hand-skin { stroke: var(--hand); }
.c4k-hand-nail { fill: #fff; opacity: .5; }
.c4k-hand-ring { fill: none; stroke: var(--k-sun); stroke-width: 3; }
.c4k-hand-tones { display: inline-flex; align-items: center; gap: .3rem; }
.c4k-hand-tone { width: 1.7rem; height: 1.7rem; padding: 0; border-radius: 50%; border: 2px solid var(--k-line); cursor: pointer; }
.c4k-hand-tone.is-on { border-color: var(--k-ink); box-shadow: 0 0 0 2px var(--k-sun); }
.c4k-kb-row { display: flex; gap: .4rem; justify-content: center; }
.c4k-kb-row.r1 { padding-left: 1.2rem; }
.c4k-kb-row.r2 { padding-left: 2rem; }
.c4k-kb-row.r3 { padding-left: 3rem; }
.c4k-key {
	width: clamp(1.6rem, 5.5vw, 2.8rem);
	height: clamp(1.6rem, 5.5vw, 2.8rem);
	display: grid; place-items: center;
	border-radius: 10px;
	font: 800 clamp(.7rem, 1.8vw, 1rem) var(--k-display);
	color: var(--k-ink);
	box-shadow: 0 3px 0 rgba(0, 0, 0, .35);
	position: relative;
	transition: transform .1s, box-shadow .1s, outline-color .1s;
}
.c4k-key.is-space { width: min(60vw, 18rem); }
.c4k-key.has-bump::after { content: ""; position: absolute; bottom: 18%; width: 30%; height: 3px; border-radius: 2px; background: currentColor; opacity: .5; }
.c4k-key.is-next { outline: 4px solid #fff; outline-offset: 2px; animation: c4k-pulse 1s infinite; z-index: 1; }
.c4k-key.is-hit { transform: translateY(3px); box-shadow: none; }
.c4k-key.is-miss { background: var(--k-coral) !important; color: #fff; }
.f-lp { background: #FFB3C7; } .f-lr { background: #FFD08A; } .f-lm { background: #FFF08A; } .f-li { background: #A8F0C6; }
.f-ri { background: #9EDCFF; } .f-rm { background: #C5B8FF; } .f-rr { background: #F5B8FF; } .f-rp { background: #FFB8A8; } .f-th { background: #E6E4F5; }

/* ---------- Checklist ---------- */
.c4k-check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.c4k-check-list li { position: relative; }
.c4k-check-list input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.c4k-check-list label {
	display: flex; gap: .85rem; align-items: flex-start;
	padding: .85rem 1rem;
	border-radius: 18px;
	background: #F6F6FD;
	border: 2px solid transparent;
	cursor: pointer;
	font-weight: 600;
	line-height: 1.45;
	transition: background .25s, border-color .25s;
}
.c4k-check-list label:hover { border-color: var(--k-grape); }
.c4k-box {
	flex: none;
	width: 1.7rem; height: 1.7rem;
	border-radius: 9px;
	border: 3px solid var(--k-ink);
	background: #fff;
	display: grid; place-items: center;
	transition: background .2s, transform .3s var(--k-bounce);
}
.c4k-check-list input:checked + label { background: var(--k-mint-soft); }
.c4k-check-list input:checked + label .c4k-box { background: var(--k-mint); transform: scale(1.1) rotate(-6deg); }
.c4k-check-list input:checked + label .c4k-box::after { content: "✓"; color: #fff; font-weight: 900; }
.c4k-check-list input:checked + label span:last-child { text-decoration: line-through; text-decoration-color: rgba(18, 184, 134, .6); text-decoration-thickness: 2px; }
.c4k-check-list input:focus-visible + label { outline: 3px solid var(--k-sun); outline-offset: 2px; }

/* ---------- Tips ---------- */
.c4k-tip-text { font: 700 clamp(1.3rem, 2.6vw, 1.75rem)/1.35 var(--k-display); margin: .5rem 0 0; min-height: 3.5em; }
.c4k-tip-text.is-in { animation: c4k-pop .45s var(--k-bounce); }
.c4k-dots { display: flex; gap: .35rem; margin-left: auto; }
.c4k-dots i { width: .6rem; height: .6rem; border-radius: 50%; background: var(--k-line); transition: background .2s, transform .2s; }
.c4k-dots i.is-on { background: var(--k-grape); transform: scale(1.3); }

/* ---------- Star counter ---------- */
.c4k-star-counter { display: flex; align-items: center; gap: .35rem; }
.c4k-stars-pill {
	display: inline-flex; align-items: center; gap: .3rem;
	padding: .35rem .85rem .3rem;
	border-radius: 999px;
	background: var(--k-sun-soft);
	border: 2px solid var(--k-ink);
	font: 800 1.05rem var(--k-display);
	color: var(--k-ink) !important;
	text-decoration: none !important;
	transition: transform .2s var(--k-bounce);
}
.c4k-stars-pill:hover { transform: scale(1.06) rotate(-2deg); }
.c4k-stars-pill.is-bump { animation: c4k-bump .6s var(--k-bounce); }
.c4k-sound-toggle { border: 0; background: none; font-size: 1.15rem; cursor: pointer; padding: .2rem; border-radius: 50%; }
.c4k-sound-toggle:hover { background: var(--k-grape-soft); }

/* ---------- Read aloud ---------- */
.c4k-read-aloud { margin-top: 1rem; }

/* ---------- Lesson complete ---------- */
.c4k-complete-box {
	margin-top: 2.5rem;
	text-align: center;
	padding: 2rem 1.5rem;
	border-radius: 28px;
	border: 3px dashed var(--k-grape);
	background: var(--k-grape-soft);
}
.c4k-complete-box.is-done { border-style: solid; border-color: var(--k-mint); background: var(--k-mint-soft); }
.c4k-complete-big { font: 800 1.6rem var(--k-display); margin: 0 0 1rem; }
.c4k-complete-msg { font: 700 1.2rem var(--k-display); color: var(--k-grape); }

/* ---------- Level filter ---------- */
.c4k-filter { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: 1.5rem; }
.c4k-filter-btn {
	font: 700 1.05rem var(--k-display);
	padding: .6em 1.2em .5em;
	border-radius: 999px;
	border: 3px solid var(--k-ink);
	background: #fff;
	color: var(--k-ink);
	box-shadow: 0 4px 0 var(--k-ink);
	cursor: pointer;
	transition: transform .2s var(--k-bounce), background .2s;
}
.c4k-filter-btn:hover { transform: translateY(-3px); }
.c4k-filter-btn.is-on { background: var(--k-grape); color: #fff; }
.c4k-filter-note { text-align: center; font-weight: 700; color: var(--wp--preset--color--muted, #5B5A7A); margin: 1rem 0 0; }

/* ---------- Flip cards ---------- */
.c4k-flip-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); margin-block: 1.5rem; }
.c4k-flip { perspective: 900px; border: 0; padding: 0; background: none; cursor: pointer; height: 170px; font: inherit; color: var(--k-ink); }
.c4k-flip-inner { position: relative; display: block; width: 100%; height: 100%; transition: transform .6s var(--k-bounce); transform-style: preserve-3d; }
.c4k-flip.is-flipped .c4k-flip-inner { transform: rotateY(180deg); }
.c4k-flip-front, .c4k-flip-back {
	position: absolute; inset: 0;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem;
	padding: 1rem;
	border-radius: 22px;
	border: 3px solid var(--k-ink);
	box-shadow: 0 6px 0 var(--k-ink);
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
}
.c4k-flip-front b { font: 800 1.45rem var(--k-display); }
.c4k-flip-front small { font-weight: 700; opacity: .6; }
.c4k-flip-back { transform: rotateY(180deg); background: #fff; font-weight: 700; line-height: 1.35; text-align: center; }
.c4k-flip.c0 .c4k-flip-front { background: var(--k-sun-soft); }
.c4k-flip.c1 .c4k-flip-front { background: var(--k-sky-soft); }
.c4k-flip.c2 .c4k-flip-front { background: var(--k-mint-soft); }
.c4k-flip.c3 .c4k-flip-front { background: var(--k-coral-soft); }
.c4k-flip.c4 .c4k-flip-front { background: var(--k-grape-soft); }

/* ---------- My stars ---------- */
.c4k-stars-hero { display: grid; grid-template-columns: auto 1fr; gap: 2rem; align-items: center; padding: 2rem; border-radius: 32px; background: var(--k-ink); color: #fff; }
.c4k-stars-big { display: grid; place-items: center; width: 200px; height: 200px; border-radius: 50%; background: var(--k-sun); color: var(--k-ink); border: 6px solid #fff; text-align: center; align-content: center; gap: 0; }
.c4k-stars-big span { font-size: 2.2rem; line-height: 1; animation: c4k-spin 6s linear infinite; }
.c4k-stars-big b { font: 800 4rem/1 var(--k-display); }
.c4k-stars-big small { font-weight: 800; text-transform: uppercase; font-size: .75rem; letter-spacing: .06em; }
.c4k-stars-next .c4k-q { color: #fff; }
.c4k-my-stars > h2, .c4k-my-stars > h3 { margin: 2.5rem 0 1rem; }
.c4k-badges { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.c4k-badge { display: flex; flex-direction: column; align-items: center; gap: .2rem; padding: 1.2rem .8rem; border-radius: 24px; background: #F6F6FD; border: 3px dashed #D6D3EE; text-align: center; filter: grayscale(1); }
.c4k-badge:not(.is-got) b, .c4k-badge:not(.is-got) small { color: #4A4866; }
.c4k-badge.is-got { filter: none; opacity: 1; background: var(--k-sun-soft); border: 3px solid var(--k-ink); box-shadow: 0 5px 0 var(--k-ink); }
.c4k-badge-emoji { font-size: 2.6rem; line-height: 1.1; }
.c4k-badge small { color: var(--wp--preset--color--muted, #5B5A7A); font-weight: 700; }
.c4k-done-list { list-style: none; padding: 0; display: grid; gap: .5rem; }
.c4k-done-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .8rem 1.1rem; border-radius: 16px; background: var(--k-mint-soft); font-weight: 700; }
.c4k-done-list li::before { content: "✅"; }
.c4k-done-list a { flex: 1; color: var(--k-ink); }
@media (max-width: 640px) {
	.c4k-stars-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
	.c4k-typing-stats { grid-template-columns: repeat(2, 1fr); }
	.c4k-kb { padding: .6rem; gap: .25rem; }
	.c4k-kb-row { gap: .25rem; }
	.c4k-kb-row.r1, .c4k-kb-row.r2, .c4k-kb-row.r3 { padding-left: 0; }
}

/* ---------- Forms ---------- */
.c4k-form form { display: grid; gap: .25rem; }
.c4k-field-row { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.c4k-field { margin: 0 0 .9rem; display: grid; gap: .35rem; min-width: 0; }
.c4k-field label { font-weight: 800; font-size: .95rem; }
.c4k-field label span { color: var(--k-coral); }
.c4k-field input, .c4k-field select, .c4k-field textarea {
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	font: inherit;
	padding: .8rem 1rem;
	border-radius: 16px;
	border: 2px solid var(--k-line);
	background: #F6F6FD;
	color: var(--k-ink);
	transition: border-color .2s, background .2s, box-shadow .2s;
}
.c4k-field input:focus, .c4k-field select:focus, .c4k-field textarea:focus { outline: none; border-color: var(--k-grape); background: #fff; box-shadow: 0 0 0 4px var(--k-grape-soft); }
.c4k-form .wp-block-button__link { border: 0; cursor: pointer; font-size: 1.1rem; }
.c4k-turnstile { min-height: 65px; margin: .25rem 0 .75rem; }
.c4k-form-note { font-size: .85rem; color: var(--wp--preset--color--muted, #5B5A7A); margin: .75rem 0 0; }
.c4k-form-error { background: var(--k-coral-soft); padding: .75rem 1rem; border-radius: 14px; font-weight: 700; margin: 0 0 .75rem; }
.c4k-form-success { background: var(--k-mint-soft); border: 3px solid var(--k-mint); padding: 1.5rem; border-radius: 22px; font: 700 1.25rem/1.4 var(--k-display); text-align: center; animation: c4k-pop .5s var(--k-bounce); }
.c4k-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Keyframes ---------- */
@keyframes c4k-pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes c4k-deal { from { opacity: 0; transform: translateY(30px) rotate(-4deg) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes c4k-shake { 0%, 100% { translate: 0; } 20% { translate: -8px; } 40% { translate: 7px; } 60% { translate: -5px; } 80% { translate: 3px; } }
@keyframes c4k-blink { 50% { background: #FFE08A; } }
@keyframes c4k-pulse { 50% { transform: scale(1.12); } }
@keyframes c4k-bump { 30% { transform: scale(1.35) rotate(-6deg); } }
@keyframes c4k-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
	.c4k-island *, .c4k-island { animation: none !important; transition: none !important; }
}

/* ---------- Coding: playground, puzzles, quiz code ---------- */
.c4k-code-playground, .c4k-code-puzzle {
	background: #fff;
	border: 3px solid var(--k-ink);
	border-radius: 28px;
	box-shadow: 0 8px 0 var(--k-ink);
	padding: clamp(1.25rem, 3vw, 2rem);
	margin-block: 2rem;
}
.c4k-code-input, .c4k-play-inputs {
	width: 100%;
	box-sizing: border-box;
	font: 600 1rem/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	tab-size: 4;
	padding: 1rem 1.1rem;
	border-radius: 18px;
	border: 3px solid var(--k-ink);
	background: #1E1D40;
	color: #EAF7F6;
	caret-color: var(--k-sun);
	resize: vertical;
	white-space: pre;
	overflow-x: auto;
}
.c4k-play-inputs { background: #F6F6FD; color: var(--k-ink); border-width: 2px; font-size: .95rem; }
.c4k-code-input:focus, .c4k-play-inputs:focus { outline: 3px solid var(--k-sun); outline-offset: 2px; }
.c4k-play-label { font-weight: 800; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--wp--preset--color--muted, #5B5A7A); margin: 1rem 0 .4rem; display: block; }
.c4k-console {
	min-height: 3.2em;
	margin: 0;
	padding: .9rem 1.1rem;
	border-radius: 18px;
	background: #0F0E26;
	color: #7CF2C2;
	font: 600 .98rem/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
	white-space: pre-wrap;
	word-break: break-word;
}
.c4k-console:empty::before { content: "Press ▶ Run to see what your code does!"; color: #6E6C9A; }
.c4k-play-status { white-space: pre-line; font-weight: 700; margin: .75rem 0 0; padding: 0; border-radius: 16px; }
.c4k-play-status:empty { display: none; }
.c4k-play-status.is-good, .c4k-play-status.is-oops { padding: .8rem 1.1rem; }
.c4k-play-status.is-good { background: var(--k-mint-soft); }
.c4k-play-status.is-oops { background: var(--k-sun-soft); }
.c4k-lang-python { background: #E3ECFF !important; }
.c4k-lang-java { background: #FCE7E1 !important; }
.c4k-lang-csharp, .c4k-lang-c\# { background: #DDF3F1 !important; }
.c4k-q-code { background: #1E1D40; color: #EAF7F6; padding: .9rem 1.1rem; border-radius: 16px; font: 600 .98rem/1.55 ui-monospace, Menlo, Consolas, monospace; white-space: pre; overflow-x: auto; margin: 0 0 1rem; }

.c4k-puzzle { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 700px) { .c4k-puzzle { grid-template-columns: 1fr; } }
.c4k-puzzle-pool, .c4k-puzzle-prog { min-height: 7rem; padding: .75rem; border-radius: 18px; background: #F6F6FD; border: 2px dashed #D6D3EE; display: flex; flex-direction: column; gap: .5rem; margin: 0; }
.c4k-puzzle-prog { background: #1E1D40; border: 3px solid var(--k-ink); list-style: none; counter-reset: ln; }
.c4k-puzzle-prog li { counter-increment: ln; display: flex; gap: .5rem; align-items: center; border-radius: 12px; }
.c4k-puzzle-prog li::before { content: counter(ln); color: #6E6C9A; font: 700 .8rem ui-monospace, Menlo, monospace; min-width: 1.4rem; text-align: right; }
.c4k-puzzle-prog li.c4k-puzzle-empty { color: #8F8DB8; font-weight: 600; }
.c4k-puzzle-prog li.c4k-puzzle-empty::before { content: ""; }
.c4k-puzzle-prog li.is-wrong .c4k-piece { outline: 3px solid var(--k-coral); animation: c4k-shake .4s; }
.c4k-piece {
	text-align: left;
	width: 100%;
	padding: .55rem .8rem;
	border-radius: 12px;
	border: 2px solid var(--k-ink);
	background: #fff;
	box-shadow: 0 3px 0 var(--k-ink);
	cursor: pointer;
	transition: transform .15s var(--k-bounce);
}
.c4k-piece:hover { transform: translateX(4px); }
.c4k-piece code { font: 600 .95rem/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre; color: var(--k-ink); }
.c4k-piece.in-prog { background: #2B2A55; border-color: #4A48A0; box-shadow: none; }
.c4k-piece.in-prog code { color: #EAF7F6; }

/* ---------- Courses ---------- */
.c4k-course-head { display: grid; grid-template-columns: auto 1fr; gap: clamp(1rem, 3vw, 2rem); align-items: center; }
.c4k-course-emoji { display: grid; place-items: center; width: clamp(5rem, 12vw, 8rem); height: clamp(5rem, 12vw, 8rem); margin: 0; font-size: clamp(2.6rem, 6vw, 4.2rem); background: #fff; border: 4px solid var(--k-ink); border-radius: 32px; box-shadow: 0 7px 0 var(--k-ink); transform: rotate(-4deg); }
.c4k-course-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.c4k-course-chips .c4k-chip-score { margin: 0; font-size: .85rem; background: #fff; }
.c4k-course-title { font-family: var(--k-display); font-size: var(--wp--preset--font-size--jumbo, 3.5rem); line-height: 1.05; margin: .5rem 0; }
.c4k-course-desc { font-size: 1.2rem; margin: 0 0 1rem; }
.c4k-course-count { font-weight: 800; margin: 0 0 .4rem; }
.c4k-course-head .c4k-progress { max-width: 520px; }
@media (max-width: 600px) { .c4k-course-head { grid-template-columns: 1fr; } }

.c4k-course-level { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem 1rem; margin: 2.5rem 0 1rem; }
.c4k-course-level:first-child { margin-top: 0; }
.c4k-course-level h3 { font-size: 1.8rem; margin: 0; }
.c4k-cg { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); }
.c4k-course-card {
	display: flex;
	flex-direction: column;
	gap: .5rem;
	padding: 1.4rem;
	border-radius: 28px;
	border: 3px solid var(--k-ink);
	box-shadow: 0 7px 0 var(--k-ink);
	color: var(--k-ink) !important;
	text-decoration: none !important;
	transition: transform .25s var(--k-bounce), box-shadow .25s var(--k-bounce);
}
.c4k-course-card:hover { transform: translateY(-6px) rotate(-.6deg); box-shadow: 0 13px 0 var(--k-ink); }
.c4k-course-card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.c4k-course-card-top .c4k-chip-score { margin: 0; }
.c4k-course-card-emoji { font-size: 2.4rem; width: 4rem; height: 4rem; display: grid; place-items: center; background: #fff; border: 3px solid var(--k-ink); border-radius: 20px; transform: rotate(-4deg); }
.c4k-course-card-title { font: 800 1.45rem/1.15 var(--k-display); margin-top: .3rem; }
.c4k-course-card-desc { font-size: .95rem; line-height: 1.45; flex: 1; }
.c4k-course-card-meta { font-weight: 800; font-size: .85rem; color: var(--wp--preset--color--muted, #5B5A7A); }
.c4k-course-card .c4k-progress { flex: none; background: #fff; }
.c4k-course-card-go { font: 800 1rem var(--k-display); }

/* ---------- Language picker ---------- */
.c4k-translate { position: relative; }
.c4k-lang-btn {
	display: inline-flex; align-items: center; gap: .3rem;
	padding: .35rem .7rem .3rem;
	border-radius: 999px;
	border: 2px solid var(--k-ink);
	background: #fff;
	color: var(--k-ink);
	font: 800 .95rem var(--k-display);
	cursor: pointer;
	transition: transform .2s var(--k-bounce);
}
.c4k-lang-btn:hover { transform: scale(1.06); background: var(--k-grape-soft); }
.c4k-lang-list {
	position: absolute; right: 0; top: calc(100% + 10px); z-index: 80;
	width: 230px; max-height: 70vh; overflow-y: auto;
	margin: 0; padding: .5rem; list-style: none;
	background: #fff; border: 3px solid var(--k-ink); border-radius: 22px;
	box-shadow: 0 6px 0 var(--k-ink), 0 20px 40px -20px rgba(27, 26, 58, .35);
	display: grid; grid-template-columns: 1fr 1fr; gap: .15rem;
}
.c4k-lang-list[hidden] { display: none; }
.c4k-lang-list button { width: 100%; text-align: left; border: 0; background: none; padding: .45rem .6rem; border-radius: 12px; font: 700 .9rem var(--wp--preset--font-family--body, inherit); color: var(--k-ink); cursor: pointer; }
.c4k-lang-list button:hover, .c4k-lang-list button.is-on { background: var(--k-grape-soft); color: var(--k-grape); }
.c4k-lang-note { grid-column: 1 / -1; font-size: .72rem; color: var(--wp--preset--color--muted, #5B5A7A); padding: .4rem .6rem 0; line-height: 1.3; }
/* Hide Google's own toolbar and hover popups; our picker replaces them. */
body { top: 0 !important; position: static !important; }
.goog-te-banner-frame, iframe.skiptranslate, .VIpgJd-ZVi9od-ORHb-OEVmcd, .VIpgJd-ZVi9od-aZ2wEe-wOHMyf, #goog-gt-tt, .goog-te-balloon-frame { display: none !important; visibility: hidden !important; }
.goog-text-highlight, font[style*="background-color"] { background: none !important; box-shadow: none !important; }
/* Reserve space while the dashboard loads so the page doesn't jump. */
.c4k-my-stars:not(.is-ready) { min-height: 720px; }
.c4k-course-grid:not(.is-ready) { min-height: 600px; }

/* Course list: the same pill and display type as the rest of the site. */
.c4k-course-level { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem .9rem; margin: 2rem 0 1rem; }
.c4k-course-level h3 { margin: 0; font: 800 clamp(1.5rem, 2.6vw, 2rem)/1.1 var(--k-display); }
.c4k-course-level .c4k-hint { font-weight: 800; color: var(--wp--preset--color--muted, #5B5A7A); }
.c4k-course-card-go { align-self: flex-start; background: #fff; border: 2px solid var(--k-ink); border-radius: 999px; padding: .3em .9em; box-shadow: 0 4px 0 var(--k-ink); }
.c4k-course-card { border: 3px solid var(--k-ink); border-radius: 26px; box-shadow: 0 8px 0 var(--k-ink); }

