/* Interaktyvios lentos žaidimai: visas ekranas, didelės paspaudimo zonos, šviesus vienas stilius (lentoms ir projektoriams). */
:root { --bg: #fff8ec; --ink: #1c2838; --muted: #5a6779; --accent: #1d6b58; --sun: #f2b53a; --line: #eadfcb; --ok: #bfe8cf; color-scheme: light; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: "Nunito", "Trebuchet MS", system-ui, sans-serif; overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
button { font-family: inherit; }
:focus-visible { outline: 4px solid var(--sun); outline-offset: 3px; }
#game { height: 100%; display: grid; grid-template-rows: auto 1fr; }

.g-bar { display: flex; align-items: center; gap: 1.6vmin; padding: 1.2vmin 2.4vmin; background: #fff; border-bottom: 3px solid var(--line); flex-wrap: wrap; }
.g-bar h1 { font-size: clamp(18px, 3.2vmin, 40px); margin: 0; font-weight: 900; flex: 1; min-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-back, .g-tools button { font-weight: 800; font-size: clamp(14px, 1.9vmin, 22px); border: 2px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: .9vmin 2vmin; text-decoration: none; cursor: pointer; white-space: nowrap; }
.g-back:hover, .g-tools button:hover { border-color: var(--ink); }
.g-tools { display: flex; gap: 1vmin; flex-wrap: wrap; }
.g-progress { display: flex; gap: .8vmin; }
.g-progress span { width: 2.4vmin; height: 2.4vmin; min-width: 12px; min-height: 12px; border-radius: 50%; background: var(--line); transition: background .3s; }
.g-progress span.on { background: var(--sun); }

.g-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4vmin; padding: 3vmin; min-height: 0; }
.gi { width: 100%; height: 100%; display: block; pointer-events: none; }

.answers { display: flex; gap: 5vmin; justify-content: center; flex-wrap: wrap; }
.ans { width: 17vmin; height: 17vmin; min-width: 96px; min-height: 96px; border-radius: 50%; border: .7vmin solid var(--ink); background: #fff; font-weight: 900; font-size: 9vmin; line-height: 1; color: var(--ink); cursor: pointer; display: grid; place-items: center; box-shadow: 0 1.1vmin 0 var(--ink); transition: transform .08s, box-shadow .08s; padding: 0; }
.ans:active { transform: translateY(.7vmin); box-shadow: 0 .4vmin 0 var(--ink); }
.ans.ok { background: var(--ok); }
.ans:disabled:not(.ok) { opacity: .3; }
.ans.pic { border-radius: 3vmin; padding: 2vmin; }

.count-field { display: grid; grid-template-columns: repeat(var(--cols), 15vmin); gap: 2.4vmin; justify-content: center; }
.cf-item { width: 15vmin; height: 15vmin; transform: rotate(var(--rot)); }
.hop { animation: hop .55s ease both; }
@keyframes hop { 50% { transform: translateY(-3.5vmin) rotate(var(--rot)); } }

.memory { display: grid; grid-template-columns: repeat(var(--cols), 19vmin); gap: 2.4vmin; }
.card { width: 19vmin; height: 19vmin; border: 0; background: none; padding: 0; cursor: pointer; position: relative; perspective: 900px; }
.card .back, .card .front { position: absolute; inset: 0; border-radius: 2.6vmin; display: grid; place-items: center; backface-visibility: hidden; transition: transform .35s; border: .6vmin solid var(--ink); }
.card .back { background: repeating-linear-gradient(45deg, #4a9be0 0 2vmin, #63aee9 2vmin 4vmin); }
.card .front { background: #fff; transform: rotateY(180deg); padding: 2.2vmin; }
.card.open .back { transform: rotateY(180deg); }
.card.open .front { transform: rotateY(0); }
.card.done .front { background: #e2f5ea; border-color: #3fa77f; }

.sort-pool { display: flex; flex-wrap: wrap; gap: 2.4vmin; justify-content: center; max-width: 94vw; min-height: 17vmin; }
.token { width: 16vmin; height: 16vmin; border: .5vmin solid transparent; background: #fff; border-radius: 2.6vmin; padding: 1.6vmin; cursor: grab; touch-action: none; box-shadow: 0 .7vmin 1.8vmin rgba(0, 0, 0, .14); }
.token.sel { border-color: var(--sun); transform: scale(1.06); }
.token.drag { position: relative; z-index: 10; cursor: grabbing; box-shadow: 0 2.4vmin 5vmin rgba(0, 0, 0, .28); }
.baskets { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 40vmin)); gap: 5vmin; justify-content: center; width: 100%; }
.basket { border: .7vmin dashed var(--ink); border-radius: 3vmin; min-height: 28vmin; background: #fff; display: grid; grid-template-rows: auto 1fr; padding: 1.6vmin; cursor: pointer; transition: background .15s; }
.basket.hot { background: #fff1c7; border-style: solid; }
.b-label { font-weight: 900; font-size: 5vmin; text-align: center; }
.b-items { display: flex; flex-wrap: wrap; gap: 1vmin; justify-content: center; align-content: flex-start; }
.b-items .token { width: 9vmin; height: 9vmin; padding: .7vmin; box-shadow: none; cursor: default; }

.letter-pic { width: 36vmin; height: 36vmin; }
.letter-word { font-weight: 900; font-size: 8vmin; letter-spacing: .5vmin; min-height: 10vmin; }
.letter-word b { color: #e5533d; }

.seq { display: flex; gap: 2vmin; flex-wrap: wrap; justify-content: center; }
.seq-cell { width: 14vmin; height: 14vmin; border-radius: 2.2vmin; background: #fff; border: .5vmin solid var(--line); padding: 1.6vmin; display: grid; place-items: center; }
.seq-cell.q { border: .7vmin dashed var(--ink); font-weight: 900; font-size: 8vmin; }

.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-1.5vmin); } 40%, 80% { transform: translateX(1.5vmin); } }

.g-overlay { position: fixed; inset: 0; background: rgba(28, 40, 56, .55); display: grid; place-items: center; z-index: 20; padding: 16px; }
.ov-card { background: #fff; border-radius: 4vmin; padding: 5vmin 7vmin; text-align: center; display: grid; gap: 2.6vmin; justify-items: center; max-width: 92vw; }
.ov-card h2 { font-weight: 900; font-size: 7vmin; margin: 0; line-height: 1.1; }
.ov-card p { font-size: 3vmin; margin: 0; color: var(--muted); max-width: 60ch; }
.ov-icons, .ov-stars { display: flex; gap: 2vmin; }
.ov-icons .gi, .ov-stars .gi { width: 15vmin; height: 15vmin; }
.big { font-weight: 900; font-size: 5vmin; padding: 2vmin 8vmin; border-radius: 999px; border: 0; background: var(--accent); color: #fff; cursor: pointer; box-shadow: 0 1.1vmin 0 #0f4236; }
.big:active { transform: translateY(.6vmin); box-shadow: 0 .4vmin 0 #0f4236; }

.spark { position: fixed; width: 16px; height: 16px; border-radius: 50%; pointer-events: none; z-index: 30; animation: spark .85s ease-out forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(.3); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
