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

html, body {
    overflow: hidden;
    background: #2d5a4a;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100%;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
}

#game-container {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Password Screen */
#password-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3c52 0%, #2d5a4a 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 150;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#password-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

#password-screen h1 {
    font-size: 4rem;
    margin-bottom: 1rem;
}

#password-screen p {
    color: #e87a90;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
}

#password-input {
    padding: 1rem 1.5rem;
    font-size: 1.2rem;
    text-align: center;
    border: 3px solid #e87a90;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    outline: none;
    width: 200px;
    letter-spacing: 0.3rem;
    margin-bottom: 1.5rem;
}

#password-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 0.3rem;
}

#password-btn {
    padding: 0.8rem 2.5rem;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #e87a90 0%, #c77daa 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(232, 122, 144, 0.4);
}

#password-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(232, 122, 144, 0.6);
}

#password-error {
    color: #ff6b6b;
    font-size: 1rem;
    margin-top: 1rem;
}

#password-error.hidden {
    display: none;
}

/* Start Screen */
#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3c52 0%, #2d5a4a 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#start-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

#start-screen h1 {
    color: #e87a90;
    font-size: 3rem;
    margin-bottom: 3rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    text-align: center;
    padding: 0 1.5rem;
}

#start-screen p {
    color: #a8d4e6;
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

#start-btn {
    padding: 1rem 3rem;
    font-size: 1.3rem;
    background: linear-gradient(135deg, #e87a90 0%, #c77daa 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(232, 122, 144, 0.4);
}

#start-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(232, 122, 144, 0.6);
}

.controls-hint {
    margin-top: 2rem;
    color: #7ab8a8;
    font-size: 0.9rem;
    text-align: center;
    line-height: 1.6;
}

/* UI Overlay */
#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.5s ease;
}

#ui-overlay.visible {
    opacity: 1;
}

#progress-container {
    background: rgba(30, 60, 82, 0.9);
    padding: 0.8rem 1.2rem;
    border-radius: 15px;
    pointer-events: auto;
}

#progress-text {
    color: #8ed6b5;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 0.5rem;
}

#progress-bar {
    width: 200px;
    height: 8px;
    background: #1a2a3a;
    border-radius: 4px;
    overflow: hidden;
}

#progress-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #4a9b7f, #3d8b9c);
    border-radius: 4px;
    transition: width 0.3s ease;
}

#music-toggle {
    background: rgba(30, 60, 82, 0.9);
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 0.5rem 0.8rem;
    border-radius: 10px;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.2s ease;
}

#music-toggle:hover {
    background: rgba(40, 80, 102, 0.9);
}

#music-toggle.muted {
    opacity: 0.5;
}

/* Final reveal animation */
.revealing {
    animation: pulse 2s ease-in-out;
}

@keyframes pulse {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

/* Joystick - only visible on touch devices */
#joystick-container {
    display: none;
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    touch-action: none;
}

#joystick-base {
    width: 120px;
    height: 120px;
    background: rgba(142, 214, 181, 0.3);
    border: 3px solid rgba(142, 214, 181, 0.6);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

#joystick-thumb {
    width: 50px;
    height: 50px;
    background: rgba(142, 214, 181, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    position: absolute;
    transition: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Show joystick on touch devices */
@media (hover: none) and (pointer: coarse) {
    #joystick-container {
        display: block;
    }

    #joystick-container.hidden {
        display: none !important;
    }

    .controls-hint {
        display: none;
    }
}

/* Picture Modal */
#picture-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

#picture-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

#picture-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(80, 20, 40, 0.85);
}

#picture-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: modalAppear 0.3s ease;
}

@keyframes modalAppear {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

#picture-modal-image {
    max-width: 85vw;
    max-height: 70vh;
    border-radius: 12px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

#picture-modal-hint {
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1rem;
    animation: pulse-hint 2s ease-in-out infinite;
}

@keyframes pulse-hint {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
