/* ═══════════════════════════════════════════════════════════
   XFLOW DRIVE — drive.css
   Mobile-first, single clean file. Font: Inter.
═══════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────── */
:root {
  --bg: #f0f4ff;
  --ink: #0a0f1e;
  --muted: #5a6480;
  --line: #dde3f5;
  --blue: #2352f5;
  --blue2: #4f35e8;
  --blue-lt: #e8eeff;
  --green: #10b97a;
  --yellow: #f5b821;
  --white: #ffffff;
  --card: rgba(255, 255, 255, 0.92);
  --sh-sm: 0 2px 8px rgba(10, 15, 30, .06), 0 4px 16px rgba(10, 15, 30, .05);
  --sh-md: 0 8px 24px rgba(10, 15, 30, .09), 0 16px 40px rgba(10, 15, 30, .07);
  --r-sm: 14px;
  --r-md: 20px;
  --r-lg: 26px;
  --dock-h: 152px;
  /* fixed dock height on mobile */
  --header-h: 58px;
  /* app header height on mobile */
}

/* ── Reset ─────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
  background: radial-gradient(ellipse at 18% 0%, #c7d7ff 0%, var(--bg) 44%, #eaeeff 100%);
  min-height: 100vh;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ── App shell ─────────────────────────────────────────── */
.drive-app {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 12px 64px;
}

/* ── Header ────────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 18px;
}

.app-logo {
  font-size: 20px;
  font-weight: 900;
  color: var(--ink);
}

.app-logo span {
  color: var(--blue);
}

.header-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ── Pill buttons ──────────────────────────────────────── */
.pill-btn {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 9px 16px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pill-btn.ghost {
  background: transparent;
}

.pill-btn.ghost:hover {
  background: rgba(0, 0, 0, .04);
}

.pill-btn.small {
  padding: 6px 12px;
  font-size: 12px;
}

.pill-btn.pl-toggle {
  border-color: #93c5fd;
  background: var(--blue-lt);
  color: #1d4ed8;
}

.pill-btn.pl-toggle.active {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.pill-btn.resume-btn {
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(35, 82, 245, .28);
}

/* ── Card ──────────────────────────────────────────────── */
.card {
  background: var(--card);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(221, 227, 245, .9);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
}

/* ══════════════════════════════════════════════════════════
   LIBRARY
══════════════════════════════════════════════════════════ */
.library-section {
  margin-bottom: 24px;
}

.library-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.library-header h2 {
  font-size: clamp(19px, 4vw, 28px);
  font-weight: 900;
  line-height: 1.2;
}

.library-header h2 span {
  color: var(--muted);
  font-weight: 700;
}

.library-meta {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 3px;
}

.verb-library {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.verb-tile {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  cursor: pointer;
  box-shadow: var(--sh-sm);
  transition: transform .18s, box-shadow .18s, border-color .18s;
}

.verb-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
  border-color: #93c5fd;
}

.verb-tile.is-current {
  border-color: var(--blue);
  background: linear-gradient(135deg, #eef2ff, #fff);
}

.verb-tile.is-done {
  border-color: var(--green);
}

.verb-tile-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 4px;
}

.verb-tile-en {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.2;
}

.verb-tile-past {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 2px;
}

.verb-tile-pl {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.verb-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  flex-shrink: 0;
}

.verb-badge.new {
  background: var(--blue-lt);
  color: var(--blue);
}

.verb-badge.done {
  background: #dcfce7;
  color: #166534;
}

.verb-badge.wip {
  background: #fef3c7;
  color: #92400e;
}

.verb-tile-bar {
  height: 3px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  margin-top: 8px;
}

.verb-tile-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width .3s;
}

/* ══════════════════════════════════════════════════════════
   LEARNING AREA
══════════════════════════════════════════════════════════ */
.learning-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Verb banner ───────────────────────────────────────── */
.verb-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}

.verb-banner h2 {
  font-size: clamp(20px, 4.5vw, 42px);
  font-weight: 900;
  line-height: 1.15;
}

.verb-meaning {
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 3px;
}

.verb-banner-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.progress-pill {
  background: var(--blue-lt);
  color: var(--blue);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 800;
}

.eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 4px;
}

/* ══════════════════════════════════════════════════════════
   MODE BUTTONS — 2×2 grid mobile, 4 cols desktop
   Icon + label, horizontal on mobile, vertical on desktop
══════════════════════════════════════════════════════════ */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.mode-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--white);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  text-align: left;
  box-shadow: var(--sh-sm);
  transition: transform .18s, box-shadow .18s, border-color .18s, background .18s;
  width: 100%;
}

.mode-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-md);
  border-color: #93c5fd;
}

.mode-btn:active {
  transform: translateY(0);
}

.mode-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--blue-lt);
  color: var(--blue);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background .18s, color .18s;
}

.mode-icon svg {
  display: block;
}

.mode-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mode-label strong {
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
  white-space: nowrap;
}

.mode-label span {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1;
  white-space: nowrap;
}

/* Selected */
.mode-btn.active {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue2) 100%);
  border-color: transparent;
  box-shadow:
    0 0 0 1px rgba(35, 82, 245, .45),
    0 4px 14px rgba(35, 82, 245, .28),
    0 14px 32px rgba(35, 82, 245, .22),
    inset 0 1px 0 rgba(255, 255, 255, .18);
  transform: translateY(-1px);
}

.mode-btn.active .mode-icon {
  background: rgba(255, 255, 255, .18);
  color: #fff;
}

.mode-btn.active .mode-label strong {
  color: #fff;
}

.mode-btn.active .mode-label span {
  color: rgba(255, 255, 255, .7);
}

/* Car loop idle accent */
.mode-btn.car {
  border-color: rgba(245, 184, 33, .55);
}

.mode-btn.car .mode-icon {
  background: #fef9ec;
  color: #d97706;
}

.mode-btn.car.active {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  border-color: transparent;
  box-shadow:
    0 0 0 1px rgba(245, 184, 33, .4),
    0 4px 14px rgba(10, 15, 30, .28),
    0 14px 32px rgba(10, 15, 30, .32),
    inset 0 1px 0 rgba(255, 255, 255, .08);
}

.mode-btn.car.active .mode-icon {
  background: rgba(245, 184, 33, .22);
  color: var(--yellow);
}

/* ══════════════════════════════════════════════════════════
   PLAYER DISPLAY CARD (stage, big text, progress bar)
══════════════════════════════════════════════════════════ */
.player {
  padding: 18px 18px 16px;
}

.stage-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 20px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.stage {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue);
}

.countdown-badge {
  font-size: 12px;
  font-weight: 900;
  background: var(--yellow);
  color: var(--ink);
  border-radius: 999px;
  padding: 2px 10px;
  animation: pulseBadge 1s ease-in-out infinite;
}

@keyframes pulseBadge {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: .7;
    transform: scale(.93);
  }
}

.audio-loader-inline {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  animation: fadeFlicker 1.2s ease-in-out infinite;
}

@keyframes fadeFlicker {

  0%,
  100% {
    opacity: .35
  }

  50% {
    opacity: 1
  }
}

.now-en {
  font-size: clamp(28px, 7.5vw, 64px);
  font-weight: 900;
  line-height: 1.1;
  min-height: clamp(36px, 9vw, 74px);
  margin-bottom: 4px;
}

.now-pl {
  font-size: clamp(16px, 3.5vw, 26px);
  font-weight: 700;
  color: var(--muted);
  min-height: clamp(22px, 4vw, 34px);
  margin-bottom: 14px;
}

.bar {
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  margin-bottom: 0;
}

.bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width .3s ease;
}

/* ── Controls row 2: Prev / Next / Repeat always in one line ── */
.controls-row2 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  width: 100%;
}

/* ── Controls wrapper: Start above, row2 below ─────────────── */
.controls {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 7px;
  width: 100%;
}

.controls .big-control {
  width: 100%;
}

/* ── Lane toggles always in one line ───────────────────────── */
.language-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  width: 100%;
}

/* SVG alignment */
.ic-pause {
  display: none;
}

.control svg,
.big-control svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.big-control {
  border: 0;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--blue), var(--blue2));
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 0 0 1px rgba(35, 82, 245, .35), 0 6px 20px rgba(35, 82, 245, .3), inset 0 1px 0 rgba(255, 255, 255, .2);
  transition: transform .15s, box-shadow .15s;
}

.big-control:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(35, 82, 245, .45), 0 10px 28px rgba(35, 82, 245, .38), inset 0 1px 0 rgba(255, 255, 255, .2);
}

.big-control:active {
  transform: translateY(0);
}

.control {
  border: 1.5px solid var(--line);
  background: var(--white);
  border-radius: var(--r-sm);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: var(--sh-sm);
  transition: background .15s, transform .12s;
}

.control:hover {
  background: var(--blue-lt);
  transform: translateY(-1px);
}

.control:active {
  transform: translateY(0);
}

.lane-toggle {
  border: 1.5px solid var(--line);
  background: var(--white);
  border-radius: var(--r-sm);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
}

.lane-toggle:hover {
  background: var(--blue-lt);
}

.lane-toggle.active {
  background: var(--ink);
  color: #fff;
  border-color: var(--ink);
}

/* ── Car-active skin on player ─────────────────────────── */
.player.car-active {
  background: linear-gradient(135deg, #0a0f1e, #0d1e4a);
  color: #fff;
  border-color: transparent;
}

.player.car-active .stage {
  color: var(--yellow);
}

.player.car-active .now-pl {
  color: var(--yellow);
}

.player.car-active .bar {
  background: rgba(255, 255, 255, .14);
}

/* ══════════════════════════════════════════════════════════
   CONTENT PANEL — words/phrases cards
══════════════════════════════════════════════════════════ */
.content-panel {
  display: grid;
  gap: 7px;
}

.item-card {
  display: grid;
  grid-template-columns: 38px 1fr 1fr;
  gap: 10px;
  align-items: center;
  padding: 13px 16px;
  border-radius: var(--r-md);
  background: var(--white);
  border: 1.5px solid transparent;
  box-shadow: var(--sh-sm);
  cursor: pointer;
  transition: transform .2s, opacity .2s, border-color .18s, background .18s;
}

.item-card:hover {
  border-color: #93c5fd;
}

.item-card.active {
  background: var(--blue-lt);
  border-color: var(--blue);
}

.item-card .idx {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue-lt);
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.item-card .en {
  font-size: 15px;
  font-weight: 800;
}

.item-card .pl {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

/* DIALOGUE CARD ══════════════════════════════════════════════════════════ */ 
.dialogue-card {
  background: var(--card);
  border: 1px solid rgba(191, 219, 254, .9);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-md);
  overflow: hidden;
  animation: slideInR .28s cubic-bezier(.16, 1, .3, 1) both;
}

.dialogue-card.from-left {
  animation-name: slideInL;
}

@keyframes slideInR {
  from {
    opacity: 0;
    transform: translateX(40px) scale(.98)
  }

  to {
    opacity: 1;
    transform: none
  }
}

@keyframes slideInL {
  from {
    opacity: 0;
    transform: translateX(-40px) scale(.98)
  }

  to {
    opacity: 1;
    transform: none
  }
}

/* Top bar: ‹  |  phrase + counter  |  › */
.dc-topbar {
  display: flex;
  align-items: stretch;
}

.dc-nav {
  flex-shrink: 0;
  width: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: background .15s, color .15s;
}

.dc-nav:hover {
  background: var(--blue-lt);
  color: var(--blue);
}

/* Phrase display — big, the main content of this card */
.dc-phrase {
  flex: 1;
  padding: 14px 4px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

.dc-count {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--blue);
}

.dc-en {
  font-size: clamp(18px, 5vw, 32px);
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink);
}

.dc-pl {
  font-size: clamp(13px, 3vw, 17px);
  font-weight: 700;
  color: var(--muted);
}

/* Next strip — slim single line at bottom */
.dc-next {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  background: #f8fafc;
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.dc-next-label {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--blue);
}

.dc-next-en {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.dc-next-pl {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
  max-width: 40%;
}

/* Dots */
.dialogue-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 9px;
  flex-wrap: wrap;
}

.dialogue-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: 0;
  background: #cbd5e1;
  cursor: pointer;
  transition: .22s;
}

.dialogue-dot.active {
  width: 26px;
  background: var(--blue);
}

/* ── PL blur ───────────────────────────────────────────── */
.pl-blurred .pl-text,
.pl-blurred .pl {
  filter: blur(6px);
  opacity: .28;
  user-select: none;
  transition: filter .2s, opacity .2s;
}

.pl-blurred .item-card:hover .pl,
.pl-blurred .dialogue-card:hover .pl-text {
  filter: none;
  opacity: 1;
}

/* ── Empty state ───────────────────────────────────────── */
.empty-note {
  padding: 20px;
  border-radius: var(--r-md);
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-weight: 700;
}

/* ══════════════════════════════════════════════════════════
   MOBILE — < 680px
   Fixed dock at bottom. Scroll-wheel content list.
   Full-width cards edge-to-edge. No orphan margins.
══════════════════════════════════════════════════════════ */
@media (max-width: 679px) {

  /* Full bleed — pad bottom for fixed dock */
  .drive-app {
    padding: 0 0 calc(var(--dock-h) + 16px);
  }

  /* Header: sticky at top, always visible */
  .app-header {
    padding: 14px 12px 16px;
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(240, 244, 255, 0.97);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  /* Library section padding */
  .library-section {
    padding: 0 12px;
  }

  /* Learning area: normal page flow */
  .learning-area {
    gap: 0;
    display: flex;
    flex-direction: column;
  }

  /* Verb banner: compact, edge-to-edge card */
  .verb-banner {
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 14px 12px;
    margin: 0;
  }

  .verb-banner h2 {
    font-size: clamp(18px, 5vw, 26px);
  }

  .verb-meaning {
    font-size: 14px;
  }

  /* Mode grid: edge-to-edge, 2×2 tab strip */
  .mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--line);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    margin: 0;
  }

  .mode-btn {
    border-radius: 0;
    border: none;
    background: var(--white);
    padding: 14px 12px;
    gap: 10px;
    box-shadow: none;
  }

  .mode-btn:hover {
    transform: none;
    box-shadow: none;
    background: var(--blue-lt);
  }

  .mode-btn.active {
    transform: none;
    box-shadow: inset 0 -3px 0 var(--blue);
    background: linear-gradient(180deg, var(--blue-lt) 0%, rgba(232, 238, 255, .5) 100%);
    border-color: transparent;
  }

  .mode-btn.active .mode-icon {
    background: var(--blue);
    color: #fff;
  }

  .mode-btn.active .mode-label strong {
    color: var(--blue);
  }

  .mode-btn.active .mode-label span {
    color: var(--muted);
  }

  .mode-btn.car {
    border-color: transparent;
  }

  .mode-btn.car .mode-icon {
    background: #fef9ec;
    color: #d97706;
  }

  .mode-btn.car.active {
    background: linear-gradient(180deg, #fef9ec 0%, #fff 100%);
    box-shadow: inset 0 -3px 0 var(--yellow);
  }

  .mode-btn.car.active .mode-icon {
    background: var(--yellow);
    color: var(--ink);
  }

  .mode-btn.car.active .mode-label strong {
    color: var(--ink);
  }

  .mode-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .mode-label strong {
    font-size: 13px;
  }

  .mode-label span {
    font-size: 10px;
  }

  /* Player: sticky so it locks below the sticky header when you scroll past verb banner+tabs */
  .player {
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: 14px 12px 12px;
    margin: 0;
    position: sticky;
    top: var(--header-h);
    z-index: 40;
  }

  .now-en {
    font-size: clamp(24px, 7vw, 40px);
    min-height: 0;
  }

  .now-pl {
    font-size: clamp(14px, 3.5vw, 20px);
    min-height: 0;
    margin-bottom: 10px;
  }

  /* ── Scroll wheel ── */
  .content-scroll-wrap {
    position: relative;
    height: 42vh;
    min-height: 180px;
    max-height: 320px;
    overflow: hidden;
    margin: 0;
  }

  .content-panel {
    height: 100%;
    overflow-y: scroll;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: y mandatory;
    padding: 50px 12px;
    gap: 7px;
    display: grid;
  }

  .item-card {
    scroll-snap-align: center;
  }

  .item-card {
    opacity: .42;
    transform: scale(.95);
  }

  .item-card.active {
    opacity: 1;
    transform: scale(1.01);
    box-shadow: 0 4px 16px rgba(35, 82, 245, .14);
  }

  /* Fade masks */
  .content-scroll-wrap::before,
  .content-scroll-wrap::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 64px;
    pointer-events: none;
    z-index: 2;
  }

  .content-scroll-wrap::before {
    top: 0;
    background: linear-gradient(to bottom, var(--bg) 0%, transparent 100%);
  }

  .content-scroll-wrap::after {
    bottom: 0;
    background: linear-gradient(to top, var(--bg) 0%, transparent 100%);
  }

  /* ── Fixed controls dock ── */
  .controls-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 10px 12px env(safe-area-inset-bottom, 8px);
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    border-top: 1px solid var(--line);
    box-shadow: 0 -6px 24px rgba(10, 15, 30, .10);
  }

  /* Row 1: Start button — full width */
  .controls-dock .controls {
    margin-bottom: 7px;
    gap: 7px;
  }

  .controls-dock .big-control {
    min-height: 48px;
    font-size: 15px;
    padding: 12px 16px;
    border-radius: var(--r-md);
  }

  /* Row 2: Prev · Next · Repeat */
  .controls-dock .controls-row2 {
    gap: 7px;
  }

  .controls-dock .control {
    min-height: 40px;
    font-size: 12px;
    padding: 9px 4px;
    border-radius: var(--r-sm);
  }

  /* Row 3: Lane toggles */
  .controls-dock .language-row {
    gap: 7px;
  }

  .controls-dock .lane-toggle {
    min-height: 36px;
    font-size: 11px;
    padding: 8px 4px;
    border-radius: var(--r-sm);
  }

  /* Car-active dock */
  .controls-dock.car-active {
    background: rgba(10, 15, 30, .97);
    border-top-color: rgba(255, 255, 255, .1);
  }

  .controls-dock.car-active .control {
    background: rgba(255, 255, 255, .09);
    border-color: rgba(255, 255, 255, .18);
    color: #fff;
  }

  .controls-dock.car-active .lane-toggle {
    background: rgba(255, 255, 255, .07);
    border-color: rgba(255, 255, 255, .14);
    color: rgba(255, 255, 255, .65);
  }

  .controls-dock.car-active .lane-toggle.active {
    background: var(--yellow);
    color: var(--ink);
    border-color: var(--yellow);
  }
}

/* ══════════════════════════════════════════════════════════
   DESKTOP — ≥ 680px  (dock becomes a normal card, no fades)
══════════════════════════════════════════════════════════ */
@media (min-width: 680px) {
  .drive-app {
    padding: 18px 26px 80px;
  }

  .verb-library {
    grid-template-columns: repeat(5, 1fr);
  }

  .mode-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .player {
    padding: 28px 30px;
  }

  .now-en {
    font-size: clamp(36px, 5vw, 64px);
  }

  /* Dock: static card, not fixed */
  .controls-dock {
    position: static;
    background: var(--card);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(221, 227, 245, .9);
    border-radius: var(--r-lg);
    box-shadow: var(--sh-md);
    padding: 22px 26px;
  }

  /* Controls: Start full-width, Prev/Next/Repeat in one row */
  .controls {
    gap: 9px;
    margin-bottom: 10px;
  }

  .big-control {
    padding: 17px 24px;
    font-size: 17px;
    min-height: 56px;
  }

  .controls-row2 {
    gap: 9px;
  }

  .control {
    padding: 13px 10px;
    min-height: 46px;
  }

  /* Lane toggles */
  .language-row {
    gap: 9px;
  }

  .lane-toggle {
    padding: 12px 8px;
    min-height: 44px;
    font-size: 13px;
  }

  /* Dialogue card: wider phrase text, taller touch targets */
  .dc-nav {
    width: 52px;
  }

  .dc-phrase {
    padding: 16px 8px;
  }

  .dc-en {
    font-size: clamp(22px, 2.8vw, 36px);
  }

  .dc-pl {
    font-size: clamp(14px, 1.8vw, 20px);
  }

  .dc-next {
    padding: 8px 16px;
  }

  .dc-next-en {
    font-size: 13px;
  }

  .dc-next-pl {
    font-size: 12px;
  }

  /* Content: no wheel, no fades */
  .content-scroll-wrap {
    position: static;
    height: auto;
    overflow: visible;
  }

  .content-scroll-wrap::before,
  .content-scroll-wrap::after {
    display: none;
  }

  .content-panel {
    overflow: visible;
    padding: 0;
    height: auto;
    scroll-snap-type: none;
    gap: 8px;
  }

  .item-card {
    opacity: 1;
    transform: none;
    scroll-snap-align: none;
  }

  .item-card.active {
    opacity: 1;
    transform: none;
  }

  .item-card {
    padding: 14px 18px;
  }

  .item-card .en {
    font-size: 17px;
  }

  .item-card .pl {
    font-size: 14px;
  }

  /* Dialogue: side-by-side bubbles */

  /* Mode buttons: vertical stack on desktop */
  .mode-btn {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px 16px;
  }

  .mode-icon {
    width: 36px;
    height: 36px;
  }

  .mode-label strong {
    font-size: 14px;
  }

  .mode-label span {
    font-size: 11px;
  }
}

/* ══════════════════════════════════════════════════════════
   LARGE — ≥ 960px
══════════════════════════════════════════════════════════ */
@media (min-width: 960px) {
  .now-en {
    font-size: clamp(44px, 5.5vw, 70px);
  }

  .verb-tile-en {
    font-size: 26px;
  }

  .item-card .en {
    font-size: 18px;
  }
}



/* ── QR button ─────────────────────────────────────────── */
.qr-btn {
  border-color: #93c5fd;
  background: var(--blue-lt);
  color: #1d4ed8;
}

.qr-btn:hover {
  background: #dbeafe;
}

/* ── QR Modal ─────────────────────────────────────────── */
.qr-modal {
  position: fixed;
  top: 60px;
  right: 12px;
  z-index: 9999;
  animation: qrFadeIn .15s ease;
}

@keyframes qrFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px)
  }

  to {
    opacity: 1;
    transform: translateY(0)
  }
}

.qr-modal-box {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-md);
  padding: 16px;
  text-align: center;
  width: 196px;
}

.qr-modal-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 12px;
}

.qr-modal-url {
  font-size: 10px;
  font-family: monospace;
  color: var(--muted);
  word-break: break-all;
  margin-top: 10px;
  line-height: 1.5;
}

#qrBox img,
#qrBox canvas {
  border-radius: 6px;
}

/* ── Logout pill: same visual system as Show PL ───────── */
.logout-pill,
.logout-pill:visited{
  text-decoration:none;
}
.logout-pill:hover{
  background:#dbeafe;
}


/* ══════════════════════════════════════════════════════════
   XFLOW DRIVE DEMO LOCKS — only "be" is playable
══════════════════════════════════════════════════════════ */
.verb-tile.is-demo-locked {
  position: relative;
  opacity: .54;
  filter: grayscale(.22);
  cursor: pointer;
  overflow: hidden;
}

.verb-tile.is-demo-locked:hover {
  opacity: .72;
  transform: translateY(-2px);
  border-color: #c7d2fe;
}

.verb-tile.is-demo-locked::after {
  content: '🔒';
  position: absolute;
  right: 12px;
  bottom: 10px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.9);
  box-shadow: var(--sh-sm);
  font-size: 14px;
}

.verb-badge.locked {
  background: #f1f5f9;
  color: #475569;
}

.demo-lock-tooltip {
  position: absolute;
  left: 12px;
  right: 48px;
  bottom: 10px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(10,15,30,.88);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease;
}

.verb-tile.is-demo-locked:hover .demo-lock-tooltip,
.verb-tile.is-demo-locked:focus .demo-lock-tooltip {
  opacity: 1;
  transform: translateY(0);
}

/* ════════════════════════════════════════════════
   PREMIUM ANIMATIONS (Added as requested)
════════════════════════════════════════════════ */

/* 1. Page Load Pop-up Effect */
.drive-app {
  animation: pagePopUp 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
  transform-origin: top center;
}

@keyframes pagePopUp {
  0% {
    opacity: 0;
    transform: scale(0.96) translateY(20px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 2. "Kup Dostęp" / "Kup Teraz" Button Nudge Effect */
.btn-kup, 
.btn-kup-dostep {
  background: linear-gradient(140deg, #e11d48, #b91c1c) !important;
  color: #ffffff !important;
  text-decoration: none !important;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2) !important;
  box-shadow: 0 4px 15px rgba(225, 29, 72, 0.3) !important;
  border: none !important;
  transform-origin: center;
  animation: nudgeJerk 4s infinite cubic-bezier(0.36, 0, 0.66, -0.56) !important;
}

.btn-kup:hover, 
.btn-kup-dostep:hover {
  animation: none !important;
  transform: translateY(-3px) scale(1.02) !important;
  box-shadow: 0 8px 24px rgba(225, 29, 72, 0.45) !important;
  color: #ffffff !important;
  text-decoration: none !important;
}

@keyframes nudgeJerk {
  0%, 82%, 100% { 
    transform: translateY(0) scale(1) rotate(0); 
  }
  86% { 
    transform: translateY(-4px) scale(1.04) rotate(2deg); 
  }
  90% { 
    transform: translateY(2px) scale(0.98) rotate(-2deg); 
  }
  94% { 
    transform: translateY(-1px) scale(1.02) rotate(1deg); 
  }
  97% { 
    transform: translateY(0) scale(1) rotate(0); 
  }
}

/* ══════════════════════════════════════════════════════════
   MOBILE-ONLY TOP BAR PATCH
   - QR is hidden on phones because the user is already on mobile.
   - Top purchase/language buttons stay visible and do not overflow.
══════════════════════════════════════════════════════════ */
@media (max-width: 679px) {
  .app-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    padding: 12px 12px 12px !important;
    min-height: 58px !important;
    overflow: visible !important;
  }

  .app-logo {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    font-size: 16px !important;
    line-height: 1 !important;
    letter-spacing: -0.04em !important;
  }

  .header-right {
    flex: 0 0 auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 6px !important;
    min-width: 0 !important;
    margin-left: auto !important;
  }

  .qr-btn,
  #qrBtn,
  .qr-modal,
  #qrModal {
    display: none !important;
  }

  .app-header .pill-btn {
    min-height: 36px !important;
    padding: 8px 10px !important;
    border-radius: 999px !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
  }

  .app-header .pl-toggle {
    max-width: 84px !important;
  }

  .app-header .btn-kup-dostep {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 70 !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    font-size: 11px !important;
    letter-spacing: 0.01em !important;
  }
}

@media (max-width: 374px) {
  .app-logo {
    font-size: 14px !important;
  }

  .app-header .pill-btn {
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 10.5px !important;
  }

  .app-header .btn-kup-dostep {
    padding-left: 9px !important;
    padding-right: 9px !important;
  }
}
