:root {
  color-scheme: light;
  --ink: #16352d;
  --muted: #5d726b;
  --green: #0c6b4b;
  --green-dark: #075039;
  --mint: #dff6e9;
  --cream: #fbf7e9;
  --yellow: #f6c947;
  --red: #c44343;
  --white: #fff;
  --shadow: 0 14px 36px rgba(21, 71, 55, .14);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--cream); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: ui-rounded, "Arial Rounded MT Bold", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 0%, rgba(246, 201, 71, .28), transparent 28rem),
    radial-gradient(circle at 100% 18%, rgba(12, 107, 75, .15), transparent 24rem),
    var(--cream);
}
button { font: inherit; }
button:focus-visible, a:focus-visible { outline: 4px solid rgba(246, 201, 71, .75); outline-offset: 3px; }

.app-shell { width: min(100%, 800px); min-height: 100vh; margin: 0 auto; display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: max(14px, env(safe-area-inset-top)) 18px 10px; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0; border: 0; color: inherit; background: transparent; text-align: left; cursor: pointer; }
.brand-mark { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 15px; background: var(--green); font-size: 25px; box-shadow: 0 7px 20px rgba(12, 107, 75, .22); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 1.08rem; line-height: 1.15; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .82rem; }
.icon-button { width: 46px; height: 46px; border: 1px solid rgba(22,53,45,.12); border-radius: 14px; background: rgba(255,255,255,.75); cursor: pointer; box-shadow: 0 6px 18px rgba(21,71,55,.08); }

main { flex: 1; padding: 16px 18px 24px; }
.hero { padding: 14px 4px 4px; text-align: center; }
.eyebrow { margin: 0 0 8px; color: var(--green); font-size: .83rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: clamp(2rem, 9vw, 3.7rem); line-height: .98; letter-spacing: -.045em; }
.hero-copy { max-width: 34rem; margin: 0 auto 22px; color: var(--muted); font-size: 1.06rem; line-height: 1.55; }
.hero-birds { display: flex; justify-content: center; margin: 4px 0 17px; font-size: clamp(2.2rem, 12vw, 4.3rem); letter-spacing: -.2em; filter: drop-shadow(0 8px 8px rgba(21,71,55,.13)); }

.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin: 0 auto; }
.mode-card { min-height: 132px; padding: 18px 16px; border: 0; border-radius: 24px; color: var(--ink); text-align: left; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; }
.mode-card:hover { transform: translateY(-2px); box-shadow: 0 18px 38px rgba(21,71,55,.19); }
.mode-card:active { transform: scale(.98); }
.mode-card.learn { background: var(--mint); }
.mode-card.quiz { background: var(--yellow); }
.mode-card.mistakes { grid-column: 1 / -1; min-height: auto; background: var(--white); }
.mode-icon { display: block; margin-bottom: 10px; font-size: 1.9rem; }
.mode-card strong { display: block; margin-bottom: 5px; font-size: 1.2rem; }
.mode-card small { color: #47645a; font-size: .9rem; line-height: 1.35; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 14px; }
.stat { padding: 12px 8px; border: 1px solid rgba(22,53,45,.09); border-radius: 17px; background: rgba(255,255,255,.68); text-align: center; }
.stat strong, .stat small { display: block; }
.stat strong { font-size: 1.25rem; }
.stat small { margin-top: 2px; color: var(--muted); font-size: .75rem; }

.screen-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.back-button { width: 45px; height: 45px; flex: 0 0 auto; border: 0; border-radius: 14px; background: var(--white); cursor: pointer; box-shadow: 0 7px 20px rgba(21,71,55,.1); }
.screen-head h1 { margin: 0; font-size: 1.7rem; letter-spacing: -.025em; }
.screen-head p { margin: 2px 0 0; color: var(--muted); font-size: .87rem; }

.bird-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.bird-card { overflow: hidden; padding: 0; border: 0; border-radius: 22px; background: var(--white); color: var(--ink); text-align: left; cursor: pointer; box-shadow: var(--shadow); }
.bird-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #e7eee9; }
.bird-card span { display: block; padding: 13px 14px 15px; font-weight: 800; line-height: 1.15; }
.bird-card small { display: block; margin-top: 4px; color: var(--muted); font-weight: 500; }

.learn-detail { overflow: hidden; border-radius: 28px; background: var(--white); box-shadow: var(--shadow); }
.learn-detail img { display: block; width: 100%; height: min(53vh, 460px); object-fit: contain; background: #e7eee9; }
.learn-detail-body { padding: 20px; }
.learn-detail h1 { margin: 0 0 4px; font-size: 2rem; }
.latin { margin-bottom: 14px; color: var(--muted); font-style: italic; }
.clue { padding: 14px 16px; border-radius: 17px; background: var(--mint); line-height: 1.48; }
.detail-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px; }

.progress-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 15px; }
.progress { height: 10px; flex: 1; overflow: hidden; border-radius: 999px; background: #dce6df; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .3s ease; }
.progress-label { min-width: 50px; color: var(--muted); font-size: .85rem; font-weight: 700; text-align: right; }
.quiz-photo { overflow: hidden; position: relative; border-radius: 27px; background: #d9e6dd; box-shadow: var(--shadow); }
.quiz-photo img { display: block; width: 100%; height: clamp(250px, 45vh, 430px); object-fit: contain; background: #e7eee9; }
.quiz-photo::after { content: "Kdo je to?"; position: absolute; left: 15px; bottom: 15px; padding: 8px 13px; border-radius: 999px; background: rgba(255,255,255,.92); font-weight: 900; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 13px; }
.answer { min-height: 62px; padding: 12px 10px; border: 2px solid transparent; border-radius: 18px; background: var(--white); color: var(--ink); font-weight: 800; cursor: pointer; box-shadow: 0 8px 20px rgba(21,71,55,.1); }
.answer.correct { border-color: var(--green); background: var(--mint); color: var(--green-dark); }
.answer.wrong { border-color: var(--red); background: #ffe4e1; color: #8e2626; }
.answer:disabled { cursor: default; opacity: 1; }
.feedback { min-height: 56px; margin-top: 12px; padding: 12px 14px; border-radius: 17px; background: rgba(255,255,255,.72); line-height: 1.35; text-align: center; }
.feedback strong { display: block; font-size: 1.05rem; }
.feedback small { color: var(--muted); }

.primary-button, .secondary-button { min-height: 52px; padding: 12px 18px; border: 0; border-radius: 17px; font-weight: 800; cursor: pointer; }
.primary-button { background: var(--green); color: var(--white); box-shadow: 0 9px 22px rgba(12,107,75,.24); }
.secondary-button { background: #e7efe9; color: var(--ink); }
.wide { width: 100%; margin-top: 12px; }

.result-card { padding: 26px 21px; border-radius: 28px; background: var(--white); text-align: center; box-shadow: var(--shadow); }
.result-emoji { font-size: 4rem; }
.result-card h1 { margin: 8px 0 8px; }
.score-ring { display: grid; width: 130px; height: 130px; margin: 20px auto; place-items: center; border-radius: 50%; background: conic-gradient(var(--green) var(--score), #dfe8e2 0); position: relative; }
.score-ring::before { content: ""; position: absolute; inset: 12px; border-radius: 50%; background: var(--white); }
.score-ring span { position: relative; font-size: 1.8rem; font-weight: 900; }
.result-actions { display: grid; gap: 10px; }

.credits-list { display: grid; gap: 10px; }
.credit { padding: 14px; border-radius: 17px; background: var(--white); box-shadow: 0 6px 18px rgba(21,71,55,.08); }
.credit strong { display: block; margin-bottom: 4px; }
.credit p { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.45; }
.credit a { color: var(--green-dark); }
.footer { display: flex; justify-content: center; gap: 7px; padding: 12px 18px max(16px, env(safe-area-inset-bottom)); color: var(--muted); font-size: .78rem; }
.text-button { padding: 0; border: 0; background: transparent; color: var(--green-dark); text-decoration: underline; cursor: pointer; }
.toast { visibility: hidden; position: fixed; z-index: 20; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); max-width: calc(100% - 36px); padding: 12px 17px; transform: translate(-50%, 20px); border-radius: 999px; background: #173c31; color: white; opacity: 0; transition: .25s ease; box-shadow: 0 10px 30px rgba(0,0,0,.22); }
.toast.show { visibility: visible; transform: translate(-50%, 0); opacity: 1; }

@media (min-width: 650px) {
  main { padding-inline: 28px; }
  .bird-grid { grid-template-columns: repeat(3, 1fr); }
  .mode-grid { max-width: 620px; }
  .quiz-photo img { height: 430px; }
}
@media (max-width: 390px) {
  .answers { grid-template-columns: 1fr; }
  .mode-grid { grid-template-columns: 1fr; }
  .mode-card.mistakes { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

