/* ============================================================
   SenseStars · Editorial v3 · Раздел «Справочник Таро»
   ----------------------------------------------------------------
   Полная переразметка под mockup-c-reference.html.
   Скоупаны на body.app[data-section="evolution"] #screen-reference.
   ============================================================ */

body.app[data-section="evolution"] #screen-reference {
    background: var(--section-bg, var(--bg));
    padding-top: 8px;
}

/* ── Top pills (back + search) ─────────────────────────────── */
body.app[data-section="evolution"] #screen-reference .reference-top-pills {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: env(safe-area-inset-top, 12px) 0 0;
    margin-bottom: 14px;
    position: relative;
    z-index: 5;
}
body.app[data-section="evolution"] #screen-reference .reference-top-pills .icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    cursor: pointer;
    box-shadow: none;
    padding: 0;
}

/* ── Section indicator + title ─────────────────────────────── */
body.app[data-section="evolution"] #screen-reference .reference-section-indicator {
    padding: 14px 0 4px;
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--section-voice);
    position: relative;
    z-index: 1;
}
body.app[data-section="evolution"] #screen-reference .reference-section-indicator .roman {
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
}
body.app[data-section="evolution"] #screen-reference .reference-section-indicator .sep {
    font-family: var(--serif);
    font-size: 14px;
    opacity: 0.5;
}

body.app[data-section="evolution"] #screen-reference .reference-title-block {
    padding: 16px 0 22px;
    position: relative;
    z-index: 1;
}
body.app[data-section="evolution"] #screen-reference .reference-page-title {
    font-family: var(--serif);
    font-size: 38px;
    font-weight: 500;
    line-height: 1.1;
    margin-bottom: 14px;
    color: var(--text);
    letter-spacing: -0.01em;
}
body.app[data-section="evolution"] #screen-reference .reference-page-title em {
    font-style: italic;
    color: var(--section-voice);
    font-weight: 500;
}
body.app[data-section="evolution"] #screen-reference .reference-page-subtitle {
    font-family: var(--sans);
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
    max-width: 320px;
}

/* ── Filter pills (категории) ──────────────────────────────── */
body.app[data-section="evolution"] #screen-reference .ref-categories,
body.app[data-section="evolution"] #screen-reference .reference-filters {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 6px 0 22px;
    scrollbar-width: none;
    margin: 0 -16px 0;
    padding-left: 16px;
    padding-right: 16px;
    position: relative;
    z-index: 1;
}
body.app[data-section="evolution"] #screen-reference .ref-categories::-webkit-scrollbar,
body.app[data-section="evolution"] #screen-reference .reference-filters::-webkit-scrollbar {
    display: none;
}

body.app[data-section="evolution"] #screen-reference .ref-category-btn,
body.app[data-section="evolution"] #screen-reference .reference-pill {
    flex-shrink: 0;
    padding: 10px 16px !important;
    border-radius: 999px !important;
    font-family: var(--sans) !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase;
    background: var(--bg-elev) !important;
    color: var(--text-dim) !important;
    border: 1px solid var(--line) !important;
    box-shadow: none !important;
    text-shadow: none !important;
    cursor: pointer;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
body.app[data-section="evolution"] #screen-reference .ref-category-btn.active,
body.app[data-section="evolution"] #screen-reference .reference-pill.active {
    background: var(--section-voice) !important;
    color: #1a1812 !important;
    border-color: var(--section-voice) !important;
}

/* ── Quiz CTA ──────────────────────────────────────────────── */
body.app[data-section="evolution"] #screen-reference .reference-quiz-cta {
    margin: 0 0 26px;
    padding: 22px 22px 20px;
    border-radius: 18px;
    background: linear-gradient(160deg, rgba(196, 176, 122, 0.08) 0%, rgba(196, 176, 122, 0.02) 100%);
    border: 1px solid rgba(196, 176, 122, 0.2);
    position: relative;
    z-index: 1;
}
body.app[data-section="evolution"] #screen-reference .reference-quiz-cta .eyebrow-accent {
    font-family: var(--sans);
    font-size: 11px;
    color: var(--section-voice);
    letter-spacing: 0.3em;
    text-transform: uppercase;
    font-weight: 500;
    margin-bottom: 14px;
}
body.app[data-section="evolution"] #screen-reference .reference-quiz-cta .ttl {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 500;
    line-height: 1.25;
    margin-bottom: 10px;
    color: var(--text);
}
body.app[data-section="evolution"] #screen-reference .reference-quiz-cta .ttl em {
    font-style: italic;
    color: var(--section-voice);
}
body.app[data-section="evolution"] #screen-reference .reference-quiz-cta .body {
    font-family: var(--sans);
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.55;
    margin-bottom: 16px;
}
body.app[data-section="evolution"] #screen-reference .reference-quiz-cta #reference-quiz-btn,
body.app[data-section="evolution"] #screen-reference .reference-quiz-cta .cta-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px !important;
    border-radius: 14px !important;
    background: transparent !important;
    border: 1px solid var(--line-strong) !important;
    color: var(--text) !important;
    font-family: var(--sans) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    letter-spacing: 0.04em !important;
    cursor: pointer;
    box-shadow: none !important;
    text-shadow: none !important;
    margin: 0 !important;
    width: auto;
}

/* ── Section label над сеткой ───────────────────────────────── */
body.app[data-section="evolution"] #screen-reference .reference-section-label {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 0 0 14px;
    position: relative;
    z-index: 1;
}
body.app[data-section="evolution"] #screen-reference .reference-section-label .lbl {
    font-family: var(--sans);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    font-weight: 500;
}
body.app[data-section="evolution"] #screen-reference .reference-section-label .anchor {
    font-family: var(--serif);
    font-style: italic;
    font-size: 14px;
    color: var(--text-muted);
}

/* ── Cards grid ─────────────────────────────────────────────── */
body.app[data-section="evolution"] #screen-reference .ref-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    padding: 0;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

body.app[data-section="evolution"] #screen-reference .ref-card {
    aspect-ratio: 2 / 3;
    border-radius: 14px !important;
    border: 1px solid var(--line) !important;
    background: var(--cosmos) !important;
    padding: 0 !important;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: none !important;
    transition: border-color 0.2s, transform 0.15s;
}
body.app[data-section="evolution"] #screen-reference .ref-card:active {
    transform: scale(0.98);
    border-color: var(--section-voice) !important;
}
body.app[data-section="evolution"] #screen-reference .ref-card-img {
    width: 100%;
    height: 100%;
    background: var(--cosmos) !important;
    border-radius: 14px;
    overflow: hidden;
    position: absolute;
    inset: 0;
}
body.app[data-section="evolution"] #screen-reference .ref-card-img .card-img-actual {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.78;
    filter: saturate(0.9) brightness(0.95);
}
body.app[data-section="evolution"] #screen-reference .ref-card-title {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 6px;
    z-index: 2;
    font-family: var(--serif) !important;
    font-style: italic;
    font-size: 12px !important;
    font-weight: 500 !important;
    color: var(--text) !important;
    letter-spacing: 0.02em !important;
    text-align: center;
    line-height: 1.15 !important;
    padding: 4px 6px;
    background: linear-gradient(180deg, transparent 0%, rgba(2, 5, 13, 0.85) 60%);
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6) !important;
}
body.app[data-section="evolution"] #screen-reference .ref-card .card-fallback-text {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-family: var(--serif) !important;
    font-style: italic;
    font-size: 12px;
    color: var(--section-voice);
    text-align: center;
    padding: 6px;
}

/* Tarot tile (для preview-стенда — абстрактные карты) */
body.app[data-section="evolution"] #screen-reference .tarot-tile {
    aspect-ratio: 2 / 3;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--cosmos);
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
body.app[data-section="evolution"] #screen-reference .tarot-tile.active {
    border-color: var(--section-voice);
}
body.app[data-section="evolution"] #screen-reference .tarot-tile .roman {
    font-family: var(--serif);
    font-size: 11px;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--section-voice);
    align-self: stretch;
    text-align: center;
}
body.app[data-section="evolution"] #screen-reference .tarot-tile .glyph {
    font-family: var(--serif);
    font-size: 32px;
    color: var(--section-voice);
    line-height: 1;
}
body.app[data-section="evolution"] #screen-reference .tarot-tile .name {
    font-family: var(--serif);
    font-style: italic;
    font-size: 13px;
    color: var(--text);
    text-align: center;
    line-height: 1.15;
}
