.quests {
  --page-gutter: var(--compact-page-gutter);
  --quests-ink: #3a2b43;
  --quests-accent: #7d69d9;
  --quests-label: #9179b0;
  --quests-chip: rgb(204 197 254 / 50%);
  --quests-path-color: rgb(179 118 239 / 83%);
  position: relative;
  isolation: isolate;
  container: quests / inline-size;
  padding-block: 2.9375rem 1.375rem;
  color: var(--quests-ink);
  background: var(--color-page);
  overflow-wrap: anywhere;
}
/* Continue the violet underlay past the section boundary. Four CSS pixels
   cover one output pixel even at 25% preview scale, so resampling cannot pick
   up the pale page. Increasing height equally preserves the rounded top. */
.quests::after { position: absolute; z-index: -1; content: ""; inset: auto 0 -4px; height: calc(7.3125rem + 4px); border-radius: 2.5rem 2.5rem 0 0; background: var(--color-celebration-surface); }
.quests__container { max-width: var(--container-width); }
.quests__decoration { position: absolute; inset: -5rem 0 0; overflow: clip; pointer-events: none; }
.quests__decor { position: absolute; z-index: -1; max-width: none; mix-blend-mode: darken; pointer-events: none; }
.quests__decor--glowBridge { display: none; }
.quests__decor--cloud { width: 33.9375rem; height: 15.5625rem; left: calc(50% - 53.125rem); bottom: 15rem; opacity: .7; }
.quests__decor--star { width: 2.9375rem; height: 2.875rem; left: calc(50% - 41.9375rem); bottom: 26.4375rem; }
.quests__decor--glow { width: 53.0625rem; height: 52.1875rem; top: -8.6875rem; left: calc(50% - 27.539rem); mix-blend-mode: normal; }
.quests__decor--glowSoft { width: 52.4375rem; height: 52.4375rem; top: 8.647rem; left: calc(50% - 3.9765rem); mix-blend-mode: normal; }
.quests__layout { position: relative; }
.quests__header { max-width: 36rem; }
.quests__eyebrow { display: inline-flex; align-items: center; min-height: 1.875rem; padding: .4375rem 1rem; border-radius: var(--radius-pill); background: rgb(204 197 254 / 19%); color: rgb(58 43 67 / 40%); font-size: .875rem; font-weight: 500; line-height: 1.11; }
.quests h2 { margin-block: 1.875rem 1.75rem; font-size: clamp(1.5rem, 4.2cqw, 1.875rem); font-weight: 600; line-height: 1.11; opacity: .82; text-wrap: pretty; }
.quests h2 > span { color: var(--quests-accent); }
.quests__description { max-width: 27.75rem; color: rgb(58 43 67 / 40%); font-size: .875rem; font-weight: 500; line-height: 1.25; }
.quests__path { display: none; }
.quests__prop-art { display: contents; }
.quests__route { position: relative; max-width: 28rem; margin: 2rem auto 3rem; }
.quests__props { position: relative; display: grid; grid-template-columns: minmax(0, 38fr) minmax(0, 24fr) minmax(0, 38fr); grid-auto-rows: minmax(7.25rem, 1fr); margin: 0; padding: 0; list-style: none; }
/* Equal, content-sized rows keep the curve attached to every marker even
   without JS and with larger text. The line has its own central lane. */
.quests__trail { position: absolute; z-index: -1; left: calc(38% + .75rem); top: 0; width: calc(24% - 1.5rem); height: 100%; overflow: visible; pointer-events: none; }
.quests__trail path { fill: none; stroke: var(--quests-path-color); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 7 9; vector-effect: non-scaling-stroke; }
.quests__marker { position: absolute; top: 50%; left: calc(100% + .75rem); width: 1.75rem; height: 1.75rem; translate: -50% -50%; clip-path: ellipse(32% 48% at 50% 58%); pointer-events: none; mix-blend-mode: darken; opacity: .83; }
.quests__sparks { position: absolute; inset: 0; pointer-events: none; }
.quests__spark { position: absolute; width: 1rem; height: 1.125rem; mix-blend-mode: darken; opacity: .83; }
.quests__spark--gold { left: 70%; top: 3%; }
.quests__spark--pink { left: 13%; top: 22%; width: .75rem; height: .8125rem; }
.quests__spark--ring { left: 18%; top: 44%; width: .875rem; height: .875rem; }
.quests__spark--gold-end { left: 15%; top: 71%; }
.quests__spark--ring-end { left: 42%; top: 91%; width: .875rem; height: .875rem; }
.quests__prop { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4375rem; text-align: center; grid-column: 1; grid-row: var(--quest-step); padding-block: .5rem; }
.quests__prop:where(:nth-child(even)) { grid-column: 3; }
.quests__prop:where(:nth-child(even)) .quests__marker { left: -.75rem; }
.quests__prop img { flex: none; width: min(100%, var(--quest-icon-width), 5rem); height: clamp(4rem, 12cqw, 5rem); object-fit: contain; opacity: .83; }
.quests__prop > span { max-width: 100%; display: inline-flex; align-items: center; justify-content: center; min-height: 1.875rem; padding: .4375rem clamp(.5rem, 1.5cqw, .875rem); border-radius: var(--radius-pill); background: linear-gradient(var(--quests-chip), var(--quests-chip)), #fff; color: var(--quests-label); font-size: clamp(.6875rem, 1.85cqw, .875rem); font-weight: 500; line-height: 1.11; }
/* Quest Kids supplies the compact arrangement only. The artwork, typography
   and surfaces continue to use the approved Hello Kids design. */
.quests__scenario { position: relative; isolation: isolate; display: grid; gap: 1.5rem; max-width: 38.75rem; margin-inline: auto; padding: 1.75rem 1.25rem; border: 1px solid rgb(255 255 255 / 50%); border-radius: 1.875rem; background-image: var(--quests-panel-art); background-size: 100% 100%; background-origin: border-box; color: #fff; }
.quests__scenario-copy { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.25rem .75rem; }
.quests__scenario h3 { grid-column: 1 / -1; justify-self: center; max-width: 18rem; margin: 0; font-size: clamp(1.5rem, 4cqw, 1.875rem); font-weight: 600; line-height: 1.05; text-align: center; }
.quests__scenario-copy > p { max-width: 16.625rem; margin: 0; color: rgb(255 255 255 / 70%); font-size: 1.125rem; line-height: 1.2; }
.quests__format { display: flex; align-items: center; gap: .625rem; margin: 0; }
.quests__format > span { min-width: 3.375rem; padding: .125rem .5625rem; border: 1px solid #c2bcca; border-radius: var(--radius-pill); color: rgb(255 255 255 / 70%); font-size: 1rem; line-height: 1.2; text-align: center; }
.quests__format > img { width: 1.375rem; height: 1.375rem; }
.quests__book {
  width: min(100%, 23.1875rem);
  height: auto;
  justify-self: center;
  align-self: center;
  mix-blend-mode: lighten;
  /* Dissolve the cropped cloud beyond the book's right page edge. */
  mask-image: linear-gradient(to right, #000 96%, rgb(0 0 0 / 85%) 97%, rgb(0 0 0 / 50%) 98%, rgb(0 0 0 / 15%) 99%, transparent);
}
.quests-form { min-width: 0; margin-top: 0; }
.quests-form .offer-form__row { display: grid; grid-template-columns: minmax(0, 1fr); gap: .6875rem; min-height: 0; border: 0; border-radius: 0; background: none; }
.quests-form .offer-phone { min-height: 4.5625rem; padding-left: 1.625rem; border: 1px solid rgb(97 79 109 / 59%); border-radius: var(--radius-pill); background: rgb(255 255 255 / 80%); }
.quests-form .offer-phone input { color: #2c2c2c; }
.quests-form .offer-phone input::placeholder { color: rgb(127 127 127 / 40%); }
.quests-form .offer-form__submit { min-height: 4.875rem; color: #876b2b; background: linear-gradient(83.8744288247deg, var(--color-gold-start) .75162%, var(--color-gold-end) 99.459%); }
.quests-form .offer-form__consents { gap: .5rem; margin-top: 1rem; }
.quests-form .offer-consent { align-items: center; min-height: 2.75rem; }
/* Thanks centred over the form column (Figma ASUbb6hQZf8cAetY2CnRN6 6820:2969). */
.quests-form[data-sent] > .form-success { inset: 0; margin: auto; }
/* On the PC the 365 px card is wider than the column and overhangs it evenly, as in the frame. */
@media (width >= 75rem) { .quests-form[data-sent] > .form-success { inset: 0 -2rem; width: min(22.8125rem, 100% + 4rem); } }
.quests-form .offer-consent > span { color: rgb(255 255 255 / 32.48%); font-size: .6875rem; line-height: 1.35; }
.quests-form .offer-consent__underlined { font: inherit; color: inherit; text-decoration: underline; text-underline-offset: .12em; }
.quests-form .offer-consent input { appearance: none; margin: 0; border: 1px solid rgb(255 255 255 / 10%); border-radius: .1875rem; background: rgb(243 243 243 / 43%); }
.quests-form .offer-consent input:checked { appearance: auto; background: none; }
@container quests (width < 40em) {
  .quests__scenario-copy { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .quests__scenario-copy > p, .quests__format { justify-self: center; }
}
@container quests (min-width: 40em) {
  .quests__scenario { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1.25rem; padding: 2rem; }
  .quests__scenario-copy { grid-column: 1 / -1; }
  .quests__scenario h3 { grid-area: 1 / 1; justify-self: start; text-align: left; }
  .quests__scenario-copy > p { grid-area: 2 / 1; }
  .quests__format { grid-area: 1 / 2; align-self: end; }
  .quests__book { grid-area: 2 / 2; align-self: start; }
  .quests-form { grid-area: 2 / 1; }
  .quests-form .offer-phone, .quests-form .offer-form__submit { min-height: 4.5625rem; }
}
/* Tablet: the scenario panel spans the same content width as the special offer
   card above it, and the gained room goes to the book, not to empty padding. */
@media (48rem <= width < 75rem) {
  .quests__book {
    /* Feather the enlarged image's matte without reaching the book or stars. */
    mask-image:
      linear-gradient(to right, transparent, rgb(0 0 0 / 15%) .5%, rgb(0 0 0 / 50%) 1%, rgb(0 0 0 / 85%) 1.5%, #000 2%, #000 96%, rgb(0 0 0 / 85%) 97%, rgb(0 0 0 / 50%) 98%, rgb(0 0 0 / 15%) 99%, transparent),
      linear-gradient(to bottom, transparent, rgb(0 0 0 / 15%) 1.25%, rgb(0 0 0 / 50%) 2.5%, rgb(0 0 0 / 85%) 3.75%, #000 5%);
    mask-composite: intersect;
  }
  @container quests (min-width: 44em) {
    .quests__scenario { grid-template-columns: minmax(18rem, 1fr) minmax(0, 1.45fr); column-gap: clamp(1.25rem, 3cqw, 2.5rem); max-width: none; padding: clamp(2rem, 4cqw, 2.75rem); border-radius: 2.5rem; }
    /* The 1536 px source of node 5952:8511 keeps the enlarged book sharp. */
    /* Centred on the whole panel rather than on the form row, so it no longer
       hangs below the heading; the top margin keeps it clear of the PDF badge. */
    /* The copy keeps to the left column so the book can span the panel; the
       PDF badge moves to the panel's top-right corner, where it sat before. */
    .quests__scenario-copy { grid-area: 1 / 1; }
    .quests__format { position: absolute; top: clamp(2rem, 4cqw, 2.75rem); right: clamp(2rem, 4cqw, 2.75rem); }
    .quests__book { grid-row: 1 / span 2; width: min(100%, 34rem); align-self: center; margin-top: 2.5rem; }
  }
}
/* Enlarged text needs full rows before the description or telephone becomes
   a narrow sliver. Ordinary phone widths keep the compact reference layout. */
@container quests (max-width: 19em) {
  .quests__scenario { padding: 1rem .5rem; }
  .quests__scenario-copy > p { max-width: none; }
  .quests-form .offer-phone { flex-wrap: wrap; gap: .25rem; padding: .5rem; }
  .quests-form .offer-phone__prefix { flex-basis: 100%; }
  .quests-form .offer-phone input { flex: 1 0 100%; padding: .5rem 0; }
  .quests-form .offer-form__submit { padding-inline: .5rem; }
}
/* Icons carry real transparency (scripts/prepare-transparent-icons.py) —
   no blend modes, Safari dropped darken and showed white boxes
   (16.10/23.10.2026). Desktop keeps the wrapper as display: contents. */
@media (width < 75rem) {
  .quests__prop-art { display: flex; flex: none; justify-content: center; width: min(100%, var(--quest-icon-width), 5rem); height: clamp(4rem, 12cqw, 5rem); opacity: .83; }
  .quests__prop img { width: 100%; height: 100%; opacity: 1; }
}
@media (48rem <= width < 75rem) {
  /* Tablet: the desktop route at full width under the heading, arranged like
     the kvestkids.ru gift-quest tablet map: the same Hello Kids path, icons
     and captions at the desktop positions (questsAssets.tabletMap, % of the
     route image), never larger than desktop. Enlarged text that no longer
     fits falls back to the vertical route, as does desktop enlarged text. */
  @container quests (min-width: 44em) {
    .quests__header { max-width: 36rem; }
    .quests__route { container: quests-map / inline-size; width: 100%; max-width: 62.25rem; aspect-ratio: 996 / 699; margin-block: 1.5rem 3rem; }
    .quests__path { display: block; position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; clip-path: inset(3.147% 0 0); mix-blend-mode: darken; opacity: .83; }
    .quests__trail, .quests__marker, .quests__sparks { display: none; }
    .quests__props { position: absolute; inset: 0; display: block; }
    .quests__prop { position: static; display: block; padding: 0; }
    .quests__prop-art { display: block; position: absolute; left: var(--map-icon-x); top: var(--map-icon-y); width: var(--map-icon-width); height: auto; translate: -50% 0; }
    .quests__prop img { display: block; width: 100%; height: auto; }
    .quests__prop > span { position: absolute; left: var(--map-label-x); top: var(--map-label-y); translate: -50% 0; min-height: 2.142857em; padding: 0 1em; white-space: nowrap; font-size: clamp(.75rem, 1.4056cqi, .875rem); }
  }
}
@media (width >= 75rem) {
  .quests { --page-gutter: var(--desktop-page-gutter); }
  /* Overlap the shared glow by one physical pixel so fractional section
     boundaries do not leave an antialiased light seam between the crops. */
  .quests__decor--glowBridge { display: block; width: 53.078125rem; height: 52.203125rem; top: -27.5390625rem; left: calc(50% + 5.9609375rem); clip-path: inset(calc(32.5390625rem - 1px) 0 0); mix-blend-mode: normal; }
  @container quests (min-width: 70em) {
    .quests__layout { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); grid-template-rows: minmax(16.0625rem, auto) auto; row-gap: 1.0625rem; padding-bottom: 4.625rem; }
    .quests__header { grid-area: 1 / 1 / 2 / 12; max-width: 31.25rem; }
    .quests h2 { margin-bottom: 1.9375rem; font-size: 1.875rem; text-wrap: wrap; }
    .quests__route, .quests__props { display: contents; }
    .quests__trail, .quests__marker, .quests__sparks { display: none; }
    .quests__path { position: absolute; z-index: -1; display: block; left: 10rem; top: -4.3125rem; width: 62.25rem; height: 43.6875rem; max-width: none; clip-path: inset(1.375rem 0 0); mix-blend-mode: darken; opacity: .83; }
    .quests__prop { justify-content: start; padding: 0; }
    .quests__prop img { width: min(100%, var(--quest-icon-width)); height: auto; }
    .quests__prop > span { padding-inline: .875rem; font-size: .875rem; }
    .quests__prop--games { grid-area: 2 / 4 / 3 / 8; padding-top: 6.5rem; gap: 2.5625rem; }
    .quests__prop--keys { grid-area: 2 / 8 / 3 / 12; padding-top: 5.1875rem; }
    .quests__prop--maze { grid-area: 2 / 12 / 3 / 16; padding-top: 10.5rem; }
    .quests__prop--safe { grid-area: 2 / 16 / 3 / 19; padding-top: 2.6875rem; gap: .5rem; }
    .quests__prop--electronics { grid-area: 2 / 21 / 3 / 25; gap: .5625rem; }
    .quests__prop--prizes { grid-area: 1 / 22 / 2 / 25; padding-top: 2.6875rem; gap: .25rem; }
    .quests__prop--ultraviolet { grid-area: 1 / 16 / 2 / 20; padding-top: 3.3125rem; gap: .125rem; }
    .quests__prop--vr { grid-area: 1 / 12 / 2 / 16; padding-top: 7.375rem; gap: .4375rem; }
    /* Align the caption centers to the looping route while retaining the
       designer's small offsets between each cropped icon and its caption. */
    .quests__prop--games { margin-right: 1.770833rem; }
    .quests__prop--games img, .quests__prop--keys img { margin-left: .8125rem; }
    .quests__prop--keys { margin-right: 2.125rem; }
    .quests__prop--maze { margin-left: .833333rem; }
    .quests__prop--maze img, .quests__prop--prizes img { margin-right: .1875rem; }
    .quests__prop--safe { margin-left: .0625rem; }
    .quests__prop--safe img { margin-right: .0625rem; }
    .quests__prop--electronics { margin-right: .229167rem; }
    .quests__prop--electronics img { margin-right: .125rem; }
    .quests__prop--prizes { margin-left: 1.125rem; }
    .quests__prop--ultraviolet { margin-left: 1.729167rem; }
    .quests__prop--ultraviolet img { margin-right: 2.0625rem; }
    .quests__prop--vr { margin-right: 1.541667rem; }
    .quests__scenario { grid-template-columns: 18.1875rem 23.1875rem minmax(0, 1fr); column-gap: .875rem; align-items: start; max-width: none; min-height: 17.1875rem; padding: .625rem 4.75rem .875rem 3.3125rem; }
    .quests__scenario-copy { display: block; grid-area: auto; align-self: start; padding-top: 2.4375rem; }
    .quests__scenario h3 { max-width: none; text-align: left; }
    .quests__scenario-copy > p { margin-top: 1.3125rem; }
    .quests__format { margin-top: 1.1875rem; }
    .quests__book { grid-area: auto; align-self: start; }
    .quests-form { grid-area: auto; padding-top: 1.75rem; margin-left: 2.3125rem; }
    .quests-form .offer-form__row { grid-template-columns: minmax(0, 1fr); }
    .quests-form .offer-form__submit { min-height: 4.875rem; }
    .quests-form .offer-form__consents { gap: .46875rem; margin-top: 1.0625rem; margin-inline: -.875rem -2.875rem; }
    .quests-form .offer-consent { gap: .8125rem; min-height: .8125rem; }
    .quests-form .offer-consent > span { font-size: .5625rem; line-height: 1.19; }
  }
}
@media (prefers-reduced-motion: reduce) { .quests-form .offer-form__submit { transition: none; } }

/* The extra PDF lines stay in the existing inline success grid, never in the
   scenario's copy or book columns. Explicit placement also keeps the icon
   centered beside all four lines at narrow and desktop widths. */
#quest-scenario .quests-form[data-sent] > .form-success .form-success__icon { grid-row: 1 / span 4; }
#quest-scenario .form-success__title,
#quest-scenario .form-success__text,
#quest-scenario .form-success__pdf-note,
#quest-scenario .form-success__pdf-link {
  justify-self: center;
  text-align: center;
}
#quest-scenario .form-success__pdf-note,
#quest-scenario .form-success__pdf-link { grid-column: 2; min-width: 0; }
#quest-scenario .form-success__pdf-note {
  margin: .375rem 0 0;
  color: rgb(255 255 255 / 70%);
  font-size: .75rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
#quest-scenario .form-success__pdf-link {
  margin-top: .25rem;
  padding-block: .125rem;
  color: var(--color-white);
  font-size: .75rem;
  line-height: 1.35;
  text-decoration: underline;
  text-underline-offset: .2em;
}
