/* Clumpy: sunny yellow, leafy green, sky blue, berry for levels 1-4. Each row also carries its name, so colour is never the only cue. */
:root { --cl-0: #ffd84d; --cl-1: #8ad46f; --cl-2: #7cc3f5; --cl-3: #b3338a; --cl-ink: #2b2036; --cl-3-ink: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cl-0: #f2c230; --cl-1: #5fbf55; --cl-2: #4aa3e0; --cl-3: #c0479b; --cl-3-ink: #fff; } }
:root[data-theme="dark"] { --cl-0: #f2c230; --cl-1: #5fbf55; --cl-2: #4aa3e0; --cl-3: #c0479b; --cl-3-ink: #fff; }

.cl-how { margin: 0 0 8px; color: var(--muted); font-weight: 600; font-size: .92rem; text-align: center; }
.cl-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.cl-count { color: var(--muted); font-size: .88rem; font-weight: 600; }
.cl-lives { display: flex; gap: 4px; }
.leaf svg { width: 26px; height: 26px; display: block; overflow: visible; }
.leaf .lf { fill: var(--leaf); stroke: var(--leaf-ink); stroke-width: 1.4; stroke-linejoin: round; }
.leaf .vn { fill: none; stroke: var(--leaf-ink); stroke-width: 1.4; stroke-linecap: round; }
.leaf.gone svg { transform: translateY(5px) rotate(40deg); animation: cl-fall .5s ease-in; }
.leaf.gone .lf { fill: transparent; stroke-dasharray: 3 3; opacity: .55; } .leaf.gone .vn { opacity: .3; }
@keyframes cl-fall { from { transform: none; } 40% { transform: translateY(-4px) rotate(-10deg); } to { transform: translateY(5px) rotate(40deg); } }

.cl-solved { display: grid; gap: 6px; margin-bottom: 6px; }
.cl-solved:empty { display: none; }
.cl-row { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 58px; padding: 6px 10px; border-radius: 14px; background: var(--cl-0); color: var(--cl-ink); border: 2px solid rgba(0, 0, 0, .18); }
.cl-row strong { font-size: .95rem; letter-spacing: .02em; text-transform: uppercase; }
.cl-row span { font-size: .85rem; font-weight: 600; overflow-wrap: anywhere; }
.cl-row.lv1 { background: var(--cl-1); } .cl-row.lv2 { background: var(--cl-2); } .cl-row.lv3 { background: var(--cl-3); color: var(--cl-3-ink); border-color: rgba(0, 0, 0, .3); }
.cl-row.missed { border-style: dashed; filter: saturate(.6); }
.cl-row.enter { animation: cl-enter .45s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes cl-enter { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

.cl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cl-grid.shuf .cl-tile { animation: cl-shuf .3s ease-out; }
@keyframes cl-shuf { from { transform: scale(.85) rotate(-4deg); opacity: .4; } to { transform: none; opacity: 1; } }
.cl-tile { position: relative; appearance: none; min-height: 64px; min-width: 0; padding: 2px; display: grid; place-items: center; border-radius: 14px; border: 2px solid var(--edge); background: var(--soft); color: var(--ink); font: 600 14px/1.1 var(--font); text-transform: uppercase; letter-spacing: -.01em; cursor: pointer; box-shadow: 0 3px 0 var(--edge); touch-action: manipulation; user-select: none; -webkit-tap-highlight-color: transparent; transition: background .12s, color .12s, transform .08s; }
.cl-tile span { white-space: nowrap; display: block; max-width: 100%; }
.cl-tile:hover { background: var(--line); }
.cl-tile[aria-pressed="true"] { background: var(--ink); color: var(--card); border-color: var(--ink); box-shadow: 0 3px 0 var(--accent); transform: translateY(-2px); }
.cl-tile[aria-pressed="true"]::after { content: ""; position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--sun); }
.cl-tile:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.cl-tile.pop { animation: cl-pop .22s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes cl-pop { 0% { transform: scale(.9); } 60% { transform: translateY(-3px) scale(1.07); } 100% { transform: translateY(-2px) scale(1); } }
.cl-tile.shake { animation: cl-shake .5s; background: var(--coral); color: #2b2036; border-color: var(--accent-edge); }
@keyframes cl-shake { 0%, 100% { transform: none; } 15%, 55% { transform: translateX(-7px); } 35%, 75% { transform: translateX(7px); } }
.cl-tile.lock { animation: cl-lock .38s ease-in forwards; background: var(--sun); color: #2b2036; border-color: var(--gold-edge); }
@keyframes cl-lock { 0% { transform: translateY(-2px); } 50% { transform: translateY(-10px) scale(1.08); } 100% { transform: scale(.8); opacity: 0; } }

.cl-msg { min-height: 1.6em; margin: 8px 0 4px; text-align: center; font-weight: 700; }
.cl-msg.one { color: var(--ok); } .cl-msg.bad { color: var(--accent); }
.cl-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.cl-actions .btn { flex: 1 1 auto; min-width: 96px; }
.cl-actions .btn.primary { flex: 1.4 1 auto; }
.cl-actions .btn.block { flex: 1 1 100%; }

.cl-final { text-align: center; }
.cl-sum { font-weight: 700; margin: 4px 0 10px; }
.cl-final .cl-solved { text-align: center; margin: 0 0 10px; }
.cl-emoji { display: grid; gap: 0; font-size: 1.25rem; line-height: 1.25; letter-spacing: 2px; margin: 8px 0; }
.cl-emoji span { display: block; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
