:root {
  --bg: #0c0d10;
  --card: #17191e;
  --card-hi: #1e2128;
  --ink: #f2f4f7;
  --muted: #8b93a1;
  --line: #262a32;
  --accent: #e63329;
  --accent-ink: #fff;
  --art: linear-gradient(160deg, #f7f8fa, #e8ebef);
  --radius: 20px;
  --shadow: 0 10px 26px rgba(0, 0, 0, .45);
  --safe: env(safe-area-inset-bottom, 0px);
  --ease: cubic-bezier(.2, .7, .3, 1);
}

* { box-sizing: border-box; }

/* musí přebít display na skrývaných řádcích slovníčku */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

/*
 * Znak 柔道 na pozadí. Je ukotvený napevno, takže při rolování stojí.
 * Ve výchozím stavu leží velký uprostřed za obsahem a je hodně ztlumený,
 * aby se karty daly číst; na širokém okně se odsune vedle obsahu, kde na
 * něj je místo, a může být vidět naplno.
 */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url('img/kanji.png') no-repeat center 46% / auto min(72vh, 620px);
  opacity: .3;
  filter: blur(1.5px);
}

/* Karty jsou o chlup průsvitné, aby znak za nimi prosvítal a nekončil jen v mezerách. */
.card, .tile, .list, .search { background: color-mix(in srgb, var(--card) 88%, transparent); }

/*
 * Vedle obsahu. Sloupec je široký 760 px, takže šířka znaku se počítá ze
 * zbytku okna — jinak by ho karty přejely. Odečtených 900 px místo 760 nechá
 * mezi obsahem a znakem mezeru.
 */
@media (min-width: 1240px) {
  body::before {
    background-position: right 3vw center;
    background-size: min(calc((100vw - 900px) / 2), 400px) auto;
    /* větší a ostřejší než na mobilu, tak ho ztlumíme, ať nepřebíjí obsah */
    opacity: .42;
    filter: blur(3px);
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  overflow-wrap: break-word;
  -webkit-tap-highlight-color: transparent;
}

/* jednotný nadpisový styl — stlačený, verzálky, těžký řez */
.display {
  margin: 0;
  font-weight: 800;
  letter-spacing: -.02em;
  text-transform: uppercase;
  line-height: 1.05;
}

/* ---------- horní lišta ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: max(env(safe-area-inset-top, 0px), 12px) 18px 14px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}

.back {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-left: -6px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: background .18s var(--ease), transform .12s var(--ease);
}

.back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.back:hover { background: var(--card-hi); }
.back:active { transform: scale(.9); }

.crest {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
  background: #000;
  border: 1px solid var(--line);
}

.titles { min-width: 0; }

.topbar h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.01em;
  text-transform: uppercase;
  line-height: 1.15;
}

.topbar p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 18px calc(30px + var(--safe));
}

/* ---------- sekce ---------- */

.section { margin: 0 0 30px; }

.section h2 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .9);   /* ať se neztratí přes fotku v pozadí */
}

.section-note {
  margin: -4px 0 12px;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- karty pásků ---------- */

.belts { display: grid; gap: 12px; }

.card {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease),
              transform .14s var(--ease);
}

.card:hover { background: var(--card-hi); border-color: #333844; }
.card:active { transform: scale(.975); background: var(--card-hi); }

.swatch {
  flex: none;
  width: 8px;
  height: 44px;
  border-radius: 99px;
}

.belt-img {
  flex: none;
  width: 74px;
  height: auto;
  transition: transform .2s var(--ease);
}

.card:hover .belt-img { transform: scale(1.06) rotate(-2deg); }

.crest { background: transparent; border: 0; border-radius: 0; }

.swatch.glyph {
  display: grid;
  place-items: center;
  width: 44px;
  background: rgba(230, 51, 41, .14);
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
}

.swatch.glyph.small { font-size: 17px; letter-spacing: -.02em; }

.card b {
  display: block;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.01em;
  text-transform: uppercase;
}

.card span.sub { display: block; margin-top: 1px; font-size: 13px; color: var(--muted); }

.chev {
  margin-left: auto;
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s var(--ease), stroke .2s var(--ease);
}

.card:hover .chev { transform: translateX(3px); stroke: var(--ink); }

/* ---------- rozbalovací pruh ---------- */

.disclosure summary {
  list-style: none;          /* pryč s výchozím trojúhelníčkem prohlížeče */
  user-select: none;
}

.disclosure summary::-webkit-details-marker { display: none; }

.chev.spin { transition: transform .25s var(--ease), stroke .2s var(--ease); }

.disclosure[open] .chev.spin { transform: rotate(180deg); stroke: var(--ink); }

.disclosure[open] .tree { margin-top: 12px; }

.disclosure .search { margin: 14px 0 12px; }

.disclosure .linkrow b { font-weight: 700; text-transform: uppercase; letter-spacing: .01em; }

.disclosure .linkrow .group {
  font-style: normal;
  font-size: 12.5px;
  color: var(--muted);
}

@media (prefers-reduced-motion: no-preference) {
  .disclosure[open] .tree > li { animation: rise .3s var(--ease) both; }
  .disclosure[open] .tree > li:nth-child(2) { animation-delay: .05s; }
  .disclosure[open] .tree > li:nth-child(3) { animation-delay: .1s; }
}

/* ---------- písmenka J U D O u baby juda ---------- */

.letter-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 12px;
}

.letter-head h2 { margin: 0; }

.letter {
  flex: none;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 99px;
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}

/* ---------- dlaždice technik ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}

.tile {
  display: flex;
  flex-direction: column;
  padding: 8px 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .2s var(--ease), border-color .2s var(--ease),
              transform .14s var(--ease);
}

.tile:hover { background: var(--card-hi); border-color: #333844; }
.tile:active { transform: scale(.97); }

.tile figure {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 10px;
  padding: 10px;
  height: 124px;
  border-radius: 14px;
  background: var(--art);
  overflow: hidden;
}

.tile img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform .3s var(--ease);
}

.tile:hover img { transform: scale(1.06); }

/* český popis místo japonského názvu se čte líp bez verzálek */
.tile b.plain { text-transform: none; letter-spacing: 0; }

.tile .noimg { font-size: 30px; color: #99a; }

.tile b {
  padding: 0 8px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.01em;
  text-transform: uppercase;
}

.tile small { padding: 3px 8px 0; font-size: 12.5px; color: var(--muted); }

/* ---------- odznaky a tlačítka ---------- */

.pill {
  align-self: flex-start;
  margin: 8px 0 0 8px;
  padding: 4px 9px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.videobtn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 2px 0 14px;
  padding: 12px 20px;
  border-radius: 99px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(230, 51, 41, .3);
  transition: transform .14s var(--ease), box-shadow .2s var(--ease), filter .2s var(--ease);
}

.videobtn svg { width: 15px; height: 15px; fill: currentColor; }

.videobtn:hover { filter: brightness(1.08); box-shadow: 0 10px 26px rgba(230, 51, 41, .42); }
.videobtn:active { transform: scale(.95); box-shadow: 0 4px 12px rgba(230, 51, 41, .3); }

/* ---------- seznamy ---------- */

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.list li {
  padding: 12px 16px;
  font-size: 14.5px;
  border-top: 1px solid var(--line);
}

.list li:first-child { border-top: 0; }

.list.terms li { color: var(--muted); }

.list li.explained {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 12px;
}

.list li.explained b { flex: none; font-weight: 700; }
.list li.explained span { color: var(--muted); font-size: 14px; }

.list li.explained .examples { flex: none; margin-left: auto; }

.examples summary {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 99px;
  background: var(--card-hi);
  border: 1px solid var(--line);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.examples summary::-webkit-details-marker { display: none; }

.examples-list {
  display: none;
  flex: 1 0 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}

.examples[open] ~ .examples-list { display: block; }

.examples-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  border-top: 1px dashed var(--line);
}

.examples-list li:first-child { border-top: 0; }

.examples-list a { color: inherit; text-decoration: none; }
.examples-list a:hover { text-decoration: underline; }
.examples-list .arrow { color: var(--muted); }

.linkrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  color: inherit;
  text-decoration: none;
  border-top: 1px solid var(--line);
  font-size: 14.5px;
  transition: background .18s var(--ease);
}

.linkrow:first-child { border-top: 0; }
.linkrow:hover { background: var(--card-hi); }
.linkrow:active { background: #232730; }
.linkrow .chev { stroke: var(--muted); }

/* ---------- detail techniky ---------- */

.detail-art {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px;
  min-height: 250px;
  border-radius: 26px;
  background: var(--art);
  box-shadow: var(--shadow);
}

.detail-art figure { display: flex; margin: 0; max-height: 46vh; }
.detail-art img { max-width: 100%; max-height: 46vh; object-fit: contain; }
.detail-art .noimg { font-size: 54px; color: #99a; }

.detail h2 { margin: 22px 0 6px; font-size: clamp(26px, 8vw, 38px); }
.detail .where { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.detail .nolink { color: var(--muted); font-size: 14px; }

/* ---------- slovníček ---------- */

.search {
  width: 100%;
  margin: 0 0 20px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  box-shadow: var(--shadow);
  -webkit-appearance: none;
  transition: border-color .2s var(--ease);
}

.search::placeholder { color: var(--muted); }
.search:focus { outline: none; border-color: var(--accent); }

/*
 * Hlavička skupiny slovíček. Drží se při rolování u horní lišty, ale jen
 * v rámci své sekce — jakmile skupina skončí, vytlačí ji ta další, takže
 * je pořád vidět, ke kterému pásku patří slovíčka na obrazovce.
 */
.belt-head {
  position: sticky;
  top: 62px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  margin: 0 0 12px;
  background: var(--bg);
}

.belt-head img { flex: none; width: 52px; height: auto; }

.belt-head span {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--ink);
}

/* barevný proužek pásku podél celého seznamu */
.belt-group .list {
  border-left: 3px solid var(--belt, var(--line));
  border-radius: 6px var(--radius) var(--radius) 6px;
}

.belt-group + .belt-group { margin-top: 34px; }

.list.words li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 12px;
}

.list.words b { flex: none; font-size: 14.5px; font-weight: 700; }
.list.words span { color: var(--muted); font-size: 14px; }

.list.count li { display: flex; align-items: baseline; gap: 12px; }
.list.count .num {
  flex: none;
  width: 26px;
  color: var(--accent);
  font-weight: 800;
}
.list.count b { flex: none; font-size: 14.5px; }
.list.count span { color: var(--muted); font-size: 14px; }

.tree { margin: 0; padding: 0; list-style: none; }

.tree > li {
  margin-bottom: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}

.tree b { font-size: 14.5px; font-weight: 800; letter-spacing: .02em; }
.tree i { font-style: normal; color: var(--muted); font-size: 13.5px; }

.tree ul { margin: 10px 0 0; padding: 0 0 0 14px; list-style: none; border-left: 2px solid var(--line); }
.tree ul li { padding: 5px 0 5px 12px; }
.tree ul ul { margin-top: 6px; }

.waza-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: -4px -8px;
  padding: 4px 8px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
  transition: background .18s var(--ease);
}

.waza-link:hover { background: var(--card-hi); }
.waza-link:active { background: #252a33; }

.chev.tiny {
  width: 14px;
  height: 14px;
  margin-left: 0;
  stroke: var(--accent);
}

.waza-link:hover .chev.tiny { transform: translateX(3px); }

.waza-link .count {
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(230, 51, 41, .16);
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
}

/* ---------- patička ---------- */

.foot {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 18px calc(26px + var(--safe));
  color: var(--muted);
  font-size: 11.5px;
  text-align: center;
}

.foot p { margin: 0 0 3px; }
.foot p:first-child { font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #6f7684; }

/* ---------- pohyb ---------- */

@media (prefers-reduced-motion: no-preference) {
  main > * { animation: rise .34s var(--ease) both; }
  main > *:nth-child(2) { animation-delay: .04s; }
  main > *:nth-child(3) { animation-delay: .08s; }
  main > *:nth-child(4) { animation-delay: .12s; }
  main > *:nth-child(n+5) { animation-delay: .16s; }

  @keyframes rise {
    from { opacity: 0; transform: translateY(10px); }
  }
}
