:root {
    --dark-bg: #1a1a2e;
    --main-purple: #4a4a88;
    --bright-pink: #e94560;
    --off-white: #f5f5ff;
    --shadow-color: rgba(0, 0, 0, 0.4);
}

body {
    font-family: 'Press Start 2P', monospace;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    gap: 20px;
}

h1 {
    font-size: 4rem;
    text-shadow: 4px 4px 0 var(--main-purple);
    margin-bottom: 20px;
    text-transform: uppercase;
}

.title-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    position: relative;
}

#settingsBtn {
    background: var(--main-purple);
    border: 3px solid var(--off-white);
    border-radius: 10px;
    width: 60px;
    height: 60px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    box-shadow: 0 4px 0 #2a2a58;
    transition: all 0.2s ease;
}

#settingsBtn:active {
    transform: translateY(2px);
    box-shadow: 2px 2px 0 #2a2a58;
}

#settingsBtn img {
    width: 70%;
    height: 70%;
}

.game-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    width: 100%;
    max-width: 1600px;
    position: relative;
}

#gameCanvas {
    border: 5px solid var(--off-white);
    box-shadow: 0 10px 20px var(--shadow-color);
    border-radius: 12px;
    cursor: none;
}

#cutsceneVideo {
    border: 5px solid var(--off-white);
    box-shadow: 0 10px 20px var(--shadow-color);
    border-radius: 12px;
}

.controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 1200px;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.input-group label {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.input-group input {
    width: 100%;
    padding: 8px;
    font-family: inherit;
    border: 2px solid var(--off-white);
    border-radius: 8px;
    background-color: var(--dark-bg);
    color: var(--off-white);
}

button {
    padding: 18px 36px;
    font-family: inherit;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--dark-bg);
    background-color: var(--bright-pink);
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 0 #ab2a41;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

button:active {
    transform: translateY(2px);
    box-shadow: 2px 2px 0 #ab2a41;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 10px;
    margin-top: 10px;
    font-size: 1.5rem;
    position: relative;
}

#messageBox {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    color: var(--bright-pink);
    text-shadow: 2px 2px 0 var(--shadow-color);
    min-height: 4rem;
    text-align: center;
    background-color: rgba(26, 26, 46, 0.7);
    padding: 20px;
    border-radius: 12px;
    z-index: 10;
}

#endMessageBox {
    font-size: 2rem;
    color: var(--bright-pink);
    text-shadow: 2px 2px 0 var(--shadow-color);
    min-height: 4rem;
    text-align: center;
    background-color: rgba(26, 26, 46, 0.7);
    padding: 20px;
    border-radius: 12px;
}

#settingsModal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--dark-bg);
    border: 5px solid var(--off-white);
    border-radius: 12px;
    padding: 30px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
    box-shadow: 0 10px 30px var(--shadow-color);
}

#settingsModal h2 {
    font-size: 2rem;
    margin: 0;
    color: var(--off-white);
    text-shadow: 2px 2px 0 var(--main-purple);
}

#closeModalBtn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--off-white);
    cursor: pointer;
    padding: 5px;
    box-shadow: none;
}

#oneUpMessage {
    position: absolute;
    top: -30px;
    right: 0;
    color: #ffde54;
    font-size: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s ease-in, transform 1s ease-out;
}

#oneUpMessage.visible {
    opacity: 1;
    transform: translateY(-20px);
    animation: oneUpFade 1.5s forwards;
}

@keyframes oneUpFade {
    0% {
        opacity: 0;
        transform: translateY(0) scale(1);
    }

    20% {
        opacity: 1;
        transform: translateY(-20px) scale(1.2);
    }

    80% {
        opacity: 1;
        transform: translateY(-40px) scale(1.1);
    }

    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.8);
    }
}

.menu-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.menu-container h2 {
    font-size: 2.5rem;
    color: var(--off-white);
    text-shadow: 2px 2px 0 var(--main-purple);
}

.level-buttons {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 950px;
}

.main-menu-btn {
    width: 350px;
    height: 100px;
    position: relative;
}

.level-btn {
    width: 150px;
    height: 150px;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: relative;
}

.level-btn.locked,
.main-menu-btn.locked {
    background-color: var(--main-purple);
    cursor: not-allowed;
    opacity: 0.6;
}

.lock-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50%;
    height: 50%;
    pointer-events: none;
}

.main-menu-btn .lock-icon {
    width: 60px;
    height: 60px;
}

.hidden {
    display: none !important;
}

#loadingScreen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    max-width: 600px;
}

#progressBarContainer {
    width: 100%;
    height: 40px;
    border: 3px solid var(--off-white);
    border-radius: 10px;
    background-color: var(--main-purple);
}

#progressBar {
    width: 0%;
    height: 100%;
    background-color: var(--bright-pink);
    border-radius: 7px;
    transition: width 0.3s ease-in-out;
}

#loadingText {
    font-size: 1.5rem;
}