/* ══ v4 · original hero restored, one-screen sections, alignment pass (2026-09-20) ══
   Loaded AFTER style.css via <link>, so these rules win without specificity tricks. */

/* ── HERO: original storybook picture; wording sits in a glass panel BELOW Mia ── */
.hero.hero-story {
  height: calc(100vh - 92px); min-height: 540px; max-height: 920px;
  justify-content: flex-end; align-items: center;
  margin: 0 12px; border-radius: 0 0 40px 40px;
}
.hero.hero-story .hero-bg { background-position: center top; }          /* Mia stays in the top ~43% of the picture */
.hero.hero-story .hero-bg::after {
  background: linear-gradient(180deg, rgba(11,16,53,0) 0%, rgba(11,16,53,0) 40%, rgba(11,16,53,.55) 72%, rgba(11,16,53,.88) 100%);
}
.hero-panel {
  position: relative; z-index: 2; text-align: center;
  width: min(1000px, calc(100% - 32px)); margin: 0 auto 22px;
  padding: 20px 34px 22px; border-radius: 32px;
  background: rgba(13, 18, 58, .62); border: 1.5px solid rgba(255,255,255,.16);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(4,8,30,.55);
}
.hero-panel h1 {
  font-size: clamp(1.55rem, min(3.1vw, 5.4vh), 3rem); font-weight: 800; line-height: 1.15;
  text-shadow: 0 3px 18px rgba(0,0,0,.45);
}
.hero-panel h1 .gold { color: var(--gold); text-shadow: 0 0 26px var(--gold-glow); white-space: nowrap; }
.hero-panel p { font-size: clamp(.98rem, 1.5vw, 1.2rem); color: #e8ecff; margin: 8px auto 14px; max-width: 760px; }
.hero-panel .hero-cta { gap: 14px; align-items: center; }
.hero-panel .btn.big { font-size: clamp(1.05rem, 1.6vw, 1.3rem); padding: 14px 34px; }
.hero-panel .btn.secondary { font-size: clamp(.95rem, 1.4vw, 1.1rem); padding: 12px 26px; }
.hero-panel .cta-sub { margin-top: 2px; font-size: .88rem; }

/* ── SECTIONS: compact so each one fits a single screen ── */
.section { padding: 34px 5vw; }
.section-title { font-size: clamp(1.55rem, 3vw, 2.25rem); margin-bottom: 24px; }
.section-sub { margin-bottom: 24px; font-size: 1rem; }
.section .big-center { padding: 18px 0 0; }

.how-grid { gap: 18px; align-items: stretch; }
.how-card { padding: 22px 20px; display: flex; flex-direction: column; align-items: center; }
.how-card .icon-badge { width: 68px; height: 68px; margin-bottom: 10px; }
.how-card .icon-badge svg { width: 30px; height: 30px; }
.how-card h3 { font-size: 1.22rem; min-height: 2.5em; display: flex; align-items: center; justify-content: center; margin-bottom: 6px; line-height: 1.2; }
.how-card p { font-size: .95rem; line-height: 1.5; }

.level-grid { gap: 18px; align-items: stretch; }
.level-card { padding: 22px; display: flex; flex-direction: column; align-items: center; }
.level-card img { width: 104px; height: 104px; margin-bottom: 6px; }
.level-card h3 { font-size: 1.35rem; }
.level-card p { font-size: .95rem; flex: 1; }
.level-card .lc-count { margin-top: 12px; }

/* all six stories on one row — no orphaned card */
.cover-row { grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 0; align-items: stretch; }
.cover { display: flex; flex-direction: column; }
.cover div { padding: 10px 12px 12px; flex: 1; }
.cover b { font-size: .95rem; line-height: 1.25; }
.cover small { font-size: .8rem; display: block; margin-top: 3px; line-height: 1.3; }

.parents-grid { gap: 18px; align-items: stretch; }
.parents-grid .card { padding: 22px; }
.parents-grid .card h3 { display: block; min-height: 2.6em; font-size: 1.12rem; line-height: 1.3; margin-bottom: 6px; }
.parents-grid .card p { font-size: .95rem; line-height: 1.5; }

.price-grid { gap: 18px; align-items: stretch; max-width: 980px; }
.price-card { padding: 24px 22px; display: flex; flex-direction: column; }
.price-card h3 { font-size: 1.2rem; }
.price-card .price { font-size: 2.2rem; margin: 6px 0; line-height: 1.15; }
.price-card ul { margin: 10px 0 14px; line-height: 1.75; font-size: .93rem; }
.price-card .btn { margin-top: auto; align-self: center; padding: 12px 30px; font-size: 1.05rem; }   /* buttons line up along the bottom */
.price-card-note { margin-bottom: 14px; }

/* ── STORY COVER: fits the screen, no scrolling ── */
.overlay-card.cover-card {
  max-width: 880px; width: 100%; padding: 22px; text-align: left;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: center;
  max-height: 94vh; overflow: visible;
}
.cover-card .cover-img { margin: 0; aspect-ratio: 4/3; max-height: 70vh; border-radius: 22px; }
.cover-card .cover-info { text-align: center; }
.cover-card h2 { font-size: clamp(1.35rem, 2.4vw, 1.9rem); line-height: 1.2; }
.cover-chips { margin: 12px 0 4px; gap: 8px; }
.cover-chips .chip { font-size: .85rem; padding: 6px 13px; }
.cover-q { margin: 12px 0; }
.cover-btns { flex-direction: column; align-items: stretch; gap: 14px; }
.cover-btns .btn { font-size: 1.1rem; padding: 13px 22px; width: 100%; }

/* library cards: "Czytaj" buttons share a baseline */
.story-card { display: flex; flex-direction: column; }
.sc-body { flex: 1; display: flex; flex-direction: column; }
.sc-foot { margin-top: auto; }

@media (max-width: 1000px) {
  .cover-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 700px) {
  .hero.hero-story { height: auto; min-height: 640px; max-height: none; }
  .hero-panel { padding: 16px 16px 18px; margin-bottom: 14px; border-radius: 26px; }
  .hero-panel h1 { font-size: 1.6rem; }
  .hero-panel .hero-cta .btn { width: 100%; max-width: 340px; }
  .hero.hero-story::before { content: ''; display: block; height: 290px; flex-shrink: 0; }   /* reserves the space Mia occupies */
  .cover-row { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 28px 5vw; }
  .overlay-card.cover-card { grid-template-columns: 1fr; gap: 12px; padding: 16px; max-height: 96vh; overflow-y: auto; }
  .cover-card .cover-img { aspect-ratio: 16/9; max-height: 26vh; }
  .cover-btns { gap: 12px; }
}
@media (max-height: 620px) and (min-width: 701px) {
  .hero-panel { padding: 14px 28px 16px; margin-bottom: 14px; }
  .hero-panel p { margin: 4px auto 10px; }
  .hero-panel .btn.big { padding: 11px 28px; }
}

/* ══ v5 · placement test intro redesign + tap-to-hear Mia (2026-09-25) ══ */
.test-wrap { padding-top: 6px; }
.intro-card {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 26px; align-items: center;
  max-width: 820px; margin: 18px auto 0; padding: 30px 36px 30px 26px; border-radius: 34px; text-align: left;
  background: linear-gradient(135deg, rgba(42,51,118,.85), rgba(19,25,72,.92));
  border: 1.5px solid rgba(255,201,77,.45);
  box-shadow: 0 0 60px rgba(255,201,77,.14), 0 26px 70px rgba(4,8,30,.6);
  position: relative; overflow: hidden;
}
.intro-card::before { content: ''; position: absolute; inset: -40%; background: radial-gradient(circle at 22% 50%, rgba(255,201,77,.22), transparent 38%); pointer-events: none; }
.intro-mia { position: relative; border: none; background: none; cursor: pointer; padding: 0; width: 240px; height: 240px; display: grid; place-items: center; }
.intro-halo { position: absolute; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(255,201,77,.35), rgba(255,201,77,0) 70%); animation: haloPulse 3s ease-in-out infinite; }
@keyframes haloPulse { 0%,100% { transform: scale(.9); opacity: .7; } 50% { transform: scale(1.1); opacity: 1; } }
.intro-mia img { position: relative; width: 205px; animation: miaFly 6s ease-in-out infinite; transition: transform .2s; }
.intro-mia:hover img { transform: scale(1.06); }
.intro-speak { position: absolute; right: 18px; bottom: 18px; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold)); color: var(--ink); box-shadow: 0 5px 0 #c68f1f, 0 0 20px var(--gold-glow); }
.intro-text h1 { font-size: clamp(1.7rem, 3.2vw, 2.5rem); line-height: 1.1; margin-bottom: 10px; }
.intro-text p { color: #dbe1ff; font-size: 1.08rem; line-height: 1.6; }
.intro-tap { color: var(--gold-soft) !important; font-weight: 800; font-size: .92rem !important; margin: 10px 0 18px; }
.intro-text .btn.big { font-size: 1.3rem; padding: 15px 40px; }
.instr-mia-btn { border: none; background: none; padding: 0; cursor: pointer; border-radius: 50%; flex-shrink: 0; }
.instr-mia-btn:hover .instr-mia { transform: scale(1.1); }
.instr-mia { transition: transform .2s; display: block; }
.instr-pl { font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.instr-en { color: #9a8fc0; font-size: .88rem; font-weight: 700; }
@media (max-width: 700px) {
  .intro-card { grid-template-columns: 1fr; text-align: center; padding: 22px 18px 24px; gap: 8px; }
  .intro-mia { margin: 0 auto; width: 200px; height: 200px; }
  .intro-mia img { width: 140px; }
  .intro-text .btn.big { width: 100%; }
}

/* ══ v6 · Mia story round (2026-09-26): cover, challenge, T/F modes, Grammagic ══ */
.cover-pl { color: #aab4e8; }
#storyCover { cursor: pointer; }
.cover-btns .btn { cursor: pointer; }

/* end-of-story challenge */
.overlay-card.challenge-card { max-width: 640px; padding: 26px 34px 32px; }
.challenge-mia { position: relative; border: none; background: none; cursor: pointer; padding: 0; width: 210px; height: 190px; display: grid; place-items: center; margin: 0 auto 4px; }
.challenge-mia .intro-halo { width: 180px; height: 180px; }
.challenge-mia img { width: 205px; position: relative; animation: miaFly 6s ease-in-out infinite; transition: transform .2s; }
.challenge-mia:hover img { transform: scale(1.06); }
.challenge-mia .intro-speak { right: 12px; bottom: 12px; width: 40px; height: 40px; }
.challenge-q { font-family: 'Baloo 2', sans-serif; font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 800; color: var(--ink); line-height: 1.2; margin: 4px 0 2px; }
.challenge-sub { color: #9a8fc0; font-weight: 700; margin-bottom: 18px; }
.challenge-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.challenge-btns .btn { width: 100%; justify-content: center; font-size: 1.05rem; padding: 14px 16px; }
.overlay-card .challenge-btns .btn.secondary { color: var(--ink); background: #f2edff; border: 2px solid #cdb8f5; box-shadow: 0 8px 0 #cdb8f5; }

/* Wordventure · true or false */
.tf-mode { display: flex; justify-content: center; margin: 0 0 10px; }
.tf-hear { padding: 2px 0 0; }
.tf-hear .replay-big { margin-bottom: 4px; }
.tf-btn small { display: block; font-size: .78rem; font-weight: 800; opacity: .65; margin-top: 2px; }

/* Grammagic · Mia explains */
.gm-explain {
  display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 22px; align-items: start;
  background: rgba(255,255,255,.07); border: 1.5px solid rgba(255,201,77,.35); border-radius: 30px; padding: 24px 28px; margin-bottom: 24px;
  box-shadow: 0 0 50px rgba(255,201,77,.08);
}
.gm-mia { position: sticky; top: 90px; border: none; background: none; cursor: pointer; padding: 0; width: 200px; height: 200px; display: grid; place-items: center; }
.gm-mia .intro-halo { width: 185px; height: 185px; }
.gm-mia img { width: 200px; position: relative; animation: miaFly 6s ease-in-out infinite; transition: transform .2s; }
.gm-mia:hover img { transform: scale(1.06); }
.gm-mia .intro-speak { right: 10px; bottom: 10px; width: 40px; height: 40px; }
.gm-tap { color: var(--gold-soft); font-weight: 800; font-size: .9rem; margin-bottom: 8px; }
.gm-line { font-size: 1.12rem; line-height: 1.7; color: #e6eaff; }
.gm-line b { color: var(--gold-soft); }
.gm-forms { list-style: none; margin: 12px 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 6px 18px; }
.gm-forms li { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.gm-forms b { color: var(--gold-soft); white-space: nowrap; }
.gm-forms span { color: #cdd5ff; }
.gm-ex { list-style: none; margin: 4px 0 14px; padding: 0; }
.gm-ex li { display: flex; gap: 8px; align-items: flex-start; font-size: 1.05rem; line-height: 1.6; }
.gm-ex li b { color: var(--gold-soft); }
.gm-ex i { color: #aab4e8; }
.gm-outro { font-weight: 800; color: var(--gold-soft); font-size: 1.08rem; line-height: 1.6; }
.gm-outro svg { vertical-align: middle; margin-left: 4px; }

/* Grammagic · exercise tiles */
.gm-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 28px; }
.gm-tile {
  text-align: left; cursor: pointer; color: inherit; font-family: inherit;
  border: 2px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); border-radius: 26px; padding: 18px 22px;
  display: flex; gap: 16px; align-items: center; transition: transform .15s, border-color .15s, box-shadow .15s;
}
.gm-tile:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 0 30px rgba(255,201,77,.25); }
.gm-tile-ico { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(180deg, var(--gold-soft), var(--gold)); color: var(--ink); flex-shrink: 0; box-shadow: 0 5px 0 #c68f1f; }
.gm-tile h3 { font-size: 1.12rem; margin-bottom: 2px; line-height: 1.2; }
.gm-tile h3 small { color: #aab4e8; font-weight: 800; font-size: .85rem; }
.gm-tile p { color: #cdd5ff; font-size: .92rem; line-height: 1.4; }
.gm-tile.done { border-color: var(--gold); box-shadow: 0 0 26px var(--gold-glow); }
.gm-done { margin-left: auto; color: var(--gold); flex-shrink: 0; }

/* Grammagic · type the verb */
.gap-input {
  font-family: 'Baloo 2', sans-serif; font-weight: 800; font-size: inherit; width: 160px; text-align: center;
  border: none; border-bottom: 4px dashed var(--gold); background: rgba(255,255,255,.08); color: var(--gold);
  border-radius: 12px 12px 0 0; padding: 2px 8px; outline: none; margin: 0 8px; text-shadow: 0 0 20px var(--gold-glow);
}
.gap-input::placeholder { color: rgba(255,201,77,.45); font-size: .8em; text-shadow: none; }
.gap-input:focus { background: rgba(255,201,77,.14); }
.gap-input.right { color: #7fe8c9; border-color: #7fe8c9; text-shadow: 0 0 20px rgba(127,232,201,.6); }
.gap-input.wrong { animation: shake .4s; color: #ff9a9a; border-color: #ff9a9a; }
.gm-hint { color: #aab4e8; font-weight: 700; margin-top: 12px; min-height: 1.4em; }
#grammagicNav { display: none; }
#grammagicNav[style*="flex"] { display: flex !important; }

@media (max-width: 700px) {
  .gm-explain { grid-template-columns: 1fr; padding: 18px; }
  .gm-mia { position: static; margin: 0 auto; }
  .gm-tiles { grid-template-columns: 1fr; }
  .challenge-btns { grid-template-columns: 1fr; }
  .overlay-card.challenge-card { padding: 20px 18px 24px; }
  .gap-input { width: 120px; }
}
