:root {
  --bg: #0b0c10; --bg2: #13151b; --card: rgba(255,255,255,.055); --card2: rgba(255,255,255,.09);
  --line: rgba(255,255,255,.12); --ink: #f2f4f8; --mut: rgba(242,244,248,.62); --dim: rgba(242,244,248,.38);
  --ok: #6cf2a5; --okbg: rgba(108,242,165,.14); --no: #ff6b6b; --nobg: rgba(255,107,107,.12);
  --uv: #b28cff; --warn: #ffc56b; --ease: cubic-bezier(.2,.8,.2,1);
  --gut: 16px; --r: 16px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { background: var(--bg); color-scheme: dark; touch-action: manipulation; } /* bez přiblížení dvojitým ťuknutím */
* { touch-action: manipulation; }
input, textarea { -webkit-user-select: text; user-select: text; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; margin: 0; min-height: 100vh; background: radial-gradient(120% 60% at 50% -10%, #1b2030 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--ink); font: 400 15px/1.45 Geist, system-ui, sans-serif; -webkit-font-smoothing: antialiased;
  padding-bottom: calc(112px + env(safe-area-inset-bottom)); overflow-x: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
a { color: var(--mut); }
h1, h2, h3, p { margin: 0; }
.grain { position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .09; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }

/* hlavička */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) var(--gut) 10px; background: rgba(11,12,16,.78);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); border-bottom: 1px solid var(--line); }
.eyes { width: 64px; height: 32px; flex: none; filter: drop-shadow(0 0 8px rgba(108,242,165,.35)); }
.brand { flex: 1; min-width: 0; }
.brand h1 { font: 900 26px/1 Doto, monospace; letter-spacing: .06em; }
.status { font: 500 13px/1.3 'Geist Mono', monospace; color: var(--ok); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.reset { display: flex; align-items: center; gap: 6px; padding: 9px 13px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); font-weight: 600; font-size: 14px; transition: transform .2s var(--ease); }
.reset svg { width: 17px; height: 17px; }
.reset:active { transform: scale(.94) rotate(-8deg); }

.wrap { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; padding: 14px var(--gut) 0; }
.block { margin-bottom: 18px; }
.row-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; width: 100%; }
.row-head h2, .next h2 { font: 600 13px/1 'Geist Mono', monospace; letter-spacing: .08em; text-transform: uppercase; color: var(--mut); }
.toggle { padding: 4px 0; }
.chev { width: 9px; height: 9px; border-right: 2px solid var(--mut); border-bottom: 2px solid var(--mut); transform: rotate(45deg); transition: transform .25s var(--ease); margin-right: 4px; }
.toggle[aria-expanded="true"] .chev { transform: rotate(-135deg); }
.pill { display: inline-block; min-width: 18px; padding: 2px 6px; margin-left: 4px; border-radius: 9px; background: var(--ok); color: #08130d; font-size: 11px; text-align: center; vertical-align: 1px; }

/* počet důkazů */
.seg { display: flex; padding: 3px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.seg button { min-width: 36px; height: 30px; border-radius: 9px; font: 600 14px 'Geist Mono', monospace; color: var(--mut); text-align: center; transition: background .2s, color .2s; }
.seg button.on { background: var(--ink); color: var(--bg); }

/* důkazy */
.evgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ev { position: relative; display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 10px 12px; border-radius: var(--r);
  background: var(--card); border: 1.5px solid var(--line); user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: background .2s, border-color .2s, transform .15s var(--ease); min-width: 0; }
.ev:last-child { grid-column: 1 / -1; }
.ev:active { transform: scale(.97); }
.evi { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: rgba(255,255,255,.07); color: var(--mut); transition: inherit; }
.evi svg { width: 20px; height: 20px; }
.evt { flex: 1; min-width: 0; font-size: 14.5px; line-height: 1.2; }
.evt b { font-weight: 600; }
.evs { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; display: none; place-items: center; font: 700 13px/1 Geist; box-shadow: 0 0 0 3px var(--bg); }
.ev.on .evs, .ev.x .evs { display: grid; }
.ev.on { background: var(--okbg); border-color: var(--ok); }
.ev.on .evi { background: var(--ok); color: #07140c; }
.ev.on .evs { background: var(--ok); color: #07140c; }
.ev.x { background: var(--nobg); border-color: rgba(255,107,107,.55); }
.ev.x .evt { color: var(--mut); text-decoration: line-through; text-decoration-color: var(--no); }
.ev.x .evi { color: var(--no); }
.ev.x .evs { background: var(--no); color: #1a0707; }
.hint { margin-top: 8px; font-size: 12.5px; color: var(--dim); }
.hint .ok { color: var(--ok); font-weight: 600; } .hint .no { color: var(--no); font-weight: 600; }

/* chování */
.beh { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.frow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.flabel { font-size: 14px; color: var(--mut); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--line); font-size: 14px; font-weight: 500; transition: background .2s, border-color .2s; }
.chips button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* co dál */
.next { padding: 14px; border-radius: var(--r); background: linear-gradient(160deg, rgba(108,242,165,.12), rgba(178,140,255,.08)); border: 1px solid rgba(108,242,165,.3); }
.next h2 { color: var(--ok); margin-bottom: 8px; }
.next h2 .hl { font: 900 22px/1.1 Doto, monospace; color: var(--ink); text-transform: none; letter-spacing: .03em; }
.next h2 i { text-transform: none; color: var(--mut); font-style: normal; letter-spacing: 0; }
.next p { font-size: 14px; color: var(--mut); }
.next .sub { margin: 10px 0 6px; font: 600 12px 'Geist Mono', monospace; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.nexts { display: flex; flex-wrap: wrap; gap: 6px; }
.nx { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 12px; background: rgba(0,0,0,.25); border: 1px solid var(--line); font-size: 13.5px; }
.nx svg { width: 16px; height: 16px; color: var(--ok); }
.nx i { font-style: normal; color: var(--dim); font: 500 12px 'Geist Mono', monospace; }

/* duchové */
.ghosts { display: flex; flex-direction: column; gap: 8px; }
.ghost { border-radius: var(--r); background: var(--card); border: 1px solid var(--line); overflow: hidden; transition: background .2s, border-color .2s; }
.ghost.open { background: var(--card2); border-color: rgba(255,255,255,.22); }
.gh { display: flex; flex-direction: column; gap: 7px; width: 100%; padding: 12px 14px; }
.gname { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.gname b { font: 900 21px/1.05 Doto, monospace; letter-spacing: .03em; }
.gname i { font-style: normal; font-size: 13px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gchips { display: flex; flex-wrap: wrap; gap: 5px; }
.ch { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 6px; border-radius: 8px; background: rgba(255,255,255,.06); color: var(--mut); font-size: 12.5px; }
.ch svg { width: 14px; height: 14px; }
.ch i { font-style: normal; }
.ch.on { background: var(--ok); color: #07140c; font-weight: 600; }
.ch.x { background: var(--nobg); color: var(--no); text-decoration: line-through; }
.ch.fake { border: 1px dashed var(--dim); background: none; }
.ch.forced:not(.on) { box-shadow: inset 0 0 0 1px var(--warn); }
.gmeta { display: flex; flex-wrap: wrap; gap: 4px 14px; font: 500 12.5px 'Geist Mono', monospace; color: var(--mut); }
.gtip { font-size: 13.5px; color: var(--mut); line-height: 1.35; }
.ghost.open .gtip { display: none; }
.why { font: 500 12.5px 'Geist Mono', monospace; color: var(--no); }
.ghost.out { opacity: .55; }
.ghost.out .gname b { text-decoration: line-through; text-decoration-color: var(--no); }
.gbody { padding: 0 14px 14px; border-top: 1px solid var(--line); }
.gbody h3 { margin: 14px 0 6px; font: 600 12px 'Geist Mono', monospace; letter-spacing: .07em; text-transform: uppercase; color: var(--dim); }
.gbody ul, .next ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.gbody li, .next li { position: relative; padding-left: 16px; font-size: 14.5px; line-height: 1.4; }
.gbody li::before, .next li::before { content: ''; position: absolute; left: 3px; top: .58em; width: 5px; height: 5px; border-radius: 50%; background: var(--dim); }
.tests li.sure::before { background: var(--ok); }
.tests li b { font: 700 10.5px/1 'Geist Mono', monospace; letter-spacing: .06em; padding: 2px 5px; border-radius: 5px; background: var(--okbg); color: var(--ok); vertical-align: 1px; }
.next .tests li b { all: unset; font-weight: 700; color: var(--ink); }
.outs li::before { background: var(--no); }
.note { margin-top: 12px; font-size: 13px; color: var(--warn); }
.gact { margin-top: 14px; display: flex; justify-content: flex-end; }
.btn { padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-weight: 600; font-size: 14px; }
.btn.ghosty { background: none; color: var(--no); border: 1.5px solid rgba(255,107,107,.45); }
.showout { margin: 6px auto 2px; padding: 9px 14px; border-radius: 999px; border: 1px dashed var(--line); color: var(--mut); font-size: 13.5px; text-align: center; }

.foot { margin: 26px 0 10px; font-size: 12px; line-height: 1.6; color: var(--dim); text-align: center; }

/* stopky */
.timers { position: fixed; z-index: 6; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 10px var(--gut) max(10px, env(safe-area-inset-bottom)); background: rgba(11,12,16,.82);
  backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); border-top: 1px solid var(--line); }
.timer { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 4px 6px; padding: 9px 12px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); min-width: 0; transition: border-color .2s, background .2s; }
.tname { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tval { font: 700 15px 'Geist Mono', monospace; color: var(--mut); }
.tbar { grid-column: 1 / -1; position: relative; height: 5px; border-radius: 3px; background: rgba(255,255,255,.08); overflow: hidden; }
.tbar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ok); border-radius: 3px; transition: width .25s linear; }
.tbar b { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(255,255,255,.55); }
.tnote { grid-column: 1 / -1; font: 500 11px Geist, sans-serif; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer.run { border-color: rgba(108,242,165,.5); }
.timer.run .tval { color: var(--ok); }
.timer.past { border-color: rgba(255,197,107,.65); }
.timer.past .tval { color: var(--warn); }
.timer.past .tbar i { background: var(--warn); }

/* spodní okno s nápovědou */
.sheet-bg { position: fixed; inset: 0; z-index: 10; background: rgba(0,0,0,.5); opacity: 0; transition: opacity .25s; }
.sheet-bg.on { opacity: 1; }
.sheet { position: fixed; z-index: 11; left: 0; right: 0; bottom: 0; max-width: 640px; margin: 0 auto; padding: 10px 20px max(20px, env(safe-area-inset-bottom));
  border-radius: 22px 22px 0 0; background: #171a22; border-top: 1px solid var(--line); transform: translateY(100%); transition: transform .26s var(--ease); }
.sheet.on { transform: none; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 14px; }
.sheet .sh-ic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: var(--okbg); color: var(--ok); margin-bottom: 10px; }
.sheet .sh-ic svg { width: 26px; height: 26px; }
.sheet h2 { font: 900 24px/1.1 Doto, monospace; margin-bottom: 4px; }
.sheet .en { font-size: 13px; color: var(--dim); margin-bottom: 10px; }
.sheet p { font-size: 15px; margin-bottom: 10px; }
.sheet .who { font-size: 13.5px; color: var(--mut); }
.sheet .btn { width: 100%; margin-top: 6px; text-align: center; }
.sheet .sh-ic.warn { background: var(--nobg); color: var(--no); font: 900 24px/1 Doto, monospace; }
.sh-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 6px; }
.sh-row .btn { margin-top: 0; padding: 13px 10px; }
.sh-row .btn.ghosty { color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--no); color: #1a0707; }

@media (min-width: 560px) { .evgrid { grid-template-columns: 1fr 1fr 1fr; } .ev:last-child { grid-column: auto; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media (max-width: 359px) {
  .reset span { display: none; } .reset { padding: 9px; }
  .timer { padding: 8px 10px; } .tname { font-size: 12.5px; } .tval { font-size: 13px; }
}

/* počet důkazů – popisek */
.evc { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.evc > span { font: 500 10.5px 'Geist Mono', monospace; color: var(--dim); letter-spacing: .02em; }
.warnhint { color: var(--warn); margin-top: 6px; line-height: 1.4; }
.flabel small { display: block; font-size: 11.5px; color: var(--dim); margin-top: 1px; }

/* hrát spolu */
.syncbtn { position: relative; display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border-radius: 999px; background: var(--card2); border: 1px solid var(--line); font: 600 14px Geist; flex: none; }
.syncbtn svg { width: 18px; height: 18px; flex: none; }
.syncbtn.on { border-color: rgba(108,242,165,.5); font-family: 'Geist Mono', monospace; letter-spacing: .06em; }
.syncbtn .dot { display: none; position: absolute; top: -2px; right: -2px; width: 10px; height: 10px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px var(--bg); }
.syncbtn.on .dot { display: block; }
.syncbtn[data-st="on"] .dot { background: var(--ok); }
.reset { height: 38px; padding: 0 12px; }
.fld { display: flex; flex-direction: column; gap: 5px; margin: 6px 0 12px; font-size: 13px; color: var(--mut); }
.sheet input { height: 46px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: rgba(255,255,255,.06); color: var(--ink); font: 500 16px Geist; outline: none; }
.sheet input:focus { border-color: var(--ok); }
.btn.wide { width: 100%; padding: 13px; text-align: center; }
.or { display: flex; align-items: center; gap: 10px; margin: 16px 0 10px; color: var(--dim); font-size: 12.5px; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.joinrow { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.joinrow input { font: 700 20px 'Geist Mono', monospace; letter-spacing: .3em; text-transform: uppercase; text-align: center; min-width: 0; }
.joinrow .btn { margin: 0; width: auto; padding: 0 18px; }
.err { color: var(--no); font-size: 13px; margin-top: 8px; }
.sub2 { font: 600 11.5px 'Geist Mono', monospace; letter-spacing: .07em; text-transform: uppercase; color: var(--dim); margin-bottom: 6px !important; }
.bigcode { font: 900 56px/1 Doto, monospace; letter-spacing: .12em; text-align: center; margin: 6px 0 8px; color: var(--ok); text-shadow: 0 0 24px rgba(108,242,165,.35); }
.st { display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 13.5px; color: var(--mut); margin-bottom: 14px !important; }
.st i { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.st-on i { background: var(--ok); }
.peers { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.peers li { padding: 7px 12px; border-radius: 999px; background: var(--card2); font-size: 14px; }
.peers em { color: var(--dim); font-style: normal; }
.peers .dim { color: var(--dim); }
.tip { font-size: 13px !important; color: var(--dim); }

/* měřič rychlosti */
.tap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; height: 170px; margin: 4px 0 12px; border-radius: 22px;
  background: radial-gradient(circle at 50% 40%, rgba(108,242,165,.18), rgba(108,242,165,.04)); border: 1.5px solid rgba(108,242,165,.4); text-align: center; touch-action: none; }
.tap span { font: 900 40px/1 Doto, monospace; color: var(--ok); }
.tap small { font: 500 12.5px 'Geist Mono', monospace; color: var(--mut); }
.tap.hit { animation: tapHit .18s ease-out; }
@keyframes tapHit { from { transform: scale(.97); background-color: rgba(108,242,165,.25); } to { transform: none; } }
.gsrow { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.gsrow .chips button { padding: 6px 10px; font-size: 13px; }
.tapmatch { min-height: 20px; font-size: 13.5px; color: var(--ink); margin-bottom: 8px; line-height: 1.4; }
.tapmatch span { color: var(--dim); }
.btn:disabled { opacity: .4; }

/* prokleté předměty */
.cursed { display: flex; flex-direction: column; gap: 8px; }
.cur { border-radius: var(--r); background: var(--card); border: 1px solid var(--line); padding: 0 14px; }
.cur summary { list-style: none; display: flex; align-items: baseline; gap: 8px; padding: 13px 0; cursor: pointer; }
.cur summary::-webkit-details-marker { display: none; }
.cur summary b { font: 900 18px/1.1 Doto, monospace; letter-spacing: .03em; }
.cur summary i { font-style: normal; font-size: 12.5px; color: var(--dim); }
.cur[open] { background: var(--card2); }
.cur p { font-size: 14px; color: var(--mut); margin-bottom: 8px; }
.cur ul { margin: 0 0 10px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.cur li { font-size: 14px; line-height: 1.4; padding-left: 12px; position: relative; }
.cur li::before { content: ''; position: absolute; left: 0; top: .6em; width: 4px; height: 4px; border-radius: 50%; background: var(--dim); }
.cur li em { display: block; font-style: normal; color: var(--no); font-size: 13px; }
.cur .curse { color: var(--warn); font-size: 13.5px; padding-bottom: 6px; }

@media (max-width: 400px) {
  .syncbtn { padding: 0 10px; }
  .syncbtn:not(.on) span { display: none; }
  .reset span { display: none; } .reset { padding: 0 11px; }
  .brand h1 { font-size: 23px; }
}

.sheet { max-height: 92vh; overflow-y: auto; overscroll-behavior: contain; }
