/* ============================================================
   ZEMĚPIS 6. TŘÍDA — styl
   ============================================================ */
:root {
  --bg: #eef6ee;
  --paper: #ffffff;
  --ink: #21332a;
  --muted: #6b7d72;
  --line: #d8e5da;
  --accent: #2e7d55;
  --sky: #cfe8f7;
  --ok: #2e7d32;
  --no: #c62828;
  --radius: 16px;
  --shadow: 0 1px 3px rgba(25, 60, 40, .08), 0 8px 20px rgba(25, 60, 40, .07);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Nunito', system-ui, sans-serif;
  background: linear-gradient(180deg, #dceefb 0%, var(--bg) 260px);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
}
.wrap { max-width: 1020px; margin: 0 auto; padding: 20px 16px 80px; }

h1, h2, h3, .flash-face, .result-big { font-family: 'Baloo 2', 'Nunito', sans-serif; }

/* ---------- hlavička ---------- */
header { margin-bottom: 18px; }
.eyebrow { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; font-weight: 700; }
h1 { font-size: clamp(1.8rem, 4.5vw, 2.5rem); margin-bottom: 2px; }
.subtitle { color: var(--muted); margin-bottom: 14px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab {
  border: 2px solid var(--line); background: var(--paper); color: var(--ink);
  padding: 8px 15px; border-radius: 999px; font: inherit; font-size: .95rem; font-weight: 800;
  cursor: pointer; transition: all .15s;
}
.tab:hover { border-color: var(--accent); transform: translateY(-1px); }
.tab.on { background: var(--accent); color: #fff; border-color: var(--accent); }

.view { display: none; }
.view.show { display: block; animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

.view-intro { color: var(--muted); margin: 10px 0 18px; max-width: 72ch; }

/* ---------- pás kapitol ---------- */
.chapband { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 6px; }
.chapchip {
  border: none; border-radius: 12px; padding: 10px 12px; cursor: pointer; text-align: left;
  background: var(--c); color: #fff; font: inherit; box-shadow: var(--shadow); transition: transform .15s;
}
.chapchip:hover { transform: translateY(-2px); }
.chapchip b { display: block; font-size: .98rem; letter-spacing: .02em; }
.chapchip span { font-size: .75rem; opacity: .9; }

.toolbar { display: flex; justify-content: flex-end; margin: 8px 0; }
.btn {
  border: 2px solid var(--line); background: var(--paper); color: var(--ink);
  padding: 8px 16px; border-radius: 12px; font: inherit; font-weight: 800; cursor: pointer; transition: all .15s;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: #256645; }

/* ---------- seznam témat ---------- */
.chaphead {
  margin: 30px 0 12px; padding: 12px 16px;
  background: color-mix(in srgb, var(--c) 14%, var(--paper));
  border-left: 6px solid var(--c); border-radius: 0 var(--radius) var(--radius) 0;
}
.chaphead-name { font-family: 'Baloo 2', sans-serif; font-size: 1.3rem; font-weight: 700; color: color-mix(in srgb, var(--c) 85%, black); }
.chaphead p { font-size: .9rem; color: var(--ink); }

.topic { position: relative; margin: 12px 0; }
.topic-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border-left: 6px solid var(--c); }
.topic-head {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left; border: none; background: none; font: inherit; cursor: pointer; padding: 13px 16px;
}
.topic-head:hover { background: color-mix(in srgb, var(--c) 6%, var(--paper)); }
.topic-emoji {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%;
  background: color-mix(in srgb, var(--c) 14%, var(--paper));
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.topic-tit { flex: 1; }
.topic-name { font-family: 'Baloo 2', sans-serif; font-size: 1.15rem; font-weight: 700; line-height: 1.25; }
.topic-tag { font-size: .88rem; color: var(--muted); }
.topic-arrow { color: var(--muted); transition: transform .25s; font-size: 1.1rem; }
.topic.open .topic-arrow { transform: rotate(180deg); }
.topic-body { display: none; padding: 4px 18px 18px; border-top: 1px dashed var(--line); }
.topic.open .topic-body { display: block; animation: fadein .2s; }

.sec { margin-top: 14px; }
.sec h4 {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
  color: color-mix(in srgb, var(--c) 80%, black); margin-bottom: 4px;
}
.facts { list-style: none; }
.facts li { padding: 5px 0 5px 24px; position: relative; font-size: .96rem; }
.facts li::before { content: '●'; position: absolute; left: 6px; top: 7px; color: var(--c); font-size: .6rem; }
.facts b { color: color-mix(in srgb, var(--c) 65%, black); }

.minitable { margin-top: 8px; width: 100%; border-collapse: collapse; font-size: .92rem; }
.minitable th { background: color-mix(in srgb, var(--c) 16%, var(--paper)); padding: 8px 12px; text-align: left; border-radius: 8px 8px 0 0; }
.minitable td { padding: 7px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }

.diagram { margin: 14px 0 4px; background: #fbfdff; border: 1px solid var(--line); border-radius: 12px; padding: 10px; overflow-x: auto; }
.diagram svg { display: block; width: 100%; height: auto; max-width: 660px; margin: 0 auto; }
.diagram-cap { text-align: center; font-size: .8rem; color: var(--muted); margin-top: 4px; }

.schoolnote {
  margin-top: 14px; padding: 10px 14px; border-radius: 12px; font-size: .9rem;
  background: #fff7df; border: 1.5px dashed #d9a900;
}
.chips-line { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: .78rem; font-weight: 800; padding: 3px 11px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 14%, var(--paper)); color: color-mix(in srgb, var(--c) 75%, black);
}

/* ---------- test ---------- */
#quiz-setup h2, #flash-setup h2, #match-setup h2 { margin: 14px 0 12px; }
.qgroups { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.qgroup {
  text-align: left; border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius);
  border-left: 6px solid var(--c, var(--accent));
  padding: 13px 16px; font: inherit; cursor: pointer; box-shadow: var(--shadow); transition: all .15s;
}
.qgroup:hover { border-color: var(--c, var(--accent)); transform: translateY(-2px); }
.qgroup b { display: block; font-size: 1rem; }
.qgroup span { font-size: .82rem; color: var(--muted); }
.qlen { margin-top: 16px; display: flex; gap: 14px; align-items: center; font-size: .92rem; color: var(--muted); flex-wrap: wrap; }
.qlen label { cursor: pointer; font-weight: 700; color: var(--ink); }

.quiz-top { display: flex; justify-content: space-between; align-items: center; margin: 12px 0 6px; font-size: .9rem; color: var(--muted); }
.barwrap { background: var(--line); border-radius: 99px; height: 9px; overflow: hidden; margin-bottom: 16px; }
#quiz-prog, #flash-prog { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .3s; }
#quiz-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.q-chap {
  display: inline-block; font-size: .78rem; font-weight: 800; padding: 3px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 14%, var(--paper)); color: color-mix(in srgb, var(--c) 75%, black); margin-bottom: 10px;
}
.q-text { font-size: 1.15rem; font-weight: 700; margin-bottom: 16px; }
.q-answers { display: grid; gap: 8px; }
.ans {
  display: flex; align-items: center; gap: 10px; text-align: left; font: inherit; font-size: .98rem;
  border: 1.5px solid var(--line); background: #fff; border-radius: 12px; padding: 11px 14px; cursor: pointer; transition: all .15s;
}
.ans:hover:not(:disabled) { border-color: var(--accent); background: #f2f9f4; }
.ans .key {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 7px; background: var(--line); font-size: .78rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.ans.ok { border-color: var(--ok); background: #e8f5e9; }
.ans.ok .key { background: var(--ok); color: #fff; }
.ans.no { border-color: var(--no); background: #ffebee; }
.ans.no .key { background: var(--no); color: #fff; }
.ans:disabled { cursor: default; opacity: .92; }
.q-next { margin-top: 16px; text-align: right; }
.note { margin-top: 10px; font-size: .8rem; color: var(--muted); }
kbd { background: var(--line); border-radius: 4px; padding: 1px 6px; font-family: inherit; font-size: .75rem; }

#quiz-result, #flash-result { text-align: center; padding: 24px 0; }
.result-big { font-size: 3.4rem; font-weight: 800; }
.result-sub { color: var(--muted); }
.result-grade { font-size: 1.1rem; margin: 12px 0 20px; }
#quiz-result h3, #flash-result h3 { margin-bottom: 10px; }
.wronglist { display: grid; gap: 8px; text-align: left; max-width: 640px; margin: 0 auto; }
.wrong-item { background: var(--paper); border: 1px solid var(--line); border-left: 5px solid var(--c, var(--accent)); border-radius: 12px; padding: 10px 14px; }
.wi-q { font-weight: 700; font-size: .95rem; }
.wi-a { color: var(--ok); font-size: .92rem; margin-top: 2px; }
.wi-p { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.perfect { font-size: 1.05rem; }
.result-btns { margin-top: 20px; display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ---------- kartičky ---------- */
.flashcard {
  perspective: 1200px; cursor: pointer; outline: none;
  max-width: 640px; margin: 0 auto; height: 300px;
}
.flash-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform .5s; transform-style: preserve-3d;
}
.flashcard.flipped .flash-inner { transform: rotateY(180deg); }
.flashcard.noflip .flash-inner { transition: none; }
.flash-face {
  position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden;
  display: flex; align-items: center; justify-content: center; text-align: center;
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px;
  font-size: 1.25rem; font-weight: 700; line-height: 1.4;
}
.flash-front { background: var(--paper); border: 2px solid var(--c, var(--line)); }
.flash-back { background: color-mix(in srgb, var(--c, var(--accent)) 12%, var(--paper)); border: 2px solid var(--c, var(--accent)); transform: rotateY(180deg); }
.flash-hint { position: absolute; bottom: 10px; left: 0; right: 0; font-size: .75rem; font-weight: 600; color: var(--muted); }
.flash-btns { display: flex; gap: 10px; justify-content: center; margin-top: 16px; min-height: 46px; }
.flash-btns .btn { font-size: 1rem; }
.btn.good { border-color: var(--ok); color: var(--ok); }
.btn.good:hover { background: #e8f5e9; }
.btn.bad { border-color: var(--no); color: var(--no); }
.btn.bad:hover { background: #ffebee; }

/* ---------- spojovačky ---------- */
#match-info { margin: 12px 0; font-size: .95rem; }
.match-board { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; max-width: 760px; }
.mcol { display: grid; gap: 8px; align-content: start; }
.mitem {
  border: 2px solid var(--line); background: var(--paper); font: inherit; font-size: .93rem; font-weight: 700;
  padding: 10px 13px; border-radius: 12px; cursor: pointer; transition: all .15s; box-shadow: var(--shadow);
  text-align: left; color: var(--ink);
}
.mitem:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-1px); }
.mitem.sel { border-color: var(--accent); background: #eaf6ee; }
.mitem.done { border-color: var(--ok); background: #e8f5e9; color: var(--ok); cursor: default; transform: none; opacity: .85; }
.mitem.shake { animation: shake .4s; border-color: var(--no); background: #ffebee; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); } 75% { transform: translateX(5px); }
}

footer { margin-top: 50px; text-align: center; font-size: .8rem; color: var(--muted); }
footer a { color: var(--accent); font-weight: 700; }

@media (max-width: 640px) {
  .chapband { grid-template-columns: 1fr 1fr; }
  .topic-head { padding: 11px 12px; }
  .flashcard { height: 340px; }
  .match-board { gap: 8px 10px; }
  .mitem { font-size: .85rem; padding: 9px 10px; }
}
