/* Shabbat Runner · каркас экрана и раскладки: обложка, обучение, финал, «не хватает искр», карточка в «Играх» */

/* Каркас. Экран занимает всю высоту контейнера; тело прокручивается только если не помещается, низ с кнопкой закреплён. */
.sr-screen { position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; overflow: hidden; background: var(--sr-page); }
.sr-screen__body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 14px; padding: 20px var(--sr-gutter) 12px;
}
.sr-screen__body > * { flex-shrink: 0; }
.sr-screen__foot {
  flex: none; display: flex; flex-direction: column; gap: 8px;
  padding: 8px var(--sr-gutter) calc(16px + env(safe-area-inset-bottom, 0px));
}
.sr-screen--tabbar .sr-screen__foot { padding-bottom: 10px; }   /* снизу стоит панель вкладок оболочки */
.sr-stack { display: flex; flex-direction: column; gap: 6px; }
.sr-stack--8 { gap: 8px; }
.sr-section-label { font-size: 14px; font-weight: 900; color: var(--sr-muted); padding-inline-start: 4px; }
.sr-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

/* ---------- обложка ---------- */
/* высота сцены как в макете: 268px, не сжимается под окно */
.sr-cover__scene { flex: 0 0 268px; height: 268px; min-height: 268px; max-height: none; }
.sr-cover__back { position: absolute; inset-inline-start: 12px; top: calc(12px + env(safe-area-inset-top, 0px)); }
.sr-cover__chapter {
  position: absolute; inset-inline-end: 12px; top: calc(16px + env(safe-area-inset-top, 0px));
  display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 18px;
  background: rgba(20, 14, 48, .55); color: var(--sr-night-text); font-size: 13px; font-weight: 800;
}
.sr-cover__title { position: absolute; inset-inline: 0; top: 70px; text-align: center; font-size: 19px; }
.sr-cover__sun { inset-inline-start: 8%; top: 34%; }
.sr-cover__scene .sr-scene__skyline {
  top: 78px; bottom: auto; width: 390px; height: 200px;
  left: 50%; transform: translateX(-50%);
}
.sr-cover__deco--1 { inset-inline-end: 26%; top: 42%; }
.sr-cover__deco--2 { inset-inline-end: 7%; top: 60%; }
.sr-cover__rabbi { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); }
.sr-cover__sheet {
  position: relative; flex: 0 0 auto; display: flex; flex-direction: column;
  margin-top: -28px; border-radius: 28px 28px 0 0; background: var(--sr-page);
}
.sr-cover.sr-screen { height: auto; min-height: 100%; overflow: visible; }
.sr-cover .sr-screen__body { overflow: visible; flex: none; }
.sr-cover__foot-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.sr-cover__balance { font-size: 14px; font-weight: 700; color: var(--sr-muted); padding-inline-start: 4px; }

/* ---------- обучение ---------- */
.sr-tut__head {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 0; padding-inline-start: var(--sr-gutter);
}
.sr-tut__count { font-size: 13px; font-weight: 800; color: var(--sr-muted); white-space: nowrap; }
.sr-tut__step { padding-top: 12px; }
.sr-tut__art { flex: 0 0 260px; height: 260px; min-height: 260px; }
.sr-tut__art-title { position: absolute; inset-inline: 0; top: 22px; text-align: center; font-size: 15px; }
.sr-tut__art-sun { left: 50%; top: 32%; margin-left: -36px; }
.sr-tut__art-candles { inset-inline-start: 10%; top: 24%; }
.sr-tut__art-rabbi { position: absolute; inset-inline-end: 26px; bottom: 16px; }
.sr-tut__art-bubble { position: absolute; inset-inline-end: 116px; bottom: 50px; max-width: 160px; }
.sr-tut__nav { display: flex; gap: 10px; }
.sr-tut__foot-note { text-align: center; }

.sr-itemcard {
  display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; padding: 12px 4px 10px;
  border-radius: 18px; background: var(--sr-surface); border: 2px solid var(--sr-border); cursor: pointer;
}
.sr-itemcard[aria-pressed="true"] { background: var(--sr-gold-soft); border-color: var(--sr-cta-1); }
.sr-itemcard--static { border-width: 1px; cursor: default; }
.sr-itemcard__name { font-size: 13px; font-weight: 900; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.sr-story { display: flex; flex-direction: column; gap: 4px; min-height: 112px; padding: 14px 16px; background: var(--sr-gold-soft); border-color: var(--sr-gold-soft-edge); }
.sr-story__name { font-size: 16px; font-weight: 900; }
.sr-facts { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; }
.sr-facts__item { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 800; color: var(--sr-body); }
.sr-facts__item .sr-icon { color: var(--sr-gold-ink); }

/* ---------- финал ---------- */
.sr-final__scene { flex: 0 0 248px; height: 248px; min-height: 248px; }
.sr-final.sr-screen { height: auto; min-height: 100%; overflow: visible; }
.sr-final .sr-screen__body { overflow: visible; flex: none; }
.sr-final__scene .sr-scene__skyline, .sr-final__scene .sr-scene__windows { bottom: -40px; }
.sr-final__hero {
  position: absolute; inset-inline-start: 20px; inset-inline-end: 110px; top: calc(22px + env(safe-area-inset-top, 0px));
  display: flex; flex-direction: column; gap: 8px; align-items: flex-start;
}
.sr-final__title { font-size: 28px; font-weight: 900; line-height: 1.15; color: var(--sr-surface); }
.sr-final__rabbi { position: absolute; inset-inline-end: 24px; top: calc(36px + env(safe-area-inset-top, 0px)); }
.sr-final__body { position: relative; margin-top: -54px; padding: 0 16px 12px; gap: 10px; }
.sr-tablecard { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 14px 12px; border-color: var(--sr-slot-edge); }
.sr-tablecard__label { font-size: 14px; font-weight: 900; color: var(--sr-gold-ink); }
.sr-result { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; }
.sr-result__top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.sr-result__score { display: flex; flex-direction: column; }
.sr-result__label { font-size: 13px; font-weight: 800; color: var(--sr-muted); }
.sr-result__value { font-size: 52px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.sr-result__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; padding-bottom: 4px; max-width: 190px; text-align: end; font-size: 15px; font-weight: 800; color: var(--sr-body); }
.sr-result__meta b { font-weight: 900; color: var(--sr-ink); }
.sr-result__badge { padding: 2px 10px; border-radius: 10px; background: var(--sr-gold-tile); color: var(--sr-gold-ink); font-size: 13px; font-weight: 900; }
.sr-stats { display: flex; gap: 8px; }
.sr-stat { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; padding: 8px 6px; border-radius: 14px; background: var(--sr-sand); text-align: center; }
.sr-stat--main { background: var(--sr-surface); border: 1px solid var(--sr-border); }
.sr-stat__value { font-size: 18px; font-weight: 900; }
.sr-stat--main .sr-stat__value { font-size: 30px; line-height: 1.1; }
.sr-stat__label { font-size: 12px; font-weight: 800; color: var(--sr-muted); }
.sr-rowlink { padding: 8px 12px; border-radius: 18px; text-decoration: none; }
.sr-rowlink .sr-row__title { font-size: 15px; font-weight: 800; }
.sr-rowlink__go { display: flex; align-items: center; gap: 2px; font-size: 14px; font-weight: 800; color: var(--sr-teal); }

/* финал на сайте: без панели вкладок, рейтинга и искр */
.sr-final--site .sr-final__body { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }

/* ---------- не хватает искр ---------- */
.sr-nosparks__back { margin-inline-start: -8px; }
.sr-nosparks__banner { flex: 0 0 168px; height: 168px; min-height: 168px; }
.sr-nosparks__banner .sr-scene__skyline { bottom: -70px; }
.sr-nosparks__title { position: absolute; inset-inline-start: 20px; top: 22px; font-size: 15px; }
.sr-nosparks__sun { inset-inline-end: 26%; top: 42%; }
.sr-nosparks__rabbi { position: absolute; inset-inline-end: 28px; bottom: 10px; }

/* ---------- карточка игры в разделе «Игры» ---------- */
.sr-gamecard { display: flex; flex-direction: column; gap: 12px; padding: 12px; }
.sr-gamecard__preview { height: 168px; }
.sr-gamecard__preview .sr-scene__skyline { bottom: -56px; }
.sr-gamecard__title { position: absolute; inset-inline: 0; top: 16px; text-align: center; font-size: 17px; }
.sr-gamecard__sun { inset-inline-end: 22%; top: 37%; }
.sr-gamecard__deco--1 { inset-inline-start: 9%; top: 32%; }
.sr-gamecard__deco--2 { inset-inline-start: 31%; top: 50%; }
.sr-gamecard__deco--3 { inset-inline-start: 52%; top: 30%; }
.sr-gamecard__deco--4 { inset-inline-end: 22%; top: 55%; }
.sr-gamecard__rabbi { position: absolute; inset-inline-end: 14px; bottom: 64px; }
.sr-gamecard__img { width: 100%; height: 150px; object-fit: cover; border-radius: 14px; }
.sr-gamecard__text { display: flex; flex-direction: column; gap: 4px; padding: 0 4px; }
.sr-gamecard__desc { font-size: 15px; font-weight: 600; color: var(--sr-body); }

/* ---------- низкие экраны ---------- */
@media (max-height: 740px) {
  .sr-screen__body { gap: 12px; padding-top: 16px; }
  .sr-h1 { font-size: 22px; }
  .sr-text { font-size: 15px; line-height: 1.45; }
  .sr-rows { gap: 10px; padding: 12px 14px; }
  .sr-itemcard { padding: 8px 4px; gap: 6px; }
  .sr-itemcard .sr-thing { width: 52px; height: 52px; }
  .sr-itemcard .sr-thing img { width: 32px; height: 32px; }
  .sr-story { min-height: 100px; padding: 12px 14px; }
  .sr-final__body { gap: 8px; }
  .sr-result { gap: 10px; padding: 12px 14px; }
  .sr-result__value { font-size: 44px; }
}
@media (max-height: 700px) {
  .sr-cover .sr-screen__body { gap: 8px; padding: 10px var(--sr-gutter) 4px; }
  .sr-cover .sr-h1 { font-size: 22px; }
  .sr-cover .sr-rows { gap: 6px; padding: 8px 12px; }
  .sr-cover .sr-option { padding: 8px 12px; }
}
@media (max-height: 620px) {
  .sr-cover .sr-screen__body { padding-top: 6px; padding-bottom: 0; }
  .sr-row .sr-tile { width: 36px; height: 36px; border-radius: 12px; }
}
/* узкие экраны */
@media (max-width: 359px) {
  :root { --sr-gutter: 16px; }
  .sr-table { gap: 6px; }
  .sr-slot { width: 40px; height: 40px; }
}
@media (max-width: 374px) { .sr-grid3 { gap: 8px; } .sr-itemcard { padding-inline: 2px; } .sr-itemcard__name { font-size: 12px; letter-spacing: -.2px; } }
