/* Cesta k Ježíškovi – vzhled.
   Rozvržení: pevná scéna 1280 × 720 (16:9 tabule), zvětšená na celou obrazovku.
   Svět je jediný a záměrně tmavý: noční zimní nebe, zlato, krémový papír. */
:root {
  --night-1: #0E1A33;
  --night-2: #172A52;
  --night-3: #24407A;
  --panel: #22335A;
  --panel-line: #3A5185;
  --muted: #C9D3E8;
  --locked: #8FA3C7;
  --gold: #F4B942;
  --gold-light: #FFD27A;
  --gold-pale: #FFE3A3;
  --gold-deep: #B07A12;
  --cream: #FFF6E5;
  --cream-line: #E9D6AE;
  --parchment: #F3E3C3;
  --parchment-2: #F7EBD2;
  --red: #A8322D;
  --red-bright: #E0453A;
  --red-deep: #7E1F1B;
  --green: #2F6B4A;
  --green-bright: #3E8A5E;
  --brown: #6B4A2B;
  --brown-dark: #3B2A12;
  --snow: #F7FAFD;
  --snow-blue: #DDE7F3;
  --snow-line: #C5D3E6;

  --font-display: 'Baloo 2', 'Trebuchet MS', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Nunito', 'Segoe UI', system-ui, sans-serif;

  --door-radius: 52px 52px 16px 16px;
  --ease-bounce: cubic-bezier(.2, .8, .3, 1.25);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: #08101F; overflow: hidden; }
body { font-family: var(--font-body); color: var(--cream); -webkit-tap-highlight-color: transparent; user-select: none; }

button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 4px solid var(--gold-light); outline-offset: 3px;
}
h1:focus { outline: none; }

#viewport { position: fixed; inset: 0; }
#stage {
  position: absolute; left: 50%; top: 50%;
  width: 1280px; height: 720px; overflow: hidden;
  transform-origin: center center;
  background: linear-gradient(180deg, var(--night-1) 0%, var(--night-2) 55%, var(--night-3) 100%);
}
#backdrop, #snow, #screen, #overlay { position: absolute; inset: 0; }
#backdrop svg { display: block; }
#snow { pointer-events: none; }
#overlay { pointer-events: none; z-index: 20; }
#overlay > * { pointer-events: auto; }
#overlay > .spark, #overlay > .confetti, #overlay > .piece { pointer-events: none; }

/* Ambientní pohyb v dekoracích */
.bulb { animation: twinkle 2s ease-in-out infinite alternate; }
.twinkle { animation: twinkle 2.6s ease-in-out infinite alternate; }
.church-star { animation: glow-soft 3s ease-in-out infinite alternate; transform-origin: 636px 424px; }
@keyframes twinkle { from { opacity: .45; } to { opacity: 1; } }
@keyframes glow-soft { from { opacity: .7; transform: scale(.94); } to { opacity: 1; transform: scale(1.06); } }

/* ---------- Společné prvky ---------- */
.topbar {
  position: absolute; left: 48px; right: 48px; top: 56px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 16px; }
.brand-badge {
  width: 64px; height: 64px; border-radius: 20px; background: var(--red);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 0 var(--red-deep);
}
.brand-badge svg { animation: badge-spin 6s ease-in-out infinite; }
@keyframes badge-spin { 0%, 80% { transform: rotate(0); } 90% { transform: rotate(-12deg) scale(1.1); } 100% { transform: rotate(0); } }
.title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 44px; line-height: 1; color: var(--cream); }
.subtitle { margin: 2px 0 0; font-size: 17px; font-weight: 700; color: var(--muted); }
.actions { display: flex; align-items: center; gap: 12px; }

.pill {
  display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 22px;
  border-radius: 999px; border: 2px solid transparent;
  font-family: var(--font-display); font-weight: 800; font-size: 20px;
  transition: transform .15s var(--ease-bounce), box-shadow .15s;
}
.pill:active, .icon-btn:active, .btn:active { transform: scale(.95); }
.pill-dark { background: var(--panel); border-color: var(--panel-line); color: var(--cream); font-weight: 700; }
.pill-gold { background: var(--gold); color: var(--brown-dark); box-shadow: 0 4px 0 var(--gold-deep); }
.pill:hover { transform: translateY(-2px); }
.pill:disabled { opacity: .45; cursor: default; transform: none; }
.restart-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.restart-card .modal-text { max-width: 560px; }

.icon-btn {
  width: 52px; height: 52px; border-radius: 999px; border: 2px solid var(--panel-line); background: var(--panel);
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
  transition: transform .15s var(--ease-bounce);
}
.icon-btn:hover { transform: translateY(-2px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 64px; padding: 0 40px; border-radius: 999px; border: 0;
  font-family: var(--font-display); font-weight: 800; font-size: 24px;
  transition: transform .15s var(--ease-bounce), filter .15s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn-red { background: var(--red); color: var(--cream); box-shadow: 0 5px 0 var(--red-deep); }
.btn-gold { background: var(--gold); color: var(--brown-dark); box-shadow: 0 5px 0 var(--gold-deep); }
.btn-ghost { background: transparent; color: var(--brown); border: 3px solid var(--cream-line); box-shadow: none; }
.btn-small { height: 52px; padding: 0 24px; font-size: 19px; }

.shake { animation: shake .45s ease; }
@keyframes shake {
  0%, 100% { translate: 0 0; } 20% { translate: -9px 0; } 40% { translate: 8px 0; } 60% { translate: -5px 0; } 80% { translate: 3px 0; }
}

.flash {
  position: absolute; inset: 0; z-index: 40; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 50%, #FFF3D1 0%, var(--gold) 45%, #C9861F 100%);
}

.toast {
  position: absolute; left: 50%; bottom: 40px; z-index: 50; transform: translateX(-50%);
  background: var(--cream); color: var(--brown-dark); border: 3px solid var(--cream-line);
  padding: 14px 28px; border-radius: 999px; font-family: var(--font-display); font-weight: 800; font-size: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  animation: toast-in .35s var(--ease-bounce);
}
.toast.out { opacity: 0; transition: opacity .35s; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 20px); } }

.spark { position: absolute; z-index: 30; line-height: 0; }
.confetti { position: absolute; top: 0; width: 12px; height: 16px; border-radius: 3px; z-index: 30; }

/* ---------- Okno ---------- */
.modal-backdrop {
  position: absolute; inset: 0; z-index: 35;
  background: rgba(8, 16, 31, .62);
  display: flex; align-items: center; justify-content: center;
  animation: fade-in .25s ease;
}
.modal-backdrop.out { opacity: 0; transition: opacity .2s; }
.modal-card {
  position: relative; width: 760px; max-height: 660px; overflow: auto;
  background: var(--cream); color: var(--brown-dark);
  border: 4px solid var(--cream-line); border-radius: 32px; padding: 32px 40px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  animation: pop-in .45s var(--ease-bounce);
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: scale(.85) translateY(20px); } }
.modal-close {
  position: absolute; right: 20px; top: 20px; width: 52px; height: 52px; border-radius: 999px;
  border: 3px solid var(--cream-line); background: #FFFBF2; display: flex; align-items: center; justify-content: center; padding: 0;
}
.modal-title { margin: 0 0 6px; font-family: var(--font-display); font-weight: 800; font-size: 38px; line-height: 1.05; color: var(--red); text-wrap: balance; }
.modal-text { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.45; color: var(--brown); }

/* ---------- Úvod: kalendář ---------- */
.progress-row {
  position: absolute; left: 48px; right: 48px; top: 134px;
  display: flex; align-items: center; gap: 18px;
}
.progress-label { font-family: var(--font-display); font-weight: 800; font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; }
.stars-row { display: flex; align-items: center; gap: 5px; }
.stars-row .on { animation: star-pop .5s var(--ease-bounce) backwards; }
@keyframes star-pop { from { transform: scale(0) rotate(-90deg); } }
.progress-row .pill { margin-left: auto; height: 44px; font-size: 18px; }

.doors {
  position: absolute; left: 48px; right: 48px; top: 182px;
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 16px;
}
.door {
  position: relative; height: 104px; padding: 0; border: 0; background: none;
  perspective: 700px;
  animation: door-in .55s var(--ease-bounce) backwards;
  animation-delay: calc(var(--i) * 22ms);
}
@keyframes door-in { from { opacity: 0; transform: translateY(18px) scale(.85); } }
.door-inside, .door-leaf { position: absolute; inset: 0; border-radius: var(--door-radius); }
.door-inside {
  background: radial-gradient(circle at 50% 55%, #FFF3D1 0%, var(--gold) 38%, #8A5715 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 18px rgba(59, 42, 18, .6);
}
.door-inside svg { opacity: 0; transform: scale(.4); transition: opacity .4s .25s, transform .6s .25s var(--ease-bounce); }
.door-leaf {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  transform-origin: left center;
  transition: transform 1s cubic-bezier(.45, .05, .25, 1);
}
.door-num { font-family: var(--font-display); font-weight: 800; font-size: 38px; line-height: 1; }
.door-tag { display: flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 800; }
.door-bow { position: absolute; top: -9px; left: 50%; margin-left: -17px; }

.door.is-done .door-leaf { background: var(--cream); border: 3px solid var(--cream-line); }
.door.is-done .door-num { color: var(--red); }
.door.is-done .door-tag { color: var(--brown); }
.door.is-done:hover .door-leaf { transform: rotateY(-14deg); }

.door.is-now { transform: scale(1.07); z-index: 2; }
.door.is-now .door-leaf {
  background: var(--gold); border: 3px solid var(--gold-pale); color: var(--brown-dark);
  animation: now-glow 2.2s ease-in-out infinite;
}
.door.is-now:hover .door-leaf { transform: rotateY(-18deg); }
@keyframes now-glow {
  0%, 100% { box-shadow: 0 0 0 6px rgba(244, 185, 66, .25), 0 0 34px rgba(244, 185, 66, .5); }
  50% { box-shadow: 0 0 0 10px rgba(244, 185, 66, .35), 0 0 60px rgba(244, 185, 66, .8); }
}

.door.is-locked { cursor: default; }
.door.is-locked .door-leaf {
  background: var(--panel); border: 2px solid #34497A; border-top: 10px solid #EEF3FA; gap: 4px;
}
.door.is-locked .door-num { font-size: 32px; color: var(--locked); }
.door.is-locked .door-inside { visibility: hidden; }

.door.opening .door-leaf { transform: rotateY(-108deg) !important; animation: none; box-shadow: none; }
.door.opening .door-inside svg { opacity: 1; transform: scale(1.15); }
.door.opening { z-index: 3; }

/* ---------- Mapa ---------- */
.map-head { display: flex; align-items: center; gap: 16px; }
.map-progress { display: flex; align-items: center; gap: 14px; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bar { width: 220px; height: 14px; border-radius: 999px; background: var(--panel); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--gold); transition: width .8s var(--ease-bounce); }

.map-frame {
  position: absolute; left: 48px; top: 136px; width: 924px; height: 544px;
  border-radius: 28px; background: var(--parchment); border: 4px solid var(--cream-line); padding: 8px;
  transition: box-shadow 1s;
}
.map-frame.glowing { box-shadow: 0 0 0 8px rgba(244, 185, 66, .5), 0 0 90px rgba(255, 210, 122, .85); }
.map-inner { position: relative; width: 900px; height: 520px; border-radius: 18px; overflow: hidden; }
.map-inner > .map-art, .map-trail { position: absolute; left: 0; top: 0; }
.map-trail { pointer-events: none; z-index: 3; }
.map-grid {
  position: absolute; inset: 0; z-index: 2;
  display: grid; grid-template-columns: repeat(6, 150px); grid-template-rows: repeat(4, 130px);
}
.cell { position: relative; }
.cell .snow-cover {
  position: absolute; inset: 0; background: var(--snow-blue); border: 1px solid var(--snow-line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  transition: opacity .7s ease, transform .7s ease;
}
.cell .snow-cover::before {
  content: ""; position: absolute; inset: 0; opacity: .55;
  background: radial-gradient(circle at 20% 30%, #fff 0 3px, transparent 4px), radial-gradient(circle at 70% 70%, #fff 0 2px, transparent 3px),
              radial-gradient(circle at 80% 20%, #fff 0 2px, transparent 3px), radial-gradient(circle at 35% 80%, #fff 0 3px, transparent 4px);
}
.cell .snow-num { font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1; color: #4E6385; position: relative; }
.cell .found-num {
  position: absolute; left: 6px; top: 6px; width: 22px; height: 22px; border-radius: 999px;
  background: rgba(107, 74, 43, .14); color: var(--brown); font-size: 11px; font-weight: 800;
  display: none; align-items: center; justify-content: center;
}
.cell .new-tag {
  position: absolute; left: 6px; top: 6px; background: var(--gold); color: var(--brown-dark);
  font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 999px; display: none;
}
.cell.found .snow-cover { opacity: 0; transform: scale(1.12); pointer-events: none; }
.cell.found { border: 1px dashed rgba(107, 74, 43, .3); }
.cell.found .found-num { display: flex; }
.cell.new { border: 4px solid var(--gold); border-radius: 6px; z-index: 1; }
.cell.new .found-num { display: none; }
.cell.new .new-tag { display: block; animation: pop-in .4s var(--ease-bounce); }
.map-frame.complete .cell { border: 0; }
.map-frame.complete .found-num, .map-frame.complete .new-tag { display: none !important; }

.piece {
  position: absolute; width: 150px; height: 130px; z-index: 32; overflow: hidden;
  border: 4px solid var(--gold); border-radius: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45), 0 0 40px rgba(244, 185, 66, .6);
}
.piece-art { position: absolute; width: 900px; height: 520px; }

.finale-star { position: absolute; left: 0; top: 0; z-index: 4; width: 0; height: 0; pointer-events: none; }
.finale-star svg { position: absolute; left: -32px; top: -32px; filter: drop-shadow(0 0 14px #FFD27A) drop-shadow(0 0 30px #F4B942); }

.map-side { position: absolute; left: 1000px; top: 136px; width: 232px; display: flex; flex-direction: column; gap: 16px; }
.side-card { background: var(--panel); border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.side-label { font-size: 14px; font-weight: 800; color: var(--muted); }
.side-found { display: flex; align-items: center; gap: 12px; }
.side-badge {
  width: 56px; height: 56px; border-radius: 16px; background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 30px; color: var(--brown-dark);
}
.side-big { font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1.1; }
.side-text { font-size: 17px; font-weight: 700; line-height: 1.4; margin: 0; }
.map-side .btn { height: 60px; padding: 0 16px; font-size: 22px; }

.finale-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.finale-place {
  margin: 4px 0 8px; padding: 18px 26px; border-radius: 22px; background: var(--parchment);
  font-family: var(--font-display); font-weight: 800; font-size: 34px; line-height: 1.15; color: var(--red); text-wrap: balance;
}
.finale-actions { display: flex; gap: 14px; }

/* ---------- Pravidla ---------- */
.back-btn { position: absolute; left: 48px; top: 64px; }
.rules-card {
  position: absolute; left: 150px; top: 64px; width: 980px;
  background: var(--cream); color: var(--brown-dark);
  border: 4px solid var(--cream-line); border-radius: 32px; padding: 32px 44px;
  display: flex; flex-direction: column; gap: 22px;
  animation: pop-in .5s var(--ease-bounce);
}
.rules-head { display: flex; align-items: center; gap: 14px; }
.rules-head h1 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1; color: var(--red); }
.rules-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 36px; }
.rule { display: flex; gap: 14px; align-items: flex-start; animation: rule-in .5s var(--ease-bounce) backwards; animation-delay: calc(var(--i) * 70ms + 150ms); }
@keyframes rule-in { from { opacity: 0; transform: translateX(-14px); } }
.rule-num {
  flex: none; width: 44px; height: 44px; border-radius: 999px; background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 24px; color: var(--brown-dark);
}
.rule-num.red { background: var(--red); color: var(--cream); }
.rule-num.green { background: var(--green); }
.rule h2 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1.15; }
.rule p { margin: 2px 0 0; font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--brown); }
.rule.teacher { background: var(--parchment); border-radius: 18px; padding: 12px 14px; margin: -12px -14px; }
.rules-card .btn { align-self: center; }

/* ---------- Minihra ---------- */
.game-head { display: flex; align-items: center; gap: 16px; }
.eyebrow { margin: 0 0 2px; font-size: 15px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); }
.round-stars { display: flex; gap: 8px; }
.round-stars svg { transition: transform .4s var(--ease-bounce); }
.round-stars .got { transform: scale(1.15); }
.game-area { position: absolute; left: 48px; right: 48px; top: 140px; bottom: 36px; }

.win-card { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.win-piece {
  width: 180px; height: 156px; border-radius: 14px; position: relative; overflow: hidden;
  background: var(--snow-blue); border: 5px solid var(--gold);
  display: flex; align-items: center; justify-content: center;
  animation: piece-wobble 2.4s ease-in-out infinite;
  box-shadow: 0 0 40px rgba(244, 185, 66, .55);
}
.win-piece span {
  width: 76px; height: 76px; border-radius: 999px; background: var(--gold); color: var(--brown-dark);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 42px;
}
@keyframes piece-wobble { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) translateY(-6px); } }

.screen-game .title { font-size: 36px; }
.game-tip { margin: 4px 0 0; font-size: 15px; font-weight: 700; color: var(--muted); max-width: 820px; }
.screen-game .game-area { top: 150px; bottom: 26px; }

/* ---------- Společné prvky miniher ---------- */
.kit { height: 100%; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.kit-prompt {
  margin: 0; min-height: 38px; max-width: 1120px; text-align: center; text-wrap: balance;
  font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1.2;
}
.num { color: var(--gold-light); }
.scene .num, .bubble .num { color: var(--red); }
.kit-stage { flex: 1; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; gap: 40px; }
.kit-stage.col { flex-direction: column; gap: 22px; }
.kit-hint { margin: 0; min-height: 34px; font-family: var(--font-display); font-weight: 800; font-size: 26px; color: var(--muted); text-align: center; }
.kit-hint.ok { color: var(--gold-light); }
.kit-row { display: flex; gap: 16px; align-items: center; }
.col-box { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.kit .btn-ghost { color: var(--cream); border-color: var(--panel-line); }

.scene {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 12px;
  background: var(--cream); color: var(--brown-dark); border: 4px solid var(--cream-line); border-radius: 28px; padding: 16px;
}
.scene-sky { background: linear-gradient(180deg, #E4EDF8, #FFFFFF); border-color: var(--snow-line); }
.scatter { position: relative; }
.scatter .item { position: absolute; }
.item { display: inline-block; line-height: 0; animation: item-in .45s var(--ease-bounce) backwards; }
@keyframes item-in { from { opacity: 0; transform: scale(.3); } }
.item-row { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
.op { font-family: var(--font-display); font-weight: 800; font-size: 64px; color: var(--brown); margin: 0 10px; }

.numcard {
  display: inline-flex; align-items: center; justify-content: center; min-width: 96px; height: 96px; padding: 0 18px;
  border-radius: 24px; background: var(--gold); color: var(--brown-dark); box-shadow: 0 6px 0 var(--gold-deep);
  font-family: var(--font-display); font-weight: 800; font-size: 60px; line-height: 1; font-variant-numeric: tabular-nums;
}
.numcard.big { min-width: 130px; height: 130px; font-size: 84px; }
.example { font-family: var(--font-display); font-weight: 800; font-size: 56px; line-height: 1; color: var(--cream); font-variant-numeric: tabular-nums; }

.choices { display: flex; gap: 24px; align-items: center; justify-content: center; }
.choices.col { flex-direction: column; gap: 16px; }
.answer {
  width: 132px; height: 132px; border-radius: 36px; border: 4px solid var(--cream-line);
  background: var(--cream); color: var(--brown-dark);
  font-family: var(--font-display); font-weight: 800; font-size: 68px; line-height: 1;
  box-shadow: 0 8px 0 #CDB88E;
  transition: transform .15s var(--ease-bounce), background .2s, opacity .3s;
  animation: pop-in .45s var(--ease-bounce) backwards; animation-delay: calc(var(--i) * 80ms);
}
.choices.col .answer { width: 120px; height: 112px; font-size: 62px; }
.answer:hover { transform: translateY(-4px); }
.answer:active { transform: translateY(4px); box-shadow: 0 4px 0 #CDB88E; }
.answer.right { background: var(--green-bright); border-color: #8FD3A8; color: #FFFFFF; box-shadow: 0 8px 0 var(--green); transform: scale(1.08); }
.answer.wrong { opacity: .4; cursor: default; }
.answer-sm { width: 104px; height: 104px; font-size: 54px; border-radius: 30px; }
.answer-pic { width: auto; height: auto; min-width: 132px; min-height: 132px; padding: 12px; line-height: 0; }
.answer.mailbox { width: auto; height: auto; padding: 10px 18px 12px; display: flex; flex-direction: column; align-items: center; gap: 0; }
.answer.mailbox b { font-size: 52px; }
.answer.right svg path, .answer.right svg rect { filter: brightness(1.05); }

/* 2 Světýlka */
.garland-scene { width: 980px; height: 240px; background: linear-gradient(180deg, #1B2E58, #24407A); border-color: var(--panel-line); }
.wire { position: absolute; left: 36px; top: 20px; }
.bulb-btn {
  position: absolute; top: 62px; left: calc(36px + 56px + var(--k) * 112.5px - 32px);
  width: 64px; height: 120px; border: 0; padding: 0; background: none;
  display: flex; flex-direction: column; align-items: center;
}
.bulb-cap { width: 22px; height: 16px; border-radius: 4px; background: #C9A86A; }
.bulb-glass {
  width: 46px; height: 72px; border-radius: 50% 50% 46% 46%; background: var(--c);
  opacity: .28; filter: saturate(.4); transition: opacity .2s, filter .2s, box-shadow .2s;
}
.bulb-btn[aria-pressed="true"] .bulb-glass { opacity: 1; filter: none; box-shadow: 0 0 26px 8px var(--c); }
.lit-count { font-family: var(--font-display); font-weight: 800; font-size: 30px; }

/* 4 Tvary */
.shape-grid { display: grid; grid-template-columns: repeat(5, 124px); gap: 10px; padding: 20px; }
.shape-btn {
  width: 124px; height: 124px; border: 0; border-radius: 26px; background: transparent; padding: 0;
  display: flex; align-items: center; justify-content: center; transition: transform .15s var(--ease-bounce), background .2s;
  animation: pop-in .4s var(--ease-bounce) backwards; animation-delay: calc(var(--i) * 50ms);
}
.shape-btn:hover { transform: scale(1.06); }
.shape-btn.found { background: #DFF3E5; box-shadow: inset 0 0 0 5px var(--green-bright); }

/* 5 Talíře */
.plate-btn { border: 0; background: none; padding: 0; transition: transform .15s var(--ease-bounce), opacity .3s; }
.plate-btn:hover { transform: translateY(-4px); }
.plate {
  display: flex; align-items: center; justify-content: center; width: 420px; height: 330px; border-radius: 50%;
  background: radial-gradient(ellipse at center, #FFFFFF 58%, #EFE3C8 59%, #FFFFFF 72%); border: 6px solid var(--cream-line);
}
.plate-btn.right .plate { border-color: var(--green-bright); box-shadow: 0 0 0 10px rgba(93, 187, 122, .4); }
.plate-btn.wrong { opacity: .45; }

/* 6 Sáňky */
.sled-pile { display: flex; gap: 18px; }
.sled-btn, .slot { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 24px; }
.sled-btn {
  width: 140px; height: 130px; background: var(--cream); border: 4px solid var(--cream-line); box-shadow: 0 6px 0 #CDB88E;
  animation: pop-in .4s var(--ease-bounce) backwards; animation-delay: calc(var(--i) * 60ms);
}
.sled-btn b, .slot b { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1; color: var(--red); }
.sled-btn.gone { visibility: hidden; }
.track { display: flex; gap: 14px; padding: 14px; border-radius: 26px; border: 3px dashed #5C73A3; }
.slot { width: 124px; height: 112px; background: rgba(255, 255, 255, .06); }
.slot.filled { background: var(--cream); animation: pop-in .35s var(--ease-bounce); }

/* 7 Polička */
.shelf { display: grid; grid-template-columns: repeat(3, 140px); gap: 12px; padding: 16px; background: #8A5A33; border: 6px solid #6B4A2B; border-radius: 22px; }
.shelf-cell {
  width: 140px; height: 124px; border: 0; border-radius: 14px; background: var(--parchment);
  border-bottom: 8px solid #6B4A2B; display: flex; align-items: center; justify-content: center;
  transition: transform .15s var(--ease-bounce);
}
.shelf-cell:hover { transform: scale(1.04); }
.shelf-cell.right { background: #DFF3E5; }
.shelf-cell.wrong { opacity: .5; }

/* 8 Řetěz */
.chain { gap: 8px; padding: 26px 30px; }
.mystery {
  width: 76px; height: 76px; border-radius: 50%; border: 5px dashed var(--gold-deep); line-height: 66px; text-align: center;
  font-family: var(--font-display); font-weight: 800; font-size: 44px; color: var(--gold-deep);
}

/* 9 Páry */
.pair-col { display: flex; flex-direction: column; gap: 12px; }
.pair-num, .pair-group {
  height: 94px; border-radius: 24px; background: var(--cream); border: 4px solid var(--cream-line);
  display: flex; align-items: center; justify-content: center; gap: 8px; transition: transform .15s var(--ease-bounce), box-shadow .15s;
}
.pair-num { width: 160px; }
.pair-num b { font-family: var(--font-display); font-weight: 800; font-size: 52px; line-height: 1; color: var(--red); }
.pair-group { width: 440px; }
.picked { box-shadow: 0 0 0 6px var(--gold); transform: scale(1.04); }
.paired { background: #DFF3E5; border-color: #8FD3A8; }

/* 10 Ulice */
.street { display: flex; gap: 14px; }
.house { position: relative; display: flex; flex-direction: column; align-items: center; animation: pop-in .4s var(--ease-bounce) backwards; animation-delay: calc(var(--i) * 70ms); }
.house b { position: absolute; top: 52px; font-family: var(--font-display); font-weight: 800; font-size: 44px; color: var(--brown-dark); }
.house.missing b { color: #4E6385; }

/* 11 Dárky */
.tree-scene { width: 600px; height: 400px; flex-direction: column; justify-content: flex-end; }
.gift-row { display: flex; gap: 4px; margin-top: -40px; }
.gift.later { animation: none; opacity: 0; transform: translateY(-260px); }
.gift.later.drop { animation: drop-in .9s var(--ease-bounce) forwards; }
@keyframes drop-in { to { opacity: 1; transform: none; } }

/* 12 Hýlové */
.branch-scene { width: 660px; height: 340px; overflow: hidden; background: linear-gradient(180deg, #E4EDF8, #FFFFFF); }
.branch { position: absolute; left: 30px; top: 198px; }
.bird-row { position: relative; display: flex; gap: 6px; top: -8px; }
.bird.fly { animation: fly-away 1.3s ease-in forwards; }
@keyframes fly-away { to { transform: translate(calc(var(--d) * 280px), -340px) rotate(calc(var(--d) * 25deg)); opacity: 0; } }

/* 13 Porovnávání */
.compare { display: flex; align-items: center; gap: 36px; }
.cmp-side { display: flex; flex-direction: column; align-items: center; gap: 14px; background: var(--cream); padding: 20px 24px; border-radius: 28px; }
.cmp-slot {
  width: 124px; height: 124px; border-radius: 32px; border: 5px dashed var(--gold); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 80px; color: var(--gold);
}

/* 14 Punčochy */
.socks-scene { flex-direction: column; gap: 6px; padding: 16px 30px; }
.socks { display: flex; gap: 50px; }
.sock-box { position: relative; display: flex; flex-direction: column; align-items: center; }
.sock-in { position: absolute; top: 60px; left: 34px; width: 92px; }
.sock-box b { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1; color: var(--red); }

/* 15 Věž */
.tower-scene { width: 380px; height: 420px; flex-direction: column; justify-content: flex-end; gap: 0; background: linear-gradient(180deg, #E4EDF8, #FFFFFF); border-color: var(--snow-line); }
.tower { display: flex; flex-direction: column-reverse; align-items: center; gap: 3px; }
.block { width: 130px; height: 29px; border-radius: 8px; border: 3px solid rgba(59, 42, 18, .25); animation: block-in .3s var(--ease-bounce); }
@keyframes block-in { from { transform: translateY(-70px); opacity: 0; } }
.ground { width: 300px; height: 14px; border-radius: 8px; background: var(--snow-line); margin-top: 4px; }

/* 16 Pexeso */
.memory { display: grid; grid-template-columns: repeat(8, 128px); gap: 14px 12px; }
.mem-card { position: relative; width: 128px; height: 156px; border: 0; padding: 0; background: none; perspective: 700px; animation: pop-in .4s var(--ease-bounce) backwards; animation-delay: calc(var(--i) * 40ms); }
.mem-back, .mem-front {
  position: absolute; inset: 0; border-radius: 22px; display: flex; align-items: center; justify-content: center;
  backface-visibility: hidden; transition: transform .5s cubic-bezier(.4, .1, .2, 1);
}
.mem-back { background: var(--red); border: 4px solid #C8433C; box-shadow: inset 0 0 0 6px rgba(255, 246, 229, .25); }
.mem-front { background: var(--cream); border: 4px solid var(--cream-line); transform: rotateY(180deg); }
.mem-front b { font-family: var(--font-display); font-weight: 800; font-size: 74px; line-height: 1; color: var(--red); }
.mem-card.flip .mem-back { transform: rotateY(-180deg); }
.mem-card.flip .mem-front { transform: rotateY(0deg); }
.mem-card.matched .mem-front { background: #DFF3E5; border-color: #8FD3A8; }

/* 17 Číselná osa */
.axis-scene { width: 980px; height: 270px; display: block; padding: 0; }
.axis-scene svg { position: absolute; left: 36px; bottom: 16px; }
.axis-sled { position: absolute; left: calc(36px + var(--x) - 45px); bottom: 104px; line-height: 0; animation: sled-in 1.4s cubic-bezier(.3, .7, .3, 1) backwards; }
.axis-sled::after { content: ""; position: absolute; left: 50%; bottom: -10px; margin-left: -12px; border: 12px solid transparent; border-bottom: 0; border-top: 18px solid var(--red); }
@keyframes sled-in { from { transform: translateX(-420px); opacity: 0; } }

/* 18 Rampouchy */
.roof { width: 920px; height: 44px; border-radius: 14px 14px 6px 6px; background: linear-gradient(180deg, var(--snow) 0 20px, #6B4A2B 20px); }
.icicles { display: flex; gap: 46px; margin-top: -22px; }
.icicle {
  width: 120px; height: var(--len); border: 0; padding: 14px 0 0; display: flex; justify-content: center; align-items: flex-start;
  background: linear-gradient(180deg, #F7FAFD, #A9CDE6); clip-path: polygon(0 0, 100% 0, 50% 100%);
  animation: grow .6s var(--ease-bounce) backwards; animation-delay: calc(var(--i) * 80ms); transform-origin: top;
}
@keyframes grow { from { transform: scaleY(0); } }
.icicle b { font-family: var(--font-display); font-weight: 800; font-size: 50px; line-height: 1; color: #24407A; }
.icicle.right { background: linear-gradient(180deg, #FFE3A3, var(--gold)); }
.icicle.wrong { opacity: .4; }

/* 19 Souboj */
.duel { height: 100%; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr auto; gap: 14px 28px; }
.duel-task { grid-column: 1 / -1; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 64px; line-height: 1; }
.duel-side { border-radius: 28px; padding: 18px 22px; display: flex; flex-direction: column; gap: 24px; align-items: center; justify-content: center; transition: opacity .3s; }
.duel-side.red { background: rgba(168, 50, 45, .35); border: 4px solid #C8433C; }
.duel-side.green { background: rgba(47, 107, 74, .45); border: 4px solid var(--green-bright); }
.duel-side.locked { opacity: .45; }
.duel-head { display: flex; align-items: center; gap: 14px; width: 100%; }
.duel-head b { font-family: var(--font-display); font-weight: 800; font-size: 28px; }
.duel-track { position: relative; flex: 1; height: 70px; margin: 0 32px; border-bottom: 4px dashed rgba(255, 255, 255, .4); }
.duel-sled { position: absolute; left: 0; bottom: -10px; margin-left: -32px; line-height: 0; transition: left .8s var(--ease-bounce); }
.duel-score { min-width: 44px; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 46px; line-height: 1; }
.duel .kit-hint { grid-column: 1 / -1; }

/* 20 Pošta */
.letter {
  display: flex; align-items: center; gap: 22px; padding: 14px 34px; border-radius: 26px; background: var(--cream); color: var(--brown-dark);
  animation: letter-in .7s var(--ease-bounce);
}
.letter b { font-family: var(--font-display); font-weight: 800; font-size: 66px; line-height: 1; }
@keyframes letter-in { from { transform: translateY(-80px) rotate(-8deg); opacity: 0; } }

/* 21 Cukroví */
.plate-scene { width: 580px; height: 420px; padding: 10px; }
.big-plate {
  width: 540px; height: 390px; border-radius: 50%; display: flex; flex-wrap: wrap; align-content: center; justify-content: center; gap: 10px; padding: 50px 70px;
  background: radial-gradient(ellipse at center, #FFFFFF 60%, #EFE3C8 61%, #FFFFFF 73%); border: 6px solid var(--cream-line);
}
.cookie { border: 0; background: none; padding: 0; line-height: 0; transition: transform .35s ease, opacity .35s; animation: pop-in .4s var(--ease-bounce) backwards; animation-delay: calc(var(--i) * 60ms); }
.cookie:hover { transform: scale(1.08); }
.cookie.eaten { transform: scale(0) rotate(120deg); opacity: 0; }

/* 22 Hádanky */
.riddle { display: flex; align-items: center; gap: 26px; max-width: 800px; }
.elf { line-height: 0; animation: elf-bob 2.4s ease-in-out infinite; }
@keyframes elf-bob { 50% { transform: translateY(-8px) rotate(-3deg); } }
.bubble {
  position: relative; background: var(--cream); color: var(--brown-dark); border-radius: 32px; padding: 28px 34px;
  font-family: var(--font-display); font-weight: 800; font-size: 36px; line-height: 1.25; text-wrap: balance;
  animation: pop-in .45s var(--ease-bounce);
}
.bubble::before { content: ""; position: absolute; left: -22px; top: 50%; margin-top: -16px; border: 16px solid transparent; border-right: 22px solid var(--cream); border-left: 0; }

/* 23 Obrázek z tvarů */
.shape-pic { width: 620px; height: 400px; }
.shape-canvas { position: relative; width: 580px; height: 350px; }
.shape-canvas .item { position: absolute; line-height: 0; }

/* ---------- Hry na čtení ---------- */
.pic-card { flex-direction: column; gap: 10px; width: 460px; min-height: 330px; padding: 22px; }
.pic-card.small { width: auto; min-height: 0; padding: 18px; }
.pic-card .ic { animation: pop-in .5s var(--ease-bounce); }
.word-big { font-family: var(--font-display); font-weight: 800; font-size: 58px; line-height: 1; letter-spacing: .06em; color: var(--brown-dark); display: flex; align-items: center; gap: 4px; }
.blank {
  display: inline-flex; align-items: center; justify-content: center; width: 70px; height: 74px; letter-spacing: 0;
  border-radius: 16px; border: 4px dashed var(--gold-deep); color: var(--gold-deep);
}
.blank.filled { border-style: solid; background: var(--gold); color: var(--brown-dark); animation: pop-in .4s var(--ease-bounce); }
.syl { padding: 0 6px; border-radius: 12px; animation: pop-in .4s var(--ease-bounce) backwards; }
.syl.s0 { background: #FCE1DE; } .syl.s1 { background: #DFF3E5; } .syl.s2 { background: #DDE9F8; }
.syl + .syl { margin-left: 6px; }
.hl { color: var(--red); background: #FCE1DE; border-radius: 10px; padding: 0 4px; }

.letter-card {
  display: inline-flex; align-items: center; justify-content: center; min-width: 110px; height: 120px; padding: 0 20px;
  border-radius: 28px; background: var(--cream); border: 4px solid var(--cream-line); color: var(--red);
  font-family: var(--font-display); font-weight: 800; font-size: 86px; line-height: 1; box-shadow: 0 6px 0 #CDB88E;
}
.letter-card.ghost { color: var(--gold-deep); border-style: dashed; background: transparent; box-shadow: none; border-color: var(--gold); }
.letter-card.hop { animation: hop-r .8s var(--ease-bounce); }
.letter-card.hop2 { animation: hop-l .8s var(--ease-bounce); }
@keyframes hop-r { from { transform: translateX(-60px) rotate(-10deg); opacity: 0; } }
@keyframes hop-l { from { transform: translateX(60px) rotate(10deg); opacity: 0; } }
.join { display: flex; align-items: center; gap: 18px; }
.plus { font-family: var(--font-display); font-weight: 800; font-size: 64px; color: var(--gold-light); }

.answer-word { width: auto; min-width: 200px; height: 104px; padding: 0 30px; font-size: 52px; letter-spacing: .04em; }
.choices.col .answer-word { width: 360px; height: 96px; font-size: 48px; }
.answer-claps { width: 260px !important; height: 86px !important; display: flex; align-items: center; justify-content: flex-start; gap: 14px; padding: 0 18px; font-size: 50px !important; }
.claps { display: flex; gap: 2px; line-height: 0; }

/* Pytle */
.sack-btn { border: 0; background: none; padding: 0; line-height: 0; transition: transform .15s var(--ease-bounce), opacity .3s; }
.sack-btn:hover { transform: translateY(-5px) rotate(-2deg); }
.sack-btn.right { transform: scale(1.08); }
.pic-card.into-left { animation: into-left .7s ease-in forwards; }
.pic-card.into-right { animation: into-right .7s ease-in forwards; }
@keyframes into-left { to { transform: translate(-330px, 40px) scale(.2); opacity: 0; } }
@keyframes into-right { to { transform: translate(330px, 40px) scale(.2); opacity: 0; } }

/* Sněhové koule */
.balls { display: flex; gap: 26px; }
.ball-btn {
  width: 170px; height: 170px; border-radius: 50%; border: 0; padding: 0;
  background: radial-gradient(circle at 35% 30%, #FFFFFF 0 35%, #DDE7F3 75%, #BFCDE2 100%);
  box-shadow: 0 10px 0 #9FB3CF, 0 14px 30px rgba(0, 0, 0, .3);
  font-family: var(--font-display); font-weight: 800; font-size: 96px; line-height: 1; color: #24407A;
  transition: transform .15s var(--ease-bounce), opacity .3s;
  animation: ball-in .6s var(--ease-bounce) backwards; animation-delay: calc(var(--i) * 80ms);
}
@keyframes ball-in { from { transform: translateY(-200px) scale(.6); opacity: 0; } }
.ball-btn:hover { transform: scale(1.05); }
.ball-btn.right { background: radial-gradient(circle at 35% 30%, #FFF3D1 0 35%, var(--gold) 100%); }
.ball-btn.wrong { opacity: .4; }

/* Písmenkový sníh */
.flakes { display: grid; grid-template-columns: repeat(6, 128px); gap: 10px; }
.flake-btn {
  position: relative; width: 128px; height: 128px; border-radius: 30px; border: 0; padding: 0;
  background: rgba(255, 255, 255, .1); display: flex; align-items: center; justify-content: center;
  transition: transform .15s var(--ease-bounce), background .2s;
  animation: pop-in .4s var(--ease-bounce) backwards; animation-delay: calc(var(--i) * 40ms);
}
.flake-btn .ic { position: absolute; opacity: .55; }
.flake-btn b { position: relative; font-family: var(--font-display); font-weight: 800; font-size: 64px; line-height: 1; color: var(--cream); }
.flake-btn:hover { transform: scale(1.06); }
.flake-btn.found { background: var(--gold); }
.flake-btn.found b { color: var(--brown-dark); }

/* Hláskový vláček */
.vlacek-top { display: flex; align-items: center; gap: 30px; }
.vlacek-top .word-big { color: var(--cream); }
.train { display: flex; align-items: flex-end; gap: 0; }
.coupler { width: 22px; height: 8px; margin-bottom: 92px; background: #3B2A12; border-radius: 4px; }
.wagon {
  border: 0; background: rgba(255, 255, 255, .08); border-radius: 26px; padding: 10px 12px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .15s var(--ease-bounce), background .2s, opacity .3s;
}
.wagon span { font-family: var(--font-display); font-weight: 800; font-size: 26px; color: var(--cream); }
.wagon:hover { transform: translateY(-4px); background: rgba(255, 255, 255, .16); }
.wagon.right { background: rgba(93, 187, 122, .45); }
.wagon.wrong { opacity: .4; }

/* Rukavice */
.mit-row { display: flex; gap: 26px; }
.mit-btn {
  position: relative; width: 150px; height: 150px; border-radius: 30px; border: 4px solid transparent; background: rgba(255, 255, 255, .08);
  display: flex; align-items: center; justify-content: center; transition: transform .15s var(--ease-bounce), box-shadow .15s;
  animation: pop-in .4s var(--ease-bounce) backwards; animation-delay: calc(var(--i) * 60ms);
}
.mit-btn b { position: absolute; top: 46px; font-family: var(--font-display); font-weight: 800; font-size: 50px; line-height: 1; color: #FFFFFF; text-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.mit-btn.paired { background: rgba(93, 187, 122, .35); border-color: #8FD3A8; }

/* Slabiky ve slově */
.syl-slots { display: flex; gap: 12px; padding: 12px; border-radius: 24px; border: 3px dashed #5C73A3; }
.syl-slot {
  min-width: 140px; height: 100px; border-radius: 20px; background: rgba(255, 255, 255, .06);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 54px; color: var(--brown-dark);
}
.syl-slot.filled { background: var(--cream); animation: pop-in .35s var(--ease-bounce); }
.syl-pile { display: flex; gap: 18px; }
.syl-btn {
  min-width: 150px; height: 110px; padding: 0 20px; border-radius: 26px; border: 4px solid var(--cream-line);
  background: var(--cream); color: var(--red); box-shadow: 0 6px 0 #CDB88E;
  font-family: var(--font-display); font-weight: 800; font-size: 58px; line-height: 1;
  animation: pop-in .4s var(--ease-bounce) backwards; animation-delay: calc(var(--i) * 70ms);
}
.syl-btn.gone { visibility: hidden; }

/* ---------- Nastavení ---------- */
.settings-card { width: 860px; padding: 30px 40px 34px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 28px; margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field-label { font-family: var(--font-display); font-weight: 800; font-size: 21px; line-height: 1.1; color: var(--brown-dark); }
.field-hint { font-size: 15px; font-weight: 700; color: var(--brown); margin: 0; line-height: 1.35; }
.field textarea, .field input {
  font: inherit; font-size: 19px; font-weight: 700; color: var(--brown-dark);
  background: #FFFDF8; border: 3px solid var(--cream-line); border-radius: 16px; padding: 12px 16px;
  user-select: text;
}
.field textarea { resize: none; height: 70px; }
.segmented { display: flex; background: var(--parchment); border-radius: 999px; padding: 5px; gap: 5px; }
.segmented button {
  flex: 1; height: 52px; border: 0; border-radius: 999px; background: transparent;
  font-family: var(--font-display); font-weight: 800; font-size: 19px; color: var(--brown);
}
.segmented button[aria-pressed="true"] { background: var(--red); color: var(--cream); box-shadow: 0 3px 0 var(--red-deep); }
.code-row { display: flex; gap: 10px; align-items: center; }
.code-box {
  flex: 1; min-width: 0; height: 56px; border-radius: 16px; background: var(--parchment);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 800; font-size: 30px; letter-spacing: .08em; color: var(--brown-dark);
  user-select: all; font-variant-numeric: tabular-nums;
}
.code-row input { flex: 1; min-width: 0; height: 56px; text-transform: uppercase; letter-spacing: .06em; }
.msg { min-height: 20px; margin: 0; font-size: 15px; font-weight: 800; }
.msg.ok { color: var(--green); }
.msg.err { color: var(--red); }
.danger-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn-danger { background: transparent; color: var(--red); border: 3px solid #E7B9B4; box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
