:root {
  --pozadi: #fff4e0;
  --inkoust: #3b2a1a;
  --sedy: #7a6a58;
  --oranzova: #ffb347;
  --zelena: #5cc46a;
  --modra: #57a8ff;
  --ruzova: #ff8fb1;
  --fialova: #a98bff;
  --pismo: ui-rounded, "Arial Rounded MT Bold", "Nunito", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 17px/1.45 var(--pismo); color: var(--inkoust); background: var(--pozadi);
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; touch-action: manipulation; overflow: hidden;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 4px solid var(--modra); outline-offset: 3px; }

.pohled { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; }

/* úvod */
#v-domu {
  justify-content: center; gap: clamp(14px, 3vh, 30px); padding: 20px;
  background: radial-gradient(circle at 20% 15%, #ffe2b8 0 18%, transparent 19%), radial-gradient(circle at 85% 80%, #ffd6e4 0 16%, transparent 17%), var(--pozadi);
}
.nadpis { margin: 0; font-size: clamp(30px, 7vw, 56px); text-align: center; color: #e2762b; letter-spacing: .01em; text-shadow: 0 3px 0 #fff; }
.volba { display: flex; gap: clamp(14px, 3vw, 30px); flex-wrap: wrap; justify-content: center; max-width: 1100px; }
.dlazdice-hry {
  width: min(40vw, 24vh, 210px); aspect-ratio: 1; border: 0; border-radius: 30px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 10px 0 rgba(0, 0, 0, .12), 0 16px 30px rgba(120, 60, 0, .18); transition: transform .12s;
}
.dlazdice-hry:active { transform: translateY(6px) scale(.98); box-shadow: 0 4px 0 rgba(0, 0, 0, .12); }
.dlazdice-hry.pexeso { background: var(--modra); }
.dlazdice-hry.puzzle { background: var(--zelena); }
.dlazdice-hry.pocitani { background: var(--ruzova); }
.dlazdice-hry.pismenka { background: var(--fialova); }
.dlazdice-hry.album { background: var(--oranzova); }
.obr-text { color: #fff; font-weight: 900; font-size: clamp(34px, 7vh, 64px); line-height: 1; text-shadow: 0 4px 0 rgba(0, 0, 0, .15); }
.popis { color: #fff; font-weight: 800; font-size: clamp(18px, 3.4vw, 28px); text-shadow: 0 2px 0 rgba(0, 0, 0, .15); }
.obr-pexeso, .obr-puzzle { display: grid; grid-template-columns: 1fr 1fr; gap: 8%; width: 58%; aspect-ratio: 1; }
.obr-pexeso i { border-radius: 16%; background: #fff; box-shadow: inset 0 0 0 5px #ffd36b; }
.obr-pexeso i:nth-child(2), .obr-pexeso i:nth-child(3) { background: #ffd36b; box-shadow: inset 0 0 0 5px #fff; }
.obr-puzzle i { border-radius: 14%; background: #fff3b0; }
.obr-puzzle i:nth-child(2) { background: #ff9f7a; }
.obr-puzzle i:nth-child(3) { background: #8fd1ff; }
.obr-puzzle i.volny { background: transparent; border: 5px dashed rgba(255, 255, 255, .8); transform: translate(18%, 18%) rotate(8deg); }
.rodice {
  border: 2px dashed #e0c9a6; background: transparent; border-radius: 999px; padding: 8px 18px; color: var(--sedy); font-size: 14px;
  position: relative; overflow: hidden;
}
.rodice::after { content: ""; position: absolute; inset: 0; background: rgba(226, 118, 43, .2); transform: scaleX(0); transform-origin: left; }
.rodice.drzi::after { transform: scaleX(1); transition: transform 1.2s linear; }
.pata { position: absolute; bottom: calc(10px + env(safe-area-inset-bottom)); font-size: 12px; color: var(--sedy); }
.pata a { color: inherit; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.itl { display: inline-grid; place-items: center; height: 18px; padding: 0 5px; border-radius: 5px; background: #f0dfc4; color: #15171a; font: 700 11px/1 system-ui, sans-serif; letter-spacing: .04em; }

/* hra */
.domecek {
  position: absolute; top: calc(10px + env(safe-area-inset-top)); left: calc(10px + env(safe-area-inset-left)); z-index: 20;
  width: 58px; height: 58px; border-radius: 50%; border: 0; background: #fff; font-size: 28px; box-shadow: 0 4px 0 rgba(0, 0, 0, .1);
}
.plocha { position: absolute; inset: 0; padding: 78px 12px 12px; }

/* pexeso */
.pexeso-mrizka { display: grid; gap: var(--mezera); justify-content: center; align-content: center; height: 100%; }
.karta {
  width: var(--velikost); height: var(--velikost); border: 0; padding: 0; background: none; perspective: 900px;
}
.karta-vnitrek { display: block; position: relative; width: 100%; height: 100%; transition: transform .45s; transform-style: preserve-3d; }
.karta.otocena .karta-vnitrek, .karta.hotova .karta-vnitrek { transform: rotateY(180deg); }
.strana { display: block; position: absolute; inset: 0; border-radius: 18%; backface-visibility: hidden; overflow: hidden; box-shadow: 0 5px 0 rgba(0, 0, 0, .1); }
.rub {
  background: var(--fialova);
  background-image: radial-gradient(circle at 50% 50%, #ffd36b 0 18%, transparent 19%), radial-gradient(circle at 20% 20%, rgba(255, 255, 255, .35) 0 9%, transparent 10%), radial-gradient(circle at 80% 78%, rgba(255, 255, 255, .35) 0 9%, transparent 10%);
  border: 5px solid #fff;
}
.lic { transform: rotateY(180deg); background: #fff; border: 5px solid #fff; }
.lic img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 14%; }
.karta.hotova .lic { animation: radost .6s .45s; box-shadow: 0 0 0 5px var(--zelena), 0 5px 0 rgba(0, 0, 0, .1); }
@keyframes radost { 30% { transform: rotateY(180deg) scale(1.12); } 60% { transform: rotateY(180deg) scale(.96); } }

/* puzzle */
.deska-puzzle { position: absolute; border-radius: 16px; background-color: #fff; box-shadow: 0 0 0 6px #fff, 0 8px 22px rgba(120, 60, 0, .15); overflow: hidden; }
.deska-puzzle .stin-obrazku { position: absolute; inset: 0; background-size: 100% 100%; opacity: .22; filter: grayscale(.4); }
.deska-puzzle .policko { position: absolute; border: 2px dashed rgba(59, 42, 26, .25); }
.dilek {
  position: absolute; border-radius: 12px; box-shadow: 0 6px 0 rgba(0, 0, 0, .14), 0 0 0 4px #fff; touch-action: none; cursor: grab;
  transition: box-shadow .15s, transform .15s;
}
.dilek.drzim { transform: scale(1.06); box-shadow: 0 14px 20px rgba(0, 0, 0, .25), 0 0 0 4px #fff; cursor: grabbing; transition: none; }
.dilek.zpet { transition: left .35s, top .35s; }
.dilek.hotovy { box-shadow: none; border-radius: 0; cursor: default; transition: left .15s, top .15s, border-radius .3s; pointer-events: none; }

/* oslava */
.oslava { position: fixed; inset: 0; z-index: 50; background: rgba(255, 244, 224, .82); display: grid; place-items: center; animation: objev .3s; }
@keyframes objev { from { opacity: 0; } }
.oslava-obsah { display: flex; flex-direction: column; align-items: center; gap: 10px; position: relative; z-index: 2; }
.oslava-obsah img { width: min(56vw, 46vh, 320px); aspect-ratio: 1; object-fit: cover; border-radius: 28px; border: 8px solid #fff; box-shadow: 0 12px 30px rgba(120, 60, 0, .25); animation: skok 1s ease-in-out infinite alternate; }
@keyframes skok { to { transform: translateY(-10px) rotate(2deg); } }
.hura { margin: 0; text-align: center; max-width: 92vw; font-size: clamp(32px, 7vw, 64px); font-weight: 800; color: #e2762b; text-shadow: 0 4px 0 #fff; }
.oslava-tlacitka { display: flex; gap: 22px; }
.kulate { width: 86px; height: 86px; border-radius: 50%; border: 0; background: #fff; font-size: 40px; box-shadow: 0 6px 0 rgba(0, 0, 0, .12); }
.kulate.zelene { background: var(--zelena); color: #fff; font-weight: 800; }
.ohnostroj { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.ohnostroj span { position: absolute; bottom: -60px; font-size: 40px; animation: let 2.6s ease-out forwards; }
@keyframes let { to { transform: translate(var(--dx), -110vh) rotate(var(--rot)); opacity: .9; } }

/* nastavení */
.dialog { border: 0; border-radius: 22px; padding: 20px; width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: #fffaf2; color: var(--inkoust); user-select: text; }
.dialog::backdrop { background: rgba(59, 42, 26, .45); }
.dialog h2 { margin: 0 0 6px; font-size: 26px; }
.dialog h3 { margin: 18px 0 4px; font-size: 19px; }
.pole { display: grid; gap: 4px; margin: 12px 0; font-weight: 700; font-size: 15px; }
.pole textarea { font: inherit; font-weight: 400; padding: 8px 10px; border-radius: 12px; border: 1px solid #ead8bd; background: #fff; resize: vertical; }
.pole select, .pole input[type=range] { font: inherit; font-weight: 400; padding: 8px 10px; border-radius: 12px; border: 1px solid #ead8bd; background: #fff; min-height: 44px; }
.pole output { font-weight: 400; color: var(--sedy); }
.prepinac { display: flex; gap: 10px; align-items: center; margin: 12px 0; }
.prepinac input { width: 22px; height: 22px; accent-color: var(--zelena); }
.pozn { color: var(--sedy); font-size: 14px; margin: 4px 0 10px; }
.fotky { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 10px; }
.fotka { display: grid; gap: 4px; }
.fotka img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.fotka input { font: inherit; font-size: 14px; width: 100%; padding: 5px 7px; border-radius: 8px; border: 1px solid #ead8bd; }
.fotka button { border: 0; background: #f6dcdc; color: #8c2323; border-radius: 8px; padding: 4px; font-size: 13px; }
.btn { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; padding: 10px 18px; min-height: 46px; background: var(--zelena); color: #fff; font-weight: 700; cursor: pointer; }
.btn.vedlejsi { background: #f0e3cf; color: var(--inkoust); }
.akce { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

@media (prefers-reduced-motion: reduce) {
  .karta-vnitrek, .dilek { transition: none !important; }
  .oslava-obsah img, .ohnostroj span { animation: none !important; }
}

/* úkoly (počítání, písmenka) */
.ukol { display: flex; flex-direction: column; height: 100%; gap: 12px; }
.ukol-hlava { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 64px; margin-top: -66px; padding-left: 70px; }
.otazka { margin: 0; font-size: clamp(22px, 4.6vw, 34px); font-weight: 800; text-align: center; }
.hvezdy { font-size: 26px; letter-spacing: 2px; color: #f2b632; white-space: nowrap; }
.hvezdy .ne { color: #e8d9bf; }
.predmety { position: relative; flex: 1; min-height: 140px; }
.predmet { position: absolute; transform: translate(-50%, -50%); border: 0; background: none; padding: 0; line-height: 1; transition: transform .2s; filter: drop-shadow(0 4px 0 rgba(0,0,0,.08)); }
.predmet.spocitano { transform: translate(-50%, -50%) scale(.82); filter: drop-shadow(0 0 0 transparent); opacity: .55; }
.predmet .cislo-predmetu { position: absolute; right: -6px; top: -6px; background: var(--zelena); color: #fff; font-size: 18px; font-weight: 800; border-radius: 999px; min-width: 28px; height: 28px; display: grid; place-items: center; }
.predmet.zvyrazni { transform: translate(-50%, -50%) scale(1.25); opacity: 1; }
.predmety.radost .predmet { animation: poskok .6s ease-in-out 2; }
@keyframes poskok { 50% { transform: translate(-50%, -70%); } }
.cisla { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; max-width: 640px; width: 100%; margin: 0 auto; }
.cislo, .pismeno {
  border: 0; border-radius: 22px; background: #fff; font-weight: 900; color: var(--inkoust);
  box-shadow: 0 6px 0 rgba(0, 0, 0, .1); transition: transform .1s;
}
.cislo { font-size: clamp(30px, 7vw, 48px); aspect-ratio: 1.15; }
.cislo:active, .pismeno:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, .1); }
.cislo.spatne, .pismeno.spatne { animation: zavrteni .5s; background: #ffe1e1; }
.cislo.dobre, .pismeno.dobre { background: var(--zelena); color: #fff; }
@keyframes zavrteni { 20%, 60% { transform: rotate(-8deg); } 40%, 80% { transform: rotate(8deg); } }
.pismena { display: flex; justify-content: center; gap: clamp(10px, 3vw, 24px); flex-wrap: wrap; padding-bottom: 8px; }
.pismeno { width: clamp(78px, 20vw, 130px); aspect-ratio: 1; font-size: clamp(44px, 11vw, 76px); }
.pismeno:nth-child(4n+1) { color: #2f62c9; } .pismeno:nth-child(4n+2) { color: #cf3e45; } .pismeno:nth-child(4n+3) { color: #2e8a55; } .pismeno:nth-child(4n+4) { color: #b5562b; }
.vzor { display: grid; place-items: center; width: clamp(70px, 16vw, 100px); aspect-ratio: 1; border-radius: 22px; background: #fff; border: 4px dashed var(--fialova); font-size: clamp(44px, 10vw, 66px); font-weight: 900; color: var(--fialova); }
.obrazek-ukolu { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 0; }
.obrazek-ukolu img { height: min(100%, 40vh); max-width: 80vw; aspect-ratio: 1; border-radius: 26px; border: 6px solid #fff; box-shadow: 0 8px 20px rgba(120, 60, 0, .15); min-height: 0; }
.slovo { font-size: clamp(30px, 7vw, 48px); font-weight: 900; letter-spacing: .12em; }
.slovo b { color: var(--fialova); }
.slovo .skryte { color: transparent; border-bottom: 5px solid var(--fialova); }
.jmeno-sloty { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: auto 0; }
.slot { width: clamp(52px, 13vw, 92px); aspect-ratio: .9; border-radius: 16px; border: 4px dashed #d9c6a6; display: grid; place-items: center; font-size: clamp(34px, 8vw, 60px); font-weight: 900; background: #fffaf2; }
.slot.plny { border-style: solid; border-color: var(--zelena); background: #fff; color: var(--zelena); animation: pop .3s; }
@keyframes pop { 50% { transform: scale(1.15); } }

/* nálepky */
.nova-nalepka { display: flex; flex-direction: column; align-items: center; background: #fff; border-radius: 24px; padding: 10px 22px; box-shadow: 0 6px 0 rgba(0,0,0,.08); animation: prilet .7s cubic-bezier(.2, 1.6, .4, 1); }
.nova-nalepka span { font-size: 64px; line-height: 1.1; }
.nova-nalepka small { font-weight: 800; color: var(--sedy); }
@keyframes prilet { from { transform: scale(0) rotate(-30deg); } }
.album-strana { display: flex; flex-direction: column; height: 100%; gap: 12px; }
.album-strana .otazka small { font-size: 16px; color: var(--sedy); font-weight: 700; margin-left: 8px; }
.album-svitek { flex: 1; overflow-y: auto; padding: 4px 4px 20px; }
.album-mrizka { display: grid; grid-template-columns: repeat(auto-fill, minmax(clamp(74px, 18vw, 110px), 1fr)); gap: 12px; }
.nalepka {
  position: relative; aspect-ratio: 1; border-radius: 22px; border: 0; background: #fff; display: grid; place-items: center;
  font-size: clamp(40px, 10vw, 64px); box-shadow: 0 5px 0 rgba(0,0,0,.08);
}
.nalepka.prazdna { background: transparent; border: 3px dashed #e3d0b2; box-shadow: none; color: #e3d0b2; font-size: 30px; font-weight: 900; }
.nalepka .kolik { position: absolute; right: 6px; bottom: 4px; font-size: 14px; font-weight: 800; color: var(--sedy); }
.nalepka.ozije { animation: zavrteni .6s; }

.prehraj { width: clamp(110px, 26vw, 160px); aspect-ratio: 1; border-radius: 50%; border: 0; background: #fff; font-size: clamp(48px, 12vw, 72px); box-shadow: 0 8px 0 rgba(0,0,0,.08); }
.prehraj:active { transform: translateY(4px); }
.tecky { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 320px; }
.tecky i { width: 26px; height: 26px; border-radius: 50%; background: var(--ruzova); }
.avatar { width: min(100%, 36vh, 260px); aspect-ratio: 1; border-radius: 26px; border: 6px solid #fff; background: #ffe1ec; display: grid; place-items: center; font-size: clamp(80px, 18vh, 140px); box-shadow: 0 8px 20px rgba(120, 60, 0, .15); object-fit: cover; }
.lide-volby { display: flex; justify-content: center; gap: clamp(10px, 3vw, 22px); flex-wrap: wrap; padding-bottom: 8px; }
.osoba-volba { border: 0; background: #fff; border-radius: 22px; padding: 8px 8px 6px; box-shadow: 0 6px 0 rgba(0,0,0,.1); display: flex; flex-direction: column; align-items: center; gap: 4px; width: clamp(96px, 26vw, 150px); }
.osoba-volba .avatar { width: 100%; font-size: clamp(44px, 12vw, 70px); border-width: 0; box-shadow: none; border-radius: 16px; }
.osoba-volba span { font-weight: 800; font-size: 16px; }
.osoba-volba.dobre { background: var(--zelena); color: #fff; }
.osoba-volba.spatne { animation: zavrteni .5s; background: #ffe1e1; }
