.story-dialog {
  box-sizing: border-box;
  width: min(94vw, 37rem, calc( (100dvh - 9rem) * 1.1 + 4rem));
  min-width: min(19rem,94vw);
  max-height: 94dvh;
  overflow: auto;
  padding: clamp(.8rem, 2.4vw, 1.3rem);
  border: 1px solid #97754e;
  border-radius: 1rem;
  color: #382f29;
  background: linear-gradient(125deg,#fff7e6,#f3e5cd);
  box-shadow: 0 1.5rem 5rem #091e22a8;
}
.story-dialog::backdrop {background:#0b1c22b5}
.story-head,.story-controls,.story-shelf,.story-album-goal {display:flex;align-items:center;gap:.55rem;flex-wrap:wrap}
.story-head {justify-content:space-between;margin-block-end:.65rem;flex-wrap:nowrap}
.story-head h2 {margin:0;font:600 clamp(1.15rem, 3.6vw, 1.55rem)/1.14 Georgia,serif}
.story-dialog button,.story-shelf button {min-height:2.55rem}
.story-head button.story-close-icon {flex:none;width:44px;min-height:44px;padding:0;font-size:1.55rem;line-height:1}
.story-picture {display:block;width:100%;height:auto;border-radius:.5rem;background:#193432}
.story-stage {position:relative}
.story-caption {margin:.6rem 0;color:#514538}
.story-caption::first-letter {text-transform:uppercase}
.story-dialog select {width:100%;margin-bottom:.55rem;font:inherit;padding:.45rem}
.story-menu {display:grid;grid-template-columns:repeat(auto-fit,minmax(12rem,1fr));gap:.5rem}
.story-gallery {max-width:76rem;margin-inline:auto;padding:clamp(.65rem,2vw,1.4rem)}
.story-gallery-head {display:flex;align-items:center;justify-content:space-between;gap:.7rem;margin-bottom:1rem}
.story-gallery-head h1 {font:600 clamp(1.7rem,4vw,2.7rem)/1.08 Georgia,serif;color:#fff0d4}
.story-gallery-head button {flex:none}
.story-gallery-layout {display:grid;grid-template-columns:minmax(0,1.12fr) minmax(0,1fr);align-items:start;gap:clamp(.65rem,2vw,1.2rem)}
.story-gallery-stage,.story-gallery-card {min-width:0;background:#1a3033;border:1px solid #53686b;border-radius:.7rem}
.story-gallery-stage {padding:.72rem;max-width:39rem;scroll-margin-top:4.7rem}
.story-gallery-label {min-height:4rem;padding:.13rem .35rem .65rem}
.story-gallery-label .story-gallery-title {color:#fff1d2;font-size:clamp(1.12rem,2.9vw,1.52rem);line-height:1.16}
.story-gallery-title::first-letter {text-transform:uppercase}
.story-gallery-label .story-gallery-series {margin-bottom:.22rem;color:#d9bf92;font-size:.84rem}
.story-gallery-stage .story-picture {width:100%;max-height:58svh;object-fit:contain}
.story-gallery-controls {display:grid;grid-template-columns:1fr auto 1fr;gap:.4rem;margin-top:.7rem}
.story-gallery-controls button {min-width:0;padding-inline:.38rem}
.story-gallery-controls button:disabled {opacity:.55}
.story-gallery-index {display:grid;gap:.46rem}
.story-gallery-card {padding:.48rem .6rem;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:.55rem}
.story-gallery-card h2 {display:flex;align-items:center;gap:.42rem;color:#fcefd7;font:600 .94rem/1.2 system-ui,sans-serif}
.story-gallery-card h2 canvas {flex:none;width:1.65rem;height:1.65rem;border-radius:50%;background:#fbecd1}
.story-gallery-steps {display:flex;flex-wrap:wrap;gap:.27rem}
.story-gallery-steps button {min-height:2.55rem;padding:.36rem .45rem;font-size:.79rem}
.story-gallery-index button[aria-pressed=true] {border-color:#f1ce87;background:#4b4430;color:#ffe9b8}
.story-gallery-midnight {border-color:#ab8c5c}
@media (min-width:761px) {
  .story-gallery-stage {position:sticky;top:4.7rem}
}
@media (max-width:1000px) {
  .story-gallery-card {grid-template-columns:minmax(0,1fr)}
}
@media (max-width:760px) {
  .story-gallery-layout {grid-template-columns:minmax(0,1fr)}
  .story-gallery-stage {width:100%;justify-self:center;scroll-margin-top:7.3rem}
  .story-gallery-card {grid-template-columns:minmax(0,1fr) auto}
}
@media (max-width:410px) {
  .story-gallery-card {grid-template-columns:minmax(0,1fr)}
}
.story-shelf {margin-block:.4rem 0;color:inherit}
.story-shelf span {font-weight:600}
.story-shelf button {font-size:.87rem}
.story-album-goal[hidden],.elka-album-options[hidden] {display:none}
.elka-collection-shelf-heading h2 {display:flex;align-items:center;gap:.6rem}
.story-shelf-count {color:var(--collection-frost);font:500 .84rem/1.2 system-ui,sans-serif;white-space:nowrap}
.elka-collection-shelf-heading h2 canvas {width:2.05rem;height:2.05rem;border-radius:50%;background:#f9ecd4}
.story-series-steps {max-width:38rem;padding:.65rem .85rem;margin:.5rem 0;background:#192f3d;border:1px solid #536775;border-radius:.5rem;color:#ffeccf}
.story-series-steps .story-step-counts {font-size:.85rem;color:#e3c18b}
.story-series-steps .story-ladder li {border-color:#445c65}
.story-series-steps .story-ladder button,.story-series-steps .story-ladder small {color:#ebd5a5}
.story-series-steps .story-ladder button {background:transparent}
.elka-collection-tile.is-arrival-target {border-color:#ffdf91;box-shadow:inset 0 0 0 2px #f4c778}
.elka-collection-tile.is-arrival-target:focus-visible {outline:2px solid #ffe3a3;outline-offset:2px}
.story-shelf button:first-child {color:#ffe3a3;border-color:#967a50}
.story-album-goal [aria-label^="Предпросмотр"]::before {content:'';display:inline-block;width:0;height:0;margin-inline-end:.42em;border-block:.32em solid transparent;border-inline-start:.46em solid currentColor}
.story-shelf button:has(canvas) {display:inline-flex;align-items:center;gap:.45rem}
.story-shelf button canvas {width:1.55rem;height:1.55rem;background:#fff0d4;border-radius:50%}
.elka-filter-search-lead {display:none}
.elka-album-filter-toggle::first-letter {text-transform:uppercase}
.elka-collection-cover-actions {display:flex;align-items:center;flex-wrap:wrap;gap:.35rem .7rem;margin-top:.6rem}
.elka-collection-cover-actions .elka-collection-progress,.elka-collection-cover-actions .elka-collection-new-link {margin:0}
.story-album-goal button {background:#132430ed;color:#ffe7b0;border:1px solid #967a50;font-size:.85rem}
.elka-collection .elka-collection-cover {min-height:clamp(7.5rem,15vw,10rem);padding:clamp(.85rem,2.4vw,1.55rem)}
.elka-collection .elka-collection-cover h1 {font-size:clamp(1.9rem,4vw,3rem)}
.elka-album-toolbar {display:grid;grid-template-columns:minmax(8rem,1.5fr) minmax(7rem,1fr) auto;align-items:end;gap:.55rem}
.elka-album-options {display:grid;gap:.6rem}
.elka-album-options .elka-collection-filters {grid-template-columns:repeat(auto-fit,minmax(min(100%,9rem),1fr))}
.elka-album-filter-toggle[aria-expanded=true] {border-color:var(--collection-brass)}
@media(max-width:550px){
  .elka-collection .elka-collection-cover {min-height:6rem}
  .elka-album-toolbar {grid-template-columns:minmax(0,1fr) auto}
  .elka-album-toolbar > label:first-child {grid-column:1/-1}
  .elka-filter-search-lead {display:inline}
  .elka-filter-desktop {display:none}
  .elka-album-toolbar:has([aria-expanded=false]) > label:first-child:has(input:placeholder-shown) {display:none}
  .elka-collection-navigation {flex-wrap:nowrap;gap:.25rem}
  .elka-collection-navigation .elka-collection-tab {padding-inline:.5rem}
  .story-shelf {column-gap:.6rem;row-gap:.2rem}
  .story-shelf button {padding-inline:.5rem}
}
.tour-prize-series canvas {width:2rem;height:2rem;background:#fff0d3;border-radius:50%;border:1px solid #caa873}
.tour-prize-series {display:flex;align-items:center;justify-content:center;gap:.55rem;font-size:.92rem;}
.story-intro-copy {color:#fff2d6;background:#20382f;border:1px solid #a68a60;border-radius:.65rem;display:grid;gap:.32rem;padding:.55rem .7rem;max-width:23rem;line-height:1.23;pointer-events:auto}
.story-intro-copy>small {color:#ebc77f;font-size:.72rem;letter-spacing:.03em}
.story-intro-copy p {margin:0;font-size:.84rem}
.story-intro-actions {display:grid;grid-template-columns:1fr 1fr;gap:.4rem}
.story-intro-copy h2 {margin:0;font:600 1.3rem/1.18 Georgia,serif}
.tour-guide.story-intro-copy {padding:.78rem .9rem;gap:.33rem}
.tour-guide.story-intro-copy>.tour-guide__actions {position:absolute;right:.65rem;top:.65rem;margin:0}
.tour-guide.story-intro-copy>small {padding-right:5rem}
.story-intro-actions {grid-template-columns:auto auto;justify-content:start;margin-top:.18rem}
@media(max-width:650px) and (orientation:portrait){
  .tour-guide.story-intro-copy {top:max(.5rem,env(safe-area-inset-top))!important;left:.6rem!important;width:calc(100% - 1.2rem)}
  .tour-guide.story-intro-copy p {font-size:.86rem;line-height:1.3}
}
.story-intro-actions button {color:#fff0cd;background:#355748;border:1px solid #b39a69;border-radius:.45rem;padding:.48rem .6rem;font:600 .78rem/1.13 system-ui,sans-serif;cursor:pointer;}
.story-intro-actions button:first-child {color:#302614;background:#f3d599}
.story-intro-actions button:last-child {color:#fff2d6;background:transparent;border-color:transparent;text-decoration:underline;text-underline-offset:.2em}
.tour-overlay:has(.story-intro-copy) .tour-shade {opacity:.45}
@media(max-width:750px){.story-intro-actions button {min-height:44px}}
.story-ladder {display:grid;list-style:none;padding:0;gap:0}
.story-ladder li {display:grid;grid-template-columns:2.15rem minmax(0,1fr) auto;column-gap:.55rem;align-items:center;text-align:left;border-bottom:1px solid #d5c6a9;padding:.48rem 0}
.story-level-count {width:2rem;height:2rem;display:grid;place-items:center;background:#28483c;border:1px solid #496951;border-radius:50%;color:#fff2cf;font-variant-numeric:tabular-nums}
.story-level-effect {line-height:1.32}
.story-level-effect::first-letter {text-transform:uppercase}
.story-level-next .story-level-count {outline:1px solid #ae8242;outline-offset:2px}
.story-level-instruction {color:#615542}
.story-level-finale {display:block;font-weight:700;font-style:normal;color:#634e2c}
.story-ladder small {display:block;color:#54634d;font-weight:500}
.story-ladder button {min-width:44px;min-height:44px;padding:.35rem;color:#355448;background:transparent;border-color:transparent;text-decoration:underline;text-underline-offset:.15em}
.story-ladder button+button {grid-column:2/-1;justify-self:start}
.story-price,.story-task {line-height:1.45}
.story-task {border-inline-start:3px solid #977346;padding-inline-start:.55rem}
.story-layer {position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.story-layer-front {z-index:7}
.story-layer-back {z-index:0}
.story-room-link,.story-return {
  border-radius:.5rem;border:1px solid #c6a371;background:#293b31;color:#fff4d9;
  font-family:inherit;font-size:.85rem;line-height:1.2;font-weight:600;padding:.5rem .7rem;cursor:pointer;
}
.story-return {display:block;width:fit-content;max-width:95%;margin:.45rem auto;text-align:center;text-decoration:underline;text-underline-offset:.2em}
.claw-stage > .story-return {position:absolute;z-index:5;bottom:.4rem;left:.4rem;max-width:min(76%,23rem);margin:0;pointer-events:auto;font-size:.74rem;}
.story-praise {
  position:fixed;z-index:1200;left:50%;bottom:max(1rem,env(safe-area-inset-bottom));transform:translateX(-50%);
  box-sizing:border-box;width:max-content;max-width:min(91vw,34rem);margin:0;padding:.75rem 1rem;border-radius:.65rem;
  background:#193a32;color:#fff6dd;border:1px solid #d5b17a;text-align:center;line-height:1.38;
  box-shadow:0 .4rem 1.4rem #13282060;pointer-events:none;
}
@media(max-width:650px) and (orientation:portrait){
  .mobile-layout:has(.ec-scene[data-editing=true]) > .story-praise {top:calc(env(safe-area-inset-top,0px) + 3.3rem);bottom:auto}
  .mobile-layout:has(.story-lantern.is-open) > .story-praise {visibility:hidden}
}
.story-lantern {position:absolute;z-index:8;width:50px;height:60px;pointer-events:none}
.story-lantern.is-open {z-index:19}
.ec-scene[data-tour-step]:not([data-tour-step=""]) .story-lantern {display:none}
.story-lantern-trigger {position:relative;display:grid;place-items:center;width:50px;height:60px;padding:0;border:0;background:transparent;color:#fff4db;cursor:pointer;pointer-events:auto}
.story-lantern-trigger canvas {position:relative;width:50px;height:56px;object-fit:contain;filter:saturate(.34) brightness(.66) drop-shadow(0 1px 2px #2c160e);transform-origin:50% 8%}
.story-lantern-trigger::before {content:'';position:absolute;top:-3px;left:-4px;right:-4px;height:7px;border-radius:2px 2px 4px 4px;background:linear-gradient(#c0915b,#7c4c33 45%,#422e24);box-shadow:0 3px 4px #21170d80}
.story-lantern-trigger:focus-visible {outline:2px solid #f5cd80;border-radius:.65rem}
.story-lantern.is-ready .story-lantern-trigger {background:radial-gradient(ellipse at 50% 63%,#ffb43873,transparent 71%)}
.story-lantern.is-ready .story-lantern-trigger canvas {filter:brightness(1.12) saturate(1.3) drop-shadow(0 0 5px #ffcf75)}
.story-lantern.is-ready .story-lantern-trigger::after {content:'';position:absolute;inset:38% 36% 20%;border-radius:50%;background:radial-gradient(ellipse,#fff5c3 0%,#ffcf6a99 36%,transparent 72%);pointer-events:none}
@media(prefers-reduced-motion:no-preference){
 .story-lantern.is-ready canvas {animation:series-lantern-sway 2.4s ease-in-out 2}
 @keyframes series-lantern-sway {0%,100% {transform:rotate(0)} 30% {transform:rotate(6deg)} 72% {transform:rotate(-4deg)}}
}
.story-lantern-hint {box-sizing:border-box;position:absolute;padding:0 .65rem .35rem;overflow:auto;overscroll-behavior:contain;border:1px solid #baa06b;border-radius:.6rem;background:#19362f;color:#fff2d6;box-shadow:0 .45rem 1.4rem #0c15175c;pointer-events:auto;font:500 .83rem/1.25 system-ui,sans-serif}
.story-lantern-hint[hidden] {display:none}
.story-lantern-head {position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:.4rem;background:#19362f}
.story-lantern-head h2 {margin:0;font:600 1.12rem/1.2 Georgia,serif}
.story-lantern-head button {min-width:36px;min-height:36px;padding:0;border:0;background:transparent;color:inherit;font-size:1.3rem;cursor:pointer}
.story-lantern-hint p {margin:.3rem 0 .55rem;color:#deceb0}
.story-lantern-list {margin:0;padding:0;list-style:none}
.story-lantern-row {display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:.3rem;padding:.28rem 0;border-top:1px solid #717d626e}
.story-lantern-item {display:grid;gap:.1rem;overflow-wrap:anywhere}
.story-lantern-item small {color:#dfcfac;font-variant-numeric:tabular-nums}
.story-lantern-row button {min-height:34px;padding:.24rem .42rem;border:1px solid #83947c;border-radius:.32rem;background:#28483c;color:#fff2da;font:inherit;cursor:pointer}
.story-lantern-row button[data-action='wearSeries']:enabled {color:#342814;background:#f4d597;border-color:#e4b66e}
.story-lantern-row button:disabled {opacity:.48;cursor:default}

