/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: #450a0a;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #7f1d1d;
}

::-webkit-scrollbar-thumb {
    background: #f59e0b;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #d97706;
}

/* Main Container */
.main-container {
    min-height: 100vh;
    position: relative;
    color: white;
    overflow: hidden;
}

/* Background Layers */
.horse-bg {
    position: fixed;
    inset: 0;
    opacity: 0,45;
    background-image: url('horse2.svg');
    background-size: 200% auto;
    background-position: 100% 10%;
    background-repeat: no-repeat;
    z-index: -0.4;
    pointer-events: none;
}

.pattern-bg {
    position: fixed;
    inset: 0;
    opacity: 0.4;
    background-image: url('chinese-pattern.svg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 3;
    pointer-events: none;
}

.gradient-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(to bottom,
        rgba(69, 10, 10, 0.9) 0%,
        rgba(127, 29, 29, 0.85) 50%,
        rgba(120, 53, 15, 0.9) 100%
    );
    z-index: 2;
    pointer-events: none;
}

/* Lanterns */
.lanterns-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.lantern {
    position: absolute;
    font-size: 2rem;
    animation: float-up linear infinite;
    filter: drop-shadow(0 0 10px rgba(255, 200, 0, 0.5));
}

@keyframes float-up {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(50px);
        opacity: 0;
    }
}

/* Animations */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.animate-fade-in {
    animation: fade-in 1s ease-out;
}

.bounce {
    animation: bounce 1s ease-in-out infinite;
}

.delay-0 { animation-delay: 0s; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Hero Section */
.hero-section {
    position: relative;
    z-index: 4;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
}

.hero-content {
    max-width: 56rem;
    margin: 0 auto;
}

.chinese-chars {
    font-size: 4rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: #fef3c7;
    max-width: 42rem;
    margin: 0 auto 2rem;
}

.decorative-elements {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    font-size: 2.5rem;
    margin: 2rem 0;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
}

.scroll-arrow {
    color: #fbbf24;
    font-size: 2.5rem;
}

/* Buttons */
.btn {
    font-weight: 700;
    font-size: 1.25rem;
    padding: 1rem 3rem;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    transform: scale(1);
    transition: all 0.3s ease;
}

.btn:hover {
    transform: scale(1.05);
}

.btn-primary {
    background: linear-gradient(to right, #dc2626, #d97706);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(to right, #b91c1c, #b45309);
}

.btn-secondary {
    background: linear-gradient(to right, #d97706, #dc2626);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(to right, #b45309, #b91c1c);
}

/* Hero Actions */
.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* About Section */
.about-section {
    position: relative;
    z-index: 4;
    padding: 5rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: #fbbf24;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
}

@media (min-width: 768px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .chinese-chars {
        font-size: 6rem;
    }

    .hero-title {
        font-size: 4.5rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
    }

    .section-title {
        font-size: 3rem;
    }
}

.card {
    background: rgba(127, 29, 29, 0.5);
    backdrop-filter: blur(12px);
    padding: 2rem;
    border-radius: 1rem;
    border: 2px solid #d97706;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: scale(1.05);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fcd34d;
}

.card-text {
    color: #fef3c7;
}

/* Fortune Section */
.fortune-section {
    position: relative;
    z-index: 4;
    padding: 5rem 1rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fortune-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
}

.fortune-subtitle {
    font-size: 1.25rem;
    color: #fef3c7;
    margin-bottom: 2rem;
    max-width: 42rem;
    text-align: center;
}

.cookie-container {
    position: relative;
    width: 300px;
    height: 300px;
}

.cookie-whole {
    cursor: pointer;
    transition: all 0.5s ease;
}

.cookie-whole:hover {
    transform: scale(1.1);
}

.cookie-whole.hidden {
    opacity: 0;
    transform: scale(0);
}

.cookie-svg {
    filter: drop-shadow(0 25px 50px rgba(0, 0, 0, 0.25));
}

.cookie-broken {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(0);
    transition: all 0.5s ease;
}

.cookie-broken.visible {
    opacity: 1;
    transform: scale(1);
}

.cookie-broken-inner {
    position: relative;
    width: 300px;
    height: 300px;
}

.cookie-half {
    position: absolute;
    transition: all 0.7s ease;
}

.cookie-left {
    left: 0;
    transform-origin: right center;
}

.cookie-left.open {
    transform: translateX(-64px) rotate(-20deg);
}

.cookie-right {
    right: 0;
    transform-origin: left center;
}

.cookie-right.open {
    transform: translateX(64px) rotate(20deg);
}

.fortune-paper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: all 1s ease 0.3s;
}

.fortune-paper.visible {
    opacity: 1;
    transform: translate(-50%, -200px);
}

.fortune-paper p {
    background: #fffbeb;
    color: #7f1d1d;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    border: 2px solid #d97706;
    font-size: 1.125rem;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    line-height: 1.4;
    max-width: none;
    overflow-wrap: break-word;
}

@media (max-width: 640px) {
    .fortune-paper p {
        white-space: normal;
        width: min(90vw, 64rem);
        max-width: none;
        font-size: 1rem;
    }
}

.reset-btn {
    margin-top: 2rem;
}

.reset-btn.visible {
    display: block;
    animation: fade-in 0.5s ease-out;
}

.share-actions {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.share-actions.visible {
    display: flex;
    animation: fade-in 0.5s ease-out;
}

.share-btn {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

/* Details Section */
.details-section {
    position: relative;
    z-index: 4;
    padding: 5rem 1rem;
}

.details-section .container {
    max-width: 56rem;
    text-align: center;
}

.details-box {
    background: linear-gradient(to bottom right, rgba(127, 29, 29, 0.8), rgba(120, 53, 15, 0.8));
    backdrop-filter: blur(12px);
    padding: 2.5rem;
    border-radius: 1.5rem;
    border: 2px solid #d97706;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 2rem;
    text-align: left;
}

@media (min-width: 768px) {
    .details-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.detail-item {
    padding: 0.5rem;
}

.detail-icon {
    font-size: 1.875rem;
    margin-bottom: 0.5rem;
}

.detail-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #fcd34d;
    margin-bottom: 0.5rem;
}

.detail-text {
    color: #fef3c7;
}

.details-cta {
    margin-top: 3rem;
}

/* Footer */
.footer {
    position: relative;
    z-index: 4;
    padding: 3rem 1rem;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    text-align: center;
}

.footer-emojis {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.footer-text {
    color: #fde68a;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.footer-copyright {
    color: rgba(251, 191, 36, 0.7);
}
