/* =========================================
   Vánoce 2H – adventní kalendář (styl)
   ========================================= */

:root {
  --night: #07132a;
  --night2: #0f2549;
  --gold: #f6c86a;
  --gold2: #e09b2d;
  --ink: #2b1a12;
  --muted: #b8c4da;
  --red: #d33a46;
  --green: #1f8a57;
  --gap: 10px;
  --pad: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: #f4f1ea;
  background:
    radial-gradient(900px 600px at 85% -5%, rgba(92, 140, 220, .35), transparent 60%),
    radial-gradient(700px 500px at 5% 10%, rgba(60, 90, 170, .30), transparent 60%),
    linear-gradient(180deg, #13305c 0%, var(--night2) 35%, var(--night) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
body.modal-open { overflow: hidden; }

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
.hidden { display: none !important; }

#snow { position: fixed; inset: 0; z-index: 3; pointer-events: none; }
#fxCanvas { position: fixed; inset: 0; z-index: 80; pointer-events: none; }

/* ---------- Měsíc ---------- */
.moon {
  position: fixed; top: 130px; right: 7%; z-index: 0;
  width: 86px; height: 86px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffdf3 0%, #f3ecd2 55%, #d9cfae 100%);
  box-shadow: 0 0 40px 10px rgba(255, 245, 210, .22), 0 0 120px 40px rgba(255, 245, 210, .10);
}
.moon::before, .moon::after { content: ''; position: absolute; border-radius: 50%; background: rgba(180, 170, 140, .28); }
.moon::before { width: 21%; height: 21%; top: 26%; left: 55%; }
.moon::after  { width: 14%; height: 14%; top: 60%; left: 28%; }

/* ---------- Světýlka ---------- */
.lights {
  position: absolute; top: 0; left: 0; right: 0; height: 56px; z-index: 4;
  display: flex; justify-content: center; overflow: hidden;
  list-style: none; pointer-events: none;
}
.lights li { position: relative; flex: 0 0 44px; height: 56px; }
.lights li::after {
  content: ''; position: absolute; top: -14px; left: 0; width: 44px; height: 28px;
  border-bottom: 2px solid #1a2433; border-radius: 50%;
}
.bulb {
  position: absolute; top: 17px; left: 50%; width: 11px; height: 18px; margin-left: -5.5px;
  border-radius: 50%; background: var(--c);
  box-shadow: 0 2px 16px 4px var(--c);
  animation: glow 1.6s ease-in-out infinite alternate; animation-delay: var(--d);
}
.bulb::before { content: ''; position: absolute; top: -5px; left: 2px; width: 7px; height: 6px; border-radius: 2px; background: #2a2f38; }
@keyframes glow {
  0%   { opacity: 1;   box-shadow: 0 2px 18px 5px var(--c); }
  100% { opacity: .4;  box-shadow: 0 2px 4px 0 var(--c); }
}

/* ---------- Horní lišta ---------- */
.topbar {
  position: relative; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  max-width: 1000px; margin: 0 auto; padding: 50px 18px 8px;
}
.brand { display: flex; align-items: center; gap: 8px; font-family: 'Playfair Display', Georgia, serif; font-weight: 900; font-size: 1.35rem; }
.brand-star { color: var(--gold); text-shadow: 0 0 12px rgba(246, 200, 106, .8); display: inline-block; animation: twinkle 2.4s ease-in-out infinite; }
.user-box { display: flex; align-items: center; gap: 8px; }
.score-pill {
  display: flex; align-items: baseline; gap: 6px; padding: 8px 14px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(246, 200, 106, .45);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-weight: 800;
}
#scoreValue { font-size: 1.15rem; color: var(--gold); }
.score-pill small { color: var(--muted); font-weight: 600; }
.score-pill.bump { animation: bump .5s; }
.btn-icon {
  width: 42px; height: 42px; border-radius: 50%; font-size: 1.15rem;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18);
  transition: transform .3s, background .2s;
}
.btn-icon:hover { background: rgba(255, 255, 255, .2); transform: rotate(90deg); }

/* ---------- Úvod ---------- */
.hero { position: relative; z-index: 1; text-align: center; max-width: 720px; margin: 0 auto; padding: 24px 20px 26px; }
.hero-kicker { text-transform: uppercase; letter-spacing: .28em; font-size: .78rem; font-weight: 800; color: var(--gold); margin-bottom: 10px; }
.hero h1 {
  font-family: 'Playfair Display', Georgia, serif; font-weight: 900;
  font-size: clamp(2.1rem, 8vw, 3.6rem); line-height: 1.05; text-shadow: 0 4px 30px rgba(0, 0, 0, .4);
}
.hero h1 span {
  font-size: .72em;
  background: linear-gradient(90deg, #ffe3a1, #f6c86a 45%, #ffad6b);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-text { margin: 14px auto 0; max-width: 520px; color: var(--muted); line-height: 1.55; }
.test-badge {
  display: inline-block; margin-top: 16px; padding: 6px 14px; border-radius: 999px;
  font-size: .72rem; font-weight: 800; letter-spacing: .06em; color: #ffe3a1;
  border: 1.5px dashed rgba(246, 200, 106, .6); background: rgba(246, 200, 106, .08);
}

/* ---------- Kalendář ---------- */
.calendar-wrap {
  position: relative; z-index: 1; container-type: inline-size;
  max-width: 980px; margin: 0 auto; padding: 6px 14px calc(16vh + 40px);
}
.calendar {
  --cols: 4;
  --cell: calc((100cqw - 2 * var(--pad) - (var(--cols) - 1) * var(--gap)) / var(--cols));
  display: grid; grid-template-columns: repeat(var(--cols), 1fr);
  grid-auto-rows: var(--cell); grid-auto-flow: dense; gap: var(--gap);
  padding: var(--pad); border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
  border: 1px solid rgba(246, 200, 106, .25);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .08);
}
@media (min-width: 760px) {
  .calendar { --cols: 8; --gap: 12px; --pad: 18px; }
}

.cell {
  position: relative; perspective: 900px; border-radius: 14px; outline: none;
  animation: cellIn .7s cubic-bezier(.2, .9, .3, 1.2) backwards;
  animation-delay: calc(var(--i) * 40ms);
}
.cell.wide { grid-column: span 2; }
.cell.tall { grid-row: span 2; }
.cell.big  { grid-column: span 2; grid-row: span 2; }

/* Vnitřek okénka (co je za dvířky) */
.inside {
  position: absolute; inset: 0; border-radius: 14px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: radial-gradient(circle at 50% 45%, #ffe9a8 0%, #f1b54a 30%, #9a4f16 80%, #5e2c0b 100%);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .25), inset 0 8px 22px rgba(0, 0, 0, .45);
}
.inside-icon { font-size: calc(var(--cell) * .36); line-height: 1; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .35)); }
.big .inside-icon { font-size: calc(var(--cell) * .7); }
.cell.open .inside-icon, .cell.done .inside-icon { animation: popIcon .6s .25s both; }
.inside-label {
  font-weight: 900; font-size: calc(var(--cell) * .14); color: #3a1a06;
  background: rgba(255, 248, 230, .9); padding: 1px 8px; border-radius: 999px;
}
.inside-label:empty { display: none; }
.cell.done .inside::after {
  content: '✓'; position: absolute; top: 6px; right: 7px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: .72rem; font-weight: 900; color: #fff; background: var(--green);
}

/* Dvířka */
.door {
  position: absolute; inset: 0; border-radius: 14px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  color: #fff8ec; transform-origin: left center;
  background:
    radial-gradient(rgba(255, 255, 255, .10) 1.2px, transparent 1.4px) 0 0 / 12px 12px,
    linear-gradient(150deg, var(--a), var(--b));
  box-shadow: 0 6px 14px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .25), inset 0 -3px 0 rgba(0, 0, 0, .2);
  transition: transform .9s cubic-bezier(.3, 1.2, .4, 1), box-shadow .5s, filter .3s;
}
.door::before {
  content: ''; position: absolute; inset: 6px; border-radius: 10px; pointer-events: none;
  border: 1.5px solid rgba(246, 200, 106, .55);
}
.door::after {
  content: ''; position: absolute; top: 0; left: -80%; width: 50%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
  transform: skewX(-18deg); transition: left .8s;
}
.num {
  position: relative; font-family: 'Playfair Display', Georgia, serif; font-weight: 900; line-height: 1;
  font-size: calc(var(--cell) * .42);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .25), 0 0 18px rgba(255, 255, 255, .15);
}
.wide .num, .tall .num { font-size: calc(var(--cell) * .5); }
.big .num { font-size: calc(var(--cell) * .9); }
.deco { position: absolute; top: 9px; right: 11px; font-size: calc(var(--cell) * .15); opacity: .55; }
.knob { position: absolute; right: 10px; top: 50%; width: 7px; height: 7px; margin-top: -3.5px; border-radius: 50%; background: var(--gold); box-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.lock { display: none; position: absolute; bottom: 8px; left: 10px; font-size: .8rem; }
.locked .lock { display: block; }
.locked .door { filter: saturate(.55) brightness(.75); }

/* Okénko 24 jako dárek */
.big .door {
  background:
    linear-gradient(90deg, transparent 45%, rgba(246, 200, 106, .9) 45% 55%, transparent 55%),
    linear-gradient(0deg, transparent 45%, rgba(246, 200, 106, .9) 45% 55%, transparent 55%),
    radial-gradient(rgba(255, 255, 255, .10) 1.2px, transparent 1.4px) 0 0 / 12px 12px,
    linear-gradient(150deg, var(--a), var(--b));
}
.bow { position: absolute; top: 8%; left: 50%; transform: translateX(-50%); font-size: calc(var(--cell) * .42); }

/* Barvy dvířek */
.c1 .door { --a: #e2464f; --b: #8f1c26; }
.c2 .door { --a: #2a9a63; --b: #0f4d33; }
.c3 .door { --a: #3a6fc0; --b: #173466; }
.c4 .door { --a: #fffaf0; --b: #ead6b0; color: #9c1f2b; }
.c4 .door::before { border-color: rgba(156, 31, 43, .35); }
.c5 .door { --a: #a63a6a; --b: #56143a; }

/* Stavy dvířek */
@media (hover: hover) {
  .cell:hover .door::after { left: 140%; }
  .cell:not(.open):not(.done):not(.locked):hover .door {
    transform: rotateY(-16deg);
    box-shadow: 10px 10px 24px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .25);
  }
}
.cell:active .door { filter: brightness(1.12); }
.cell:focus-visible .door { box-shadow: 0 0 0 3px var(--gold), 0 6px 14px rgba(0, 0, 0, .35); }
.cell.open { z-index: 6; }
.cell.open .door { transform: rotateY(-95deg); box-shadow: -10px 0 24px rgba(0, 0, 0, .5); }
.cell.done .door { transform: rotateY(-72deg); box-shadow: -6px 0 16px rgba(0, 0, 0, .45); }

.footer { text-align: center; color: rgba(255, 255, 255, .45); font-size: .78rem; margin-top: 18px; }

/* ---------- Kopce ---------- */
.hills { position: fixed; left: 0; right: 0; bottom: 0; width: 100%; height: 16vh; min-height: 90px; z-index: 0; pointer-events: none; }

/* ---------- Tlačítka ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 22px; border-radius: 999px; font-weight: 800; font-size: 1.05rem;
  transition: transform .2s cubic-bezier(.3, 1.6, .5, 1), box-shadow .15s, filter .2s;
}
.btn::after {
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: skewX(-20deg); transition: left .6s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn:hover::after { left: 130%; }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn-block { width: 100%; }
.btn-sm { padding: 10px 16px; font-size: .9rem; }

.btn-gold { color: #4a2405; background: linear-gradient(180deg, #ffd98a, #e9a33b); box-shadow: 0 5px 0 #b0701c, 0 12px 24px rgba(224, 155, 45, .35); }
.btn-red  { color: #fff;    background: linear-gradient(180deg, #e9535e, #b2232f); box-shadow: 0 5px 0 #7d1520, 0 12px 24px rgba(211, 58, 70, .3); }
.btn-green{ color: #fff;    background: linear-gradient(180deg, #34b075, #187348); box-shadow: 0 5px 0 #0f4d30, 0 12px 24px rgba(31, 138, 87, .3); }
.btn-ghost{ color: #5a4636; background: #fff; border: 2px solid #eedfc0; box-shadow: 0 4px 0 #e5d3ae; }
.btn-ghost.confirm { color: var(--red); border-color: var(--red); }
.btn-gold:active, .btn-red:active, .btn-green:active, .btn-ghost:active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.pulse { animation: pulse 1.8s infinite; }

/* ---------- Okna (modaly) ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(4, 10, 22, .62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.card {
  position: relative; width: 100%; max-width: 480px; max-height: calc(100dvh - 32px); overflow-y: auto;
  padding: 28px 22px 24px; border-radius: 24px; color: var(--ink);
  background: linear-gradient(180deg, #fffaf0, #f6ead2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5), inset 0 0 0 2px rgba(246, 200, 106, .6);
  transform: translateY(26px) scale(.94);
  transition: transform .45s cubic-bezier(.2, 1.3, .4, 1);
}
.overlay.show .card { transform: none; }
.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 8px;
  background: repeating-linear-gradient(-45deg, #d33a46 0 10px, #fff 10px 20px);
}
.card h2 { font-family: 'Playfair Display', Georgia, serif; font-weight: 900; font-size: 1.7rem; text-align: center; color: #8f1c26; }
.card-deco { font-size: 3rem; text-align: center; animation: floaty 3s ease-in-out infinite; }
.muted { color: #7a6a58; text-align: center; margin: 6px 0 18px; }
.btn-close {
  position: absolute; top: 16px; right: 14px; z-index: 2; width: 36px; height: 36px; border-radius: 50%;
  background: rgba(43, 26, 18, .08); color: var(--ink); transition: transform .25s, background .2s;
}
.btn-close:hover { transform: rotate(90deg); background: rgba(43, 26, 18, .15); }

/* Formulář */
.field { display: block; margin-bottom: 14px; font-weight: 800; font-size: .9rem; color: #4a3426; }
.field small { font-weight: 600; color: #9a8670; }
.field input {
  display: block; width: 100%; margin-top: 6px; padding: 13px 14px; border-radius: 12px;
  border: 2px solid #ecdcbc; background: #fff; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink);
  transition: border-color .2s, box-shadow .2s;
}
.field input:focus { outline: none; border-color: var(--gold2); box-shadow: 0 0 0 4px rgba(246, 200, 106, .3); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 18px; font-size: .85rem; line-height: 1.4; color: #5a4636; }
.check input { flex: none; width: 20px; height: 20px; margin-top: 1px; accent-color: var(--red); }
.tiny { margin-top: 12px; font-size: .75rem; text-align: center; color: #9a8670; }

/* Menu */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 4px 0 18px; }
.stat { padding: 14px; border-radius: 14px; text-align: center; background: #fff; border: 2px solid #eedfc0; }
.stat b { display: block; font-family: 'Playfair Display', Georgia, serif; font-size: 1.8rem; color: #8f1c26; }
.stat span { font-size: .8rem; font-weight: 700; color: #7a6a58; }

/* ---------- Hra – obecné ---------- */
.game-head { display: flex; align-items: center; gap: 12px; margin: 6px 44px 18px 0; }
.day-badge {
  flex: none; width: 50px; height: 50px; border-radius: 14px; display: grid; place-items: center;
  font-family: 'Playfair Display', Georgia, serif; font-weight: 900; font-size: 1.5rem; color: #fff;
  background: linear-gradient(150deg, #e2464f, #8f1c26); box-shadow: 0 4px 0 #6a121a;
}
.game-type { font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: #b07a2a; }
.game-head h2 { text-align: left; font-size: 1.45rem; line-height: 1.15; }

.intro { text-align: center; }
.intro-icon {
  width: 110px; height: 110px; margin: 4px auto 16px; border-radius: 50%; display: grid; place-items: center; font-size: 3.8rem;
  background: radial-gradient(circle, #fff 0%, #fdebc4 70%);
  box-shadow: 0 10px 30px rgba(224, 155, 45, .35), inset 0 0 0 3px rgba(246, 200, 106, .6);
  animation: floaty 3s ease-in-out infinite;
}
.intro-desc { color: #5a4636; line-height: 1.55; margin-bottom: 16px; }
.intro-best { margin: -4px 0 16px; color: #1f6b45; }

.hud { display: flex; justify-content: space-between; margin-bottom: 10px; font-weight: 800; color: #5a4636; }
.hud b { font-size: 1.15rem; color: #8f1c26; }
.progress { height: 8px; margin-bottom: 14px; border-radius: 99px; background: #efe2c6; overflow: hidden; }
.progress div { height: 100%; border-radius: 99px; background: linear-gradient(90deg, #f6c86a, #e04a55); transition: width .4s; }
.q-count { font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #b07a2a; }
.hint { margin-top: 10px; font-size: .8rem; text-align: center; color: #8a7764; }

/* Kvíz */
.q-text { margin: 6px 0 16px; font-family: 'Playfair Display', Georgia, serif; font-size: 1.3rem; line-height: 1.3; }
.answers { display: grid; gap: 10px; }
.answer {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; text-align: left;
  border-radius: 14px; background: #fff; border: 2px solid #eedfc0; font-weight: 700; color: var(--ink);
  transition: transform .2s, border-color .2s, background .2s, box-shadow .2s;
  animation: slideIn .45s cubic-bezier(.2, .9, .3, 1.2) backwards;
}
@media (hover: hover) {
  .answer:hover { transform: translateX(4px); border-color: var(--gold); box-shadow: 0 6px 16px rgba(224, 155, 45, .2); }
}
.answer:active { transform: scale(.98); }
.answer-key { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: .85rem; font-weight: 900; color: #b07a2a; background: #fbefd5; }
.answer.right { background: #dcf5e7; border-color: var(--green); }
.answer.right .answer-key { background: var(--green); color: #fff; }
.answer.wrong { background: #fde1e1; border-color: var(--red); animation: shake .45s; }
.answer.wrong .answer-key { background: var(--red); color: #fff; }

/* Pexeso */
.memory { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mcard { aspect-ratio: 1; perspective: 600px; animation: cellIn .5s backwards; }
.mcard-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.3, 1.3, .5, 1); }
.mcard.flipped .mcard-inner { transform: rotateY(180deg); }
.mface {
  position: absolute; inset: 0; border-radius: 12px; display: grid; place-items: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden; font-size: clamp(1.6rem, 8vw, 2.2rem);
}
.mback {
  font-size: 1.2rem; color: rgba(255, 255, 255, .75);
  background: radial-gradient(rgba(255, 255, 255, .15) 1.2px, transparent 1.4px) 0 0 / 10px 10px, linear-gradient(150deg, #e2464f, #8f1c26);
  box-shadow: inset 0 0 0 3px rgba(246, 200, 106, .55), 0 4px 10px rgba(0, 0, 0, .15);
}
.mfront { transform: rotateY(180deg); background: #fff; box-shadow: inset 0 0 0 2px #eedfc0; }
.mcard.matched { animation: matchPop .5s; }
.mcard.matched .mfront { background: #effbf4; box-shadow: inset 0 0 0 3px var(--green), 0 0 16px rgba(31, 138, 87, .35); }
@media (hover: hover) { .mcard:not(.flipped):hover .mcard-inner { transform: translateY(-3px); } }

/* Akční hry */
.stage { position: relative; overflow: hidden; border-radius: 18px; background: linear-gradient(180deg, #14305e, #0b1d3c); box-shadow: inset 0 0 0 2px rgba(246, 200, 106, .35); }
.catch { display: block; width: 100%; touch-action: none; }
.stage-msg { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 4; }
.cd { font-family: 'Playfair Display', Georgia, serif; font-weight: 900; font-size: 3.4rem; color: #fff; text-shadow: 0 4px 20px rgba(0, 0, 0, .55); animation: cdPop .7s both; }
.holes-stage { padding: 16px; background: linear-gradient(180deg, #dbe8fb, #f6faff); }
.holes-stage .cd { color: #8f1c26; text-shadow: 0 4px 20px rgba(255, 255, 255, .9); }
.holes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.hole {
  position: relative; aspect-ratio: 1; border-radius: 50%; overflow: hidden;
  background: radial-gradient(ellipse at 50% 60%, #1d2f4d 0%, #2c4570 55%, #c9dbf2 72%, #fff 100%);
  box-shadow: inset 0 -6px 0 rgba(255, 255, 255, .7), 0 6px 12px rgba(30, 60, 110, .18);
}
.mole { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(2rem, 11vw, 2.8rem); transform: translateY(105%); transition: transform .16s cubic-bezier(.3, 1.5, .5, 1); }
.hole.up .mole { transform: translateY(8%); }
.hole.hit { animation: holeHit .3s; }
.float { position: absolute; z-index: 5; transform: translateX(-50%); font-weight: 900; font-size: 1.35rem; pointer-events: none; animation: floatUp .8s forwards; }
.float.good { color: var(--green); }
.float.bad { color: var(--red); }

/* Výsledek */
.result { text-align: center; padding: 6px 0; }
.result-msg { font-family: 'Playfair Display', Georgia, serif; font-size: 1.5rem; font-weight: 900; color: #8f1c26; }
.result-points {
  width: 160px; height: 160px; margin: 16px auto; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 35% 30%, #fff7da, #f6c86a 60%, #d88f25);
  box-shadow: 0 14px 40px rgba(224, 155, 45, .45), inset 0 -6px 0 rgba(0, 0, 0, .12);
  animation: resultIn .7s cubic-bezier(.2, 1.5, .4, 1) both;
}
.result-points span { font-family: 'Playfair Display', Georgia, serif; font-size: 3.4rem; font-weight: 900; line-height: 1; color: #5a2a05; }
.result-points small { font-weight: 800; color: #7a4a12; }
.result-total { margin-bottom: 18px; color: #5a4636; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 90; max-width: 92vw;
  padding: 12px 20px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: #fff; font-weight: 700; background: rgba(10, 22, 44, .94); border: 1px solid rgba(246, 200, 106, .5);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .4);
  transform: translate(-50%, 180%); transition: transform .45s cubic-bezier(.2, 1.4, .4, 1);
}
.toast.show { transform: translate(-50%, 0); }

/* ---------- Animace ---------- */
@keyframes cellIn   { from { opacity: 0; transform: translateY(24px) scale(.85); } }
@keyframes popIcon  { 0% { transform: scale(.3) rotate(-15deg); opacity: 0; } 70% { transform: scale(1.15) rotate(4deg); opacity: 1; } 100% { transform: scale(1); } }
@keyframes shake    { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
.shake { animation: shake .5s 0s !important; }
@keyframes twinkle  { 50% { opacity: .5; transform: scale(.85) rotate(20deg); } }
@keyframes bump     { 40% { transform: scale(1.18); } }
@keyframes floaty   { 50% { transform: translateY(-8px) rotate(3deg); } }
@keyframes pulse    { 0% { box-shadow: 0 5px 0 #b0701c, 0 12px 24px rgba(224, 155, 45, .35), 0 0 0 0 rgba(246, 200, 106, .65); } 100% { box-shadow: 0 5px 0 #b0701c, 0 12px 24px rgba(224, 155, 45, .35), 0 0 0 16px rgba(246, 200, 106, 0); } }
@keyframes slideIn  { from { opacity: 0; transform: translateY(12px); } }
@keyframes matchPop { 50% { transform: scale(1.12); } }
@keyframes cdPop    { 0% { transform: scale(2.2); opacity: 0; } 40% { transform: scale(1); opacity: 1; } 100% { transform: scale(.9); opacity: .9; } }
@keyframes holeHit  { 50% { transform: scale(.9); } }
@keyframes floatUp  { to { transform: translate(-50%, -40px); opacity: 0; } }
@keyframes resultIn { from { transform: scale(.3) rotate(-20deg); opacity: 0; } }

/* ---------- Mobil ---------- */
@media (max-width: 600px) {
  .moon { width: 40px; height: 40px; top: 104px; right: 4%; }
  .brand { font-size: 1.15rem; }
  .score-pill { padding: 7px 12px; }
  .card { padding: 26px 18px 22px; }
}

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

/* =========================================================
   NOVÉ ČÁSTI (verze s účty a databází)
   ========================================================= */

/* ---------- Grafika od grafiků ---------- */
.door.has-img { background: center / cover no-repeat; }
.door.has-img::before, .door.has-img .deco, .door.has-img .knob, .door.has-img .bow { display: none; }
.inside.has-img { background: center / cover no-repeat; }
.inside.has-img .inside-icon { display: none; }
.inside.has-img .inside-label { position: absolute; bottom: 8%; }

body.ma-pozadi { background: #0f2549 var(--bg-mobil) center bottom / cover no-repeat fixed; }
@media (min-width: 760px) { body.ma-pozadi { background-image: var(--bg-pc); } }
body.ma-pozadi .moon, body.ma-pozadi .hills { display: none; }

.deco-tree, .deco-char { position: fixed; bottom: 0; z-index: 0; pointer-events: none; }
.deco-tree { left: 0; }
.deco-char { right: 0; }
.deco-tree img, .deco-char img { display: block; height: 22vh; width: auto; max-width: 40vw; object-fit: contain; animation: kyvani 4s ease-in-out infinite; transform-origin: bottom center; }
@keyframes kyvani { 50% { transform: rotate(-2deg); } }

.sprite { display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.sprite img { width: 80%; height: 80%; object-fit: contain; image-rendering: auto; }

/* ---------- Registrace ---------- */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-error { min-height: 1.2em; margin: -4px 0 12px; font-size: .88rem; font-weight: 700; color: var(--red); text-align: center; }
.form-error:empty { margin: 0; min-height: 0; }
.link-btn { display: block; margin: 14px auto 0; padding: 6px 10px; font-size: .9rem; color: #7a5a3a; text-decoration: underline; text-underline-offset: 3px; }
.link-btn b { color: #8f1c26; }
.test-tools { margin-top: 18px; padding-top: 14px; border-top: 2px dashed #eedfc0; display: grid; gap: 8px; }
.test-tools .tiny { margin: 0 0 2px; }
#menuEmail { word-break: break-all; }

/* ---------- Kvízy a připravované hry ---------- */
.ukazka-badge { margin: 0 0 12px; padding: 6px 10px; border-radius: 10px; text-align: center; font-size: .78rem; font-weight: 800; color: #8a5a00; background: #fff1c7; border: 1.5px dashed #e8b74a; }
.pripravujeme { text-align: center; padding: 10px 0; color: #5a4636; }
.pripravujeme-ikona { font-size: 3.5rem; margin-bottom: 10px; animation: floaty 3s ease-in-out infinite; }
.pripravujeme p { margin-bottom: 16px; line-height: 1.5; }
.mface .sprite { width: 100%; height: 100%; }

/* ---------- Stupně vítězů ---------- */
body.rezim-vysledky .hero,
body.rezim-vysledky .calendar-wrap,
body.rezim-vysledky .user-box { display: none !important; }
.podium { position: relative; z-index: 1; max-width: 620px; margin: 0 auto; padding: 30px 16px calc(16vh + 40px); text-align: center; }
.podium-title { font-family: 'Playfair Display', Georgia, serif; font-weight: 900; font-size: clamp(2.2rem, 9vw, 3.6rem); line-height: 1.05; margin-bottom: 34px; text-shadow: 0 4px 30px rgba(0, 0, 0, .4); }
.podium-stage { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 10px; }
.podium-col { display: flex; flex-direction: column; align-items: center; animation: podiumIn .8s cubic-bezier(.2, 1.2, .4, 1) both; animation-delay: var(--d); }
.podium-who { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 10px; min-height: 92px; justify-content: flex-end; }
.podium-medal { font-size: 2.2rem; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .4)); }
.p1 .podium-medal { font-size: 3rem; animation: floaty 2.6s ease-in-out infinite; }
.podium-name { font-weight: 900; font-size: clamp(.95rem, 4vw, 1.2rem); line-height: 1.2; word-break: break-word; }
.podium-points { font-size: .85rem; font-weight: 700; color: var(--gold); }
.podium-block {
  width: 100%; display: flex; justify-content: center; padding-top: 12px; border-radius: 14px 14px 4px 4px;
  font-family: 'Playfair Display', Georgia, serif; font-weight: 900; font-size: 2.6rem; color: rgba(255, 255, 255, .92);
  box-shadow: 0 14px 30px rgba(0, 0, 0, .35), inset 0 2px 0 rgba(255, 255, 255, .45), inset 0 -6px 0 rgba(0, 0, 0, .15);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
}
.p1 .podium-block { height: 170px; background: linear-gradient(180deg, #ffe08a, #e0a12d); color: #6b3c05; text-shadow: 0 2px 0 rgba(255, 255, 255, .4); }
.p2 .podium-block { height: 125px; background: linear-gradient(180deg, #f1f4f8, #aab4c3); color: #47505e; text-shadow: 0 2px 0 rgba(255, 255, 255, .5); }
.p3 .podium-block { height: 95px; background: linear-gradient(180deg, #f0b583, #b8693a); }
.podium-note { margin: 26px auto 0; max-width: 420px; color: var(--muted); line-height: 1.55; }
#podiumBack { margin-top: 18px; }
@keyframes podiumIn { from { opacity: 0; transform: translateY(60px); } }

/* =========================================================
   DEN 8 – SNĚHOVÁ STŘELNICE (pixelový styl)
   ========================================================= */
.sb { font-family: 'Pixelify Sans', 'Courier New', monospace; }
.sb-cabinet { background: #0a1226; border: 4px solid #b8e9f4; box-shadow: 0 0 0 4px #1d3b66, 6px 6px 0 4px rgba(0, 0, 0, .35); color: #d9eef7; }
.sb-cabinet.sb-shake { animation: sbShake .16s steps(2); }
@keyframes sbShake { 0% { transform: translate(3px, -2px); } 50% { transform: translate(-3px, 2px); } 100% { transform: none; } }
.sb-hud { display: grid; grid-template-columns: repeat(3, 1fr); background: #0b1530; border-bottom: 4px solid #b8e9f4; text-align: center; }
.sb-cell { padding: 6px 4px 4px; border-right: 4px solid #1d3b66; }
.sb-cell:last-child { border-right: 0; }
.sb-cell span { display: block; color: #6fa3c2; font-size: 11px; letter-spacing: 2px; }
.sb-cell strong { display: block; font-size: 24px; color: #ffd23f; text-shadow: 2px 2px 0 #000; font-weight: 700; }
.sb-warn strong { color: #ff4d4d; animation: sbBlink .5s steps(1) infinite; }
@keyframes sbBlink { 50% { opacity: .25; } }
.sb-game { position: relative; overflow: hidden; width: 100%; height: min(440px, 58vh); min-height: 330px; touch-action: manipulation; user-select: none; -webkit-user-select: none; background: #07101f; }
.sb-game canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; image-rendering: pixelated; }
.sb-bg { z-index: 0; }
.sb-fx { z-index: 6; }
.sb-game::after { content: ''; position: absolute; inset: 0; z-index: 9; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .14) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 60px #0009; }
.sb-gift { position: absolute; z-index: 3; image-rendering: pixelated; user-select: none; -webkit-user-drag: none; transform: translate(-50%, -50%); animation: sbAppear .25s steps(4) both; filter: drop-shadow(0 4px 0 #0006); }
@keyframes sbAppear { from { opacity: 0; scale: .3; } to { opacity: 1; scale: 1; } }
.sb-snowball { position: absolute; z-index: 5; width: 16px; height: 16px; background: #fff; pointer-events: none; transform: translate(-50%, -50%);
  clip-path: polygon(25% 0, 75% 0, 75% 12%, 100% 12%, 100% 88%, 75% 88%, 75% 100%, 25% 100%, 25% 88%, 0 88%, 0 12%, 25% 12%); box-shadow: inset -4px -4px 0 #a9d4ea; }
.sb-pop { position: absolute; z-index: 8; pointer-events: none; font-weight: 700; font-size: 28px; transform: translate(-50%, -50%); animation: sbRise .9s steps(9) forwards; white-space: nowrap; }
.sb-good { color: #ffd23f; text-shadow: 3px 3px 0 #0a7a3c, -2px 0 0 #000, 2px -2px 0 #000; }
.sb-bad { color: #ff4d4d; text-shadow: 3px 3px 0 #5a0d0d, -2px 0 0 #000; }
@keyframes sbRise { from { opacity: 1; margin-top: 0; } 70% { opacity: 1; } to { opacity: 0; margin-top: -56px; } }
.sb-msg { position: absolute; z-index: 10; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; background: rgba(6, 11, 20, .82); padding: 18px; text-align: center; }
.sb-msg.sb-hidden { display: none; }
.sb-msg h4 { margin: 0 0 10px; font-size: 30px; text-transform: uppercase; color: #ffd23f; text-shadow: 3px 3px 0 #b3361f; display: flex; align-items: center; gap: 10px; }
.sb-msg p { font-size: 18px; }
.sb-msg b { color: #ffd23f; }
.sb-ico { width: 22px; height: 22px; fill: #dff5ff; shape-rendering: crispEdges; }
.sb-cd { font-size: 64px; font-weight: 700; color: #ffd23f; text-shadow: 4px 4px 0 #b3361f, 8px 8px 0 #000; animation: cdPop .7s steps(6) both; }
.sb .hint { font-family: 'Nunito', sans-serif; }

/* ---------- Náhled: co ještě chybí ---------- */
.status-sticker {
  position: absolute; left: 6px; bottom: 6px; z-index: 2;
  width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 13px; line-height: 1; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
  border: 2px solid var(--st);
}
.cell .status-sticker { left: auto; right: 6px; bottom: 6px; }
.st-quiz { --st: #3a6fc0; }
.st-build { --st: #e09b2d; }
.st-idea { --st: #a63a6a; }
.st-art { --st: #2a9a63; }
.legenda {
  margin: 16px auto 0; max-width: 460px; padding: 12px 14px; border-radius: 16px; text-align: left;
  background: rgba(255, 255, 255, .07); border: 1px solid rgba(246, 200, 106, .35); color: var(--muted); font-size: .85rem; line-height: 1.45;
}
.legenda-title { font-weight: 800; color: var(--gold); letter-spacing: .08em; text-transform: uppercase; font-size: .72rem; margin-bottom: 4px; }
.legenda ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; }
.legenda li { display: flex; align-items: center; gap: 6px; }
.legenda .status-sticker { position: static; width: 22px; height: 22px; font-size: 12px; }
.intro-note { margin: -4px 0 16px; padding: 10px 12px; border-radius: 12px; font-size: .88rem; font-weight: 700; line-height: 1.45; color: #4a3426; background: #fff; border: 2px dashed var(--st); }

/* ---------- Jeden pokus ---------- */
.one-try { margin-top: 12px; font-size: .82rem; font-weight: 700; color: #8a6a4a; }
.leave-confirm { position: absolute; inset: 0; z-index: 20; display: none; align-items: center; justify-content: center; padding: 18px; background: rgba(43, 26, 18, .55); border-radius: 24px; }
.leave-confirm.show { display: flex; animation: slideIn .25s; }
.leave-box { width: 100%; max-width: 340px; padding: 22px 18px; border-radius: 18px; text-align: center; background: #fffaf0; box-shadow: 0 20px 50px rgba(0, 0, 0, .4); color: var(--ink); line-height: 1.5; }
.leave-title { font-family: 'Playfair Display', Georgia, serif; font-weight: 900; font-size: 1.4rem; color: #8f1c26; margin-bottom: 6px; }
.leave-box .result-actions { margin-top: 16px; }
