:root {
    --primary-orange: #ff6b35;
    --secondary-orange: #ff8c42;
    --dark-orange: #cc5500;
    --white: #ffffff;
    --black: #2b2b2b;
}


body {
    font-family: 'Rubik', sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, var(--primary-orange), var(--secondary-orange));
    min-height: 100vh;
    color: var(--white);
    text-align: center;
    overflow: hidden;
}


.screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
}


.button {
    background: var(--white);
    color: var(--primary-orange);
    border: 2px solid var(--white);
    padding: 1rem 2rem;
    font-size: 1.1rem;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s ease;
    margin: 0.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.button:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Form Styling */
.form-card {
    background: var(--primary-orange);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px;
    margin: 1rem auto;
    border: 2px solid var(--white);
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-label {
    display: block;
    color: var(--white);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.input-field {
    width: auto;
    padding: 1rem;
    border: 2px solid var(--white);
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    color: var(--black);
}

.input-field:focus {
    outline: none;
    border-color: var(--dark-orange);
    box-shadow: 0 0 8px rgba(255, 107, 53, 0.3);
}


.game-canvas {
    width: 90%;
    max-width: 800px;
    height: auto;
    aspect-ratio: 4/3;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    background: var(--white);
}


#score-box {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    padding: 1rem 2rem;
    border-radius: 50px;
    font-size: 1.2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    backdrop-filter: blur(5px);
}


#timer {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(0, 0, 0, 0.7);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-size: 1.2rem;
    font-weight: 600;
    backdrop-filter: blur(5px);
}


#level-up-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    color: var(--white);
    padding: 1.5rem 2.5rem;
    border-radius: 20px;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    z-index: 1000;
    display: none;
    backdrop-filter: blur(5px);
}


.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 107, 53, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background: var(--primary-orange);
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    color: var(--white);
}

.popup-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.popup-text {
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.final-score {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--white);
    margin-bottom: 1.5rem;
}

.popup-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.popup-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}


.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

.spinner {
    border: 8px solid rgba(255, 107, 53, 0.3);
    border-top: 8px solid var(--primary-orange);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.fade-in {
    animation: fadeIn 0.3s ease-in;
}

.fade-out {
    animation: fadeOut 0.3s ease-out;
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

.pop {
    animation: pop 0.2s ease-in-out;
}

.pulse {
    animation: pulse 1s infinite;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideIn {
    from { transform: translateY(-100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

#signature-paper {
    position: fixed; /* Changed from absolute to fixed */
    bottom: 20px; /* Adjusted position */
    right: 20px; /* Adjusted position */
    width: 200px;
    height: auto;
    background: white;
    background-image: url('/images/paper-texture.jpg'); /* Ensure the path is correct */
    background-size: cover;
    border: 1px solid #ccc;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    display: none; /* Initially hidden */
    padding: 20px;
    font-family: 'Dancing Script', cursive;
    font-size: 24px;
    text-align: center;
    z-index: 1001;
    overflow: hidden;
    border-radius: 10px; /* Optional: Add rounded corners */
}

#signature-text {
    display: inline-block;
    color: var(--black); /* Ensure the color is visible */
    position: relative;
    font-size: 24px; /* Adjust font size if needed */
    font-weight: bold; /* Optional: Make the text bold */
}


@media (max-width: 768px) {
    .game-title {
        font-size: 2.5rem;
    }

    .button {
        padding: 1.2rem 2.5rem;
        font-size: 1.2rem;
    }

    .form-card {
        padding: 1.5rem;
    }

    #score-box {
        font-size: 1.5rem;
        padding: 1rem 2rem;
    }

    #timer {
        font-size: 1.5rem;
        padding: 1rem 2rem;
    }

    #level-up-popup {
        font-size: 1.2rem;
        padding: 1rem 2rem;
    }
}

.sign-image {
    width: 300px; 
    height: auto; 
    border-radius: 15px; 
    margin: 1rem 0;
}
