:root {
  --bg1: #241a6b;
  --bg2: #5b2a9d;
  --ink: #1d1648;
  --yellow: #ffd23f;
  --yellow-d: #d99a00;
  --green: #3ddc84;
  --green-d: #1e9f57;
  --pink: #ff5d8f;
  --blue: #4cc9f0;
  --tile: #ffffff;
  --tile-d: #c9c4e8;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font-family: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", system-ui, sans-serif;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(160deg, var(--bg1), var(--bg2)) fixed;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}
#app {
  max-width: 520px; min-height: 100%; margin: 0 auto;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
}
button { font: inherit; color: inherit; border: 0; cursor: pointer; padding: 0; background: none; }
.loading { margin: auto; font-size: 64px; animation: pulse 1s infinite; }

/* horní lišta */
.bar { display: flex; align-items: center; gap: 10px; min-height: 52px; }
.bar h1 { flex: 1; margin: 0; font-size: 22px; letter-spacing: 1px; text-align: center; }
.round {
  width: 52px; height: 52px; border-radius: 50%; font-size: 24px;
  background: rgba(255,255,255,.16); display: grid; place-items: center; flex: none;
}
.stars { background: rgba(0,0,0,.28); border-radius: 26px; padding: 8px 14px; font-size: 20px; white-space: nowrap; }
.stars.bump { animation: bump .4s; }
.track { flex: 1; height: 16px; border-radius: 8px; background: rgba(0,0,0,.3); overflow: hidden; }
.track i { display: block; height: 100%; background: var(--green); border-radius: 8px; transition: width .3s; }

/* tlačítka */
.btn {
  display: block; width: 100%; padding: 18px; border-radius: 22px; font-size: 24px; letter-spacing: 1px;
  color: var(--ink); background: var(--yellow); box-shadow: 0 7px 0 var(--yellow-d);
  transition: transform .05s, box-shadow .05s;
}
.btn:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--yellow-d); }
.btn.green { background: var(--green); box-shadow: 0 7px 0 var(--green-d); }
.btn.ghost { background: rgba(255,255,255,.16); color: #fff; box-shadow: none; font-size: 18px; }
.btn small { display: block; font-size: 14px; opacity: .7; margin-top: 2px; }
.btn[disabled] { filter: grayscale(1); opacity: .55; }
.spacer { flex: 1; }
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; }
.prompt { font-size: 26px; text-align: center; margin: 4px 0; line-height: 1.25; }
.prompt b { color: var(--yellow); font-size: 1.5em; vertical-align: -3px; }

/* domů */
.hello { text-align: center; font-size: 34px; margin: 10px 0 0; text-shadow: 0 4px 0 rgba(0,0,0,.25); }
.parade { display: flex; justify-content: center; height: 110px; }
.parade { gap: 10px; }
.parade img { width: 104px; height: 104px; border-radius: 22px; box-shadow: 0 6px 0 rgba(0,0,0,.3); }
.menu { display: flex; flex-direction: column; gap: 18px; margin-top: 8px; }
.menu .btn { font-size: 26px; padding: 20px; }

/* mřížka písmen */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile {
  aspect-ratio: 1; border-radius: 20px; font-size: 44px; color: var(--ink);
  background: var(--tile); box-shadow: 0 6px 0 var(--tile-d); position: relative;
  display: grid; place-items: center;
}
.tile:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--tile-d); }
.tile.done { background: var(--yellow); box-shadow: 0 6px 0 var(--yellow-d); }
.tile.done::after { content: "⭐"; position: absolute; top: -8px; right: -6px; font-size: 22px; }
.tile.next { background: var(--green); box-shadow: 0 6px 0 var(--green-d); animation: pulse 1.2s infinite; }
.tile.locked { background: rgba(255,255,255,.14); color: rgba(255,255,255,.45); box-shadow: none; }
.tile.ok { background: var(--green); box-shadow: 0 6px 0 var(--green-d); animation: bump .4s; }
.tile.no { animation: shake .35s; background: #ffb3c6; }
.choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; width: 100%; }
.choices.six { grid-template-columns: repeat(3, 1fr); }
.choices .tile { font-size: 72px; aspect-ratio: 1.15; }
.choices.six .tile { font-size: 54px; }

/* lekce */
.bigletter {
  width: 190px; height: 190px; border-radius: 40px; font-size: 140px; line-height: 1; color: var(--ink);
  background: var(--yellow); box-shadow: 0 10px 0 var(--yellow-d); animation: pop .45s;
}
.pic { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.hero { width: 170px; height: 170px; border-radius: 30px; }
img.hero { box-shadow: 0 8px 0 rgba(0,0,0,.3); }
.hero.emoji { font-size: 120px; line-height: 170px; }
.word { font-size: 40px; letter-spacing: 3px; }
.word b { color: var(--yellow); font-size: 1.25em; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.card {
  border-radius: 20px; background: var(--tile); color: var(--ink); box-shadow: 0 6px 0 var(--tile-d);
  padding: 8px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0;
}
.card img { width: 92%; max-width: 120px; aspect-ratio: 1; object-fit: contain; border-radius: 14px; }
.card span { font-size: 17px; letter-spacing: .5px; overflow-wrap: anywhere; text-align: center; line-height: 1.1; }
.card span b { color: #e0218a; font-size: 1.3em; }
.card.ok { background: var(--green); animation: bump .4s; }
.card.no { animation: shake .35s; background: #ffb3c6; }
.card.locked { background: rgba(255,255,255,.12); box-shadow: none; color: rgba(255,255,255,.6); }
.card.locked img { filter: brightness(0); opacity: .35; }

/* skládání slova */
.slots, .pool { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.slot, .chip {
  width: 54px; height: 64px; border-radius: 14px; font-size: 38px; display: grid; place-items: center;
}
.slot { background: rgba(0,0,0,.28); color: rgba(255,255,255,.3); border: 3px dashed rgba(255,255,255,.3); }
.slot.cur { border-color: var(--yellow); }
.slot.full { background: var(--green); color: var(--ink); border: 0; animation: bump .3s; }
.chip { background: var(--tile); color: var(--ink); box-shadow: 0 5px 0 var(--tile-d); }
.chip.used { visibility: hidden; }
.chip.no { animation: shake .35s; background: #ffb3c6; }
.pool { margin-top: 18px; min-height: 150px; }

/* odměna */
.gift { font-size: 150px; line-height: 1; animation: wobble 1s infinite; filter: drop-shadow(0 10px 0 rgba(0,0,0,.25)); }
.won { font-size: 30px; line-height: 1.2; }
.won .big { font-size: 90px; display: block; animation: pop .5s; }
.cards.prize .card { animation: pop .5s backwards; }
.cards.prize .card:nth-child(2) { animation-delay: .25s; }
.cards.prize .card:nth-child(3) { animation-delay: .5s; }
.hint { font-size: 16px; opacity: .85; text-align: center; }

/* karta postavy */
.halo { width: 210px; height: 210px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 8px rgba(255,255,255,.35); }
.halo img { width: 150px; height: 150px; border-radius: 28px; }
.lines { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.line {
  background: var(--tile); color: var(--ink); border-radius: 18px; padding: 14px 16px; font-size: 24px;
  text-transform: uppercase; letter-spacing: 1px; line-height: 1.3; box-shadow: 0 5px 0 var(--tile-d); text-align: left;
}
.line.on { background: var(--yellow); box-shadow: 0 5px 0 var(--yellow-d); }
.row { display: flex; gap: 10px; justify-content: center; align-items: center; }
.names { display: flex; flex-direction: column; gap: 14px; width: 100%; }
.names .btn { font-size: 30px; letter-spacing: 3px; background: var(--tile); box-shadow: 0 7px 0 var(--tile-d); }
.names .btn.ok { background: var(--green); box-shadow: 0 7px 0 var(--green-d); }
.names .btn.no { animation: shake .35s; background: #ffb3c6; }

/* rodiče */
.panel { background: rgba(0,0,0,.25); border-radius: 18px; padding: 14px; font-weight: 600; font-size: 15px; line-height: 1.45; }
.panel a { color: var(--blue); }
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: #000c; padding: 12px 18px; border-radius: 16px; font-size: 18px; text-align: center; z-index: 20; max-width: 90vw;
}

/* konfety */
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 10; }
.confetti i { position: absolute; top: -20px; width: 12px; height: 18px; border-radius: 3px; animation: fall 2.4s linear forwards; }

@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@keyframes pulse { 50% { transform: scale(1.07); } }
@keyframes bump { 40% { transform: scale(1.18); } }
@keyframes pop { from { transform: scale(0); } 70% { transform: scale(1.12); } }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes wobble { 25% { transform: rotate(-8deg); } 75% { transform: rotate(8deg); } }
@media (max-height: 640px) {
  .bigletter { width: 140px; height: 140px; font-size: 100px; }
  .hero { width: 120px; height: 120px; } .hero.emoji { font-size: 90px; line-height: 120px; }
  .parade { height: 84px; } .parade img { width: 80px; height: 80px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* úrovně na domovské obrazovce */
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lvl {
  border-radius: 24px; padding: 14px 8px 12px; font-size: 21px; letter-spacing: 1px; color: var(--ink);
  background: var(--yellow); box-shadow: 0 7px 0 var(--yellow-d); display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.lvl span { font-size: 44px; line-height: 1.1; }
.lvl small { font-size: 14px; opacity: .75; }
.lvl.green { background: var(--green); box-shadow: 0 7px 0 var(--green-d); }
.lvl.blue { background: var(--blue); box-shadow: 0 7px 0 #2a8fb0; }
.lvl:active { transform: translateY(5px); box-shadow: 0 2px 0 rgba(0,0,0,.3); }
.lvl[disabled] { background: rgba(255,255,255,.14); color: rgba(255,255,255,.6); box-shadow: none; }
.lvl[disabled] span { filter: grayscale(1); opacity: .5; }

/* nové hry */
.slot.wide, .chip.wide { width: auto; min-width: 70px; padding: 0 14px; font-size: 34px; }
.readword { font-size: 54px; letter-spacing: 4px; background: var(--tile); color: var(--ink); border-radius: 22px; padding: 14px 22px; box-shadow: 0 7px 0 var(--tile-d); }
.tile.emo { font-size: 64px; }
.line.big { font-size: 28px; text-align: center; width: 100%; }
.cards.one { grid-template-columns: 150px; justify-content: center; }
.cards.two { grid-template-columns: 1fr 1fr; }
.card .num { font-size: 26px; }
.yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; }
.btn.pink { background: var(--pink); box-shadow: 0 7px 0 #c2325f; color: #fff; }
.btn.ok { background: var(--green); box-shadow: 0 7px 0 var(--green-d); animation: bump .4s; }
.btn.no { animation: shake .35s; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.stat { background: rgba(0,0,0,.3); border-radius: 16px; padding: 10px 14px; font-size: 18px; letter-spacing: 1px; }
.stat b { color: var(--yellow); font-size: 1.25em; margin-left: 4px; }
@media (max-height: 700px) { .lvl span { font-size: 34px; } .lvl { padding: 10px 6px; } }
