body {
    background-color: #000;
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    overflow: hidden;
}

#spoiler-warning-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 200;
    text-align: center;
    padding: 40px;
    box-sizing: border-box;
}

#spoiler-warning-screen h1 {
    color: yellow;
    margin-bottom: 20px;
}

#spoiler-warning-screen p {
    max-width: 600px;
    line-height: 1.5;
}

.spoiler-buttons {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.spoiler-buttons button {
    padding: 10px 20px;
    font-size: 1.1em;
    cursor: pointer;
    background-color: #333;
    color: #fff;
    border: 2px solid #fff;
    transition: background-color 0.2s;
}

.spoiler-buttons button:hover:not(:disabled) {
    background-color: #555;
}

.spoiler-buttons button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#game-container {
    position: relative;
    width: 680px;
    height: 480px;
}

#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 100;
    text-align: center;
    border: 2px solid #fff;
    box-sizing: border-box;
}

#start-button {
    padding: 10px 20px;
    font-size: 1.2em;
    cursor: pointer;
    background-color: #fff;
    color: #000;
    border: 2px solid #fff;
    margin-top: 20px;
    margin-bottom: 10px;
}

#start-button:hover {
    background-color: #fff;
    color: #000;
}

#encyclopedia-button {
    padding: 10px 20px;
    font-size: 1.2em;
    cursor: pointer;
    background-color: #333;
    color: #fff;
    border: 2px solid #fff;
    margin-top: 10px;
}

#encyclopedia-button:hover {
    background-color: #555;
    color: #fff;
}

#shop-button {
    padding: 10px 20px;
    font-size: 1.2em;
    cursor: pointer;
    background-color: #333;
    color: #fff;
    border: 2px solid #fff;
}

#shop-button:hover {
    background-color: #555;
    color: #fff;
}

.nohit-container {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    align-items: center;
}

.nohit-container label {
    margin-left: 5px;
    cursor: pointer;
}

#game-area {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 600px;
    height: 300px;
    border: 2px solid #fff;
    box-sizing: border-box;
    overflow: hidden;
}

#boss {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 64px;
    background-image: url('/toby-fox.gif');
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0;
}

#player {
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: red;
    transform: rotate(-45deg);
    opacity: 0;
    filter: brightness(1);
}

#player::before,
#player::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: red;
}

#player::before {
    top: -10px;
    left: 0;
}

#player::after {
    top: 0;
    left: 10px;
}

#ui-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 140px;
    display: flex;
    box-sizing: border-box;
    border: 2px solid #fff;
    border-top: none;
}

#sp-container {
    position: absolute;
    right: 20px;
    top: 20px;
    width: 20px;
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sp-label {
    font-size: 1.5em;
    font-weight: bold;
    color: cyan;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    margin-bottom: 10px;
}

#sp-bar-container {
    width: 100%;
    flex-grow: 1;
    border: 2px solid cyan;
    display: flex;
    flex-direction: column-reverse;
}

#sp-bar {
    width: 100%;
    height: 0%;
    background-color: cyan;
    transition: height 0.2s ease-out;
}

#hp-container {
    display: flex;
    align-items: center;
    padding: 20px;
    font-size: 1.5em;
    font-weight: bold;
}

.hp-label {
    margin-right: 10px;
    color: yellow;
}

#hp-bar-container {
    width: 150px;
    height: 20px;
    background-color: red;
    margin-right: 10px;
}

#hp-bar {
    width: 100%;
    height: 100%;
    background-color: yellow;
    transition: width 0.2s ease-out;
}

#dialogue-box {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    height: 100px;
    border: 2px solid #fff;
    padding: 10px;
    box-sizing: border-box;
    background: #000;
    display: none;
    z-index: 50;
}

#dialogue-text {
    margin: 0;
    font-size: 1.5em;
    line-height: 1.2;
    white-space: pre-wrap;
}

#dialogue-prompt {
    position: absolute;
    bottom: 10px;
    right: 15px;
    animation: blink 1s steps(1) infinite;
    display: none;
}

@keyframes blink {
    50% { opacity: 0; }
}

#player-shield {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 3px solid cyan;
    border-radius: 50%;
    top: -15px;
    left: -15px;
    opacity: 0.7;
    box-shadow: 0 0 10px cyan;
    display: none;
    pointer-events: none;
    transform: scale(0);
}

.snow-projectile {
    position: absolute;
    width: 6px;
    height: 6px;
    background-color: white;
    box-shadow: 0 0 3px white;
    z-index: 5;
}

.toby-projectile {
    position: absolute;
    width: 32px;
    height: 32px;
    background-image: url('/toby-fox.gif');
    background-size: contain;
    border-radius: 50%;
    z-index: 5;
}

.sp-pickup {
    position: absolute;
    width: 15px;
    height: 15px;
    background-color: cyan;
    border-radius: 50%;
    z-index: 5;
    opacity: 0;
}

.starwalker-projectile {
    position: absolute;
    width: 24px;
    height: 24px;
    background-image: url('/Starwalker_overworld.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
    z-index: 5;
}

.dog-shield-dog {
    position: absolute;
    width: 32px;
    height: 32px;
    background-image: url('/toby-fox.gif');
    background-size: contain;
    z-index: 6;
}

.laser {
    position: absolute;
    left: 50%;
    top: 0;
    width: 5px;
    height: 100%;
    background-color: red;
    box-shadow: 0 0 10px red, 0 0 20px red;
    transform-origin: center center;
    transform: translateX(-50%);
    z-index: 7;
}

.starwalker {
    position: absolute;
    width: 128px;
    height: 128px;
    background-image: url('/Starwalker_overworld.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 10;
    image-rendering: pixelated;
}

#starwalker-dialogue {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    border: 2px solid #fff;
    padding: 20px;
    background: #000;
    text-align: center;
    font-size: 1.2em;
    z-index: 20;
    display: none;
    opacity: 0;
}

#player.unshielded,
#player.unshielded::before,
#player.unshielded::after {
    background-color: #9e2a2b; /* Darker red to indicate debuff */
}

.gerson {
    position: absolute;
    width: 96px;
    height: 96px;
    background-image: url('/Hammer_of_Justice_battle_idle.gif');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
    z-index: 10;
}

.healing-projectile {
    position: absolute;
    width: 12px;
    height: 12px;
    background-color: #0f0;
    border-radius: 50%;
    box-shadow: 0 0 5px #0f0;
    z-index: 5;
}

#encyclopedia-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

#encyclopedia-content {
    position: relative;
    width: 80%;
    max-width: 800px;
    height: 80%;
    max-height: 600px;
    background-color: #000;
    border: 2px solid #fff;
    padding: 40px;
    box-sizing: border-box;
    overflow-y: auto;
    font-size: 1.1em;
    line-height: 1.6;
}

#encyclopedia-content h1 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 30px;
    color: yellow;
}

#encyclopedia-content h2 {
    color: cyan;
    margin-top: 20px;
    border-bottom: 1px solid cyan;
    padding-bottom: 5px;
}

#encyclopedia-content p {
    margin-bottom: 15px;
}

#encyclopedia-content strong {
    color: #ff8c00; /* darkorange */
}

#encyclopedia-close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-color: #fff;
    color: #000;
    border: 2px solid #000;
    border-radius: 50%;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
}

#encyclopedia-close-button:hover {
    background-color: #ccc;
}

#encyclopedia-debug-section h2 {
    color: #ff00ff; /* Magenta */
    border-bottom-color: #ff00ff;
}

.secret-button {
    position: absolute;
    width: 50px;
    height: 50px;
    z-index: 150;
    cursor: pointer;
}

#secret-button-tr {
    /* Covers the top right of game-area */
    top: 20px;
    right: 42px; /* 20px game-area padding + 20px sp-container width + 2px border */
}

#secret-button-bl {
    /* Covers the bottom left of game-area */
    bottom: 142px; /* 140px UI height + 2px border */
    left: 20px;
}

#secret-button-br {
    /* Covers the bottom right of game-area */
    bottom: 142px; /* 140px UI height + 2px border */
    right: 42px;
}

#debug-toggle-button {
    position: absolute;
    top: 25px;
    right: 50px;
    width: 40px;
    height: 40px;
    font-size: 24px;
    background-color: #333;
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    z-index: 150;
}

#debug-toggle-button:hover {
    background-color: #555;
}

#debug-menu {
    position: absolute;
    top: 70px;
    right: 50px;
    width: 300px;
    background-color: rgba(10, 10, 10, 0.9);
    border: 2px solid #ff00ff;
    padding: 15px;
    z-index: 149;
    color: #fff;
    font-family: 'Courier New', Courier, monospace;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#debug-menu h3 {
    margin: 0;
    text-align: center;
    color: #ff00ff;
    border-bottom: 1px solid #ff00ff;
    padding-bottom: 5px;
}

.debug-control {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.debug-control label {
    font-weight: bold;
}

.debug-control select,
.debug-control input[type="number"],
.debug-control button {
    background-color: #222;
    color: #fff;
    border: 1px solid #fff;
    padding: 5px;
    font-family: inherit;
}

.debug-control button {
    cursor: pointer;
}

.debug-control button:hover {
    background-color: #444;
}

.debug-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
}