:root {
  --blue: #1a73e8;
  --ok: #009688;
  --bad: #d93025;
  --line: #d3d3d3;
  --text: #202124;
  --muted: #595959;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: #fff;
  color: #313131;
  font: 15px/1.45 Roboto, system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  min-height: 100vh;
}
button { font: inherit; cursor: pointer; }
#app { max-width: 720px; margin: 0 auto; padding: 8vh 16px 40px; }

.host { font-size: 34px; font-weight: 500; margin: 0 0 10px; color: #222; }
.lead { font-size: 22px; font-weight: 400; margin: 0 0 22px; color: #313131; }
.lead.okay { color: #1a7f37; }
.note { color: var(--muted); margin: 28px 0 0; }

/* --- kotva: políčko „Nejsem robot" --- */
.wrap { position: relative; width: 304px; max-width: 100%; }
.anchor {
  position: relative;
  width: 304px; max-width: 100%; height: 78px;
  background: #f9f9f9; border: 1px solid var(--line); border-radius: 3px;
  box-shadow: 0 0 4px 1px rgba(0,0,0,.08);
  display: flex; align-items: center; padding: 0 8px 0 12px; gap: 12px;
  color: #000;
}
.anchor.shake { animation: shake .45s; }
.expired { position: absolute; left: 0; right: 0; top: 0; padding: 3px 12px; font-size: 10px; color: var(--bad); background: #f9f9f9; border-radius: 3px 3px 0 0; }
.expired[hidden] { display: none; }
.cb {
  width: 28px; height: 28px; flex: none; padding: 0;
  background: #fff; border: 2px solid #c1c1c1; border-radius: 2px;
  display: grid; place-items: center;
}
.cb:hover:not(:disabled) { border-color: #b2b2b2; box-shadow: inset 0 1px 1px rgba(0,0,0,.1); }
.cb:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.cb.spin { border: 4px solid #e2e2e2; border-top-color: #4a90e2; border-radius: 50%; animation: spin .8s linear infinite; }
.cb.ok { border-color: transparent; background: none; cursor: default; }
.cb.ok::after { content: ""; width: 10px; height: 22px; border: solid var(--ok); border-width: 0 4px 4px 0; transform: rotate(45deg) translate(-2px, -3px); animation: tick .3s ease-out; }
@keyframes tick { from { height: 0; width: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
.cb-label { flex: 1; font-size: 14px; }
.logo { width: 70px; text-align: center; align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.logo-t { font-size: 10px; color: #555; margin-top: 2px; }
.logo-s { font-size: 8px; color: #555; }

/* --- vyskakovací výzva --- */
.backdrop { position: fixed; inset: 0; z-index: 9; }
.backdrop[hidden], .popup[hidden] { display: none; }
.popup {
  position: absolute; z-index: 10; left: 0; top: -12px;
  width: 400px; max-width: calc(100vw - 32px);
  background: #fff; border: 1px solid #ccc;
  box-shadow: 2px 2px 3px rgba(0,0,0,.2);
  padding: 7px;
  color: var(--text);
  animation: fade .15s;
}
@keyframes fade { from { opacity: 0; } }
.popup.shake { animation: shake .45s; }
@keyframes shake {
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
.cap-head { background: var(--blue); color: #fff; padding: 22px 16px 22px 24px; }
.cap-instr { font-size: 16px; line-height: 1.3; }
.cap-instr b { display: block; font-size: 26px; font-weight: 700; line-height: 1.2; margin: 2px 0; }
.cap-sub { font-size: 13px; margin-top: 6px; opacity: .95; }
.cap-sub:empty { display: none; }
.cap-body { padding: 8px 0; min-height: 100px; }
.cap-err { color: var(--bad); font-size: 13px; padding: 0 2px 8px; }
.cap-err:empty { display: none; }
.cap-err.info { color: #555; }
.cap-foot { display: flex; align-items: center; gap: 2px; border-top: 1px solid #dfdfdf; padding: 8px 0 1px; }
.ic { width: 38px; height: 38px; border: 0; background: none; color: #737373; display: grid; place-items: center; padding: 0; border-radius: 2px; }
.ic:hover { color: #3d3d3d; background: #f2f2f2; }
.timer { flex: 1; text-align: right; padding-right: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--bad); font-size: 14px; }
.verify { background: var(--blue); color: #fff; border: 0; border-radius: 2px; padding: 0 24px; height: 42px; font-weight: 500; font-size: 14px; letter-spacing: .3px; }
.verify:hover { background: #1b66c9; }
.verify[hidden] { display: none; }

.win { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.win[hidden] { display: none; }
.win b { font-size: 20px; color: #1a7f37; }
.win .verify { margin-top: 8px; }

.stats { margin-top: 14px; font-size: 13px; color: var(--muted); }
.stats .meter { display: inline-block; width: 90px; height: 6px; background: #e6e6e6; border-radius: 3px; vertical-align: middle; overflow: hidden; margin: 0 4px; }
.stats .meter i { display: block; height: 100%; background: linear-gradient(90deg, #f9ab00, #d93025); transition: width .6s; }

.bottom { margin-top: 60px; padding-top: 14px; border-top: 1px solid #d9d9d9; font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 22px; }
.bottom code { font-family: inherit; color: #313131; }
.bottom .links { margin-left: auto; }
.link { background: none; border: 0; color: #0051c3; padding: 0; text-decoration: underline; font-size: 13px; }

/* --- prvky výzev --- */
.cv { display: block; width: 100%; height: auto; background: #eee; }
.inp { width: 100%; margin-top: 8px; padding: 10px; font-size: 17px; border: 1px solid #c4c4c4; border-radius: 0; background: #fff; color: var(--text); }
.inp:focus { outline: none; border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.arena { position: relative; height: 290px; background: #f1f3f4; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.range { width: 100%; margin-top: 10px; accent-color: var(--blue); height: 28px; }

.runner { position: absolute; display: flex; align-items: center; gap: 10px; background: #f9f9f9; border: 1px solid var(--line); box-shadow: 0 0 4px 1px rgba(0,0,0,.08); padding: 7px 14px 7px 8px; border-radius: 3px; white-space: nowrap; transition: left .14s ease-out, top .14s ease-out; cursor: pointer; font-size: 14px; color: #000; }
.runner.tired { transition: none; }
.runner .rc-box { width: 24px; height: 24px; border: 2px solid #c1c1c1; border-radius: 2px; background: #fff; display: inline-grid; place-items: center; }
.runner.checked .rc-box { border-color: transparent; background: none; }
.runner.checked .rc-box::after { content: ""; width: 8px; height: 18px; border: solid var(--ok); border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -3px); }

/* obrázková mřížka à la „vyber všechny obrázky" */
.grid { display: grid; gap: 4px; }
.tile { aspect-ratio: 1; border: 0; display: grid; place-items: center; position: relative; padding: 0; color: var(--text); overflow: hidden; transition: padding .1s; }
.tile .ph { width: 100%; height: 100%; display: grid; place-items: center; transition: transform .1s; }
.tile span { display: inline-block; filter: saturate(.85) contrast(1.05); }
.tile.num .ph { font-weight: 700; font-family: Georgia, serif; color: #fff; text-shadow: 0 1px 3px #0009; }
.tile.sel .ph { transform: scale(.8); }
.tile.sel { background: #fff !important; }
.tile.sel::after { content: "✓"; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 14px; line-height: 22px; text-align: center; font-weight: 700; }

.mathq { font-size: 30px; font-weight: 700; text-align: center; padding: 22px 6px; background: #f1f3f4; font-family: Georgia, serif; }
.mathq.words { font-size: 20px; font-style: italic; }
.wobble { animation: wob 1.6s ease-in-out infinite; }
@keyframes wob { 50% { transform: rotate(-3deg) skewX(8deg); } }

.dot { position: absolute; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; font-weight: 800; font-size: 17px; padding: 0; box-shadow: 0 2px 6px #0004; }
.dot.done { background: #b9c4d3; pointer-events: none; }
.dot.hidenum { color: transparent; }

.holdwrap { text-align: center; padding: 14px 0; }
.holdt { font-size: 42px; font-weight: 800; font-variant-numeric: tabular-nums; margin-bottom: 14px; }
.holdbtn { width: 150px; height: 150px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; font-size: 26px; font-weight: 800; box-shadow: 0 6px 0 #0b4fb0; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.holdbtn.on { transform: translateY(5px); box-shadow: 0 1px 0 #0b4fb0; background: #0b5ed7; }

.simon { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.simon.six { grid-template-columns: repeat(3, 1fr); }
.stile { aspect-ratio: 1.4; border: 0; opacity: .45; transition: opacity .1s, transform .1s; }
.stile.lit { opacity: 1; transform: scale(1.04); box-shadow: 0 0 18px currentColor; }

.bait { position: absolute; border: 0; border-radius: 4px; padding: 9px 14px; font-weight: 700; color: #fff; box-shadow: 0 4px 12px #0003; animation: pop .25s; white-space: nowrap; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } }
.patcd { position: absolute; inset: 0; display: grid; place-items: center; font-size: 96px; font-weight: 900; color: #d0d6de; pointer-events: none; }

@media (max-width: 480px) {
  #app { padding-top: 5vh; }
  .host { font-size: 26px; }
  .lead { font-size: 18px; }
  .cap-instr b { font-size: 22px; }
  .cap-head { padding: 16px; }
  .arena { height: 260px; }
}
