html {
    width: 100%;
    height: 100%;
}

@font-face {
    font-family: 'Half Bold Pixel';
    src: url('assets/Half_Bold_Pixel-7.ttf') format('truetype');
    font-display: swap;
}

body {
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #333;
}

#intro-container {
    position: relative;
    width: min(100vw, 200vh);
    aspect-ratio: 2 / 1;
    max-height: 100vh;
    overflow: hidden;
    flex: 0 0 auto;
    background: url('assets/intro.png') no-repeat center center;
    background-size: cover;
}

#intro-container img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.intro-copy {
    position: absolute;
    left: 50%;
    width: 90%;
    color: #fff;
    font-family: 'Half Bold Pixel', monospace;
    line-height: 1.2;
    text-align: center;
    pointer-events: none;
    transform: translateX(-50%);
    text-shadow: 3px 3px 0 #000;
}

.intro-copy-top {
    top: 8%;
}

.intro-headline {
    margin-bottom: 0.6em;
    font-size: clamp(32px, 4.5vw, 72px);
}

.intro-subline {
    font-size: clamp(14px, 1.65vw, 28px);
}

.intro-copy-middle {
    top: 50%;
    font-size: clamp(18px, 2vw, 34px);
    transform: translate(-50%, -50%);
}

#game-wrapper {
    position: relative;
    width: 1440px;
    height: 720px;
    flex: 0 0 auto;
}

#game-container {
    position: relative;
    width: 1440px;
    height: 720px;
    flex: 0 0 auto;
    background: url('assets/background.png') no-repeat center center;
    background-size: cover;
    overflow: hidden;
    border: 2px solid #fff;
    transform-origin: top left;
}

#player {
    position: absolute;
    width: 36px;
    height: 36px;
    background: url('assets/player.png') no-repeat center center;
    background-size: cover;
    z-index: 5;
    display: none; /* Hide the player initially */
}

.superpower-animation {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 90%;
    height: 90%;
    z-index: 6;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.superpower-halftone {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    image-rendering: pixelated;
    transform-origin: center;
}

.superpower-picture {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 50%;
    height: 50%;
    object-fit: contain;
    pointer-events: none;
    image-rendering: pixelated;
    transform: translate(-50%, -50%);
}

.superpower-name {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 12.5%;
    color: #fff;
    font-family: 'Half Bold Pixel', monospace;
    font-size: 40px;
    line-height: 1.2;
    text-align: center;
    text-shadow: 3px 3px 0 #000;
}

.background-tile {
    position: absolute;
    background-size: cover;
    z-index: 1;
    pointer-events: none;
}

.platform {
    position: absolute;
    background-size: cover;
    z-index: 2;
}

#start-screen, #end-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #00f; /* Blue color */
    font-size: 48px; /* Larger text size */
    z-index: 10; /* Ensure buttons are above the game */
}

#start-screen {
    top: auto;
    bottom: 16.6667%;
    width: 100%;
    transform: translateX(-50%);
}

#end-screen h1,
#restart-button {
    color: #fff;
    font-family: 'Half Bold Pixel', monospace;
    font-size: 40px;
    line-height: 1;
    -webkit-text-stroke: 3px #000;
    paint-order: stroke fill;
    text-shadow:
        -3px -3px 0 #000,
         3px -3px 0 #000,
        -3px  3px 0 #000,
         3px  3px 0 #000;
}

#end-screen h1 {
    margin: 0 0 24px;
    background: transparent;
    transform-origin: center;
    animation: death-text-pulse 0.6s ease-in-out infinite alternate;
}

#restart-button {
    background: transparent;
}

@keyframes death-text-pulse {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.5);
    }
}

.hidden {
    display: none !important;
}

.spike {
    position: absolute; /* Ensure spikes are positioned absolutely */
    background-size: cover;
    z-index: 3;
}

.spike-warning {
    position: absolute;
    z-index: 4;
    pointer-events: none;
}

button {
    font-size: 36px; /* Larger button text size */
    padding: 10px 20px;
    color: #00f; /* Blue color */
    background-color: #fff;
    border: none;
    cursor: pointer;
    z-index: 11; /* Ensure buttons are above the game */
}

h1 {
    background-color: #fff;
}

.coin {
    position: absolute;
    background-size: cover;
    z-index: 21;
}

#coin-counter {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 20;
    pointer-events: none;
}

.coin-counter-icon,
.coin-counter-digit {
    flex: 0 0 auto;
}

.coin-counter-digits {
    display: flex;
    gap: 2px;
}

#start-button {
    position: static;
    font-family: 'Half Bold Pixel', monospace;
    font-size: 48px;
    background: transparent;
    color: #fff;
    padding: 10px 20px;
    border: none;
    cursor: pointer;
}

.falling-spike {
    transform: rotate(180deg);
}

#ending-container {
    position: absolute;
    inset: 0;
    z-index: 100;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    overflow: hidden;
    background: #000;
    color: #fff;
    font-family: 'Half Bold Pixel', monospace;
    font-size: 40px;
    line-height: 1.35;
    text-align: center;
    white-space: pre-wrap;
}
