:root {
  --bg: #f7f8fc;
  --surface: #ffffff;
  --text: #141726;
  --muted: #5b6178;
  --line: #e3e6f0;
  --brand: #4f46e5;
  --brand-2: #0ea5a4;
  --accent: #f59e0b;
  --hero-1: #1e1b4b;
  --hero-2: #312e81;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(20, 23, 38, .06), 0 8px 24px rgba(20, 23, 38, .06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f1a;
    --surface: #161a2b;
    --text: #eef0f8;
    --muted: #a3a9c2;
    --line: #262b42;
    --brand: #818cf8;
    --brand-2: #2dd4bf;
    --hero-1: #0b0a24;
    --hero-2: #1e1b4b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
p { margin: 0 0 .8em; }
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* horní lišta */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; color: var(--text); text-decoration: none; letter-spacing: -.02em; }
.logo-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2)); font-size: 1rem;
}
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 500; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface); }

/* hero */
.hero {
  color: #fff;
  background:
    radial-gradient(900px 400px at 85% -10%, rgba(45, 212, 191, .35), transparent 60%),
    radial-gradient(700px 400px at 0% 110%, rgba(129, 140, 248, .45), transparent 60%),
    linear-gradient(135deg, var(--hero-1), var(--hero-2));
  padding: 88px 0 132px;
}
.hero-sm { padding: 64px 0 72px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -.03em; max-width: 16em; }
.hero-lead { font-size: 1.15rem; color: rgba(255, 255, 255, .82); max-width: 40em; }
.hero-lead a { color: #fff; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; font-weight: 700; color: #99f6e4; margin-bottom: 12px; }

/* tři karty rozcestníku */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: -88px; padding-bottom: 72px; }
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface); color: var(--text); text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--brand); box-shadow: 0 16px 40px rgba(79, 70, 229, .18); }
.card p { color: var(--muted); }
.card .card-lead { color: var(--text); font-weight: 600; }
.card-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-top h2 { font-size: 1.35rem; margin: 0; }
.card-icon {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; margin-bottom: 18px;
  background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand);
}
.card-aplikace .card-icon { background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); }
.card-ai .card-icon { background: color-mix(in srgb, var(--brand-2) 16%, transparent); color: var(--brand-2); }
.card-icon svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.card-lead { margin-top: 12px; }
.card-cta { margin-top: auto; padding-top: 12px; font-weight: 700; color: var(--brand); }

.badge {
  display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  color: #92400e; background: #fef3c7;
}
@media (prefers-color-scheme: dark) { .badge { color: #fde68a; background: rgba(245, 158, 11, .18); } }

/* obsah podstránek */
.block { padding: 56px 16px 0; }
.block:last-of-type { padding-bottom: 72px; }
.block-title { font-size: 1.7rem; letter-spacing: -.02em; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding-top: 48px; }
.tile {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); color: var(--text); text-decoration: none;
}
.tile p { color: var(--muted); }
.tile-link:hover { border-color: var(--brand); }
.tag { display: inline-block; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--brand); font-weight: 700; margin-bottom: 8px; }
.note { padding: 32px 16px 72px; color: var(--muted); }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: s; }
.steps li { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; margin-bottom: 12px; }
.steps strong { display: block; margin-bottom: 4px; }
.steps span { color: var(--muted); }

.btn {
  display: inline-block; border: 0; cursor: pointer; font: inherit; font-weight: 700; text-decoration: none;
  color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  padding: 12px 22px; border-radius: 12px; margin-top: 8px;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .6; cursor: default; }

.contact { display: grid; grid-template-columns: 1fr 1.2fr; gap: 32px; align-items: start; }
.form { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.form input, .form textarea {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.4em; margin: 0; color: var(--muted); }
.form-status.ok { color: #059669; }
.form-status.err { color: #dc2626; }

.footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
.footer-in { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 24px 16px; }

@media (max-width: 900px) {
  .cards, .grid-3 { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .contact, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .topbar-in { height: auto; padding-top: 10px; padding-bottom: 10px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .nav a { padding: 6px 8px; font-size: .95rem; }
  .hero { padding: 56px 0 108px; }
  .steps { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .card { transition: none; } html { scroll-behavior: auto; } }

/* hry a aplikace žáků */
.app-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; padding-top: 48px; }
.app-card { display: flex; flex-direction: column; transition: transform .18s ease, border-color .18s ease; }
.app-card:hover { transform: translateY(-3px); border-color: var(--brand); }
.app-card h2 { font-size: 1.35rem; }
.app-icon { font-size: 2.6rem; line-height: 1; margin-bottom: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.chip { font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; color: var(--muted); background: var(--bg); border: 1px solid var(--line); }
.btn-lg { font-size: 1.1rem; padding: 14px 28px; }
.h3 { font-size: 1.2rem; }
.eyebrow a { color: inherit; text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 12px 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.ranking { width: 100%; border-collapse: collapse; font-size: .95rem; }
.ranking th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.ranking td { padding: 8px; border-bottom: 1px dashed var(--line); }
.ranking tr:last-child td { border-bottom: 0; }
.ranking .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ranking tr.me td { color: var(--brand); font-weight: 700; }
.ranking tr.empty td { color: var(--muted); }
.lb-me { margin: 0 0 10px; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--brand) 10%, transparent); font-weight: 600; }

/* stránka hry: hra ve rámu přímo na webu */
.play { padding-top: 28px; }
.play-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.play-head h1 { font-size: clamp(1.6rem, 4vw, 2.3rem); margin: 0; letter-spacing: -.02em; }
.crumbs { margin: 0 0 6px; color: var(--muted); font-size: .9rem; }
.crumbs a { color: inherit; }
.play-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line); margin-top: 0; padding: 9px 16px; font-weight: 600; }
.btn-ghost:hover { border-color: var(--brand); filter: none; }
.game-frame {
  aspect-ratio: var(--ratio, 16 / 9); width: 100%; max-height: 82vh; min-height: 420px;
  border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.game-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.play-hint { margin: 12px 0 0; color: var(--muted); }
@media (max-width: 700px) {
  .game-frame { aspect-ratio: auto; height: 78vh; min-height: 0; max-height: none; }
  .ranking th:nth-child(4), .ranking td:nth-child(4), .ranking th:nth-child(5), .ranking td:nth-child(5) { display: none; }
}
@media (max-width: 700px) { .app-grid { grid-template-columns: 1fr; } }
