/* ==============================================
   SWEET BONANZA — ПОЛНЫЙ ФИНАЛЬНЫЙ CSS
   Версия: 3.0 (чистый, без багов)
   ============================================== */

/* --- Базовые переменные --- */
:root {
    --primary-pink: #ff69b4;
    --dark-pink: #ff1493;
    --purple: #9370DB;
    --light-purple: #f3e8ff;
    --chocolate: #4a2c2a;
    --creamy-white: #fffafa;
    --text-color: #2d3436;
    --glass-bg: rgba(255, 255, 255, 0.6);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --neon-glow: 0 0 20px rgba(255, 20, 147, 0.4);
}

/* --- Сброс и базовые стили --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(180deg, #98ddff 0%, #d68dfc 100%);
    background-attachment: fixed;
    color: #2d3436;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    transition: background 0.5s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Типографика --- */
h2 {
    font-family: 'Fredoka One', cursive;
    color: var(--dark-pink);
    font-size: 2.2rem;
    margin-bottom: 25px;
    text-align: center;
    text-shadow: 2px 2px 0px #fff, 4px 4px 10px rgba(255, 20, 147, 0.2);
}

h3 {
    font-family: 'Fredoka One', cursive;
    color: var(--purple);
    margin: 30px 0 15px;
}

p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: #444;
}

/* --- Плавающие леденцы (Фон) --- */
.lollipops-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.lollipop {
    position: absolute;
    width: 60px;
    height: 120px;
    background-image: url('lollipop.png');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.8;
    filter: drop-shadow(0 5px 15px rgba(255, 20, 147, 0.4));
    animation: fall linear infinite;
    top: -150px;
}

@keyframes fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.8; }
    100% { transform: translateY(110vh) rotate(360deg); opacity: 0; }
}

.lollipop:nth-child(1) { left: 5%; animation-duration: 15s; animation-delay: 0s; }
.lollipop:nth-child(2) { left: 15%; animation-duration: 20s; animation-delay: 2s; transform: scale(0.7); }
.lollipop:nth-child(3) { left: 25%; animation-duration: 18s; animation-delay: 5s; }
.lollipop:nth-child(4) { left: 35%; animation-duration: 25s; animation-delay: 1s; transform: scale(0.8); }
.lollipop:nth-child(5) { left: 45%; animation-duration: 12s; animation-delay: 8s; }
.lollipop:nth-child(6) { left: 55%; animation-duration: 22s; animation-delay: 3s; transform: scale(1.1); }
.lollipop:nth-child(7) { left: 65%; animation-duration: 19s; animation-delay: 10s; }
.lollipop:nth-child(8) { left: 75%; animation-duration: 28s; animation-delay: 0s; transform: scale(0.9); }
.lollipop:nth-child(9) { left: 85%; animation-duration: 16s; animation-delay: 6s; }
.lollipop:nth-child(10) { left: 95%; animation-duration: 21s; animation-delay: 4s; }

/* --- Хедер --- */
.header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
    box-shadow: 0 2px 20px rgba(0,0,0,0.05);
    transition: background 0.3s ease;
}

.nav-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-img {
    height: 50px;
    transition: var(--transition);
}
.logo-img:hover {
    transform: scale(1.05);
}

.nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 700;
    margin: 0 15px;
    transition: var(--transition);
}
.nav a:hover {
    color: var(--dark-pink);
}

/* --- Кнопки --- */
.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 900;
    text-decoration: none;
    text-transform: uppercase;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    letter-spacing: 0.5px;
}

.btn-header {
    background-color: var(--primary-pink);
    color: white;
    font-size: 0.9rem;
    animation: pulse-pink 2s infinite;
}

.btn-primary {
    background: linear-gradient(45deg, var(--dark-pink), var(--primary-pink));
    color: white;
    box-shadow: 0 4px 15px rgba(255, 20, 147, 0.4);
}
.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 20, 147, 0.6);
}

.btn-secondary {
    background-color: white;
    color: var(--primary-pink);
    border: 2px solid var(--primary-pink);
}
.btn-secondary:hover {
    background-color: var(--primary-pink);
    color: white;
}

@keyframes pulse-pink {
    0% { box-shadow: 0 0 0 0 rgba(255, 105, 180, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(255, 105, 180, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 105, 180, 0); }
}

/* --- Переключатель темы --- */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: rotate(15deg) scale(1.1);
}

/* --- Бургер-меню --- */
.burger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.burger span {
    display: block;
    width: 28px;
    height: 3px;
    background: var(--dark-pink);
    border-radius: 3px;
    transition: var(--transition);
}

.burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.burger.active span:nth-child(2) {
    opacity: 0;
}

.burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* --- Герой-секция --- */
.hero {
    height: 80vh;
    min-height: 500px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    color: white;
    text-align: center;
    position: relative;
    z-index: 2;
}
.hero-inner {
    width: 100%;
}
.hero h1 {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(2rem, 5vw, 4rem);
    margin-bottom: 20px;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
}
.hero p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.95);
    max-width: 800px;
    margin: 0 auto 30px;
    font-weight: 600;
    text-shadow: 1px 1px 5px rgba(0,0,0,0.5);
}
.hero-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* --- Панель характеристик --- */
.stats-bar {
    background: linear-gradient(180deg, #fff0f3 0%, #ffdde1 100%);
    border: 4px solid #ffffff;
    border-radius: 40px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(255, 182, 193, 0.4), inset 0 2px 10px rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: space-around;
    gap: 15px;
    margin-top: -45px;
    position: relative;
    z-index: 10;
    flex-wrap: wrap;
}

.stat-box, .stat-card {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 25px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    flex: 1;
    text-align: center;
    transition: all 0.3s ease;
    min-width: 120px;
}
.stat-box:hover, .stat-card:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.02);
}
.stat-box span, .stat-card span {
    color: #d187a2;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
}
.stat-box strong, .stat-card strong {
    color: #ff69b4;
    font-size: 1.4rem;
    font-family: 'Fredoka One', cursive;
    text-shadow: 1px 1px 0px #ffffff;
}

/* --- Карточки контента --- */
.main-content {
    padding: 60px 0;
}

.article-card {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 45px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 15px 35px rgba(200, 100, 200, 0.15), inset 0 0 20px rgba(255, 255, 255, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
    position: relative;
    z-index: 2;
}
.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 45px rgba(255, 20, 147, 0.15), inset 0 0 30px rgba(255, 255, 255, 0.6);
}
.article-card p {
    color: #4a2c2a;
    font-weight: 600;
    line-height: 1.7;
}

/* --- Контент с изображением --- */
.content-flex {
    display: flex;
    gap: 40px;
    align-items: center;
}
.content-flex.reverse {
    flex-direction: row-reverse;
}
.text-side {
    flex: 1;
}
.image-side {
    flex: 1;
}
.content-img {
    width: 100%;
    border-radius: 20px;
    box-shadow: var(--shadow);
}

/* Списки */
ul, ol {
    margin-left: 20px;
    margin-bottom: 20px;
}
li {
    margin-bottom: 10px;
    font-weight: 600;
}

/* --- Демо-секция --- */
.demo-section {
    text-align: center;
    margin: 60px 0;
}

/* Демо-игра (iframe) */
.demo-game-wrapper {
    max-width: 900px;
    margin: 30px auto;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    background: #1a0b4d;
    border: 4px solid rgba(255, 105, 180, 0.5);
    transition: var(--transition);
}

.demo-game-wrapper:hover {
    border-color: var(--primary-pink);
    box-shadow: 0 25px 60px rgba(255, 20, 147, 0.3);
}

.demo-game-container {
    position: relative;
    width: 100%;
    background: #000;
}

.demo-iframe {
    display: block;
    width: 100%;
    min-height: 500px;
    border: none;
}

.demo-hint {
    text-align: center;
    padding: 12px;
    margin: 0;
    background: rgba(255, 255, 255, 0.1);
    color: #ffb6c1;
    font-size: 0.9rem;
    font-weight: 600;
}

/* --- Блоки удачи --- */
.prediction-box, .lucky-box {
    text-align: center;
    background: white;
    padding: 30px;
    border-radius: 30px;
    border: 3px dashed var(--primary-pink);
    margin: 20px 0;
}
#result, #multiplier-display {
    font-family: 'Fredoka One', cursive;
    font-size: 3rem;
    color: var(--dark-pink);
    margin: 15px 0;
    transition: transform 0.2s;
    word-break: break-word;
}
.pop-animation {
    transform: scale(1.3);
}

/* --- Сетка стратегий --- */
.strategy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 30px;
}
.strat-item {
    background: var(--light-purple);
    padding: 30px;
    border-radius: 20px;
    border-bottom: 5px solid var(--purple);
    transition: var(--transition);
}
.strat-item:hover {
    transform: translateY(-5px);
}
.strat-item h4 {
    font-family: 'Fredoka One', cursive;
    color: var(--purple);
    margin-bottom: 15px;
}

/* --- FAQ --- */
.faq {
    margin: 80px 0;
}
.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

details {
    background: white;
    margin-bottom: 15px;
    padding: 20px 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    cursor: pointer;
    transition: var(--transition);
}
details[open] {
    box-shadow: 0 10px 25px rgba(255, 20, 147, 0.1);
}

summary {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--purple);
    list-style: none;
    position: relative;
    padding-right: 30px;
    outline: none;
}
summary::-webkit-details-marker {
    display: none;
}
summary::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-pink);
    font-size: 1.5rem;
    transition: var(--transition);
}
details[open] summary::after {
    content: '−';
    transform: translateY(-50%) rotate(180deg);
}
details p {
    margin-top: 15px;
    margin-bottom: 0;
    font-size: 1rem;
    color: #555;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Футер --- */
.footer {
    background-color: #1a1a1a;
    color: #ffffff;
    padding: 80px 0 40px;
    margin-top: 80px;
    transition: background 0.3s ease;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}
.footer p {
    color: #e0e0e0;
    font-size: 0.95rem;
}
.footer h4 {
    color: #ffffff;
    margin-bottom: 25px;
    font-family: 'Fredoka One', cursive;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.footer ul {
    list-style: none;
    margin: 0;
}
.footer ul a {
    color: #ffb6c1;
    text-decoration: none;
    transition: var(--transition);
    line-height: 2;
}
.footer ul a:hover {
    color: var(--primary-pink);
    padding-left: 5px;
}
.footer-bottom {
    text-align: center;
    border-top: 1px solid #333;
    padding-top: 40px;
    margin-top: 40px;
    color: #888;
}

/* --- Индикатор прокрутки --- */
.progress-container {
    position: fixed;
    top: 0;
    z-index: 2000;
    width: 100%;
    height: 4px;
    background: transparent;
}
.progress-bar {
    height: 4px;
    background: var(--dark-pink);
    width: 0%;
    transition: width 0.2s ease;
}

/* ==============================================
   ТЁМНАЯ ТЕМА
   ============================================== */
body.dark-theme {
    background: linear-gradient(180deg, #0d001a 0%, #1a0533 50%, #0d001a 100%);
    background-attachment: fixed;
}

body.dark-theme .header {
    background: rgba(10, 0, 30, 0.9);
}

body.dark-theme .nav a {
    color: #e0d0f0;
}
body.dark-theme .nav a:hover {
    color: var(--primary-pink);
}

body.dark-theme .article-card {
    background: rgba(20, 5, 40, 0.7);
    border-color: rgba(255, 20, 147, 0.25);
}
body.dark-theme .article-card:hover {
    border-color: rgba(255, 20, 147, 0.5);
    box-shadow: 0 15px 40px rgba(255, 20, 147, 0.15), inset 0 0 30px rgba(255, 105, 180, 0.1);
}
body.dark-theme .article-card p,
body.dark-theme .article-card li {
    color: #e0d0f0;
}
body.dark-theme .article-card h2 {
    color: var(--primary-pink);
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.5), 4px 4px 10px rgba(255, 20, 147, 0.3);
}
body.dark-theme .article-card h3 {
    color: #d68dfc;
}

body.dark-theme .stat-box,
body.dark-theme .stat-card {
    background: rgba(20, 5, 40, 0.6);
    border-color: rgba(255, 105, 180, 0.3);
}
body.dark-theme .stat-box span,
body.dark-theme .stat-card span {
    color: #d68dfc;
}
body.dark-theme .stat-box strong,
body.dark-theme .stat-card strong {
    color: var(--primary-pink);
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.3);
}
body.dark-theme .stats-bar {
    background: linear-gradient(180deg, rgba(30, 10, 60, 0.9) 0%, rgba(20, 5, 40, 0.9) 100%);
    border-color: rgba(255, 105, 180, 0.4);
}

body.dark-theme .prediction-box,
body.dark-theme .lucky-box {
    background: rgba(20, 5, 40, 0.8);
    border-color: var(--primary-pink);
}

body.dark-theme .strat-item {
    background: rgba(20, 5, 40, 0.6);
    border-bottom-color: var(--purple);
}
body.dark-theme .strat-item h4 {
    color: #d68dfc;
}
body.dark-theme .strat-item p {
    color: #e0d0f0;
}

body.dark-theme details {
    background: rgba(20, 5, 40, 0.8);
}
body.dark-theme summary {
    color: #d68dfc;
}
body.dark-theme details p {
    color: #e0d0f0;
}

body.dark-theme .footer {
    background-color: #0a0015;
}
body.dark-theme .demo-game-wrapper {
    border-color: rgba(255, 20, 147, 0.4);
}
body.dark-theme .burger span {
    background: #e0d0f0;
}
body.dark-theme .demo-section p {
    color: #e0d0f0;
}
body.dark-theme .theme-toggle {
    background: rgba(255, 255, 255, 0.1);
}

/* ==============================================
   АДАПТИВНОСТЬ
   ============================================== */
@media (max-width: 992px) {
    .content-flex, .content-flex.reverse {
        flex-direction: column;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    /* Бургер */
    .burger {
        display: flex;
    }
    
    .nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(15px);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
        border-radius: 0 0 25px 25px;
        z-index: 1000;
    }
    
    .nav.active {
        display: flex;
    }
    
    .nav a {
        padding: 12px 20px;
        border-radius: 10px;
        margin: 5px 0;
    }
    
    .hero {
        height: auto;
        min-height: 60vh;
        padding: 60px 0;
    }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .stats-bar {
        flex-direction: column;
    }
    
    .article-card {
        padding: 25px;
        border-radius: 30px;
    }
    
    .header-actions {
        gap: 5px;
    }
    
    .btn-header {
        padding: 10px 18px;
        font-size: 0.8rem;
    }
    
    .demo-iframe {
        min-height: 400px;
        height: 400px;
    }
    
    body.dark-theme .nav.active {
        background: rgba(10, 0, 25, 0.95);
        border: 1px solid rgba(255, 20, 147, 0.3);
    }
}