@font-face { font-family: Fredoka; font-weight: 300 700; font-display: swap; src: url(font/fredoka-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Fredoka; font-weight: 300 700; font-display: swap; src: url(font/fredoka-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --ink: #2b1640;
  --bg1: #3a1d55;
  --bg2: #7a2650;
  --cream: #fff6ea;
  --red: #e8414f;
  --gold: #ffc53d;
  --mint: #3ecf9a;
  --sky: #5bb8ff;
  --r: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--cream);
  font-family: Fredoka, "Trebuchet MS", system-ui, sans-serif; font-weight: 500;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; touch-action: none; }
button { font: inherit; }

.screen { position: fixed; inset: 0; display: none; }
.screen.on { display: block; }

.btn { border: 3px solid var(--ink); background: var(--gold); color: var(--ink); border-radius: 999px; padding: .55em 1.3em;
  font-weight: 700; font-size: 1.05rem; cursor: pointer; box-shadow: 0 4px 0 var(--ink); transition: transform .08s, box-shadow .08s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn.big { font-size: 1.6rem; padding: .5em 2.2em; }
.btn.ghost { background: rgba(255,255,255,.12); color: var(--cream); border-color: rgba(255,255,255,.35); box-shadow: none; }
.btn.small { font-size: .95rem; padding: .35em 1em; }
.btn.round { width: 44px; height: 44px; padding: 0; font-size: .9rem; background: rgba(255,255,255,.9); }
.btn.mint { background: var(--mint); }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* Úvod */
#titleBg { position: absolute; inset: 0; width: 100%; height: 100%; }
.titleBox { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 20px; }
.logo { font-size: clamp(3.2rem, 12vw, 7rem); font-weight: 700; letter-spacing: -.02em; line-height: 1; color: var(--cream);
  text-shadow: 0 6px 0 var(--ink), 0 0 40px rgba(255,120,150,.5); }
.logo span { color: var(--gold); }
.sub { margin: 0 0 14px; font-size: clamp(1.05rem, 3vw, 1.5rem); opacity: .92; }
.row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* Lišta */
.bar { position: absolute; top: 0; left: 0; right: 0; height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px;
  padding-top: env(safe-area-inset-top); z-index: 3; }
.barTitle { font-size: 1.35rem; font-weight: 700; }
.starsTotal { color: var(--gold); font-weight: 700; font-size: 1.2rem; min-width: 90px; text-align: right; }

/* Mapa */
#map { background: radial-gradient(circle at 35% 40%, #5a2a6e, var(--ink) 70%); }
.mapWrap { position: absolute; inset: 64px 0 0 0; display: flex; gap: 10px; padding: 0 16px 16px; }
.bodyHolder { flex: 1 1 55%; position: relative; display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; }
.bodyHolder svg { height: 100%; max-height: 100%; max-width: 100%; overflow: visible; transition: transform 1.1s cubic-bezier(.6,0,.3,1), opacity 1.1s; }
.bodyHolder svg.zoom { opacity: 0; }
.missionList { flex: 1 1 45%; max-width: 460px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 4px 4px 20px; touch-action: pan-y; }
.mItem { display: flex; align-items: center; gap: 12px; text-align: left; background: rgba(255,255,255,.08); border: 2px solid rgba(255,255,255,.15);
  border-radius: var(--r); padding: 10px 14px; color: var(--cream); cursor: pointer; transition: background .15s, border-color .15s; }
.mItem:hover, .mItem.hl { background: rgba(255,255,255,.16); border-color: var(--gold); }
.mItem .ic { font-size: 1.9rem; width: 46px; height: 46px; display: grid; place-items: center; background: rgba(0,0,0,.25); border-radius: 50%; flex: none; }
.mItem .tx { flex: 1; min-width: 0; }
.mItem b { display: block; font-size: 1.08rem; }
.mItem small { opacity: .78; font-size: .88rem; }
.mItem .st { color: var(--gold); font-size: 1.05rem; letter-spacing: 2px; white-space: nowrap; }
.mItem .st i { color: rgba(255,255,255,.2); font-style: normal; }
.hot { cursor: pointer; }
.hot circle.ring { fill: none; stroke: var(--gold); stroke-width: 3; animation: pulse 1.6s infinite; transform-box: fill-box; transform-origin: center; }
.hot circle.dot { fill: var(--gold); stroke: var(--ink); stroke-width: 2.5; }
.hot text { font-weight: 700; font-size: 15px; fill: var(--ink); text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.hot.done circle.dot { fill: var(--mint); }
.hot:hover circle.dot, .hot.hl circle.dot { fill: #fff; }
@keyframes pulse { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }
.organ { transition: filter .2s; }
.organ.hl { filter: brightness(1.35) drop-shadow(0 0 6px #fff); }

@media (max-width: 760px) {
  .mapWrap { flex-direction: column; }
  .bodyHolder { flex: 1 1 50%; }
  .missionList { flex: 1 1 50%; max-width: none; }
  .mItem { padding: 8px 10px; }
  .mItem small { display: none; }
}

/* Atlas */
#atlas { background: radial-gradient(circle at 60% 30%, #4b2363, var(--ink) 70%); }
.atlasGrid { position: absolute; inset: 64px 0 0 0; overflow-y: auto; padding: 8px 16px 30px; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); align-content: start; touch-action: pan-y; }
.fact { background: var(--cream); color: var(--ink); border-radius: var(--r); padding: 14px 16px; border: 3px solid var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,.35); }
.fact h4 { margin: 0 0 6px; font-size: 1.05rem; display: flex; gap: 8px; align-items: center; }
.fact p { margin: 0; font-weight: 400; line-height: 1.4; }
.fact.locked { background: rgba(255,255,255,.07); color: rgba(255,255,255,.45); border-color: rgba(255,255,255,.12); box-shadow: none; }
.atlasSec { grid-column: 1 / -1; font-size: 1.2rem; font-weight: 700; margin-top: 14px; color: var(--gold); }

/* Hra */
#game { background: #000; }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hud { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); pointer-events: none; }
.hudL { background: rgba(43,22,64,.72); border-radius: 14px; padding: 8px 12px; max-width: min(430px, 62vw); }
.hudTitle { font-weight: 700; font-size: .95rem; color: var(--gold); }
.hudGoal { font-size: .98rem; line-height: 1.25; }
.prog { height: 9px; background: rgba(255,255,255,.18); border-radius: 9px; margin-top: 6px; overflow: hidden; }
.prog div { height: 100%; width: 0; background: linear-gradient(90deg, var(--mint), var(--gold)); border-radius: 9px; transition: width .3s; }
.hudR { display: flex; align-items: center; gap: 10px; pointer-events: auto; }
.hearts { font-size: 1.35rem; letter-spacing: 1px; text-shadow: 0 2px 0 rgba(0,0,0,.4); }
.timer { background: rgba(43,22,64,.72); border-radius: 12px; padding: 4px 10px; font-weight: 700; font-size: 1.1rem; min-width: 64px; text-align: center; }
.timer:empty { display: none; }
.timer.warn { color: #ff8b8b; }
.slots { position: absolute; left: 12px; bottom: 12px; display: flex; gap: 6px; pointer-events: none; padding-bottom: env(safe-area-inset-bottom); }
.slots span { min-width: 42px; height: 42px; border-radius: 12px; background: rgba(43,22,64,.75); border: 2px solid rgba(255,255,255,.25);
  display: grid; place-items: center; font-weight: 700; font-size: .95rem; padding: 0 6px; }
.slots span.full { border-color: var(--gold); }
.mito { position: absolute; right: 12px; bottom: 12px; display: flex; align-items: flex-end; gap: 6px; flex-direction: row-reverse; pointer-events: none;
  opacity: 0; transform: translateY(20px); transition: opacity .3s, transform .3s; max-width: min(520px, 88vw); padding-bottom: env(safe-area-inset-bottom); }
.mito.on { opacity: 1; transform: none; }
.mito canvas { width: 72px; height: 72px; flex: none; }
.bubble { background: var(--cream); color: var(--ink); border-radius: 16px 16px 4px 16px; padding: 10px 14px; font-size: 1rem; line-height: 1.3; border: 3px solid var(--ink); }
.hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(43,22,64,.75); padding: 6px 14px; border-radius: 999px;
  font-size: .9rem; pointer-events: none; transition: opacity .6s; white-space: nowrap; }
.hint.off { opacity: 0; }
@media (max-width: 600px) { .hint { white-space: normal; width: 90vw; text-align: center; bottom: 70px; } .hudGoal { font-size: .88rem; } }

/* Překryv */
.overlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; background: rgba(20,8,32,.62); z-index: 10; padding: 16px;
  backdrop-filter: blur(3px); }
.overlay.on { display: flex; }
.card { background: var(--cream); color: var(--ink); border: 4px solid var(--ink); border-radius: 24px; box-shadow: 0 8px 0 rgba(0,0,0,.4);
  width: min(560px, 100%); max-height: 92vh; overflow-y: auto; padding: 22px 24px; animation: pop .35s cubic-bezier(.3,1.6,.5,1); touch-action: pan-y; }
@keyframes pop { from { transform: scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.card h2 { margin: 0 0 4px; font-size: 1.7rem; line-height: 1.1; }
.card .place { font-size: .95rem; opacity: .7; margin-bottom: 12px; }
.card p { font-weight: 400; line-height: 1.45; margin: 8px 0; }
.card .who { display: flex; gap: 14px; align-items: center; background: #f3e3d0; border-radius: 16px; padding: 10px 12px; margin: 10px 0; }
.card .who canvas { width: 84px; height: 84px; flex: none; }
.card .who p { margin: 0; }
.card ul { margin: 6px 0; padding-left: 20px; font-weight: 400; line-height: 1.45; }
.card .acts { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 16px; }
.card .acts .btn.ghost { color: var(--ink); border-color: rgba(43,22,64,.35); background: transparent; }
.bigStars { font-size: 3rem; text-align: center; color: var(--gold); letter-spacing: 6px; text-shadow: 0 3px 0 var(--ink); margin: 6px 0; }
.bigStars i { color: #d7c6b4; font-style: normal; }
.bigStars span { display: inline-block; animation: starIn .5s cubic-bezier(.3,1.8,.5,1) backwards; }
@keyframes starIn { from { transform: scale(0) rotate(-90deg); } }
.card .fact { box-shadow: none; border-width: 2px; margin-top: 8px; background: #fff; }
.hearts { white-space: nowrap; }
@media (max-width: 600px) { .hearts { font-size: 1rem; letter-spacing: 0; } .timer { font-size: .95rem; min-width: 0; } .hudR { gap: 6px; } }
