@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
    --night-deep: #0a1628;
    --night-blue: #0d1f3c;
    --midnight: #132744;
    --snow-white: #ffffff;
    --main-gold: #ffd700;
    --gold-warm: #ffd966;
    --gold-bright: #ffe066;
    --gold-dark: #d4a520;
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.75);
    --text-muted: rgba(255, 255, 255, 0.5);
    --glass-bg: rgba(255, 255, 255, 0.12);
    --glass-border: rgba(255, 255, 255, 0.2);
    --garland-red: #ff4757;
    --garland-green: #2ed573;
    --garland-blue: #3742fa;
    --garland-yellow: #ffd93d;
    --garland-pink: #ff6b9d;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

html,
body {
    height: 100%;
}

body {
    font-family: 'Montserrat', sans-serif;
    background: var(--night-deep);
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
}

img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* === Transitions для экранов === */
.screen-enter {
    transition: opacity 0.4s ease, transform 0.4s ease;
}
.screen-enter-start {
    opacity: 0;
    transform: translateX(30px);
}
.screen-enter-end {
    opacity: 1;
    transform: translateX(0);
}
.screen-leave {
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.screen-leave-start {
    opacity: 1;
    transform: translateX(0);
}
.screen-leave-end {
    opacity: 0;
    transform: translateX(-30px);
}

.bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 100%;
    background: linear-gradient(180deg, #0a1628 0%, #0d1f3c 30%, #132744 60%, #1a3a5c 100%);
    z-index: 0;
}

.stars {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.8), transparent), radial-gradient(1.5px 1.5px at 25% 35%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 40% 15%, rgba(255, 255, 255, 0.9), transparent), radial-gradient(1.5px 1.5px at 55% 45%, rgba(255, 255, 255, 0.5), transparent), radial-gradient(1px 1px at 70% 25%, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(2px 2px at 85% 10%, rgba(255, 255, 255, 0.9), transparent), radial-gradient(1px 1px at 15% 60%, rgba(255, 255, 255, 0.6), transparent), radial-gradient(1.5px 1.5px at 30% 75%, rgba(255, 255, 255, 0.8), transparent),
        radial-gradient(1px 1px at 50% 55%, rgba(255, 255, 255, 0.5), transparent), radial-gradient(1px 1px at 65% 70%, rgba(255, 255, 255, 0.7), transparent), radial-gradient(1.5px 1.5px at 80% 65%, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(1px 1px at 90% 80%, rgba(255, 255, 255, 0.8), transparent), radial-gradient(2px 2px at 45% 85%, rgba(255, 215, 0, 0.6), transparent);
    animation: twinkle 4s ease-in-out infinite;
}

@keyframes twinkle {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

/* === Снежинки === */
.snowfall {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    background-image: url('../img/horoscope-2026/snowflakes.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: fall linear infinite;
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.5));
    will-change: transform;
}

@keyframes fall {
    from {
        transform: translateY(-50px) rotate(var(--rotation, 0deg));
    }
    to {
        transform: translateY(110vh) rotate(calc(var(--rotation, 0deg) + 180deg));
    }
}

/* === Гирлянды === */
.garlands {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    min-height: 100%;
    pointer-events: none;
    z-index: 20;
}

.garland {
    position: absolute;
    top: 0;
    height: 100%;
    width: 30px;
    display: flex;
    flex-direction: column;
    gap: 35px;
    padding-top: 20px;
}

.garland::before {
    content: '';
    position: absolute;
    top: 0;
    left: 44%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: linear-gradient(180deg, rgba(50, 50, 50, 0.8), rgba(30, 30, 30, 0.6));
    z-index: -1;
}

.garland-left {
    left: 0;
}
.garland-right {
    right: 0;
    transform: scaleX(-1);
}

.garland-light {
    width: 10px;
    height: 10px;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    position: relative;
    animation: glow 1.5s ease-in-out infinite alternate;
}

.garland-light::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #333;
    border-radius: 2px;
}

.garland-light::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    filter: blur(8px);
    opacity: 0.8;
}

.garland-left .garland-light {
    transform: rotate(90deg);
}

.garland-right .garland-light {
    transform: rotate(90deg);
}

.light-red {
    background: var(--garland-red);
    box-shadow: 0 0 15px var(--garland-red);
}
.light-red::after {
    background: var(--garland-red);
}
.light-green {
    background: var(--garland-green);
    box-shadow: 0 0 15px var(--garland-green);
}
.light-green::after {
    background: var(--garland-green);
}
.light-blue {
    background: var(--garland-blue);
    box-shadow: 0 0 15px var(--garland-blue);
}
.light-blue::after {
    background: var(--garland-blue);
}
.light-yellow {
    background: var(--garland-yellow);
    box-shadow: 0 0 15px var(--garland-yellow);
}
.light-yellow::after {
    background: var(--garland-yellow);
}
.light-pink {
    background: var(--garland-pink);
    box-shadow: 0 0 15px var(--garland-pink);
}
.light-pink::after {
    background: var(--garland-pink);
}

@keyframes glow {
    0% {
        opacity: 0.6;
        filter: brightness(0.8);
    }
    100% {
        opacity: 1;
        filter: brightness(1.2);
    }
}

.garland-light:nth-child(odd) {
    animation-delay: 0s;
}
.garland-light:nth-child(even) {
    animation-delay: 0.75s;
}

/* === Экраны === */
.screen {
    position: fixed;
    inset: 0;
    z-index: 10;
}

.screen-result {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.content {
    width: 100%;
    height: 100%;
    max-width: 430px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    padding: 30px;
}

.content-center {
    justify-content: center;
    align-items: center;
}

.screen-result .content {
    height: auto;
    min-height: 100%;
    padding-top: 30px;
    padding-bottom: 30px;
}

/* === Главный экран === */
.main-logo {
    max-width: 200px;
    margin-bottom: 20px;
}

.main-title {
    font-size: 28px;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    margin-bottom: 50px;
    color: var(--snow-white);
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.main-title .year {
    color: var(--gold-warm);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.main-subtitle {
    font-size: 20px;
    text-align: center;
}

/* === Пикер === */
.picker-container {
    width: 100%;
    max-width: 280px;
    height: 220px;
    position: relative;
    margin-bottom: 50px;
}

.picker-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    touch-action: none;
    cursor: grab;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.15) 10%, rgba(0, 0, 0, 0.5) 25%, black 40%, black 60%, rgba(0, 0, 0, 0.5) 75%, rgba(0, 0, 0, 0.15) 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.15) 10%, rgba(0, 0, 0, 0.5) 25%, black 40%, black 60%, rgba(0, 0, 0, 0.5) 75%, rgba(0, 0, 0, 0.15) 90%, transparent 100%);
}

.picker-wrapper:active {
    cursor: grabbing;
}

.picker-track {
    position: absolute;
    width: 100%;
    left: 0;
    top: 50%;
    will-change: transform;
}

.picker-item {
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 400;
    color: var(--text-muted);
    transition: color 0.2s, font-size 0.2s, font-weight 0.2s;
    cursor: pointer;
    gap: 12px;
    user-select: none;
}

.picker-item.active {
    font-size: 22px;
    font-weight: 700;
    color: var(--snow-white);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.picker-item .zodiac-symbol {
    font-size: 20px;
    opacity: 0.5;
    transition: all 0.2s;
}

.picker-item.active .zodiac-symbol {
    font-size: 26px;
    opacity: 1;
    color: var(--gold-warm);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.picker-highlight {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% + 20px);
    height: 48px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    pointer-events: none;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05);
}

.btn-confirm {
    width: 100%;
    max-width: 280px;
    height: 56px;
    background: linear-gradient(135deg, var(--gold-bright), var(--gold-dark));
    border: none;
    border-radius: 16px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 600;
    color: #1a1a2e;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.35), 0 0 40px rgba(255, 215, 0, 0.15);
    -webkit-tap-highlight-color: transparent;
}

.btn-confirm:active {
    transform: scale(0.97);
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

/* === Экран результата === */
.result-header {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    margin-bottom: 20px;
}

.logo-box {
    width: 110px;
    height: 100px;
}

.zodiac-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.logo-zodiac {
    max-width: 130px;
}

.sign-icon-box {
    width: 370px;
    align-self: center;
}

.result-headline {
    font-size: clamp(20px, 5vw, 24px);
    font-weight: 600;
    text-align: center;
    margin-bottom: 4px;
    color: var(--main-gold);
    text-shadow: 0 0 25px rgba(255, 215, 0, 0.5);
}

.result-headline-faq {
    font-size: clamp(20px, 5vw, 24px);
    font-weight: 600;
    text-align: center;
    margin-bottom: 24px;
    color: var(--main-gold);
    text-shadow: 0 0 25px rgba(255, 215, 0, 0.5);
}

.sign-dates-sub {
    text-align: center;
    color: var(--main-gold);
    font-size: 14px;
}

.glass-card {
    -webkit-backdrop-filter: blur(24px);
    border-radius: 28px;
    overflow: hidden;
    position: relative;
    margin-bottom: 24px;
}

.glass-card-content {
    padding: 14px;
}

.glass-card-content::-webkit-scrollbar {
    width: 4px;
}

.glass-card-content::-webkit-scrollbar-track {
    background: transparent;
}

.glass-card-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
}

.horoscope-body {
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.horoscope-body p {
    margin-bottom: 14px;
}

.horoscope-body p:last-child {
    margin-bottom: 0;
}

.horoscope-body strong {
    color: var(--main-gold);
    font-weight: 600;
}

.horoscope-details {
    list-style: disc;
    padding-left: 20px;
    margin-top: 18px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.horoscope-details li {
    margin-bottom: 12px;
}

.horoscope-details li:last-child {
    margin-bottom: 0;
}

.horoscope-details li::marker {
    color: var(--main-gold);
}

.horoscope-details strong {
    color: var(--main-gold);
}

.horoscope-details-title {
    color: var(--text-primary);
    font-weight: 600;
}

.advice-block {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 20px;
    padding: 18px 22px;
    margin-bottom: 34px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.advice-block strong {
    color: var(--main-gold);
}

/* === Аккордион (оптимизированный) === */
.dictionary-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 34px;
}

.accordion-item {
    background: rgba(255, 255, 255, 0.17);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.accordion-trigger {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

.accordion-word {
    font-size: 16px;
    font-weight: 500;
    color: var(--main-gold);
}

.accordion-icon {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    line-height: 1;
}

.accordion-icon.rotated {
    transform: rotate(45deg);
}

.accordion-content {
    overflow: hidden;
}

.accordion-text {
    padding: 0 20px 16px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* === x-collapse плагин эмуляция через CSS === */
[x-collapse] {
    overflow: hidden;
}

[x-collapse].x-collapse-enter {
    transition: height 0.3s ease;
}

[x-collapse].x-collapse-leave {
    transition: height 0.25s ease;
}

.btn-back {
    width: 100%;
    height: 50px;
    background: var(--main-gold);
    border: 1px solid var(--main-gold);
    border-radius: 14px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    color: var(--night-deep);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.btn-back:active {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(0.98);
}

/* === Адаптив === */
@media (max-height: 700px) {
    .main-title {
        font-size: 26px;
        margin-bottom: 24px;
    }
    .picker-container {
        height: 180px;
        margin-bottom: 35px;
    }
    .btn-confirm {
        height: 50px;
    }
}

@media (min-width: 500px) {
    body {
        display: flex;
        justify-content: center;
        align-items: center;
        background: #050a15;
    }
    .bg-layer {
        max-width: 430px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 40px;
        height: calc(100% - 40px);
        top: 20px;
        overflow: hidden;
    }
    .screen {
        max-width: 430px;
        left: 50%;
        transform: translateX(-50%);
        height: calc(100% - 40px);
        top: 20px;
        border-radius: 40px;
        overflow: hidden;
    }
    .screen-result {
        overflow-y: auto;
    }
}

/* === Скрытые элементы === */
[x-cloak] {
    display: none !important;
}
