@import url("https://fonts.googleapis.com/css2?family=Notable&display=swap");

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

body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    font-family: "Notable", sans-serif;
    color: white;
    min-height: 100vh;
    padding: 30px;
    background-image: linear-gradient(
            rgba(35, 46, 57, 0.5),
            rgba(36, 70, 105, 0.5)
        ),
        url("./img/background.jpg");
    background-position: 50%;
}

h1 {
    text-align: center;
    font-size: 50px;
    text-shadow: 5px 5px 2px black;
    margin-bottom: 20px;
}

h3 {
    text-align: center;
    text-shadow: 3px 3px 2px black;
}

.game-wrapper {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
}

.gameboard,
.axis {
    display: grid;
    position: relative;
}

.gameboard,
.x-axis {
    width: max(30vw, 250px);
}

.gameboard,
.y-axis {
    height: max(30vw, 250px);
}

.axis > div {
    display: flex;
    justify-content: center;
    align-items: center;
}

.x-axis {
    grid-template-columns: repeat(10, 1fr);
    margin: auto;
    margin-top: 5px;
}

.y-axis {
    grid-template-rows: repeat(10, 1fr);
    width: 20px;
    margin-left: -25px; /* y-axis width + gap */
}

.axis-container {
    display: flex;
    justify-content: center;
    gap: 5px;
}

.gameboard {
    border: 1px solid white;
    grid-template-columns: repeat(10, 1fr);
    grid-template-rows: repeat(10, 1fr);
    cursor: crosshair;
}

.gb-space {
    border: 1px solid white;
}

.selectable-space:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.selectable-space:active {
    background-color: rgba(255, 255, 255, 0.7);
}

.form-wrapper {
    margin-top: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

button {
    font-family: inherit;
    font-size: 16px;
    padding: 10px 20px;
    border: none;
    outline: none;
    border-radius: 20px;
    cursor: pointer;
    background-color: rgb(255, 255, 255);
    color: steelblue;
}

button:hover {
    color: black;
}

.btn {
    font-family: inherit;
    padding: 10px;
    background-color: rgb(82, 79, 255);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

form {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: center;
}

.instructions {
    margin-bottom: 5px;
    text-shadow: 3px 3px 2px black;
    text-align: center;
}

.length {
    margin: 5px 0;
    font-size: 18px;
    font-style: italic;
}

.orientation-button {
    font-size: 18px;
    color: white;
    background-color: rgb(221, 111, 0);
}

.name-input {
    height: 40px;
    font-family: inherit;
    border-radius: 5px;
    text-align: center;
    font-size: 16px;
    outline: none;
    border: none;
}

.hit {
    background-color: #dc3545 !important;
}

.miss {
    background-color: yellow !important;
}

.occupied-space {
    background-color: rgb(80, 80, 255);
}

.error {
    margin: 5px auto;
    background-color: #dc3545;
    padding: 20px;
    text-align: center;
    color: white;
    border-radius: 5px;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.pop-up {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    font-size: 40px;
    color: white;
    text-shadow: -2px -2px 0 #000, 2px -2px 0 #000, -2px 2px 0 #000,
        2px 2px 0 #000;
    top: 0%;
    left: 0%;
    width: 100%;
    height: 100%;
    font-weight: bold;
    background-color: rgba(255, 255, 255, 0.5);
    text-align: center;
}

.preview-space-valid {
    background-color: #28a745 !important;
}

.preview-space-invalid {
    background-color: #dc3545 !important;
}

@media (min-width: 2000px) {
    body {
        background-repeat: no-repeat;
        background-size: cover;
    }
}

@media (max-width: 1100px) {
    .game-wrapper {
        flex-direction: column;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 28px;
    }
} ;
