/* Color Variables */
:root {
    --ruby-red: #9B1B30;
    --light-ruby: #C4344F;
    --pink: #FFB6C1;
    --light-pink: #FFC0CB;
    --deep-pink: #FF69B4;
    --blue: #4A90E2;
    --light-blue: #87CEEB;
    --dark-blue: #2C5282;
    --white: #FFFFFF;
    --cream: #FFF8F0;
    --gold: #FFD700;
    --shadow: rgba(0, 0, 0, 0.2);
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--pink) 0%, var(--light-blue) 50%, var(--ruby-red) 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

.screen.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Access Screen Styles */
#access-screen {
    background: linear-gradient(45deg, var(--ruby-red), var(--pink), var(--blue));
    background-size: 300% 300%;
    animation: gradientShift 6s ease infinite;
}

/* Intro Screen Styles */
#intro-screen {
    background: linear-gradient(135deg, var(--pink) 0%, var(--light-blue) 50%, var(--ruby-red) 100%);
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.intro-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100vh;
}

#intro-image {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 20px;
    box-shadow: 0 8px 32px var(--shadow);
    opacity: 0;
    transition: opacity 1s ease-in;
}

/* Slideshow Modal Styles */
.slideshow-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}
.slideshow-modal.hidden {
    display: none;
}
.slideshow-content {
    background: transparent;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
}
.close-slideshow {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2rem;
    color: var(--white);
    background: var(--ruby-red);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 2100;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}
.close-slideshow:hover {
    background: var(--light-ruby);
    transform: scale(1.1);
}
#slideshow-image-container {
    width: 400px;
    height: 400px;
    max-width: 90vw;
    max-height: 60vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: 15px;
    background: var(--white);
    box-shadow: 0 4px 16px var(--shadow);
}
#slideshow-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
    transition: opacity 1s;
    background: transparent;
    opacity: 1;
}
#slideshow-hearts {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2100;
}
.see-more-btn {
    margin-top: 20px;
    padding: 12px 32px;
    font-size: 1.2rem;
    background: var(--deep-pink);
    color: var(--white);
    border: none;
    border-radius: 30px;
    box-shadow: 0 2px 8px var(--shadow);
    cursor: pointer;
    transition: background 0.3s;
}
.see-more-btn:hover {
    background: var(--ruby-red);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.access-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px var(--shadow);
    text-align: center;
    max-width: 400px;
    width: 90%;
    backdrop-filter: blur(10px);
    border: 2px solid var(--gold);
}

.title {
    font-family: 'Dancing Script', cursive;
    font-size: 3rem;
    font-weight: 700;
    color: var(--ruby-red);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px var(--shadow);
}

.subtitle {
    color: var(--dark-blue);
    margin-bottom: 30px;
    font-size: 1.1rem;
    font-weight: 300;
}

.input-container {
    margin-bottom: 20px;
}

#access-code {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--pink);
    border-radius: 10px;
    font-size: 1.1rem;
    margin-bottom: 15px;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

#access-code:focus {
    outline: none;
    border-color: var(--ruby-red);
    box-shadow: 0 0 15px rgba(155, 27, 48, 0.3);
}

#access-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(45deg, var(--ruby-red), var(--light-ruby));
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

#access-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(155, 27, 48, 0.4);
}

.error-message {
    color: var(--ruby-red);
    font-weight: 500;
    margin-top: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-message.show {
    opacity: 1;
}

/* Floating Hearts Animation */
.hearts-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.heart {
    position: absolute;
    font-size: 2rem;
    animation: float 8s infinite linear;
    opacity: 0.7;
}

.heart-1 { left: 10%; animation-delay: 0s; }
.heart-2 { left: 25%; animation-delay: 2s; }
.heart-3 { left: 50%; animation-delay: 4s; }
.heart-4 { left: 75%; animation-delay: 6s; }
.heart-5 { left: 90%; animation-delay: 1s; }

@keyframes float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-20vh) rotate(360deg);
        opacity: 0;
    }
}

/* Welcome Screen Styles */
#welcome-screen {
    background: transparent;
}

.welcome-container {
    text-align: center;
    max-width: 600px;
    width: 90%;
}

.welcome-title {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    color: var(--ruby-red);
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px var(--shadow);
}

.welcome-message {
    font-size: 1.2rem;
    color: var(--dark-blue);
    margin-bottom: 40px;
    font-weight: 300;
}

/* Scroll Styles */
.scroll-container {
    margin: 40px 0;
    perspective: 1000px;
}

.scroll {
    background: linear-gradient(45deg, #8B4513, #D2B48C);
    padding: 30px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.5s ease;
    box-shadow: 0 10px 30px var(--shadow);
    position: relative;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.scroll:hover {
    transform: translateY(-5px) rotateX(5deg);
    box-shadow: 0 15px 40px var(--shadow);
}

.scroll-ribbon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.scroll-text {
    color: var(--cream);
    font-weight: 500;
    font-size: 1.1rem;
}

.scroll-content {
    margin-top: 30px;
    transition: all 0.8s ease;
}

.scroll-content.hidden {
    opacity: 0;
    transform: translateY(-50px);
    max-height: 0;
    overflow: hidden;
}

.scroll-paper {
    background: var(--cream);
    padding: 40px;
    border-radius: 15px;
    border: 3px solid var(--gold);
    box-shadow: 0 15px 35px var(--shadow);
    position: relative;
}

.scroll-paper::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: linear-gradient(45deg, var(--gold), var(--ruby-red), var(--blue));
    border-radius: 18px;
    z-index: -1;
}

.scroll-header {
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
    color: var(--ruby-red);
    text-align: center;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px var(--shadow);
}

.rules-content {
    text-align: left;
    margin-bottom: 30px;
}

.rule {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 182, 193, 0.2);
    border-radius: 8px;
    border-left: 4px solid var(--ruby-red);
}

.rule-number {
    background: var(--ruby-red);
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    margin-right: 15px;
    flex-shrink: 0;
}

.rule-text {
    color: var(--dark-blue);
    line-height: 1.5;
    font-weight: 400;
}

.start-btn {
    background: linear-gradient(45deg, var(--ruby-red), var(--deep-pink));
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 8px 20px rgba(155, 27, 48, 0.3);
}

.start-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(155, 27, 48, 0.4);
}

/* Game Screen Styles */
#game-screen {
    background: linear-gradient(135deg, var(--light-blue) 0%, var(--cream) 50%, var(--light-pink) 100%);
    padding: 20px;
}

.game-header {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 8px 20px var(--shadow);
    border: 2px solid var(--pink);
}

.game-header h3 {
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
    color: var(--ruby-red);
    margin-bottom: 10px;
}

.progress {
    color: var(--dark-blue);
    font-weight: 600;
    font-size: 1.1rem;
}

.game-area {
    background: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 8px 20px var(--shadow);
    min-height: 400px;
}

.garden {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.garden-item {
    background: rgba(255, 182, 193, 0.3);
    border: 3px solid var(--pink);
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    font-size: 3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.garden-item:hover {
    transform: scale(1.05);
    background: rgba(255, 105, 180, 0.4);
    border-color: var(--ruby-red);
    box-shadow: 0 8px 20px var(--shadow);
}

.garden-item.found {
    background: linear-gradient(45deg, var(--gold), var(--light-pink));
    border-color: var(--gold);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.token-display {
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 8px 20px var(--shadow);
    border: 2px solid var(--pink);
}

.collected-tokens {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.token-slot {
    width: 60px;
    height: 60px;
    border: 3px solid var(--pink);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cream);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.token-slot.filled {
    background: linear-gradient(45deg, var(--gold), var(--light-pink));
    border-color: var(--gold);
    animation: tokenGlow 2s infinite alternate;
}

@keyframes tokenGlow {
    0% { box-shadow: 0 0 10px var(--gold); }
    100% { box-shadow: 0 0 20px var(--ruby-red); }
}

/* Success Screen Styles */
#success-screen {
    background: linear-gradient(45deg, var(--gold), var(--pink), var(--blue));
    background-size: 300% 300%;
    animation: gradientShift 4s ease infinite;
}

.success-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 40px var(--shadow);
    text-align: center;
    max-width: 600px;
    width: 90%;
    backdrop-filter: blur(10px);
    border: 3px solid var(--gold);
}

.success-title {
    font-family: 'Dancing Script', cursive;
    font-size: 2.5rem;
    color: var(--ruby-red);
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px var(--shadow);
}

.success-message {
    font-size: 1.2rem;
    color: var(--dark-blue);
    margin-bottom: 30px;
    font-weight: 400;
}

.love-message h3 {
    font-family: 'Dancing Script', cursive;
    font-size: 1.8rem;
    color: var(--ruby-red);
    margin-bottom: 20px;
}

.final-message {
    background: rgba(255, 182, 193, 0.3);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid var(--pink);
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--dark-blue);
    text-align: left;
}

.celebrate-btn {
    background: linear-gradient(45deg, var(--ruby-red), var(--deep-pink));
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 8px 20px rgba(155, 27, 48, 0.3);
}

.celebrate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(155, 27, 48, 0.4);
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }
    
    .welcome-title, .success-title {
        font-size: 2rem;
    }
    
    .garden {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .garden-item {
        padding: 20px;
        font-size: 2.5rem;
        min-height: 100px;
    }
    
    .access-container, .success-container {
        padding: 30px 20px;
    }
    
    .scroll-paper {
        padding: 30px 20px;
    }
}

@media (max-width: 480px) {
    .garden {
        grid-template-columns: 1fr;
    }
    
    .collected-tokens {
        gap: 10px;
    }
    
    .token-slot {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 600px) {
    .slideshow-content {
        padding: 10px;
        border-radius: 12px;
        max-width: 98vw;
        max-height: 98vh;
    }
    #slideshow-image-container {
        width: 90vw;
        height: 40vh;
        max-width: 98vw;
        max-height: 50vh;
    }
    #slideshow-image {
        border-radius: 8px;
    }
    .close-slideshow {
        top: 4px;
        right: 10px;
        font-size: 1.5rem;
    }
    .see-more-btn {
        font-size: 1rem;
        padding: 10px 20px;
    }
    .screen.active {
        padding: 8px;
    }
    .game-header h3 {
        font-size: 1.1rem;
    }
    .garden {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 12px;
        width: 320px;
        max-width: 95vw;
        margin: 0 auto;
        justify-items: center;
        align-items: center;
        background: #fff8f0;
        border-radius: 24px;
        box-shadow: 0 2px 8px var(--shadow);
        padding: 16px 0;
    }
    .garden-item {
        font-size: 2rem;
        min-width: 60px;
        min-height: 60px;
        background: #fff8f0;
        border-radius: 16px;
        box-shadow: 0 2px 8px var(--shadow);
        display: flex;
        justify-content: center;
        align-items: center;
        border: 2px solid var(--pink);
    }
    .token-display {
        margin-top: 20px;
        width: 320px;
        max-width: 95vw;
        display: flex;
        justify-content: center;
    }
    .collected-tokens {
        display: flex;
        gap: 12px;
        justify-content: center;
    }
    .token-slot {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
        background: #fff8f0;
        border-radius: 50%;
        border: 2px solid var(--pink);
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .game-header {
        width: 320px;
        max-width: 95vw;
        margin: 0 auto 16px auto;
        text-align: center;
    }
}