body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.game-container {
    position: relative;
    width: 720px;
    height: 480px;
}

canvas {
    background-color: black;
    display: block;
    width: 100%;
    height: 100%;
}

.legal-link {
    margin-top: 16px;
    color: #ffd43b;
    font-family: Arial, sans-serif;
    text-decoration: none;
    text-shadow: 1px 1px 0 #160600;
}

.legal-link:hover {
    text-decoration: underline;
}

.fullscreen-button {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 20;
    width: 42px;
    height: 42px;
    border: 2px solid #ffd43b;
    border-radius: 8px;
    background: rgba(42, 11, 0, 0.78);
    color: #ffd43b;
    cursor: pointer;
    font-size: 26px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-shadow: 1px 1px 0 #160600;
}

.fullscreen-button:hover {
    background: rgba(122, 27, 0, 0.9);
}

.mute-button {
    position: absolute;
    top: 12px;
    right: 64px;
    z-index: 20;
    width: 42px;
    height: 42px;
    border: 2px solid #ffd43b;
    border-radius: 8px;
    background: rgba(42, 11, 0, 0.78);
    color: #ffd43b;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    text-shadow: 1px 1px 0 #160600;
}

.mute-button:hover {
    background: rgba(122, 27, 0, 0.9);
}

.home-button {
    position: absolute;
    left: 24px;
    bottom: 24px;
    z-index: 30;
    width: 76px;
    height: 60px;
    border: 3px solid #ffd43b;
    border-radius: 8px;
    background: rgba(42, 11, 0, 0.88);
    cursor: pointer;
    padding: 4px;
}

.home-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.home-button:hover {
    background: rgba(122, 27, 0, 0.92);
}

.touch-controls {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 18px;
    z-index: 25;
    display: none;
    justify-content: space-between;
    pointer-events: none;
}

.touch-controls-left,
.touch-controls-right {
    display: flex;
    gap: 14px;
    pointer-events: auto;
}

.touch-button {
    width: 58px;
    height: 58px;
    border: 2px solid #ffd43b;
    border-radius: 8px;
    background: rgba(42, 11, 0, 0.72);
    padding: 6px;
    cursor: pointer;
    touch-action: none;
    user-select: none;
}

.touch-button img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    pointer-events: none;
}

.touch-button:active {
    background: rgba(122, 27, 0, 0.92);
}

.rotate-device-message {
    display: none;
    color: #ffd43b;
    font-family: 'Rye', serif;
    font-size: 28px;
    text-align: center;
    padding: 24px;
    text-shadow: 2px 2px 0 #160600;
}

.game-container:fullscreen {
    width: 100vw;
    height: 100vh;
    background: black;
}

.game-container:fullscreen canvas,
.game-container:fullscreen .start-screen,
.game-container:fullscreen .end-screen {
    width: min(100vw, 150vh);
    height: min(100vh, 66.67vw);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.game-container:fullscreen .fullscreen-button {
    top: 20px;
    right: 20px;
}

.game-container:fullscreen .mute-button {
    top: 20px;
    right: 72px;
}

.start-screen {
    position: absolute;
    inset: 0;
    cursor: pointer;
}

.start-screen img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.start-hint {
    position: absolute;
    right: 24px;
    bottom: 34px;
    max-width: calc(100% - 320px);
    padding: 10px 18px;
    border: 2px solid #ffd43b;
    border-radius: 8px;
    background: rgba(42, 11, 0, 0.82);
    color: #ffd43b;
    font-family: 'Rye', serif;
    font-size: 18px;
    text-align: center;
    text-shadow: 1px 1px 0 #160600;
}

.controls-overview {
    position: absolute;
    left: 24px;
    bottom: 24px;
    display: grid;
    gap: 6px;
    padding: 12px;
    background: rgba(42, 11, 0, 0.78);
    border: 2px solid #ffd43b;
    border-radius: 8px;
    color: #fff4b8;
    font-family: Arial, sans-serif;
    font-size: 14px;
    text-shadow: 1px 1px 0 #160600;
}

.controls-overview div {
    display: grid;
    grid-template-columns: 72px 1fr;
    align-items: center;
    gap: 10px;
}

.controls-overview span:first-child {
    min-width: 48px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 212, 59, 0.16);
    color: #ffd43b;
    text-align: center;
    font-weight: 700;
}

.end-screen {
    position: absolute;
    inset: 0;
    z-index: 10;
}

.end-screen img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.end-hint {
    position: absolute;
    right: 24px;
    bottom: 34px;
    padding: 10px 18px;
    border: 2px solid #ffd43b;
    border-radius: 8px;
    background: rgba(42, 11, 0, 0.82);
    color: #ffd43b;
    font-family: 'Rye', serif;
    font-size: 18px;
    text-align: center;
    text-shadow: 1px 1px 0 #160600;
}

.d-none {
    display: none;
}

h1 {
    font-family: 'Rye', serif;
    font-size: clamp(1.8rem, 4vw, 3.8rem);
    font-weight: 400;
    color: #ffd43b;
    letter-spacing: 0.05em;
    text-transform: uppercase;

    -webkit-text-stroke: 1.5px #2a0b00;

    text-shadow:
        2px 2px 0 #7a1b00,
        4px 4px 0 #421b02,
        6px 6px 0 #160600,
        0 0 8px #ff7a00,
        0 0 16px #ff3c00,
        0 0 26px rgba(255, 80, 0, 0.75);

    filter: drop-shadow(0 0 6px rgba(255, 80, 0, 0.65));

    transform: skew(-2deg) rotate(-1deg);
}

html {
    min-height: 100%;
    background-image: url('./assets/5_background/screen_bg.png');
    background-repeat: no-repeat;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
}
