body {
    margin: 0;
    overflow: hidden;
    background-color: #000;
    font-family: 'Courier New', Courier, monospace;
}

canvas {
    display: block;
    transition: filter 0.3s ease-in-out;
}

.hidden {
    display: none !important;
}

#intro-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#intro-overlay h1 {
    font-size: 4em;
    text-align: center;
    animation: fadeInOut 3s ease-in-out forwards;
}

#loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    font-size: 2em;
}

.loading-spinner {
    border: 8px solid rgba(255,255,255,0.3);
    border-top: 8px solid white;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#character-select-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    color: #00ff00;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    font-family: 'VT323', 'Courier New', monospace;
    font-size: 1.5em;
}

.terminal {
    width: 80%;
    max-width: 800px;
    height: 80%;
    max-height: 600px;
    border: 2px solid #00ff00;
    padding: 20px;
    box-shadow: 0 0 20px #00ff00;
    overflow-y: auto;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 0, 0.1),
        rgba(0, 255, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
}

#role-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

#role-buttons button {
    font-family: inherit;
    font-size: 1em;
    padding: 10px 20px;
    background-color: #00ff00;
    color: black;
    border: none;
    cursor: pointer;
    text-align: left;
}

#role-buttons button:hover {
    background-color: #55ff55;
}

.terminal p {
    margin: 5px 0;
    text-shadow: 0 0 5px #00ff00;
}

.terminal button {
    font-family: inherit;
    font-size: 1.2em;
    padding: 10px 20px;
    margin-top: 20px;
    background-color: #00ff00;
    color: black;
    border: none;
    cursor: pointer;
}

.terminal button:disabled {
    background-color: #333;
    color: #555;
    cursor: not-allowed;
}

#start-prompt {
    margin-top: 40px;
    font-size: 1.2em;
    text-align: center;
}

.blink {
    animation: blink-animation 1s steps(2, start) infinite;
}

@keyframes blink-animation {
  to {
    visibility: hidden;
  }
}

.highlight {
    color: #ffff00;
    background-color: #003300;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

#main-menu, #pause-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10;
    color: white;
    text-shadow: 2px 2px 4px #000000;
}

#main-menu {
     background-image: url('/I SNUCK ONTO MISS CIRCLE\'S FIELD TRIP! (FUNDAMENTAL PAPER EDUCATION) 9-15 screenshot.png');
     background-size: cover;
     background-position: center;
}

#pause-menu {
    background-color: rgba(0, 0, 0, 0.5);
}

.menu-content {
    background-color: rgba(0,0,0,0.7);
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    border: 2px solid white;
}

.menu-content h1 {
    font-size: 3em;
    margin-bottom: 20px;
}

.menu-content button {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.5em;
    padding: 10px 20px;
    margin: 10px;
    background-color: #333;
    color: white;
    border: 2px solid white;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

.menu-content button:hover {
    background-color: white;
    color: black;
}

#interaction-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 4em;
    font-weight: bold;
    text-shadow: 3px 3px 6px black, 0 0 10px red;
    z-index: 20;
    pointer-events: none;
    text-align: center;
}

#kill-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 2em;
    font-weight: bold;
    text-shadow: 2px 2px 4px black, 0 0 5px red;
    z-index: 20;
    pointer-events: none;
}

#game-over-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10;
    color: white;
    text-shadow: 2px 2px 4px #000000;
    background-color: rgba(100, 0, 0, 0.7);
    text-align: center;
}

#game-over-overlay h1 {
    font-size: 4em;
    color: #ffcccc;
    text-shadow: 3px 3px 6px black, 0 0 10px red;
    margin-bottom: 20px;
}

#game-over-overlay p {
    font-size: 1.2em;
    max-width: 60%;
    margin-bottom: 30px;
}

#game-over-overlay button {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.5em;
    padding: 10px 20px;
    margin: 10px;
    background-color: #333;
    color: white;
    border: 2px solid white;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}

#game-over-overlay button:hover {
    background-color: white;
    color: black;
}

#the-end-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 100;
    color: white;
    background-color: black;
    opacity: 0;
    transition: opacity 3s ease-in-out;
}

#the-end-overlay h1 {
    font-size: 5em;
    font-weight: bold;
    text-shadow: 2px 2px 8px #fff;
}

#cutscene-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 50;
    text-align: center;
    transition: background-color 0.5s;
}

#test-paper {
    width: 200px;
    height: 300px;
    background-color: white;
    border: 1px solid #ccc;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 10em;
    color: red;
    font-family: 'Comic Sans MS', cursive, sans-serif;
    font-weight: bold;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.5);
    transform: rotate(-5deg);
}

#cutscene-subtitle {
    position: absolute;
    bottom: 10%;
    width: 80%;
    font-size: 2em;
    text-shadow: 2px 2px 4px black;
    z-index: 1; /* Ensure it's above other cutscene elements if needed */
}

#cutscene-continue-button {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.5em;
    padding: 10px 20px;
    margin-top: 50px; /* Position it below the subtitle */
    background-color: #333;
    color: white;
    border: 2px solid white;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    z-index: 2; /* Ensure it's on top */
}

#cutscene-continue-button:hover {
    background-color: white;
    color: black;
}

#player-hud {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

#allies-hud {
    color: #aaffaa;
    font-size: 1.5em;
    font-weight: bold;
    text-shadow: 2px 2px 4px black;
    margin-bottom: 10px;
}

#player-health {
    color: white;
    font-size: 2em;
    font-weight: bold;
    text-shadow: 2px 2px 4px black, 0 0 5px red;
}

#gun-overlay {
    height: 70vh;
    position: absolute;
    bottom: -10vh;
    left: calc(50vw - 35vh); /* Center it a bit better */
    z-index: 21;
    pointer-events: none;
    transform: translateX(10%); /* Shift slightly to the right */
    opacity: 0.9;
}

#claire-legs-overlay {
    height: 40vh; /* Adjust size as needed */
    width: auto;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%); /* Center horizontally */
    z-index: 21;
    pointer-events: none;
    opacity: 0.9;
}

#boss-hud {
    position: absolute;
    top: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    max-width: 800px;
    z-index: 20;
    color: white;
    text-align: center;
}

#boss-name {
    font-size: 1.5em;
    font-weight: bold;
    text-shadow: 2px 2px 4px black;
}

#boss-health-bar-container {
    width: 100%;
    height: 30px;
    background-color: rgba(0,0,0,0.5);
    border: 2px solid white;
    margin-top: 5px;
    padding: 3px;
}

#boss-health-bar {
    width: 100%;
    height: 100%;
    background-color: #c00;
    transition: width 0.2s ease-out;
}

#credits-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    overflow: hidden;
    text-align: center;
}

#credits-overlay h1 {
    font-size: 4em;
    margin-bottom: 30px;
    color: #fff;
    text-shadow: 0 0 10px #00ff00;
}

.credits-content {
    width: 80%;
    max-width: 800px;
    height: 70%;
    overflow: hidden;
    position: relative;
    padding: 20px;
}

.credits-scroll {
    position: absolute;
    width: 100%;
    top: 100%; /* Start off-screen at the bottom */
    left: 0;
    animation: creditsScroll 60s linear forwards; /* Adjust duration as needed */
}

.credits-scroll p {
    font-size: 1.5em;
    margin: 15px 0;
    line-height: 1.4;
}

.credits-scroll p strong {
    font-size: 1.2em;
    color: #00ff00;
}

@keyframes creditsScroll {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-100%); /* Move up until content is off-screen */
    }
}

#credits-main-menu-button {
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.5em;
    padding: 10px 20px;
    margin-top: 20px;
    background-color: #333;
    color: white;
    border: 2px solid white;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    z-index: 101; /* Ensure it's above credits scroll */
}

#credits-main-menu-button:hover {
    background-color: white;
    color: black;
}

#fade-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    opacity: 0;
    z-index: 99; /* Below intros/menus, but above game */
    transition: opacity 1s ease-in-out; /* Smooth transition */
    pointer-events: none; /* Allows clicks to pass through when not active */
}