@font-face {
    font-family: 'Risque';
    src: url('./assets/fonts/Risque-Regular.ttf') format('truetype');
}

* {
    font-family: 'Risque', 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode';
    letter-spacing: 2px;
    box-sizing: border-box;
    scroll-behavior: smooth;
    color: whitesmoke;
    text-shadow: rgba(0, 0, 0, 0.822) 2px 2px 4px;
}

a {
    text-decoration: none;
}

h1 {
    text-decoration: underline;
    font-size: 40px;
}

html,
body {
    overflow: hidden;
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-image: url('./assets/img/Background/html_background.jpg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

canvas {
    border: 2px solid black;
    display: block;
    image-rendering: pixelated;
    width: 100%;
    height: auto;
    max-height: 100vh;
}

button {
    padding: 10px 20px;
    font-size: 20px;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    background-color: #4CAF50;
    transition: 0.2s;
}

button:hover {
    background-color: #45a049;
}

.game-container {
    position: relative;
    width: 100%;
    max-width: 720px;
    aspect-ratio: 3 / 2;
    margin: 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    background-color: rgba(79, 116, 160, 0.842);
}

.overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.overlay-content {
    text-align: center;
    padding: 10px;
}

.overlay img {
    width: 200px;
    margin-bottom: 20px;
}

.controls {
    margin-top: 10px;
    padding: 10px;
    width: 720px;
    font-weight: 600;
    font-size: 20px;
    border: 2px solid black;
    background-color: rgba(79, 115, 160, 0.911);
}

.controls h3 {
    margin: 0 0 5px 0;
    font-size: 22px;
    text-decoration: underline;
}

.controls ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.controls li {
    margin: 3px 0;
}

.mobile-controls {
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 100%;
    height: 35%;
    display: none;
    justify-content: space-between;
    align-items: flex-end;
    padding: 10px;
    pointer-events: none;
}

.control-btn {
    background: rgba(0, 0, 0, 0.4);
    color: white;
    font-size: 18px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
    user-select: none;
    touch-action: manipulation;
    border: 2px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(4px);
}

.control-btn:active {
    background: rgba(255, 255, 255, 0.2);
}

.mute-button {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 9999;
    padding: 10px 15px;
    font-size: 18px;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 0 10px black;
    transition: background 0.2s;
}

.mute-button:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.impressum-link {
    position: fixed;
    bottom: 10px;
    right: 15px;
    font-size: 16px;
    color: whitesmoke;
    background: rgba(0, 0, 0, 0.5);
    padding: 6px 10px;
    border-radius: 8px;
    z-index: 9999;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    transition: background 0.2s;
}

.impressum-link:hover {
    background: rgba(255, 255, 255, 0.2);
}

.impressum-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.impressum-overlay.hidden {
    display: none;
}

.impressum-content {
    background: rgba(79, 115, 160, 0.95);
    border: 2px solid black;
    border-radius: 12px;
    padding: 20px;
    max-width: 90%;
    width: 500px;
    color: white;
    text-align: left;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.impressum-content h2 {
    text-align: center;
    text-decoration: underline;
    margin-bottom: 10px;
}

.close-impressum {
    display: block;
    margin: 20px auto 0;
    padding: 10px 20px;
    background: #4CAF50;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    cursor: pointer;
}

.close-impressum:hover {
    background: #45a049;
}

@media (orientation: portrait) {
    body::before {
        content: "Please rotate your device to play!";
        position: fixed;
        top: 0;
        width: 100%;
        height: 100%;
        background: rgba(10, 10, 10, 0.9);
        color: white;
        font-size: 16px;
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
        z-index: 9999;
        padding: 10px;
    }

    .game-container,
    .controls {
        display: none;
    }
}

@media (hover: none) {
    #mobileControls {
        display: flex;
    }

    h1,
    .controls {
        display: none;
    }

    .impressum-link {
        font-size: 12px;
        padding: 5px 8px;
        bottom: 90px;
        right: 10px;
        background: rgba(0, 0, 0, 0.6);
        opacity: 0.85;
    }

    .impressum-link:active {
        opacity: 1;
    }

    .impressum-content {
        width: 90%;
        font-size: 14px;
    }

    .mute-button {
        top: 8px;
        right: 8px;
        padding: 6px 10px;
        font-size: 14px;
    }
}