/* ============================================================
   DuoCards landing — design systém „Midnight Indigo"
   Světlý režim = default, tmavý přes prefers-color-scheme.
   Jeden akcent: indigo. Violet výhradně AI. Emerald úspěch,
   red chyba/nevím, amber streak.
   ============================================================ */

:root {
  --g50: #f7f9fc; --g100: #eef2f8; --g200: #dfe6f0; --g300: #c3cfe0;
  --g400: #94a5c0; --g500: #64748f; --g600: #475572; --g700: #334059;
  --g800: #1d2739; --g900: #12192b; --g950: #0a0f1e;

  --i50: #eef2ff; --i100: #e0e7ff; --i300: #a5b4fc; --i400: #818cf8;
  --i500: #6366f1; --i600: #4f46e5; --i700: #4338ca; --i900: #312e81;

  --v100: #ede9fe; --v300: #c4b5fd; --v400: #a78bfa;
  --v600: #7c3aed; --v700: #6d28d9; --v900: #4c1d95;

  --em: #059669; --em-tint: #ecfdf5;
  --red: #dc2626; --red-tint: #fee2e2;
  --amber: #f59e0b; --amber-600: #d97706;

  --bg: var(--g50);
  --text: var(--g700);
  --heading: var(--g900);
  --muted: var(--g500);
  --surface: #ffffff;
  --border: var(--g200);
  --link: var(--i600);
  --accent: var(--i600);
  --accent-h: var(--i700);
  --tint: var(--i50);
  --pill-bg: var(--g100);
  --pill-text: var(--g600);
  --card-shadow: 0 4px 6px rgba(0, 0, 0, .07);
  --card-shadow-hover: 0 20px 25px rgba(0, 0, 0, .1);
  --grad-from: #eef2ff;
  --grad-to: #e0e7ff;
  --grad: linear-gradient(135deg, var(--grad-from), var(--grad-to));
  --chrome-bg: var(--grad-from);
  --hero-bg: var(--grad);
  --nav-glass: rgba(238, 242, 255, 0.72);
  --nav-glass-border: rgba(79, 70, 229, 0.08);
  --grad-dark-sec: linear-gradient(135deg, #12192b, #0a0f1e);
  --ai-grad: linear-gradient(90deg, #7c3aed, #4f46e5);
  --ai-surface: linear-gradient(135deg, #f5f3ff, #eef2ff);
  --brand-grad: linear-gradient(90deg, #4f46e5, #7c3aed);
  --em-text: var(--em);
  --em-surface: linear-gradient(135deg, #ecfdf5, #f7f9fc);
  --ai-chip-bg: var(--v100); --ai-chip-text: var(--v700);
  --ai-icon: var(--v600);
  --count-bg: var(--i50); --count-text: var(--i600);

  /* mapování pro JS (ghost karty: --blue = VÍM, --coral = NEVÍM, --ink = neutrál) */
  --blue: var(--i600);
  --coral: var(--red);
  --ink: var(--g700);

  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--g950);
    --text: var(--g300);
    --heading: var(--g100);
    --muted: var(--g400);
    --surface: var(--g800);
    --border: var(--g700);
    --link: var(--i400);
    --tint: rgba(49, 46, 129, .3);
    --pill-bg: var(--g700);
    --pill-text: var(--g300);
    --card-shadow: 0 4px 6px rgba(0, 0, 0, .3);
    --card-shadow-hover: 0 20px 25px rgba(0, 0, 0, .45);
    --grad-from: #12192b;
    --grad-to: #1d2739;
    --grad: linear-gradient(135deg, var(--grad-from), var(--grad-to));
    --chrome-bg: var(--grad-to);
    --hero-bg: var(--grad-to);
    --nav-glass: rgba(29, 39, 57, 0.72);
    --nav-glass-border: rgba(129, 140, 248, 0.1);
    --ai-surface: linear-gradient(135deg, rgba(76, 29, 149, .2), rgba(49, 46, 129, .2));
    --brand-grad: linear-gradient(90deg, #818cf8, #a78bfa);
    --em-text: #34d399;
    --em-surface: linear-gradient(135deg, rgba(6, 78, 59, .2), rgba(10, 15, 30, 0));
    --ai-chip-bg: rgba(76, 29, 149, .3); --ai-chip-text: var(--v300);
    --ai-icon: var(--v400);
    --count-bg: rgba(49, 46, 129, .3); --count-text: var(--i300);
    --ink: var(--g300);
  }
}

/* ---------- základ ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  background-color: var(--chrome-bg);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}
body {
  font-family: var(--font);
  background-color: var(--chrome-bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  overscroll-behavior-x: none;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--i600); color: #fff; }
* { scrollbar-width: thin; scrollbar-color: var(--g400) transparent; }
@media (prefers-color-scheme: dark) { * { scrollbar-color: var(--g700) transparent; } }

.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.page { position: relative; max-width: 100%; overflow-x: hidden; }
@supports (overflow: clip) {
  html, body, .page { overflow-x: clip; }
}
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 48px); position: relative; z-index: 2; }
.sec { position: relative; padding: clamp(72px, 11vh, 128px) 0; }

a { color: var(--link); }
:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--i500); border-radius: 8px; }

h1, h2 { color: var(--heading); letter-spacing: -0.025em; line-height: 1.08; font-weight: 700; }
.big { font-size: clamp(1.9rem, 4.2vw, 3.1rem); margin: 14px 0 18px; max-width: 21ch; }
.narrow { max-width: 56ch; }

/* ---------- tlačítka ---------- */
.btn {
  display: inline-block;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  text-decoration: none;
  cursor: pointer;
  transition: all .15s;
}
.btn:hover { background: var(--accent-h); box-shadow: 0 4px 12px rgba(79, 70, 229, .3); }
.btn:active { transform: scale(.98); }
.btn-final { font-size: 17px; font-weight: 600; padding: 16px 40px; border-radius: 14px; }
.ghost {
  color: var(--link);
  font-weight: 500;
  text-decoration: none;
  border: 0;
  border-bottom: 1px solid transparent;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 0;
  transition: border-color .15s;
}
.ghost:hover { border-color: var(--link); }

/* ---------- pill / chip vzory ---------- */
.chaphead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.chaphead .badge { margin-top: 0; }
.chapnum {
  display: inline-block;
  background: var(--count-bg);
  color: var(--count-text);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
  padding: 4px 12px;
  border-radius: 999px;
}
.badge {
  display: inline-block;
  background: var(--pill-bg);
  color: var(--pill-text);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  margin-top: 16px;
}

/* ---------- nav ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px clamp(16px, 4vw, 40px);
  z-index: 50;
  pointer-events: none;
  background: var(--nav-glass);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  border-bottom: 1px solid var(--nav-glass-border);
}
.nav > * { pointer-events: auto; }
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lang-select {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  max-width: min(42vw, 190px);
}
.lang-select:hover, .lang-select:focus-visible {
  border-color: var(--link);
  color: var(--heading);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-card {
  width: 34px; height: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.3;
  display: grid;
  place-content: center;
  text-align: center;
  color: var(--i600);
}
@media (prefers-color-scheme: dark) { .brand-card { color: var(--i400); } }
.brand-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.btn-nav { box-shadow: 0 4px 6px rgba(79, 70, 229, .25); }

/* ---------- zbloudilé kartičky (paralaxa) ---------- */
.stray-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
.stray { position: absolute; }
.s2 { top: 34%; right: clamp(16px, 4vw, 32px); }
.s3 { top: 55%; left: 2%; }
.s4 { top: 72%; right: 3%; }
.s5 { top: 90%; left: 12%; }

.cardlet {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  padding: 12px 16px;
}
.cardlet b { color: var(--heading); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.cardlet i { font-style: normal; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.stray-in { opacity: .85; transform: rotate(-2deg); }
.s2 .stray-in, .s4 .stray-in { transform: rotate(2.5deg); }

/* ---------- hero ---------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(90px, 14vh, 150px) clamp(20px, 6vw, 64px) 72px;
  background: var(--hero-bg);
  position: relative;
  overflow: hidden;
}
.hero-tags {
  position: absolute;
  top: 76px; right: clamp(16px, 4vw, 40px);
  display: flex; gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.hero-fliers { position: absolute; inset: 0; pointer-events: none; }
.flier { position: absolute; opacity: .9; }
.f1 { top: 10%; animation: flyAcross 19s linear infinite; animation-delay: -6s; }
.f2 { top: 28%; animation: flyAcross 17s linear infinite; }
.f3 { top: 52%; animation: flyAcross 23s linear infinite; animation-delay: -9s; }
.f4 { top: 76%; animation: flyAcross 20s linear infinite; animation-delay: -4s; }
@keyframes flyAcross {
  from { transform: translate3d(-22vw, 0, 0) rotate(-5deg); }
  to   { transform: translate3d(115vw, 0, 0) rotate(6deg); }
}

.hero-tilt { position: relative; z-index: 2; }
.hero-title {
  font-size: clamp(2.5rem, 7.2vw, 5.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.04;
  display: flex;
  flex-direction: column;
}
.hline { display: block; overflow: hidden; padding-bottom: .08em; }
.hword { display: inline-block; transform: translateY(112%); animation: riseIn .7s cubic-bezier(.2, .9, .25, 1) forwards; }
.hw2 { animation-delay: .12s; }
.hw3 { animation-delay: .24s; }
@keyframes riseIn { to { transform: translateY(0); } }

/* slot machine */
.hslot { overflow: visible; }
.hw2 { position: relative; }
.slot { display: inline-block; overflow: hidden; vertical-align: bottom; height: 1.1em; }
.slot-track { display: flex; flex-direction: column; transition: transform .5s cubic-bezier(.3, 1.1, .4, 1); }
.slot-track.notrans { transition: none; }
.slot-word {
  height: 1.1em;
  line-height: 1.1;
  white-space: nowrap;
  background: var(--brand-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  opacity: .4;
  transition: opacity .4s;
}
.slot-word.active { opacity: 1; }
.slot-tag {
  position: absolute;
  left: calc(100% + 18px);
  top: 50%;
  translate: 0 -50%;
  background: var(--count-bg);
  color: var(--count-text);
  font-size: clamp(11px, 1.3vw, 14px);
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 999px;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .3s, transform .3s;
}
.slot-tag.show { opacity: 1; transform: translateY(0); }

/* fade varianta pro reduced-motion */
.slot--fade { position: relative; min-width: 6ch; }
.slot--fade .slot-track { transition: none; transform: none !important; position: relative; }
.slot--fade .slot-word { position: absolute; left: 0; top: 0; opacity: 0; transition: opacity .3s; }
.slot--fade .slot-word.active { opacity: 1; }

.hero-sub { max-width: 46ch; font-size: clamp(16px, 1.6vw, 19px); margin: 26px 0 34px; color: var(--text); }
.hero-cta { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; }

/* ---------- marquee ---------- */
.marquee-band {
  background: var(--grad-dark-sec);
  padding: 34px 0;
  overflow: hidden;
  transform: rotate(-1.5deg) scale(1.04);
  border-top: 1px solid rgba(129, 140, 248, .15);
  border-bottom: 1px solid rgba(129, 140, 248, .15);
}
.marquee { overflow: hidden; }
.marquee-track { display: flex; width: max-content; animation: marquee 30s linear infinite; will-change: transform; }
.m2 .marquee-track { animation: marquee 38s linear infinite reverse; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }
.mcopy { font-weight: 700; font-size: clamp(20px, 2.6vw, 30px); letter-spacing: -0.01em; color: var(--g100); white-space: nowrap; padding-right: 12px; }
.m2 .mcopy { font-family: var(--mono); font-weight: 400; font-size: clamp(12px, 1.4vw, 15px); color: var(--g400); }
.mcopy i { font-style: normal; color: var(--i400); }

/* ---------- reveal slov nadpisů ---------- */
.wt .wm { display: inline-block; overflow: hidden; vertical-align: bottom; padding-bottom: .1em; margin-bottom: -.1em; }
.wt .w { display: inline-block; transform: translateY(112%); transition: transform .6s cubic-bezier(.2, .9, .25, 1); transition-delay: calc(var(--wi, 0) * 70ms); }
.live .wt .w { transform: translateY(0); }

/* ---------- sekce: pozadí ---------- */
.sec-demo { background: var(--bg); }
.chapter.bg-blue { background: var(--ai-surface); }
.chapter.bg-ink, .sec-stats { background: var(--grad-dark-sec); }
.chapter.bg-paper { background: var(--bg); }
.chapter.bg-green { background: var(--em-surface); }
.perf { display: none; }

/* tmavé sekce — texty */
.bg-ink, .sec-stats { color: var(--g300); }
.bg-ink h2, .sec-stats h2 { color: var(--g100); }
.bg-ink .chapnum, .sec-stats .chapnum { background: rgba(49, 46, 129, .35); color: var(--i300); }

/* AI sekce — violet chip */
.bg-blue .chapnum { background: var(--ai-chip-bg); color: var(--ai-chip-text); }

.cols { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(32px, 6vw, 80px); align-items: center; }

/* ---------- demo ---------- */
.mono-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 4px 0 18px; font-size: 12px; color: var(--muted); }
.mono-note span { white-space: nowrap; }
.mono-note span:not(:first-child) {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
}
.demo-points { list-style: none; display: grid; gap: 10px; max-width: 44ch; }
.demo-points li { padding-left: 22px; position: relative; }
.demo-points li::before { content: ''; position: absolute; left: 0; top: .52em; width: 10px; height: 10px; border-radius: 3px; background: var(--i600); }
.demo-points li:nth-child(1)::before { background: var(--red); }
.demo-points li:nth-child(3)::before { background: var(--em); }
.demo-points b { color: var(--heading); }

.col-deck { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.piles { display: flex; gap: 10px; }
.pile {
  background: var(--pill-bg);
  color: var(--pill-text);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 16px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  transition: transform .2s, border-color .2s, background .2s;
}
.pile-label { font-size: 11px; font-weight: 600; letter-spacing: .05em; }
.pile-num { font-family: var(--mono); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; min-width: 1ch; }
.pile-no .pile-num { color: var(--red); }
.pile-yes .pile-num { color: var(--link); }
.pile-done .pile-num { color: var(--em-text); }
.pile.lift { transform: translateY(-4px); }
.pile.celebrate { animation: pileCelebrate .55s cubic-bezier(.2, .9, .25, 1); }
.pile-no.lift { border-color: var(--red); background: var(--red-tint); }
.pile-yes.lift { border-color: var(--i600); background: var(--tint); }
.pile-done.lift { border-color: var(--em); background: var(--em-tint); }
@media (prefers-color-scheme: dark) {
  .pile-no.lift { background: rgba(127, 29, 29, .3); }
  .pile-done.lift { background: rgba(6, 78, 59, .25); }
}
.pile.tick .pile-num { animation: tickPop .3s; }
@keyframes tickPop { 40% { transform: scale(1.35); } }
@keyframes pileCelebrate {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-8px) scale(1.12) rotate(-2deg); }
  68% { transform: translateY(2px) scale(.97) rotate(1deg); }
  100% { transform: translateY(0) scale(1); }
}

.deck { position: relative; width: min(320px, 78vw); height: 400px; perspective: 1100px; }
.dcard {
  position: absolute;
  inset: 0 0 20px 0;
  cursor: grab;
  transform: scale(calc(1 - var(--i, 0) * .05)) translateY(calc(var(--i, 0) * 14px));
  z-index: calc(10 - var(--i, 0));
  transition: transform .46s cubic-bezier(.22, .78, .22, 1), opacity .32s ease-out;
  touch-action: none;
  border-radius: 18px;
  will-change: transform;
}
.dcard::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--card-shadow);
  opacity: 0;
}
.dcard.is-top::before { opacity: 1; }
.dcard:focus-visible { box-shadow: 0 0 0 2px var(--i500); outline: none; }
.dcard.dragging { cursor: grabbing; transition: none; }
.dcard.fly { pointer-events: none; }
.dcard.fly-yes { animation: flyYes .56s cubic-bezier(.2, .72, .18, 1) forwards; }
.dcard.fly-no { animation: flyNo .56s cubic-bezier(.2, .72, .18, 1) forwards; }
.dcard.fly-done { animation: flyDone .58s cubic-bezier(.2, .72, .18, 1) forwards; }
.dcard.promoted { animation: cardPromote .48s cubic-bezier(.2, .82, .24, 1); }
@keyframes flyYes { 0% { opacity: 1; } 18% { opacity: 1; } 100% { opacity: 0; transform: translate3d(145%, -22px, 0) rotate(24deg) scale(.9); } }
@keyframes flyNo { 0% { opacity: 1; } 18% { opacity: 1; } 100% { opacity: 0; transform: translate3d(-145%, 18px, 0) rotate(-24deg) scale(.9); } }
@keyframes flyDone { 0% { opacity: 1; } 16% { opacity: 1; } 100% { opacity: 0; transform: translate3d(0, -105vh, 0) rotate(6deg) scale(.62); } }
@keyframes cardPromote {
  0% { transform: translate3d(0, 16px, 0) scale(.94); }
  62% { transform: translate3d(0, -3px, 0) scale(1.012); }
  100% { transform: translate3d(0, 0, 0) scale(1); }
}
.dcard-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform .52s cubic-bezier(.22, .78, .22, 1);
  border-radius: 18px;
  will-change: transform;
  z-index: 1;
}
.dcard.flipped .dcard-inner { transform: rotateY(180deg); -webkit-transform: rotateY(180deg); }
.dface {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  overflow: hidden;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
}
/* barevné tónování při tažení (--tint-yes / --tint-no řídí JS) */
.dface::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 18px;
  background: var(--i600);
  opacity: calc(var(--tint-yes, 0) * .5);
  transition: opacity .08s;
}
.dface::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: 18px;
  background: var(--red);
  opacity: calc(var(--tint-no, 0) * .5);
  transition: opacity .08s;
  z-index: 1;
}
.dfront { transform: rotateY(0deg) translateZ(.1px); -webkit-transform: rotateY(0deg) translateZ(.1px); }
.dback { transform: rotateY(180deg) translateZ(.1px); -webkit-transform: rotateY(180deg) translateZ(.1px); }
.dcode {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--count-bg);
  color: var(--count-text);
  padding: 3px 10px;
  border-radius: 999px;
}
.dword { font-size: clamp(26px, 3vw, 34px); font-weight: 700; letter-spacing: -0.02em; color: var(--heading); text-align: center; }
.dhint { font-size: 12px; color: var(--muted); }
.dex { font-size: 14px; color: var(--muted); text-align: center; font-style: italic; }
.dtts {
  position: absolute;
  right: 14px; bottom: 12px;
  width: 44px; height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--tint);
  color: var(--link);
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, opacity .12s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  z-index: 2;
}
.dback .dtts { opacity: 0; visibility: hidden; pointer-events: none; }
.dcard.flipped .dfront .dtts { opacity: 0; visibility: hidden; pointer-events: none; }
.dcard.flipped .dback .dtts { opacity: 1; visibility: visible; pointer-events: auto; }
.dtts:hover, .dtts:focus-visible, .dtts.is-speaking { border-color: var(--i600); box-shadow: 0 0 0 4px var(--tint); transform: scale(1.06); }
.dtts svg { width: 18px; height: 18px; fill: currentColor; }

.stamp {
  position: absolute;
  top: 18px;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 6px 12px;
  border-radius: 10px;
  border: 2px solid;
  opacity: 0;
  pointer-events: none;
  z-index: 3;
  background: var(--surface);
}
.stamp-yes { right: 16px; color: var(--i600); border-color: var(--i600); transform: rotate(-13deg); opacity: min(1, var(--st-yes, 0)); }
.stamp-no { left: 16px; color: var(--red); border-color: var(--red); transform: rotate(11deg); opacity: min(1, var(--st-no, 0)); }
.stamp-up { left: 50%; margin-left: -52px; color: var(--em-text); border-color: var(--em-text); transform: rotate(-4deg); opacity: min(1, var(--st-up, 0)); }

.ghostcard {
  position: fixed;
  border: 2px solid var(--i600);
  border-radius: 18px;
  pointer-events: none;
  opacity: 0;
  z-index: 5;
  transition: opacity .2s;
}

.deck-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.act {
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--heading);
  cursor: pointer;
  transition: all .15s;
}
.act:hover { border-color: var(--i600); box-shadow: var(--card-shadow); }
.act:active { transform: scale(.98); }
.act-no { color: var(--red); }
.act-yes { color: var(--link); }
.act-done { color: var(--em-text); display: none; }

.result-card { width: min(320px, 78vw); min-height: 300px; justify-content: center; align-items: center; text-align: center; gap: 16px; padding: 32px 24px; border-radius: 18px; }
.result-big { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--heading); line-height: 1.25; }
.result-note { font-size: 12px; color: var(--muted); }

/* ---------- 04.1 AI ---------- */
.ai-mock {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
}
.ai-line { font-size: 19px; color: var(--heading); }
.ai-word {
  position: relative;
  background: var(--ai-chip-bg);
  color: var(--ai-chip-text);
  border-radius: 8px;
  padding: 2px 6px;
  font-weight: 600;
}
.ai-dot {
  position: absolute;
  right: -7px; top: -7px;
  width: 14px; height: 14px;
  border-radius: 999px;
  background: var(--ai-icon);
  animation: aiPulse 3.5s ease-in-out infinite;
}
@keyframes aiPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .55; } }
.ai-arrow { font-size: 12px; color: var(--muted); }
.mc { align-self: flex-start; min-width: 200px; opacity: 0; transform: translateY(14px); transition: opacity .5s, transform .5s cubic-bezier(.2, .9, .25, 1); }
.live .mc { opacity: 1; transform: translateY(0); transition-delay: .45s; }
.mc-code { font-size: 11px; color: var(--ai-chip-text); background: var(--ai-chip-bg); align-self: flex-start; padding: 2px 8px; border-radius: 999px; }
.mc-word { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--heading); }
.mc-trans { font-size: 14px; color: var(--muted); }

/* AI gradient na posledním slově nadpisu */
.bg-blue .big .wm:last-child .w {
  background: var(--ai-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
@media (prefers-color-scheme: dark) {
  .bg-blue .big .wm:last-child .w { background: linear-gradient(90deg, #a78bfa, #818cf8); -webkit-background-clip: text; background-clip: text; }
}

/* ---------- 04.2 spaced repetition ---------- */
.sr-svg { width: 100%; max-width: 640px; height: auto; margin-top: 34px; overflow: visible; }
.sr-path { stroke: var(--i400); stroke-width: 3; fill: none; stroke-linecap: round; stroke-dasharray: 1000; stroke-dashoffset: 1000; transition: stroke-dashoffset 1.2s ease .1s; }
.live .sr-path { stroke-dashoffset: 0; }
.sr-dot { fill: var(--i400); transform-origin: center; transform-box: fill-box; transform: scale(0); transition: transform .45s cubic-bezier(.34, 1.56, .64, 1); }
.live .d1 { transform: scale(1); transition-delay: .15s; }
.live .d2 { transform: scale(1); transition-delay: .4s; }
.live .d3 { transform: scale(1); transition-delay: .75s; }
.live .d4 { transform: scale(1); transition-delay: 1.15s; fill: var(--v400); }
.sr-label { font-family: var(--mono); font-size: 13px; fill: var(--g400); }

/* ---------- 04.3 přehrávač ---------- */
.player { position: relative; }
.player-screen {
  position: relative;
  background: linear-gradient(135deg, #1d2739, #0a0f1e);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
  aspect-ratio: 16 / 10;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  overflow: hidden;
}
.player-play {
  position: absolute;
  top: 50%; left: 50%;
  translate: -50% -50%;
  width: 58px; height: 58px;
  border-radius: 999px;
  background: rgba(129, 140, 248, .2);
  color: var(--i300);
  display: grid;
  place-content: center;
  font-size: 20px;
}
.deck-badge {
  position: absolute;
  top: 16px; right: 16px;
  width: 44px; height: 44px;
}
.deck-badge i {
  position: absolute;
  inset: 4px;
  background: var(--i600);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, .25);
}
.deck-badge i:nth-child(1) { transform: rotate(-8deg); opacity: .5; }
.deck-badge i:nth-child(2) { transform: rotate(5deg); opacity: .75; }
.deck-badge.pulse { animation: badgePulse .32s; }
@keyframes badgePulse { 50% { transform: scale(1.12); } }
.subs { color: var(--g100); font-size: clamp(15px, 1.8vw, 19px); text-align: center; }
.sub-hot { background: rgba(99, 102, 241, .45); border-radius: 6px; padding: 1px 6px; }
.player-bar { height: 5px; background: rgba(255, 255, 255, .15); border-radius: 999px; overflow: hidden; }
.player-progress { display: block; height: 100%; width: 100%; background: var(--i500); border-radius: 999px; transform-origin: left; transform: scaleX(0); animation: progress 12s linear infinite; }
@keyframes progress { to { transform: scaleX(1); } }

.fly-word { position: absolute; z-index: 4; pointer-events: none; }
.fly-x { display: inline-block; animation: flyX .9s cubic-bezier(.3, 0, .7, 1) forwards; }
.fly-y { display: inline-block; animation: flyY .9s cubic-bezier(.2, -.4, .8, 1) forwards; background: var(--i600); color: #fff; border-radius: 6px; padding: 1px 6px; font-size: 15px; }
@keyframes flyX { to { transform: translateX(var(--dx)); } }
@keyframes flyY { to { transform: translateY(var(--dy)) scale(.45); opacity: .2; } }

/* ---------- 04.4 komunita ---------- */
.bg-green .big { max-width: 26ch; }
.decks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 36px; }
.deckcard {
  position: relative;
  gap: 6px;
  padding: 18px 16px 14px;
  opacity: 0;
  transform: translateY(36px) scale(.96);
  transition: opacity .5s, transform .18s ease, box-shadow .15s, border-color .15s;
  transition-delay: calc(var(--wave, 0) * 80ms), 0s, 0s, 0s;
}
.live .deckcard { opacity: 1; transform: translateY(0) scale(1); }
.deckcard:hover { transform: translateY(-2px); box-shadow: var(--card-shadow-hover); border-color: var(--i400); transition-delay: 0s; }
.deckcard b { font-size: 15px; }
.deckcard i { color: var(--count-text); background: var(--count-bg); align-self: flex-start; padding: 2px 10px; border-radius: 999px; font-size: 11px; }
.avatar {
  width: 34px; height: 34px;
  border-radius: 999px;
  display: grid;
  place-content: center;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
.av1 { background: var(--i100); color: var(--i700); }
.av2 { background: var(--v100); color: var(--v700); }
.av3 { background: var(--em-tint); color: var(--em); }
.av4 { background: #fffbeb; color: var(--amber-600); }
@media (prefers-color-scheme: dark) {
  .av1 { background: rgba(49, 46, 129, .5); color: var(--i300); }
  .av2 { background: rgba(76, 29, 149, .5); color: var(--v300); }
  .av3 { background: rgba(6, 78, 59, .5); color: #34d399; }
  .av4 { background: rgba(120, 53, 15, .5); color: #fbbf24; }
}

/* ---------- 05 čísla ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; margin: 40px 0 26px; }
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-decks { position: relative; }
.stat-num {
  font-size: clamp(2.6rem, 5.5vw, 4.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(90deg, #818cf8, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-val { font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; letter-spacing: .08em; color: var(--g400); }
.streak-stage { position: absolute; top: -34px; right: 0; z-index: 2; }
.stamps { display: flex; flex-wrap: wrap; gap: 8px; max-width: 640px; }
.stamp-btn {
  font-family: var(--mono);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--g700);
  background: rgba(29, 39, 57, .6);
  color: var(--g300);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0;
  transform: scale(.7);
  transition: opacity .35s, transform .18s ease, border-color .12s, color .12s, background .12s;
  transition-delay: calc(var(--n, 0) * 55ms), 0s, 0s, 0s, 0s;
}
.live .stamp-btn { opacity: 1; transform: scale(1); }
.stamp-btn:hover, .stamp-btn:focus-visible { border-color: var(--i400); color: var(--i300); background: rgba(49, 46, 129, .35); transition-delay: 0s; }
.spk { color: var(--i400); }
.streak { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid rgba(245, 158, 11, .38); border-radius: 14px; background: rgba(120, 53, 15, .2); box-shadow: 0 10px 24px rgba(0, 0, 0, .16); transform: rotate(11deg); transform-origin: right bottom; }
.streak-copy { display: flex; align-items: baseline; gap: 8px; }
.streak-copy > strong { color: #fbbf24; font-size: 1.55rem; line-height: 1; letter-spacing: -.04em; }
.streak .mono { font-size: 11px; letter-spacing: .08em; color: #fcd34d; white-space: nowrap; }
.flame { width: 25px; height: 25px; flex: 0 0 auto; fill: var(--amber); animation: breathe 2s ease-in-out infinite alternate; transform-origin: bottom center; }
@keyframes breathe { to { transform: scale(1.08); } }

/* ---------- 06 finále ---------- */
.sec-final {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-bottom: 0;
  background: var(--hero-bg);
}
.flip-scene {
  position: relative;
  perspective: 1200px;
  width: min(86vw, 660px);
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.satellites { position: absolute; inset: -12% -18%; pointer-events: none; }
.sat { position: absolute; opacity: .85; }
.sat1 { top: 0; left: 4%; offset-path: circle(46% at 50% 50%); animation: orbit 38s linear infinite; }
.sat2 { top: 0; right: 0; offset-path: circle(52% at 50% 50%); animation: orbit 46s linear infinite reverse; }
.sat3 { bottom: 0; left: 0; offset-path: circle(49% at 50% 50%); animation: orbit 42s linear infinite; animation-delay: -12s; }
.sat4 { bottom: 6%; right: 5%; offset-path: circle(55% at 50% 50%); animation: orbit 52s linear infinite reverse; animation-delay: -20s; }
@keyframes orbit { from { offset-distance: 0%; } to { offset-distance: 100%; } }
@supports not (offset-path: circle(40%)) { .sat { animation: none; } }

.flip-card {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  transform-style: preserve-3d;
  transform: rotateY(calc(min(1, var(--p, 0)) * 180deg));
  will-change: transform;
}
.flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, .18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px;
  text-align: center;
}
.flip-back { transform: rotateY(180deg); }
.flip-title { font-size: clamp(1.7rem, 4vw, 2.7rem); font-weight: 700; letter-spacing: -0.025em; color: var(--heading); max-width: 16ch; }
.flip-hint { font-size: 12px; color: var(--muted); }
.flip-note { font-size: 13px; color: var(--text); }
.flip-note.dim { color: var(--muted); font-size: 12px; }
.magnet { display: inline-block; }
.btn-final.pulse { animation: ctaPulse .48s; }
@keyframes ctaPulse { 50% { transform: scale(1.06); } }

.colophon {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  background: transparent;
  padding: 0 20px 32px;
  width: 100%;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}
.colophon a { color: var(--link); }

/* ---------- konfety ---------- */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 90; }
.confetto { position: absolute; width: 8px; height: 12px; border-radius: 2px; }
.deck-feedback {
  position: fixed;
  z-index: 91;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  animation: feedbackFloat .72s cubic-bezier(.2, .9, .25, 1) forwards;
}
.deck-feedback.yes { color: var(--i600); }
.deck-feedback.no { color: var(--red); }
.deck-feedback.done { color: var(--em-text); }
@keyframes feedbackFloat {
  0% { opacity: 0; transform: translate(-50%, 8px) scale(.72) rotate(-5deg); }
  18% { opacity: 1; transform: translate(-50%, -4px) scale(1.12) rotate(2deg); }
  100% { opacity: 0; transform: translate(-50%, -52px) scale(.96) rotate(-2deg); }
}

/* ---------- pauza animací mimo viewport ---------- */
.anim-off .flier,
.anim-off .marquee-track,
.anim-off .ai-dot,
.anim-off .player-progress,
.anim-off .sat,
.anim-off .flame {
  animation-play-state: paused;
}

/* ---------- responzivita ---------- */
@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
  .decks { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-tags { position: static; margin-bottom: 18px; }
  .slot-tag { position: static; translate: none; display: inline-block; margin-left: 14px; vertical-align: middle; }
  .stray-layer { display: none; }
}
@media (max-width: 560px) {
  .decks { grid-template-columns: 1fr; }
  .deckcard:nth-child(n + 5) { display: none; }
  .deck { height: 360px; }
  .deck.mobile-learned { animation: mobileDeckCelebrate .72s cubic-bezier(.2, .85, .25, 1); }
  .deck.mobile-learned::before,
  .deck.mobile-learned::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 43%;
    z-index: 40;
    pointer-events: none;
  }
  .deck.mobile-learned::before {
    content: '✓';
    width: 82px;
    height: 82px;
    display: grid;
    place-content: center;
    border-radius: 999px;
    background: var(--em);
    color: white;
    box-shadow: 0 14px 34px rgba(5, 150, 105, .34);
    font-size: 42px;
    font-weight: 700;
    animation: mobileLearnedBadge .82s cubic-bezier(.2, .9, .25, 1) forwards;
  }
  .deck.mobile-learned::after {
    width: 96px;
    height: 96px;
    border: 3px solid var(--em);
    border-radius: 999px;
    animation: mobileLearnedRing .72s ease-out forwards;
  }
  .hero { padding-top: 84px; }
  .hero-cta { gap: 16px; }
  .piles { gap: 6px; width: 100%; justify-content: center; }
  .streak-stage { top: -28px; right: -2px; }
  .streak { transform: rotate(12deg); }
  .pile { padding: 6px 10px; gap: 5px; }
  .pile-label { font-size: 10px; }
  .deck-actions { gap: 8px; }
  .act { min-height: 44px; padding-inline: 12px; }
  .dtts { right: 10px; bottom: 10px; }
  .flip-scene { width: 92vw; }
  .satellites { display: none; }
}
@keyframes mobileDeckCelebrate {
  0%, 100% { transform: scale(1); }
  22% { transform: scale(.975); }
  48% { transform: scale(1.025); }
  70% { transform: scale(.995); }
}
@keyframes mobileLearnedBadge {
  0% { opacity: 0; transform: translate(-50%, -42%) scale(.25) rotate(-18deg); }
  28% { opacity: 1; transform: translate(-50%, -50%) scale(1.14) rotate(4deg); }
  52% { transform: translate(-50%, -50%) scale(.96) rotate(0); }
  72% { opacity: 1; transform: translate(-50%, -55%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -105%) scale(.88); }
}
@keyframes mobileLearnedRing {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.35); }
  20% { opacity: .75; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.65); }
}

/* ---------- prefers-reduced-motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hword { animation: none; transform: none; }
  .flier, .sat, .marquee-track, .player-progress, .ai-dot, .flame { animation: none; }
  .marquee-band { transform: none; }
  .marquee-track { width: auto; flex-wrap: wrap; }
  .mcopy:last-child { display: none; }
  .wt .w { transform: none; }
  .sr-path { stroke-dashoffset: 0; transition: none; }
  .sr-dot { transform: scale(1); transition: none; }
  .deckcard { opacity: 1; transform: none; transition: box-shadow .2s, border-color .2s; }
  .stamp-btn { opacity: 1; transform: none; }
  .mc { opacity: 1; transform: none; }
  .fly-word { display: none; }
  .flip-card { transform: rotateY(180deg); transition: none; }
  .flip-hint { visibility: hidden; }
  .act-done { display: inline-block; }
  .dcard, .dcard-inner { transition-duration: .01s; }
  .dcard.fly-yes, .dcard.fly-no, .dcard.fly-done, .dcard.promoted, .pile.celebrate, .deck-feedback { animation: none; }
  .ghostcard { display: none; }
  .deck.mobile-learned, .deck.mobile-learned::before, .deck.mobile-learned::after { animation: none; }
}
