:root {
    --primary-color: #ffde00;
    --secondary-color: #3b4cca;
    --dark-color: #2a2a2a;
    --light-color: #ffffff;
    --font-family: 'Press Start 2P', cursive;
}

body {
    background-color: var(--dark-color);
    color: var(--light-color);
    font-family: var(--font-family);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
}

#game-nav {
    position: static;
    margin: 20px;
    z-index: 1000;
}

.nav-link {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--secondary-color), #5a6fd8);
    color: var(--light-color);
    text-decoration: none;
    border-radius: 25px;
    font-size: 12px;
    font-family: var(--font-family);
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    opacity: 0.3;
}

.nav-link:hover {
    background: linear-gradient(135deg, #5a6fd8, var(--secondary-color));
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    opacity: 1;
}

#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background-color: #4a4a4a;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    border: 5px solid var(--secondary-color);
}

h1 {
    color: var(--primary-color);
    text-shadow: 3px 3px 0 var(--secondary-color);
    margin-bottom: 0;
}

#viewport-container {
    position: relative;
    width: 640px;
    height: 480px;
    border: 10px solid #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.7);
}

#viewport {
    width: 100%;
    height: 100%;
    background: url('./assets/background.png') no-repeat center center/cover;
    position: relative;
}

#flash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: white;
    opacity: 0;
    z-index: 100;
    pointer-events: none;
}

#flash-overlay.flash {
    animation: flash-animation 0.3s ease-out;
}

@keyframes flash-animation {
    from { opacity: 0.8; }
    to { opacity: 0; }
}


.pokemon {
    position: absolute;
    width: 120px;
    height: 120px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.2s ease-in-out, opacity 0.3s ease;
    will-change: transform;
}

#ui-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background-color: var(--secondary-color);
    padding: 15px;
    border-radius: 10px;
    border: 3px solid #1a1a1a;
}

#objective-container, #score-container {
    text-align: center;
    flex: 1;
}

h2 {
    font-size: 0.8rem;
    margin: 0 0 5px 0;
}
p {
    font-size: 0.7rem;
    margin: 0;
}

#camera-button, #next-level-button, #close-photo-button {
    font-family: var(--font-family);
    background-color: var(--primary-color);
    color: var(--secondary-color);
    border: 3px solid var(--secondary-color);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 10px 15px;
}
#camera-button {
    padding: 12px;
    border-radius: 50%;
}

#camera-button:hover, #next-level-button:hover, #close-photo-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

#camera-button:active, #next-level-button:active, #close-photo-button:active {
    transform: translateY(1px);
}

#next-level-button, #close-photo-button {
    font-size: 0.8rem;
}

#photo-result-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
    gap: 20px;
}

.photo-frame {
    padding: 15px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

#photo-img {
    width: 480px;
    height: 360px;
    object-fit: cover;
    border: 5px solid #333;
}

#photo-feedback {
    font-size: 1.5rem;
    padding: 10px 20px;
    border-radius: 10px;
}

#photo-feedback.success {
    color: #a8ff78;
    background-color: #0c4b00;
}

#photo-feedback.failure {
    color: #ff7878;
    background-color: #6d0000;
}

.hidden {
    display: none !important;
}

/* Loading Screen Styles */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--dark-color) 0%, #1a1a2e 50%, var(--secondary-color) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

#loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

#loading-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    animation: fadeInUp 1s ease-out;
}

#studio-logo {
    width: 360px;
    height: 360px;
    object-fit: contain;
    animation: logoFloat 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 222, 0, 0.3));
}

#loading-spinner {
    display: flex;
    gap: 8px;
}

.spinner-dot {
    width: 8px;
    height: 8px;
    background-color: var(--secondary-color);
    border-radius: 50%;
    animation: spinnerBounce 1.4s ease-in-out infinite both;
}

.spinner-dot:nth-child(1) { animation-delay: -0.32s; }
.spinner-dot:nth-child(2) { animation-delay: -0.16s; }
.spinner-dot:nth-child(3) { animation-delay: 0s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}


@keyframes spinnerBounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    body {
        padding: 10px;
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    #game-container {
        width: 100%;
        max-width: 100vw;
        padding: 15px;
        gap: 15px;
        box-sizing: border-box;
    }

    h1 {
        font-size: 1.2rem;
        text-align: center;
    }

    #viewport-container {
        width: 100%;
        max-width: 90vw;
        height: auto;
        aspect-ratio: 4/3;
        border-width: 5px;
    }

    #viewport {
        width: 100%;
        height: 100%;
    }

    #ui-container {
        flex-direction: column;
        gap: 15px;
        padding: 12px;
    }

    #objective-container, #score-container {
        text-align: center;
        flex: none;
    }

    h2 {
        font-size: 0.7rem;
    }

    p {
        font-size: 0.6rem;
    }

    #camera-button {
        padding: 15px;
        width: 60px;
        height: 60px;
        align-self: center;
    }

    #camera-button svg {
        width: 30px;
        height: 30px;
    }

    #next-level-button, #close-photo-button {
        font-size: 0.7rem;
        padding: 12px 20px;
        align-self: center;
    }

    /* Loading Screen Mobile */
    #studio-logo {
        width: 200px;
        height: 200px;
        max-width: 60vw;
        max-height: 60vw;
    }

    #loading-content {
        gap: 20px;
        padding: 20px;
    }

    /* Photo Result Mobile */
    #photo-result-container {
        padding: 20px;
        box-sizing: border-box;
    }

    .photo-frame {
        padding: 10px;
        max-width: 90vw;
        box-sizing: border-box;
    }

    #photo-img {
        width: 100%;
        height: auto;
        max-width: 100%;
        aspect-ratio: 4/3;
        object-fit: cover;
    }

    #photo-feedback {
        font-size: 1rem;
        padding: 8px 15px;
        text-align: center;
    }

    .pokemon {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 480px) {
    #game-container {
        padding: 10px;
        gap: 10px;
    }

    h1 {
        font-size: 1rem;
    }

    #viewport-container {
        border-width: 3px;
    }

    h2 {
        font-size: 0.6rem;
    }

    p {
        font-size: 0.5rem;
    }

    #studio-logo {
        width: 150px;
        height: 150px;
    }

    #photo-feedback {
        font-size: 0.9rem;
    }

    .pokemon {
        width: 60px;
        height: 60px;
    }
}

