@font-face {
    font-family: Minecrafter;
    src: url('fonts/MinecraftRegular.otf');
}

html {
    cursor: url('img/arrow.png'), auto;
    height: 100%;
}

body {
    background-image: url("img/background.png");
    background-repeat: repeat;
    background-size: 64px 64px;
    font-family: Minecrafter, monospace;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    position: relative;
}

#title {
    text-align: center;
    margin-bottom: 2em;
}

#title h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
    color: #FCA800;
    margin: 0.5em 0;
}

#title h2 {
    font-size: 2.5em;
    color: #00A8A8;
    margin: 0.5em 0;
}

#title img {
    width: 1em;
    height: 1em;
    margin: 0 0.25em;
    transition: transform 0.7s ease-in-out;
}

#title img:hover {
    transform: rotate(360deg);
    cursor: pointer;
}

#main {
    text-align: center;
    width: 90%;
    max-width: 1200px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

#counter {
    font-size: 2em;
    color: #B2B2B2;
    text-decoration: underline;
    margin: 0 0 2em 0;
}

.highlight {
    color: #00A8A8;
}

#board-container {
    position: relative;
    width: 80%;
    max-width: 900px;
    z-index: 10;
    margin: 5em auto 0 auto;
}

#world-container {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1;
}

#grass-layer {
    position: relative;
    width: 100%;
    height: 60px;
    background-image: url('img/grass-block.png');
    background-repeat: repeat-x;
    background-size: auto 60px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#cave-layer {
    position: relative;
    width: 100%;
    min-height: 200px;
    height: calc(100vh - 100%);
    background-size: 1920px 1920px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

#board-container {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 900px;
    z-index: 10;
}

#board::before {
    content: '';
    position: absolute;
    bottom: -80px;
    left: 20%;
    width: 40px;
    height: 80px;
    background-image: url('img/oak-log.png');
    background-size: cover;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    z-index: 5;
}

#board::after {
    content: '';
    position: absolute;
    bottom: -80px;
    right: 20%;
    width: 40px;
    height: 80px;
    background-image: url('img/oak-log.png');
    background-size: cover;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    z-index: 5;
}

#board {
    position: relative;
    background-image: url('img/planks.png');
    background-repeat: repeat;
    background-size: 64px 64px;
    border-radius: 4px;
    padding: 1em;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.7),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.sign-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    margin: 0.8em 0;
}

.sign-header {
    font-weight: bold;
}

.sign-header .sign-column {
    color: #2d1f0f;
    font-size: 1.1em;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.2);
    font-weight: bold;
}

.sign-column {
    background-image: url('img/sign.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    font-size: 1em;
    text-shadow: 0.5px 0.5px 1px rgba(255, 255, 255, 0.3);
    font-weight: bold;
    padding: 1.2em 1.5em;
    min-height: 60px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease;
}

.player-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8em;
}

.avatar {
    height: 2.5em;
    width: auto;
    border-radius: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.avatar:hover {
    cursor: url('img/spyglass.png'), auto;
}

.player-name {
    font-size: 1em;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        background-size: 32px 32px;
    }

    #title h1 {
        font-size: 2em;
    }

    #title h2 {
        font-size: 1.5em;
    }

    #counter {
        font-size: 1.5em;
    }

    #board-container {
        width: 90%;
        margin: 3em auto 0 auto;
    }

    .sign-row {
        grid-template-columns: 1fr;
        gap: 0.3em;
        margin: 0.5em 0;
    }

    .sign-column {
        font-size: 0.9em;
        padding: 1em;
    }

    .sign-header .sign-column {
        font-size: 1em;
    }

    .avatar {
        height: 2em;
    }

    #grass-layer {
        height: 40px;
        background-size: auto 40px;
    }

    #cave-layer {
        background-size: 1280px 1280px;
    }

    #board::before,
    #board::after {
        bottom: -60px;
        height: 60px;
        width: 30px;
    }
}
