@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

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

body {
    font-family: 'Outfit', sans-serif;
    background: radial-gradient(circle at top right, #581c87, #2e1065);
    color: #f3e8ff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    overflow: hidden;
}

h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #e879f9, #c084fc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    font-weight: 300;
}

#game {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

img#sign {
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
}

img#sign:hover {
    transform: scale(1.02);
}

#timer {
    font-size: 2rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #e879f9;
}

button {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    color: white;
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    text-transform: uppercase;
    letter-spacing: 1px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.6);
}

input[type="text"] {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 1.5rem;
    font-size: 1.2rem;
    border-radius: 12px;
    color: white;
    outline: none;
    transition: all 0.3s ease;
    width: 300px;
    text-align: center;
}

input[type="text"]:focus {
    border-color: #e879f9;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 4px rgba(232, 121, 249, 0.2);
}

input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

button.grey {
    background: linear-gradient(135deg, #94a3b8, #475569);
    box-shadow: 0 4px 15px rgba(71, 85, 105, 0.4);
}

button.grey:hover {
    box-shadow: 0 6px 20px rgba(71, 85, 105, 0.6);
}

button.yellow {
    background: linear-gradient(135deg, #facc15, #ca8a04);
    box-shadow: 0 4px 15px rgba(202, 138, 4, 0.4);
    color: #422006;
    /* Darker text for contrast on yellow */
}

button.yellow:hover {
    box-shadow: 0 6px 20px rgba(202, 138, 4, 0.6);
}

button.green {
    background: linear-gradient(135deg, #22c55e, #15803d);
    box-shadow: 0 4px 15px rgba(22, 163, 74, 0.4);
}

button.green:hover {
    box-shadow: 0 6px 20px rgba(22, 163, 74, 0.6);
}

/* Flash Animations */
@keyframes flashGreen {
    0% {
        background: rgba(34, 197, 94, 0.5);
    }

    100% {
        background: rgba(255, 255, 255, 0.05);
    }
}

@keyframes flashRed {
    0% {
        background: rgba(239, 68, 68, 0.5);
    }

    100% {
        background: rgba(255, 255, 255, 0.05);
    }
}

#game.correct {
    animation: flashGreen 0.5s ease-out;
    border-color: #22c55e;
}

#game.incorrect {
    animation: flashRed 0.5s ease-out;
    border-color: #ef4444;
}

/* Modal form button reset to look like close icon */
form[method="dialog"] button.close-btn {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    color: #94a3b8;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 30px;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
}

form[method="dialog"] button.close-btn:hover {
    transform: none;
    color: #e879f9;
}

/* Dialog Styles */
dialog {
    border: none;
    padding: 0;
    background: transparent;
    margin: auto;
    max-width: 500px;
    width: 90%;
    overflow: visible;
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease-out;
}

/* The content wrapper styles, moved from .modal-content */
dialog {
    background: linear-gradient(135deg, #2e1065, #1e053d);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    text-align: left;
    color: #f3e8ff;

    /* Animation for the dialog itself */
    animation: scaleIn 0.3s ease-out forwards;
}

dialog h2 {
    color: #e879f9;
    margin-bottom: 1rem;
    font-size: 2rem;
}

dialog p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #f3e8ff;
}

dialog a {
    color: #e879f9;
    text-decoration: none;
}

dialog a:hover {
    text-decoration: underline;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}