/* mjuni.alho.cz: Apple neutrály + jeden tint (oranžová z původního konceptu).
   Je to nástroj na projektor ve třídě: jen světlý režim a písmo roste se šířkou okna.
   Barvy týmů a zelená/červená jsou herní data, ne akcenty vzhledu. */
:root {
  --tint: #f0620a;
  --tint-press: #d95500;
  --page: #f5f5f7;
  --surface: #ffffff;
  --label: #1d1d1f;
  --secondary: rgba(60, 60, 67, 0.72);
  --separator: rgba(60, 60, 67, 0.16);
  --fill: rgba(120, 120, 128, 0.12);
  --fill-2: rgba(120, 120, 128, 0.2);
  --glass: rgba(245, 245, 247, 0.78);
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 8px 24px rgba(0, 0, 0, 0.07);
  --green: #248a3d;
  --green-bg: #e8f6ec;
  --red: #d70015;
  --red-bg: #fdecec;
  --ink: #14324a;
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --r-card: 1.1rem;
  --r-btn: 0.75rem;
}

*, *::before, *::after { box-sizing: border-box; }
/* Písmo se řídí šířkou i výškou okna, aby se každá část vešla na obrazovku i mimo celoobrazovkový režim. */
html { font-size: clamp(13px, min(1.25vw, 2.22vh), 24px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--page); color: var(--label); overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.35; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
.ic { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.14em; flex: none; }

/* Tlačítka */
button {
  font: inherit; font-weight: 600; cursor: pointer; border: 0; border-radius: var(--r-btn);
  padding: 0.5em 0.9em; background: var(--fill); color: var(--label);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), opacity 0.2s;
}
button:hover { background: var(--fill-2); }
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.35; cursor: default; }
button:focus-visible { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); outline-offset: 2px; }
button.big { font-size: 1.2rem; padding: 0.62em 1.25em; background: var(--tint); color: #fff; border-radius: 999px; display: inline-flex; align-items: center; gap: 0.4em; }
button.big:hover { background: var(--tint-press); }
button.big.alt { background: var(--surface); color: var(--label); box-shadow: inset 0 0 0 1px var(--separator), var(--shadow); }
button.big.alt:hover { background: #fafafa; }
button.round { width: 2.9rem; height: 2.9rem; padding: 0; border-radius: 50%; font-size: 1.2rem; display: inline-grid; place-items: center; background: var(--surface); box-shadow: inset 0 0 0 1px var(--separator); }
button.quiet { font-size: 0.8rem; padding: 0.35em 0.75em; color: var(--secondary); display: inline-flex; align-items: center; gap: 0.35em; }

/* Horní lišta */
#top {
  position: sticky; top: 0; z-index: 5; background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--separator); padding: 0.45rem 1rem 0.5rem;
}
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand-e { font-size: 1.35rem; }
#timer { display: flex; align-items: center; gap: 0.45rem; }
.seg { display: flex; background: var(--fill); border-radius: 0.65rem; padding: 0.15rem; }
.seg button { background: transparent; padding: 0.25em 0.7em; font-size: 0.85rem; border-radius: 0.5rem; }
.seg button:hover { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
#timer .t { font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 700; min-width: 3.9ch; text-align: center; background: var(--label); color: #fff; border-radius: 0.6rem; padding: 0 0.35em; line-height: 1.35; }
#timer.run .t { background: var(--ink); }
#timer.flash .t { background: var(--red); animation: fl 0.5s infinite alternate; }
@keyframes fl { to { background: #ffb3b3; color: #600; } }
#timer .stop { padding: 0; width: 2rem; height: 2rem; display: grid; place-items: center; font-size: 1.1rem; }

/* Kroky výpravy */
#nav { display: grid; grid-template-columns: repeat(9, 1fr); gap: 0.3rem; margin-top: 0.45rem; }
#nav button { background: var(--fill); padding: 0.32em 0.3em; font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 0.6rem; }
#nav button:hover { background: var(--fill-2); }
#nav button.on { background: var(--tint); color: #fff; }
#nav button.done { background: var(--green-bg); color: var(--green); }

/* Týmy */
#teams { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; padding: 0.7rem 1rem 0; }
.team { border-radius: var(--r-card); padding: 0.45rem 0.6rem 0.45rem 0.85rem; color: #fff; display: flex; align-items: center; gap: 0.6rem; background: var(--c); box-shadow: var(--shadow); }
.team .nm { flex: 1; font-weight: 700; font-size: 0.95rem; line-height: 1.12; outline: none; min-width: 0; }
.team .nm[contenteditable="true"] { background: rgba(255, 255, 255, 0.22); border-radius: 0.4rem; padding: 0.1em 0.3em; }
.team .sc { font-size: 2.1rem; font-weight: 800; min-width: 2ch; text-align: center; line-height: 1; font-variant-numeric: tabular-nums; transition: transform 0.25s var(--ease); }
.team .sc.pop { transform: scale(1.45); }
.team .bt { display: flex; gap: 0.25rem; }
.team .bt button { background: rgba(255, 255, 255, 0.24); color: #fff; padding: 0.2em 0.55em; font-size: 1rem; border-radius: 0.6rem; }
.team .bt button:hover { background: rgba(255, 255, 255, 0.36); }

/* Plocha */
#stage { flex: 1; padding: 0.9rem 1rem 0.6rem; min-height: 0; }
.head { margin-bottom: 0.7rem; }
h1 { font-size: 3rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
h2 { font-size: 1.75rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
h3 { font-size: 1.15rem; font-weight: 700; }
.sub { color: var(--secondary); font-size: 1.02rem; }
.head .sub { margin-top: 0.15rem; }
.card { background: var(--surface); border-radius: var(--r-card); padding: 0.9rem 1.05rem; box-shadow: var(--shadow); }
.cols { display: grid; gap: 1rem; align-items: start; }
.actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.8rem; }
.count { color: var(--secondary); font-weight: 600; font-variant-numeric: tabular-nums; }
.note { font-size: 1.35rem; font-weight: 700; color: var(--green); margin-top: 0.8rem; }
.chips { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: 0.8rem; }
.chips button { min-width: 2.3rem; background: var(--surface); box-shadow: inset 0 0 0 1px var(--separator); padding: 0.3em 0.6em; font-variant-numeric: tabular-nums; }
.chips button.got { color: var(--green); background: var(--green-bg); box-shadow: none; }
.chips button.on { background: var(--label); color: #fff; box-shadow: none; }
.chips button.on.got { background: var(--green); color: #fff; }
.reveal { background: var(--green-bg); border-radius: 0.9rem; padding: 0.6rem 0.9rem; animation: pop 0.4s var(--ease); }
.reveal b.n { font-size: 1.45rem; display: block; color: var(--green); }
@keyframes pop { from { transform: translateY(0.5rem); opacity: 0; } }

/* Start */
.intro { text-align: center; padding-top: clamp(1.2rem, 10vh, 8rem); max-width: 62rem; margin: 0 auto; }
.intro .lens { font-size: 5.2rem; line-height: 1.1; animation: bob 3s ease-in-out infinite; display: inline-block; }
@keyframes bob { 50% { transform: translateY(-0.4rem) rotate(-6deg); } }
.intro .sub { font-size: 1.2rem; margin: 0.7rem auto 1.3rem; max-width: 46rem; }
.rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.9rem; margin-top: 1.8rem; text-align: left; }
.rules .card { font-size: 1rem; }

/* Hádej kde */
.dest { grid-template-columns: 1.15fr 0.85fr; }
.photo { position: relative; border-radius: var(--r-card); overflow: hidden; background: #dfe7ee; height: calc(100vh - 23.5rem); min-height: 12rem; box-shadow: var(--shadow); }
.photo img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.08); transition: filter 0.7s; display: block; }
.clues { list-style: none; padding: 0; margin: 0 0 0.7rem; display: grid; gap: 0.4rem; }
.clues li { background: var(--surface); border-radius: 0.8rem; padding: 0.5rem 0.8rem; font-size: 1.12rem; display: flex; gap: 0.7rem; align-items: baseline; box-shadow: var(--shadow); animation: pop 0.35s var(--ease); }
.clues li i { font-style: normal; font-weight: 700; color: var(--tint); font-variant-numeric: tabular-nums; }
.clues li.wait { background: var(--fill); box-shadow: none; color: var(--secondary); animation: none; }
.clues li.wait i { color: var(--secondary); }
.dest .reveal { margin-bottom: 0.7rem; }
.dest .actions .chips { margin-top: 0; margin-left: auto; }
.prod-map svg.map { max-height: calc(100vh - 24rem); }
svg.map { width: 100%; height: auto; max-height: calc(100vh - 31rem); min-height: 9rem; background: #e8f1f8; border-radius: var(--r-card); box-shadow: var(--shadow); display: block; }
.map .land { fill: #cfe8bd; stroke: #7fb069; stroke-width: 1.5; stroke-linejoin: round; }
.map text { font-size: 11px; font-weight: 700; fill: #14324a; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.map .pin { animation: drop 0.5s var(--ease); }
@keyframes drop { from { translate: 0 -30px; opacity: 0; } }
.dest.done .clues { gap: 0.3rem; margin-bottom: 0.5rem; }
.dest.done .clues li { font-size: 0.95rem; padding: 0.28rem 0.7rem; animation: none; box-shadow: none; background: var(--fill); }
.dest.done .reveal { margin-bottom: 0.5rem; padding: 0.45rem 0.8rem; }
.dest.done svg.map { max-height: calc(100vh - 36rem); }

/* Ostrov */
.isl { grid-template-columns: 1.5fr 1fr; align-items: stretch; }
.isl svg.sea { width: 100%; max-height: 58vh; border-radius: var(--r-card); box-shadow: var(--shadow); display: block; }
.isl .side { display: flex; flex-direction: column; gap: 0.7rem; }
.isl .num { font-size: 2.2rem; font-weight: 800; letter-spacing: -0.02em; }
.isl .msg { font-size: 1.4rem; font-weight: 700; margin-top: 0.4rem; }
.sol { display: grid; gap: 0.4rem; margin-top: 0.5rem; }
.sol .reveal { font-size: 1.15rem; font-weight: 600; }

/* Doprava */
.tr { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.8rem; margin-top: 0.9rem; }
.tc { background: var(--surface); border-radius: var(--r-card); padding: 0.8rem 0.7rem; text-align: center; position: relative; box-shadow: var(--shadow); }
.tc .e { font-size: 4rem; line-height: 1.1; height: 4.6rem; display: grid; place-items: center; }
.tc .e svg { height: 4.4rem; width: auto; }
.tc b { font-size: 1.25rem; }
.tc .rank { position: absolute; top: 0.5rem; left: 0.6rem; background: var(--label); color: #fff; border-radius: 50%; width: 2rem; height: 2rem; display: grid; place-items: center; font-weight: 700; }
.bar-f { height: 0.9rem; background: var(--fill); border-radius: 1rem; margin-top: 0.5rem; overflow: hidden; }
.bar-f i { display: block; height: 100%; width: 0; border-radius: 1rem; background: linear-gradient(90deg, #7bd36f, #ffc83d, #d64545); background-size: 600% 100%; transition: width 0.8s var(--ease); }
.tc .fp { min-height: 1.8rem; margin-top: 0.3rem; font-size: 1.05rem; letter-spacing: 2px; }

/* Dalekohled */
.look { grid-template-columns: 1.8fr 1fr; align-items: stretch; }
.scene { position: relative; aspect-ratio: 16/8.2; max-height: calc(100vh - 19.5rem); border-radius: var(--r-card); overflow: hidden; box-shadow: var(--shadow); background: linear-gradient(#8fd3ff 0, #d6f1ff 36%, #8ed07b 36%, #4f9d4a 100%); cursor: none; user-select: none; }
.scene.light { cursor: default; }
.scene .deco { position: absolute; pointer-events: none; line-height: 1; }
.scene svg.bg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.lake { position: absolute; left: 3%; bottom: 4%; width: 42%; height: 27%; background: radial-gradient(#6cc7ff, #2f8fd6); border-radius: 50%; border: 4px solid #a6e0ff; }
.it svg { width: 8.4rem; height: 7.2rem; display: block; filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 4px rgba(255, 255, 255, 0.9)); }
.it { position: absolute; line-height: 0; transform: translate(-50%, -50%); cursor: pointer; transition: transform 0.2s var(--ease); }
.it:hover { transform: translate(-50%, -50%) scale(1.15); }
.it.found::after { content: ""; position: absolute; right: -0.4rem; top: -0.4rem; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/70% no-repeat; }
.it.found.good::after { background-color: #12a4a4; }
.it.found { filter: drop-shadow(0 0 0.5rem #fff) drop-shadow(0 0 0.5rem #ffd54a); }
.dark { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle 7rem at var(--x, 50%) var(--y, 50%), rgba(6, 18, 30, 0) 0 5.6rem, rgba(6, 18, 30, 0.96) 7rem); transition: opacity 0.3s; }
.scene.light .dark { opacity: 0; }
.ring { position: absolute; pointer-events: none; width: 12rem; height: 12rem; border-radius: 50%; border: 0.45rem solid #111; box-shadow: 0 0 0 0.2rem #ffc83d, inset 0 0 1.5rem rgba(0, 0, 0, 0.5); transform: translate(-50%, -50%); left: var(--x, 50%); top: var(--y, 50%); }
.scene.light .ring { display: none; }
.look .side { display: flex; flex-direction: column; gap: 0.7rem; }
.info { min-height: 7.5rem; }
.info .bad { color: var(--red); font-weight: 700; font-size: 1.1rem; margin-top: 0.3rem; }
.info .good { color: var(--green); font-weight: 700; font-size: 1.1rem; margin-top: 0.3rem; }
.info p { margin-top: 0.3rem; }
.rule b { display: block; margin-bottom: 0.15rem; }

/* Semafor */
.sem { grid-template-columns: 1.4fr 0.8fr; align-items: stretch; }
.stmt { font-size: 2rem; font-weight: 700; line-height: 1.25; text-align: center; min-height: 16rem; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 0.6rem; transition: background 0.3s, box-shadow 0.3s; letter-spacing: -0.01em; }
.stmt .e { font-size: 5rem; line-height: 1; }
.stmt.g { background: var(--green-bg); box-shadow: inset 0 0 0 3px var(--green); }
.stmt.r { background: var(--red-bg); box-shadow: inset 0 0 0 3px var(--red); }
.verdict { font-size: 1.7rem; font-weight: 800; }
.stmt .why { font-size: 1.2rem; font-weight: 600; }
.stmt .ask { font-size: 1.2rem; font-weight: 400; color: var(--secondary); }
.sem .side { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; }
.cards { display: flex; gap: 1rem; justify-content: center; }
.lightc { width: 7.6rem; height: 7.6rem; border-radius: 50%; display: grid; place-items: center; font-size: 3.6rem; color: #fff; opacity: 0.28; transition: all 0.3s var(--ease); }
.lightc.g { background: #2e9e4f; color: #2e9e4f; } .lightc.r { background: #d64545; color: #d64545; }
.lightc .ic { color: #fff; stroke-width: 3.2; }
.lightc.on { opacity: 1; transform: scale(1.1); box-shadow: 0 0 2rem currentColor; }
.sem .actions { margin-top: 0; justify-content: center; }

/* Speciality */
.prod { grid-template-columns: 1.1fr 0.9fr; }
.prod .card { text-align: center; padding: 1.2rem 1rem; }
.big-e { font-size: 6.5rem; line-height: 1.05; }
.pname { font-size: 2.3rem; font-weight: 800; letter-spacing: -0.02em; }
.prod .sub { font-size: 1.25rem; }
.where { font-size: 1.55rem; font-weight: 700; min-height: 2.4rem; margin-top: 0.5rem; }
.prod .actions { justify-content: center; }

/* Plánovač */
.pl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.7rem; }
.pl .card { padding: 0.5rem 0.8rem 0.6rem; border-top: 0.4rem solid var(--c); }
.pl h3 { color: var(--c); margin-bottom: 0.1rem; }
.pl label { display: block; font-size: 0.78rem; color: var(--secondary); font-weight: 600; margin-top: 0.22rem; }
.pl select { width: 100%; font: inherit; font-size: 0.92rem; padding: 0.18em 0.4em; border-radius: 0.6rem; border: 1px solid var(--separator); background: var(--page); color: var(--label); }
.meter { margin-top: 0.4rem; font-weight: 700; font-size: 0.9rem; }
.meter .b { height: 0.6rem; border-radius: 1rem; background: var(--fill); overflow: hidden; margin: 0.08rem 0 0.2rem; }
.meter .b i { display: block; height: 100%; border-radius: 1rem; transition: width 0.5s var(--ease); }
.meter .st i { background: #d64545; } .meter .ex i { background: #f2b705; }
.meter .eq { font-size: 1.25rem; text-align: center; }

/* Závěr */
.fin { text-align: center; }
.fin .sub { font-size: 1.15rem; margin-top: 0.4rem; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 0.9rem; margin: 0.8rem 0 1rem; min-height: 12.5rem; }
.pod { width: 11rem; border-radius: 1.1rem 1.1rem 0 0; color: #fff; padding: 0.6rem 0.5rem; font-weight: 700; display: flex; flex-direction: column; justify-content: flex-start; align-items: center; line-height: 1.15; }
.pod .m { font-size: 1.6rem; } .pod .s { font-size: 2.4rem; font-weight: 800; }
.pledge { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; max-width: 62rem; margin: 0.6rem auto 0.9rem; }
.pledge .card { font-size: 1.12rem; font-weight: 600; }
.conf { position: fixed; top: -2rem; pointer-events: none; z-index: 9; animation: fall linear forwards; }
.conf i { display: block; width: 100%; height: 100%; background: currentColor; clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); filter: drop-shadow(0 0 6px currentColor); animation: twinkle 0.6s ease-in-out infinite alternate; }
@keyframes fall { to { transform: translateY(110vh) rotate(360deg); } }
@keyframes twinkle { from { transform: scale(0.45); opacity: 0.55; } to { transform: scale(1.15); opacity: 1; } }

/* Patička */
#foot { padding: 0.3rem 1rem 0.5rem; }
.planet-row { display: flex; align-items: center; gap: 0.8rem; font-weight: 600; }
#planet { flex: 1; height: 0.8rem; background: var(--fill); border-radius: 1rem; overflow: hidden; }
#planet i { display: block; height: 100%; width: 0; border-radius: 1rem; background: linear-gradient(90deg, #7bd36f, #2e9e4f); transition: width 0.6s var(--ease); }
#pl-txt { color: var(--secondary); font-weight: 600; font-variant-numeric: tabular-nums; }
.hint { text-align: center; color: var(--secondary); font-size: 0.7rem; margin-top: 0.25rem; opacity: 0.8; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@media (max-width: 900px) {
  #nav { grid-template-columns: repeat(3, 1fr); }
  #teams { grid-template-columns: repeat(2, 1fr); }
  .dest, .isl, .look, .sem, .prod { grid-template-columns: 1fr; }
  .tr { grid-template-columns: repeat(3, 1fr); }
  .pl { grid-template-columns: repeat(2, 1fr); }
  .rules, .pledge { grid-template-columns: 1fr; }
}

/* Kreslené obrázky místo emoji (návrh nové grafiky) */
.stmt .e svg { height: 1em; width: auto; display: block; }
.big-e svg { height: 1em; width: 1em; display: block; margin: 0 auto; }
svg.logo { height: 1em; width: 1em; display: block; }
.brand-e svg.logo { height: 1.25em; width: 1.25em; }
.intro .lens svg.logo { height: 1.5em; width: 1.5em; }
