* {
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

body {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
    min-height: 100dvh;
    margin: 0;
    background-position: center;
    background-image: url(img/5_background/website_bg/website-background1.jpg);
    background-repeat: no-repeat;
    background-size: cover;
    font-family: 'shortstack', Arial, Helvetica, sans-serif;
}

canvas {
    background-color: black;
    display: block;
    width: 100%;
    height: auto;
}

#mute-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    border: none;
    background-color: transparent;
    cursor: pointer;
    z-index: 20;
}

#mute-btn img {
    width: 32px;
    height: 32px;
}

.game-container {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}

.menu-buttons {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    padding: 60px 40px 20px 40px;
    z-index: 12;
    pointer-events: none;
}

.main-menu-group {
    display: flex;
    justify-content: center;
    gap: 32px;
    width: 100%;
    margin-top: 8px;
}

.legal-menu-group {
    display: flex;
    justify-content: center;
    gap: 16px;
    width: 100%;
}

.menu-buttons button {
    pointer-events: auto;
    font-family: 'shortstack', sans-serif;
    cursor: pointer;
    border: 3px solid #000;
    border-radius: 12px;
    box-shadow: 0px 4px 0px #000;
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.menu-buttons button:active {
    transform: translateY(4px);
    box-shadow: 0px 0px 0px #000;
}

#start-btn,
#instruction-btn {
    padding: 16px 32px;
    font-size: 24px;
    font-weight: bold;
}

#start-btn {
    background-color: #459128;
    color: white;
}

#instruction-btn {
    background-color: #f8bbd0;
    color: black;
}

#imprint-btn,
#privacy-btn {
    padding: 6px 16px;
    font-size: 16px;
    border: 2px solid #000;
    border-radius: 8px;
    box-shadow: 0px 2px 0px #000;
}

#imprint-btn {
    background-color: #bbdefb;
}

#privacy-btn {
    background-color: #c8e6c9;
}

#start-btn:active,
#instruction-btn:active,
#imprint-btn:active,
#privacy-btn:active {
    transform: scale(0.98);
}

dialog {
    border: 3px solid black;
    border-radius: 12px;
    padding: 0;
    max-width: 600px;
    text-align: center;
    background-color: #FC9E22;
}

dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
}

.dialog-container {
    padding: 16px;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

dialog button {
    position: absolute;
    top: 20px;
    right: 20px;
    font-family: 'shortstack', sans-serif;
    font-size: 20px;
    cursor: pointer;
    background-color: #f8bbd0;
    border: 2px solid #000;
    border-radius: 8px;
}

dialog li {
    font-size: 20px;
    padding: 12px;
}

#game-over-screen,
#you-won-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 10;
    border-radius: 4px;
    box-sizing: border-box;
}

#game-over-screen img,
#you-won-screen img {
    max-width: 80%;
    max-height: 60%;
    object-fit: contain;
}

.hidden {
    display: none !important;
}

.game-end-btns {
    display: flex;
    justify-content: space-evenly;
    gap: 16px;
}

.restart-btn {
    font-family: 'shortstack', sans-serif;
    font-size: 18px;
    padding: 8px 24px;
    margin-bottom: 12px;
    cursor: pointer;
    border: 3px solid #000;
    border-radius: 12px;
    background-color: #ff9800;
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0px 2px 0px #000;
    transition: all 0.1s ease;
}

.restart-btn:hover {
    background-color: #f57c00;
    transform: translateY(-2px);
    box-shadow: 0px 4px 0px #000;
}

.restart-btn:active {
    transform: translateY(4px);
    box-shadow: 0px 0px 0px #000;
}

.menu-link-btn {
    font-family: 'shortstack', sans-serif;
    font-size: 18px;
    padding: 8px 24px;
    margin-bottom: 12px;
    cursor: pointer;
    border: 3px solid #000;
    border-radius: 12px;
    background-color: #f8bbd0;
    color: black;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 0px 2px 0px #000;
    transition: all 0.1s ease;
}

.menu-link-btn:hover {
    background-color: #f48fb1;
    transform: translateY(-2px);
    box-shadow: 0px 4px 0px #000;
}

.menu-link-btn:active {
    transform: translateY(4px);
    box-shadow: 0px 0px 0px #000;
}

@font-face {
    font-family: 'shortstack';
    src: url(font/short_stack/shortstack-regular.ttf);
}

#mobile-controls {
    position: fixed;
    bottom: 24px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 32px;
    pointer-events: none;
    z-index: 99;
}

.mobile-btn-group {
    display: flex;
    gap: 12px;
    pointer-events: auto;
}

.mobile-btn-group button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid black;
    background-color: rgba(255, 255, 255, 0.6);
    font-family: 'shortstack', sans-serif;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.mobile-btn-group button:active {
    background-color: rgba(255, 152, 0, 0.8);
    transform: scale(0.95);
}

#rotate-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background-color: #FC9E22;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
}

.rotate-message {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    padding: 20px;
}