* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    background-image: url('img/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    font-family: 'Rye', Arial, Helvetica, sans-serif;
    text-shadow: 4px 4px 4px rgba(0, 0, 0, 0.205);
}

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

.canvas-layout {
    position: relative;
    line-height: 0;
}

.canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    border: 10px solid rgb(153, 112, 0);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    box-sizing: border-box;
}

.hint {
    position: absolute;
    left: 24px;
    bottom: 24px;
    max-width: 55%;
    padding: 10px 16px;
    background-color: rgba(20, 12, 2, 0.55);
    border: 2px solid rgb(153, 112, 0);
    border-radius: 6px;
    color: #FEC673;
    text-shadow: none;
}

.hint h3 {
    margin: 0 0 4px;
    font-size: 16px;
}

.hint p {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
}

.gameOver,
.winner {
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-size: 150% 150%;
    background-position: center;
    border: 10px solid rgb(153, 112, 0);
    border-radius: 6px;
}

.gameOver {
    background-image: url('img/dead.png');
}

.winner {
    background-image: url('img/end.png');
}

.replay {
    transition: transform 0.3s ease-in-out;
    border: 0.6vmin solid rgb(153, 112, 0);
    background-color: #FFBA00;
    color: #402700;
    width: 26%;
    height: 10%;
    font-size: 4vmin;
    font-family: Rye;
    cursor: pointer;
    position: absolute;
    left: 50%;
    bottom: 8%;
    transform: translateX(-50%);
}

.replay:hover {
    transform: translateX(-50%) scale(1.08);
}

.start-screen {
    position: absolute;
    inset: 0;
    background-color: rgba(20, 12, 2, 0.8);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-button {
    transition: transform 0.2s ease;
    border: 0.6vmin solid rgb(153, 112, 0);
    background-color: #FFBA00;
    color: #402700;
    padding: 2vmin 5vmin;
    font-size: 4vmin;
    font-family: Rye;
    cursor: pointer;
    border-radius: 6px;
}

.play-button:hover {
    transform: scale(1.08);
}

.buttons {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 16px;
    display: flex;
    justify-content: center;
}

.move {
    display: flex;
    gap: 12px;
}

.buttonGame {
    background-color: rgba(240, 230, 140, 0.85);
    border: 2px solid #8B4513;
    border-radius: 6px;
    color: #402700;
    text-align: center;
    font-size: 16px;
    width: 200px;
    height: 50px;
    cursor: pointer;
    font-family: 'Rye', cursive;
    transition: transform 0.15s, background-color 0.15s;
}

.buttonGame:hover {
    background-color: #F0E68C;
}

.buttonGame:active {
    transform: scale(0.9);
    opacity: 0.6;
}

.letterbox {
    position: absolute;
    left: 10px;
    right: 10px;
    height: 9%;
    background-color: #000;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.letterbox:not(.d-none) {
    opacity: 1;
}

.letterbox-top {
    top: 10px;
}

.letterbox-bottom {
    bottom: 10px;
}

.dialogue {
    position: absolute;
    left: 6%;
    right: 6%;
    bottom: 16%;
    padding: 3vmin 3vmin 2vmin;
    background-color: rgba(20, 12, 2, 0.85);
    border: 0.6vmin solid rgb(153, 112, 0);
    border-radius: 6px;
    color: #FEC673;
    text-shadow: none;
    cursor: pointer;
    line-height: normal;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dialogue:not(.d-none) {
    opacity: 1;
}

.dialogue p {
    margin: 0 0 1.5vmin;
    font-size: 2.6vmin;
}

.dialogue-hint {
    display: block;
    font-size: 1.4vmin;
    opacity: 0.7;
}

.sound_btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 48px;
    cursor: pointer;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* SVG Stil */
svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.notice {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #FEC673;
    text-align: center;
    padding: 12px;
    border: 10px solid rgb(153, 112, 0);
    border-radius: 6px;
}


/* Smartphones */

@media only screen and (max-width: 1024px) {
    .hint {
        display: none;
    }

    .sound_btn {
        width: 36px;
        top: 10px;
        right: 10px;
    }
}

@media (orientation: portrait) and (max-width: 900px) {
    .canvas-layout {
        transform: rotate(90deg);
    }
}

@media only screen and (max-width: 500px) {
    .buttonGame {
        width: 140px;
        height: 44px;
        font-size: 14px;
    }

    .move {
        gap: 6px;
    }
}
