:root {
  --bg: #000; --plocha: #111; --plocha2: #1c1c1c; --cara: #262626;
  --text: #f2f2f2; --tlumeny: #8f8a84; --akcent: #e9a348; --akcent-text: #000; --zlata-tmava: #b07a2e;
  --c0: #ff5a52; --c1: #ffad3b; --c2: #3ddc84; --c3: #4aa8ff;
  --r: 18px;
  --safe-t: env(safe-area-inset-top); --safe-b: env(safe-area-inset-bottom);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
[hidden] { display: none !important; }
#app { min-height: 100%; }
.view { min-height: 100dvh; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 8px) 16px calc(var(--safe-b) + 12px); }

/* Vstup */
.vstup { width: 100%; max-width: 400px; margin: auto; padding: 24px 0; }
.logo img { display: block; height: 44px; width: auto; }
.logo span { display: block; font-weight: 500; font-size: 13px; color: var(--akcent); letter-spacing: 0.32em; text-transform: uppercase; margin-top: 14px; }
.lista-titul img { height: 18px; width: auto; display: block; }
.perex { color: var(--tlumeny); margin: 14px 0 28px; }
.prepinac { display: grid; grid-template-columns: 1fr 1fr; background: var(--plocha); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.prepinac button { padding: 10px; border-radius: 9px; color: var(--tlumeny); font-weight: 600; font-size: 15px; transition: background .2s, color .2s; }
.prepinac button[aria-selected="true"] { background: var(--plocha2); color: var(--text); }
.pole { display: block; margin-bottom: 14px; }
.pole span { display: block; font-size: 13px; color: var(--tlumeny); margin-bottom: 6px; }
.pole input { width: 100%; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--cara); background: var(--plocha); font-size: 17px; outline: none; transition: border-color .15s; }
.pole input:focus { border-color: var(--akcent); }
form:not(.zalozit) .jen-zalozit { display: none; }
.vstup:has(form.zalozit) .jen-prihlasit { display: none; }
.vstup .tlacitko.tiche { margin-top: 6px; }
.napoveda a { color: var(--akcent); }
.seznam.jednoduchy li { padding: 12px 0; }
.upozorneni { background: rgba(233,163,72,.08); border: 1px solid rgba(233,163,72,.4); border-radius: 12px; padding: 12px 14px; font-size: 14px; color: #eadfcf; margin: 4px 0 12px; }
.upozorneni strong { display: block; color: var(--akcent); font-size: 15px; margin-bottom: 2px; }
.zaskrt { display: flex; gap: 10px; align-items: center; font-size: 15px; margin-bottom: 14px; }
.zaskrt input { width: 20px; height: 20px; accent-color: var(--akcent); }
.chyba { color: var(--c0); font-size: 14px; margin: 0 0 12px; }
.drobne { color: var(--tlumeny); font-size: 13px; margin-top: 16px; }

.tlacitko { display: block; width: 100%; padding: 15px 18px; border-radius: 14px; background: var(--plocha2); font-weight: 600; font-size: 16px; transition: transform .12s, opacity .2s; }
.tlacitko:active { transform: scale(.98); }
.tlacitko.hlavni { background: linear-gradient(180deg, #f0b25e, var(--akcent)); color: var(--akcent-text); }
.tlacitko.velke { padding: 20px; font-size: 19px; border-radius: 18px; }
.tlacitko.tiche { background: none; color: var(--tlumeny); }
.tlacitko:disabled { opacity: .5; }

/* Stahování */
.stred { margin: auto; text-align: center; width: 100%; max-width: 300px; color: var(--tlumeny); }
.kolo { width: 34px; height: 34px; margin: 0 auto 16px; border-radius: 50%; border: 3px solid var(--cara); border-top-color: var(--akcent); animation: toc 0.9s linear infinite; }
@keyframes toc { to { transform: rotate(360deg); } }
.pruh { height: 4px; background: var(--plocha2); border-radius: 4px; overflow: hidden; margin-top: 12px; }
.pruh i { display: block; height: 100%; width: 0; background: var(--akcent); transition: width .2s; }

/* Lišta */
.lista { display: flex; align-items: center; justify-content: space-between; height: 48px; flex: none; }
.lista-titul { font-weight: 700; font-size: 17px; }
.ikona, .ikona-misto { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; flex: none; }
.ikona { background: var(--plocha); }
.ikona:active { background: var(--plocha2); }
.ikona svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.ikona.znam { color: var(--c2); }
.ikona:disabled { opacity: .3; }

/* Domov */
.tip { position: relative; background: var(--plocha); border-radius: var(--r); padding: 14px 44px 14px 16px; margin: 8px 0 4px; font-size: 14px; color: var(--tlumeny); }
.tip strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 2px; }
.tip b { color: var(--text); }
.mini { width: 16px; height: 16px; vertical-align: -3px; fill: none; stroke: var(--c3); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.zavrit { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; font-size: 24px; color: var(--tlumeny); border-radius: 50%; }
.domov { margin: auto 0; display: flex; flex-direction: column; gap: 14px; padding: 24px 0; }
.dnes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.dnes div { background: var(--plocha); border-radius: var(--r); padding: 18px 8px; text-align: center; }
.dnes b { display: block; font-size: 34px; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.dnes span { font-size: 13px; color: var(--tlumeny); }
.dnes div:nth-child(1) b { color: var(--c2); }
.dnes div:nth-child(2) b { color: var(--akcent); }
.hotovo { background: var(--plocha); border-radius: var(--r); padding: 20px; text-align: center; }
.hotovo-titul { font-size: 22px; font-weight: 700; margin: 0; }
.hotovo-text { color: var(--tlumeny); margin: 4px 0 16px; }
.sync-stav { text-align: center; font-size: 13px; color: var(--tlumeny); margin: 0; }

/* Učení */
#v-uceni { padding-bottom: calc(var(--safe-b) + 8px); touch-action: none; user-select: none; -webkit-user-select: none; }
.pocitadla { display: flex; gap: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.c-nove { color: var(--c3); } .c-uci { color: var(--c0); } .c-opak { color: var(--c2); }
.scena { flex: 1; display: flex; align-items: center; justify-content: center; padding: 10px 0; min-height: 0; }
.karta { position: relative; width: 100%; max-width: 440px; aspect-ratio: 3 / 4; max-height: 100%; border-radius: 26px; overflow: hidden; background: var(--plocha); box-shadow: 0 20px 50px rgba(0,0,0,.5); will-change: transform; }
.karta img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; -webkit-user-drag: none; }
.odpoved { position: absolute; inset: auto 0 0 0; padding: 60px 20px 20px; background: linear-gradient(to top, rgba(0,0,0,.92) 30%, rgba(0,0,0,0)); animation: vyjed .22s ease-out; }
@keyframes vyjed { from { opacity: 0; transform: translateY(12px); } }
.jmeno { font-size: 28px; font-weight: 750; letter-spacing: -0.02em; line-height: 1.1; }
.jmeno small { font-size: 18px; font-weight: 500; color: #d0d0d5; }
.osloveni { font-size: 14px; color: var(--akcent); margin-top: 4px; }
.osloveni:empty { display: none; }
.info { font-size: 15px; color: #c8c8ce; margin-top: 6px; }
.stitek { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); padding: 6px 14px; border-radius: 99px; font-weight: 800; font-size: 15px; opacity: 0; pointer-events: none; color: #0b0b0c; }
.spodek { display: flex; align-items: center; gap: 10px; flex: none; min-height: 64px; }
.spodek .tlacitko { flex: 1; }
.hodnoceni { flex: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.hodnoceni button { padding: 10px 2px 8px; border-radius: 12px; background: var(--plocha); font-weight: 650; font-size: 14px; line-height: 1.15; }
.hodnoceni small { display: block; font-size: 11px; font-weight: 500; color: var(--tlumeny); margin-top: 2px; }
.hodnoceni .h0 { color: var(--c0); } .hodnoceni .h1 { color: var(--c1); } .hodnoceni .h2 { color: var(--c2); } .hodnoceni .h3 { color: var(--c3); }

/* Karty */
.napoveda { color: var(--tlumeny); font-size: 14px; margin: 4px 0 12px; }
.hledat { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--cara); background: var(--plocha); font-size: 16px; outline: none; margin-bottom: 8px; }
.seznam { list-style: none; margin: 0; padding: 0; }
.seznam li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--cara); }
.seznam img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; background: var(--plocha2); flex: none; }
.seznam .txt { flex: 1; min-width: 0; }
.seznam .txt b { display: block; font-weight: 600; }
.seznam .txt span { font-size: 13px; color: var(--tlumeny); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spinac { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 99px; background: var(--plocha2); position: relative; flex: none; transition: background .2s; }
.spinac::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; }
.spinac:checked { background: var(--c2); }
.spinac:checked::after { transform: translateX(20px); }

/* Panely */
.panel { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; z-index: 10; animation: zjev .18s; }
@keyframes zjev { from { opacity: 0; } }
.panel-in { width: 100%; background: var(--plocha); border-radius: 22px 22px 0 0; padding: 16px 16px calc(var(--safe-b) + 18px); max-height: 90dvh; overflow: auto; animation: nahoru .22s ease-out; }
@keyframes nahoru { from { transform: translateY(30px); } }
.panel-in.maly { text-align: center; display: flex; flex-direction: column; gap: 8px; }
.panel-hlava { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; position: relative; height: 40px; font-size: 18px; }
.panel-hlava .zavrit { top: 2px; right: -4px; }
.radek { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 14px 2px; border-bottom: 1px solid var(--cara); text-align: left; font-size: 16px; }
.radek select { background: var(--plocha2); border: 0; border-radius: 10px; padding: 8px 12px; }
.radek small { color: var(--tlumeny); font-size: 13px; }
.radek.cervene { color: var(--c0); border-bottom: 0; }
.info-ucet { color: var(--tlumeny); font-size: 14px; justify-content: flex-start; }
.dlg-titul { font-size: 20px; font-weight: 700; margin: 6px 0 0; }
.dlg-text { color: var(--tlumeny); margin: 0 0 10px; }

.toast { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 90px); transform: translateX(-50%); background: var(--plocha2); padding: 10px 16px; border-radius: 99px; font-size: 14px; z-index: 20; box-shadow: 0 8px 24px rgba(0,0,0,.4); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.kroky { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 10px; }
.kroky li { display: flex; gap: 12px; align-items: center; background: var(--plocha); border-radius: 14px; padding: 14px; font-size: 15px; }
.kroky li span { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--akcent); color: #000; font-weight: 700; font-size: 14px; }
.napoveda-heslo { margin: -6px 0 14px; }
