/* ---- Font: Outfit, bundled (works offline, no request to Google) ---- */
@font-face {
  font-family: "Outfit";
  src: url(fonts/outfit-latin-ext.woff2) format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Outfit";
  src: url(fonts/outfit-latin.woff2) format("woff2");
  font-weight: 300 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}


* { box-sizing: border-box; }

:root {
  --nav-w: 240px;
  --pink: #fe2c55;
  --cyan: #25f4ee;
}

/* Light (default) and dark theme. The video itself stays dark in both. */
:root, :root[data-theme="light"] {
  color-scheme: light;
  --bg: #fff;
  --text: #161823;
  --text-dim: #5c5f6b;
  --text-faint: #8a8b91;
  --line-soft: #ebebed;
  --hover: rgba(22, 24, 35, 0.05);
  --btn: #f1f1f2;
  --btn-hover: #e3e3e5;
  --icon: #161823;
  --logo-bg: #fff;
  --logo-ink: #161823;
  --link: #0b8a86;
  --current-bg: rgba(254, 44, 85, 0.1);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000;
  --text: #f5f5f7;
  --text-dim: #a1a1aa;
  --text-faint: #6b6b74;
  --line-soft: #1f1f24;
  --hover: rgba(255, 255, 255, 0.06);
  --btn: rgba(255, 255, 255, 0.12);
  --btn-hover: rgba(255, 255, 255, 0.2);
  --icon: #fff;
  --logo-bg: #000;
  --logo-ink: #fff;
  --link: var(--cyan);
  --current-bg: rgba(254, 44, 85, 0.16);
}

html, body { height: 100%; }

body {
  margin: 0;
  font-family: "Outfit", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  transition: background 0.25s, color 0.25s;
  color: var(--text);
  overflow: hidden;
}

button { font-family: inherit; }

/* ---- Layout: navigation left, video in the middle ---- */
.app {
  display: grid;
  grid-template-columns: var(--nav-w) 1fr;
  height: 100vh;
}

/* ---- Left navigation ---- */
.nav {
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  overflow-y: auto;
  scrollbar-width: none;
  border-right: 1px solid var(--line-soft);
}
.nav::-webkit-scrollbar { display: none; }

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 18px;
  color: var(--text);
  text-decoration: none;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.logo-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--logo-bg);
  border: 2px solid var(--logo-ink);
  box-shadow: -2.5px -1.5px 0 var(--cyan), 2.5px 1.5px 0 var(--pink);
}
.logo-mark svg { width: 18px; height: 18px; fill: none; stroke: var(--logo-ink); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }

.menu { display: flex; flex-direction: column; gap: 2px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.menu-item svg { width: 26px; height: 26px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.menu-item:hover { background: var(--hover); }
.menu-item.active { color: var(--pink); }

/* Clips of the story: the decision tree, like a list of followed accounts */
.clips { margin-top: 14px; padding: 14px 8px 0; border-top: 1px solid var(--line-soft); }
.clips h2 { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--text); }
.ends { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-dim); }
.end-dots { display: flex; gap: 6px; }
.end-dot {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--btn);
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 700;
}
.end-dot.found { background: var(--pink); color: #fff; }

.nav-foot {
  margin-top: auto;
  padding: 16px 8px 0;
  font-size: 12px;
  color: var(--text-faint);
  line-height: 1.45;
}
.nav-foot p { margin: 0 0 8px; }
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--btn);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.theme-toggle:hover { background: var(--btn-hover); }
.theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .i-sun, :root[data-theme="dark"] .theme-toggle .i-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .i-sun { display: block; }
.net::before { content: "● "; }
.net.on::before { color: #30d158; }
.help a { color: var(--link); font-weight: 700; text-decoration: none; }

/* ---- Domů: the stories ---- */
.home, .stage { grid-column: 2; grid-row: 1; min-width: 0; }
.app.view-home .clips { display: none; } /* the card shows the same progress */

.home { overflow-y: auto; padding: 40px 48px; }
.home-head h1 { margin: 0 0 6px; font-size: 32px; font-weight: 700; color: var(--text); }
.home-head p { margin: 0 0 28px; font-size: 15px; color: var(--text-dim); }

.story-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 260px)); gap: 20px; }

/* One story: a 9:16 card in the colour of its first clip */
.story-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 9 / 16;
  border-radius: 16px;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  background:
    radial-gradient(circle at 30% 25%, var(--mood) 0%, transparent 60%),
    linear-gradient(170deg, var(--mood), #050508 75%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}
.story-card:hover, .story-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.3), 0 0 0 3px var(--pink);
  outline: none;
}
.sc-play {
  position: absolute;
  top: 14px;
  left: 14px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(6px);
}
.sc-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.8) 30%);
}
.sc-title { font-size: 22px; font-weight: 700; line-height: 1.2; }
.sc-teaser { font-size: 14px; opacity: 0.85; }
.sc-tags { font-size: 13px; font-weight: 600; opacity: 0.85; }
.sc-ends { display: flex; align-items: center; gap: 8px; font-size: 12px; opacity: 0.9; }
.story-card .end-dot { background: rgba(255, 255, 255, 0.2); color: #fff; }
.story-card .end-dot.found { background: var(--pink); }
.sc-cta {
  margin-top: 6px;
  padding: 10px;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}
.story-card:hover .sc-cta { background: var(--pink); color: #fff; }

/* ---- Middle: the video and its actions ---- */
.stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 88px 16px 16px;
  overflow: hidden;
}

.player {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.3, 1), filter 0.45s, opacity 0.45s;
}

/* The video card. Everything inside is sized in "video pixels" (--u), so it
   scales as one piece on a short screen or a projector. */
.video {
  --u: calc(100cqh / 780);
  position: relative;
  height: calc(100vh - 32px);
  aspect-ratio: 9 / 16;
  border-radius: 16px;
  overflow: hidden;
  background: #111;
  container-type: size;
}

.feed {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.feed::-webkit-scrollbar { display: none; }

/* Actions beside the video */
.actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding-bottom: 12px;
}
.avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--mood, var(--pink)), #000);
  border: 2px solid #fff;
  transition: background 0.4s;
}
.avatar svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.avatar::after {
  content: "+";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  font-size: 16px;
  line-height: 19px;
  text-align: center;
  font-weight: 600;
}
.act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.act-ico {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--btn);
  transition: background 0.15s, transform 0.15s;
}
.act:hover .act-ico { background: var(--btn-hover); }
.act:active .act-ico { transform: scale(0.94); }
.act svg { width: 24px; height: 24px; fill: none; stroke: var(--icon); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.act svg .solid { fill: var(--icon); stroke: none; }
.act:disabled { opacity: 0.4; cursor: default; }
.act:disabled .act-ico { background: var(--btn); }
#toggle .i-play, #toggle[data-state="paused"] .i-pause { display: none; }
#toggle[data-state="paused"] .i-play { display: block; }
#like.liked svg .solid { fill: var(--pink); }
#like.liked .act-ico { animation: like 0.35s ease-out; }
@keyframes like { 40% { transform: scale(1.2); } }

/* ↑ ↓ arrows at the right edge */
.arrows {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.arrows button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: var(--btn);
  cursor: pointer;
}
.arrows button:hover { background: var(--btn-hover); }
.arrows button:disabled { opacity: 0.3; cursor: default; }
.arrows svg { width: 24px; height: 24px; fill: none; stroke: var(--icon); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- One clip ---- */
.slide {
  height: 100%;
  scroll-snap-align: start;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
  overflow: hidden;
}

/* Animated "video" backdrop so every clip has visible motion */
.slide::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 30% 30%, var(--mood) 0%, transparent 55%),
    radial-gradient(circle at 75% 70%, #000 0%, transparent 60%),
    linear-gradient(160deg, var(--mood), #050508);
  animation: drift 8s ease-in-out infinite alternate;
  z-index: 0;
}
/* Dark scrim at the bottom so the caption is always readable */
.slide::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 70%;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.85));
  z-index: 0;
  pointer-events: none;
}

@keyframes drift {
  from { transform: translate(-4%, -2%) scale(1); }
  to   { transform: translate(4%, 3%) scale(1.08); }
}

.slide > * { position: relative; z-index: 1; }

.slide.paused::before { animation-play-state: paused; }

.progress {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: calc(3 * var(--u));
  background: rgba(255, 255, 255, 0.2);
  z-index: 2;
}
.progress > span { display: block; height: 100%; width: 0%; background: #fff; }

/* "62 % lidí zvolilo totéž" after a choice */
.top-stack {
  position: absolute;
  top: calc(18 * var(--u));
  left: calc(16 * var(--u));
  right: calc(16 * var(--u));
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: calc(8 * var(--u));
  pointer-events: none;
}

/* The lesson earned by the last choice, shown for the whole next clip */
.lesson-card {
  max-width: 100%;
  padding: calc(10 * var(--u)) calc(14 * var(--u));
  border-radius: calc(16 * var(--u));
  background: rgba(10, 10, 14, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  font-size: calc(14 * var(--u));
  line-height: 1.4;
  animation: lesson-in 0.45s 0.25s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}
.lesson-label {
  display: block;
  margin-bottom: calc(3 * var(--u));
  font-size: calc(11 * var(--u));
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8ff3ef;
}
@keyframes lesson-in { from { opacity: 0; transform: translateY(calc(-10 * var(--u))); } }

.badge {
  padding: calc(6 * var(--u)) calc(12 * var(--u));
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: calc(13 * var(--u));
  font-weight: 600;
  backdrop-filter: blur(8px);
  animation: pop 0.3s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(calc(-6 * var(--u))); } }

.paused-icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.paused-icon svg { width: calc(72 * var(--u)); height: calc(72 * var(--u)); fill: rgba(255, 255, 255, 0.85); }
.slide.paused .paused-icon { opacity: 1; }

/* Caption at the bottom left of the clip */
.info { padding: 0 calc(18 * var(--u)) calc(20 * var(--u)); }
.caption { min-width: 0; }
.handle { font-size: calc(16 * var(--u)); font-weight: 600; margin-bottom: calc(6 * var(--u)); }
.handle span { font-weight: 400; opacity: 0.6; }
.caption h3 { font-size: calc(21 * var(--u)); font-weight: 600; margin: 0 0 calc(4 * var(--u)); }
.caption p {
  font-size: calc(15 * var(--u));
  line-height: 1.42;
  margin: 0 0 calc(6 * var(--u));
  color: rgba(255, 255, 255, 0.9);
}
.tags { font-size: calc(14 * var(--u)); font-weight: 500; color: rgba(255, 255, 255, 0.85); margin-bottom: calc(10 * var(--u)); }
.sound { display: flex; align-items: center; gap: calc(8 * var(--u)); font-size: calc(13 * var(--u)); opacity: 0.9; }
.sound svg { width: calc(16 * var(--u)); height: calc(16 * var(--u)); flex-shrink: 0; fill: none; stroke: #fff; stroke-width: 1.7; }
.sound span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Bottom sheet with the choices (or the ending button) */
.sheet {
  display: none;
  background: #121214;
  border-radius: calc(24 * var(--u)) calc(24 * var(--u)) 0 0;
  padding: calc(10 * var(--u)) calc(16 * var(--u)) calc(18 * var(--u));
  animation: sheet-up 0.35s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sheet:has(> .choices:not(.hidden)) { display: block; }
@keyframes sheet-up { from { transform: translateY(100%); } }

.grab {
  width: calc(40 * var(--u));
  height: calc(4 * var(--u));
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  margin: 0 auto calc(12 * var(--u));
}
.sheet-title {
  font-size: calc(12 * var(--u));
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: calc(10 * var(--u));
}

/* A question for the class (after a video with a prompt) */
.prompt-text { margin: 0 0 calc(4 * var(--u)); font-size: calc(20 * var(--u)); font-weight: 700; line-height: 1.25; color: #fff; }

/* The moral of an ending, above the restart button */
.moral { margin: 0 0 calc(12 * var(--u)); font-size: calc(15 * var(--u)); line-height: 1.4; color: rgba(255, 255, 255, 0.9); }

.choices { display: flex; flex-direction: column; gap: calc(8 * var(--u)); counter-reset: choice; }

.choices button {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--u));
  background: #1f1f23;
  color: #fff;
  border: 1px solid #2c2c31;
  border-radius: calc(16 * var(--u));
  padding: calc(12 * var(--u)) calc(14 * var(--u));
  font-size: calc(15 * var(--u));
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.choices button:not(.again)::before {
  counter-increment: choice;
  content: counter(choice, upper-alpha);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: calc(26 * var(--u));
  height: calc(26 * var(--u));
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  font-size: calc(12 * var(--u));
  font-weight: 600;
}
.choices button:hover { border-color: var(--pink); background: #26262b; }
.choices .again { justify-content: center; background: var(--pink); border-color: var(--pink); font-weight: 600; }
.choices .again:hover { background: #ff4a6e; }

/* Small notification inside the video (link copied) */
.toast {
  position: absolute;
  top: calc(20 * var(--u));
  left: 50%;
  transform: translate(-50%, calc(-8 * var(--u)));
  width: max-content;
  max-width: 86%;
  background: rgba(18, 18, 20, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: calc(10 * var(--u)) calc(14 * var(--u));
  border-radius: calc(14 * var(--u));
  font-size: calc(14 * var(--u));
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 10;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- Decision: one video card per choice ---- */
.stage.deciding .player { transform: scale(0.94); filter: blur(8px); opacity: 0; pointer-events: none; }
.stage.deciding .arrows { opacity: 0; pointer-events: none; }
.stage.deciding .slide .sheet { display: none; } /* the cards replace the sheet */

.picker {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 5;
}
.stage.deciding .picker { display: flex; }

.picker-title { font-size: 30px; font-weight: 700; color: var(--text); animation: fade-down 0.4s ease-out both; }
.picker-hint { font-size: 14px; color: var(--text-dim); margin-bottom: 20px; animation: fade-down 0.4s 0.05s ease-out both; }
@keyframes fade-down { from { opacity: 0; transform: translateY(-10px); } }

.picker-row { display: flex; gap: 48px; align-items: flex-end; }

/* ---- Each choice is an iPhone 17 Pro, like device previews on Xcode's canvas ---- */
/* Frame colours (aluminium), one per choice: A orange, B blue, C silver */
/* A and B are inverse: A = orange frame + purple screen, B = purple frame + orange screen */
.pick { --frame-hi: #f8b07c; --frame-mid: #e2722f; --frame-lo: #9a4116; --accent: #e2722f; --screen: #7b2cff; }
.pick[data-frame="purple"] { --frame-hi: #c4a3ff; --frame-mid: #7b2cff; --frame-lo: #3f1291; --accent: #7b2cff; --screen: #e2722f; }
.pick[data-frame="silver"] { --frame-hi: #fbfbfc; --frame-mid: #cdd0d5; --frame-lo: #8c9097; --accent: #8c9097; --screen: var(--mood); }

.pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
  -webkit-user-select: none; /* the text on the phones can't be selected or highlighted */
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  animation: card-in 0.6s cubic-bezier(0.2, 1.25, 0.4, 1) both;
  animation-delay: calc(var(--i) * 110ms);
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1), opacity 0.35s;
}
@keyframes card-in { from { opacity: 0; transform: translateY(80px) scale(0.85); } }
.pick:focus-visible { outline: none; }

/* The device: metal band and thin black bezel */
.pick-phone {
  position: relative;
  display: block;
  height: min(600px, calc(100vh - 240px));
  aspect-ratio: 375 / 770;
  padding: 1.6%;
  border: 3px solid transparent;
  border-radius: 15% / 7.4%;
  background:
    linear-gradient(#000, #000) padding-box,
    linear-gradient(135deg, var(--frame-hi) 0%, var(--frame-mid) 16%, var(--frame-lo) 34%,
      var(--frame-mid) 50%, var(--frame-hi) 62%, var(--frame-mid) 80%, var(--frame-lo) 100%) border-box;
  transition: transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1), box-shadow 0.2s;
}
/* The display. Sized in container units, so the screen scales as one piece. */
.pick-screen {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 13.6% / 6.6%;
  overflow: hidden;
  container-type: size;
  color: #fff;
  text-align: left;
  background:
    linear-gradient(to bottom, transparent 40%, rgba(0, 0, 0, 0.78)),
    radial-gradient(circle at 30% 30%, var(--screen) 0%, transparent 60%),
    linear-gradient(170deg, var(--screen), #050508 75%);
}
.pick-screen::after { /* faint glass reflection */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 28%, transparent 45%);
  pointer-events: none;
}

/* iOS status bar with the Dynamic Island */
.pick-status {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 7cqh;
  padding: 1cqh 6cqw 0 9cqw;
  font-size: 2.2cqh;
  font-weight: 600;
}
.pick-island {
  width: 33cqw;
  height: 4.7cqh;
  border-radius: 99px;
  background: #000;
}
.pick-icons { justify-self: end; display: flex; align-items: center; gap: 1.4cqw; }
.pick-icons svg { height: 1.6cqh; width: auto; fill: #fff; color: #fff; }

.pick-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2cqh;
  padding: 0 6cqw 3cqh;
}
/* The letter of the choice, once, in the middle of the screen */
.pick-letter {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 20cqh;
  height: 20cqh;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  border: 2px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(6px);
  font-size: 10cqh;
  font-weight: 700;
  line-height: 1;
  transition: background 0.2s, border-color 0.2s;
}
.pick-label { font-size: 4.2cqh; font-weight: 600; line-height: 1.2; }
.pick-home { /* home indicator */
  align-self: center;
  width: 36cqw;
  height: 0.7cqh;
  margin-bottom: 1.2cqh;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.85);
}

/* Hover / keyboard focus: a ring and letter in the phone's own colour (A orange, B purple) */
.pick:hover .pick-phone, .pick:focus-visible .pick-phone {
  transform: translateY(-10px);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--accent);
}
.pick:hover .pick-letter, .pick:focus-visible .pick-letter { background: var(--accent); border-color: var(--accent); }

/* After a pick: the chosen phone zooms forward, the other drops away */
.picker.leaving .pick { pointer-events: none; }
.picker.leaving .pick.chosen { transform: scale(1.06); }
.picker.leaving .pick.chosen .pick-phone { box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px var(--pink); }
.picker.leaving .pick.chosen .pick-letter { background: var(--pink); border-color: var(--pink); }
.picker.leaving .pick:not(.chosen) { opacity: 0; transform: translateY(60px) scale(0.85); }
.picker.leaving .picker-title, .picker.leaving .picker-hint { opacity: 0; transition: opacity 0.3s; }

@media (prefers-reduced-motion: reduce) {
  .pick, .picker-title, .picker-hint, .lesson-card { animation: none; }
  .player, .pick { transition: none; }
}

.hidden { display: none !important; }

/* ---- Třída (trida.js): join the teacher's class ---- */
.trida { margin-top: 14px; padding: 14px 8px 0; border-top: 1px solid var(--line-soft); }
.trida-toggle {
  padding: 8px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--btn);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.trida-toggle:hover { background: var(--btn-hover); }
.trida .hint { margin: 0 0 8px; font-size: 12px; line-height: 1.4; color: var(--text-faint); }
.trida-form { display: flex; gap: 6px; }
.trida-form input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.trida-form input::placeholder { text-transform: none; letter-spacing: 0; color: var(--text-faint); }
.trida-form input:focus { outline: none; border-color: var(--pink); }
.trida-form button, .trida-leave {
  padding: 7px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--pink);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.trida-leave { background: var(--btn); color: var(--text); }
.trida-leave:hover { background: var(--btn-hover); }
.trida-in { margin: 0 0 4px; font-size: 14px; }
.trida-msg { margin: 6px 0 0; font-size: 12px; color: var(--text-dim); }
.trida-msg:empty { display: none; }
.trida-msg.err { color: var(--pink); }
.trida-msg.ok { color: #1a8a3a; }

/* ---- Narrow screens: menu on top, video full width, actions over the video ---- */
@media (max-width: 900px) {
  /* A column filling the screen: menu on top, the video takes whatever height is left */
  body { overflow: hidden; }
  .app { display: flex; flex-direction: column; height: 100dvh; }
  .nav { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line-soft); overflow: visible; }
  .logo { padding: 0 8px 0 0; font-size: 20px; }
  .menu { flex-direction: row; flex-wrap: wrap; }
  .menu-item { width: auto; padding: 8px; font-size: 14px; gap: 6px; }
  .menu-item svg { width: 20px; height: 20px; }
  .clips, .nav-foot, .trida { display: none; }
  .stage { flex: 1; min-height: 0; padding: 0; }
  .home { flex: 1; min-height: 0; padding: 20px 16px; }
  .home-head h1 { font-size: 26px; }
  .story-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .player { position: relative; width: 100%; height: 100%; }
  .video { width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0; }
  .actions { position: absolute; right: 10px; bottom: 140px; z-index: 3; gap: 10px; }
  /* actions sit on the dark video here: always light, in both themes */
  .actions { --btn: rgba(255, 255, 255, 0.15); --btn-hover: rgba(255, 255, 255, 0.25); --icon: #fff; }
  .actions .act { color: #fff; }
  .arrows { display: none; }
}
