@font-face {
    font-family: 'Boogaloo';
    src: url('fonts/Boogaloo-Regular.ttf') format('truetype');
    font-display: swap;
}

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    gap: 16px;
    font-family: 'Boogaloo', sans-serif;
    background: #1b2a4a url('img/5_background/complete_background.png') center/cover fixed;
    overflow: hidden;
}

h1 {
    color: #ffcf3f;
    font-size: 40px;
    letter-spacing: 2px;
    text-shadow: 3px 3px 0 #8a4b00;
}

button {
    cursor: pointer;
    font-family: 'Boogaloo', sans-serif;
}

/* ---------- Game container ---------- */
.game-container {
    position: relative;
    width: 720px;
    height: 480px;
    max-width: 100vw;
}

canvas {
    background-color: #000;
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 8px;
}

/* ---------- Top bar ---------- */
.top-bar {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 8px;
    z-index: 5;
}

.top-bar button {
    background: rgba(0, 0, 0, 0.55);
    color: #ffcf3f;
    border: 2px solid #ffcf3f;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 16px;
}

.top-bar button:hover {
    background: #ffcf3f;
    color: #000;
}

/* ---------- Overlays ---------- */
.overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
}

.start-screen {
    background-image: url('img/9_intro_outro_screens/start/startscreen_1.png');
    justify-content: flex-start;
    padding-top: 10px;
    padding-right: 300px;
}

.start-btn {
    background: #ffcf3f;
    border: none;
    border-radius: 10px;
    padding: 16px 40px;
    font-size: 28px;
    color: #5a2d00;
    box-shadow: 0 6px 0 #b07400;
    transition: transform 0.1s;
}

.start-btn:hover {
    transform: translateY(-3px);
}

.end-screen {
    background: rgba(0, 0, 0, 0.75);
}

.end-screen img {
    max-width: 70%;
    max-height: 55%;
}

.end-buttons {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

.end-buttons button {
    background: #ffcf3f;
    border: none;
    border-radius: 8px;
    padding: 12px 22px;
    font-size: 20px;
    color: #5a2d00;
}

.end-buttons button:hover {
    background: #fff;
}

/* ---------- Dialogs ---------- */
.dialog {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20;
}

.dialog-box {
    position: relative;
    background: #fff7e6;
    color: #3a2200;
    border: 4px solid #ffcf3f;
    border-radius: 12px;
    padding: 28px 34px;
    max-width: 460px;
    width: 90%;
}

.dialog-box h2 {
    margin-bottom: 12px;
    color: #c0392b;
}

.dialog-box ul {
    list-style: none;
    margin-bottom: 12px;
    line-height: 1.8;
}

.dialog-close {
    position: absolute;
    top: 8px;
    right: 16px;
    font-size: 28px;
    cursor: pointer;
    color: #c0392b;
}

/* ---------- Mobile controls ---------- */
.mobile-controls {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    display: none;
    justify-content: space-between;
    padding: 0 12px;
    z-index: 5;
}

.mobile-left,
.mobile-right {
    display: flex;
    gap: 12px;
}

.ctrl-btn {
    width: 56px;
    height: 56px;
    font-size: 24px;
    border-radius: 50%;
    border: 2px solid #ffcf3f;
    background: rgba(0, 0, 0, 0.5);
    color: #ffcf3f;
    touch-action: none;
    user-select: none;
}

/* ---------- Rotate hint ---------- */
.rotate-hint {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    background: #1b2a4a;
    color: #ffcf3f;
    text-align: center;
    padding: 24px;
    font-size: 24px;
}

.rotate-hint img {
    width: 90px;
    animation: rotateShake 1.2s infinite ease-in-out;
}

@keyframes rotateShake {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

.d-none {
    display: none !important;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px), (pointer: coarse) {
    .mobile-controls {
        display: flex;
    }
}

@media (max-width: 933px) and (orientation: landscape) {
    h1, footer {
        display: none;
    }
    .game-container {
        width: 100vw;
        height: 100vh;
    }
}

@media (orientation: portrait) and (max-width: 933px) {
    h1, footer, .game-container {
        display: none;
    }
    .rotate-hint {
        display: flex;
    }
}

footer a {
    color: #ffcf3f;
    font-size: 18px;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}
