/* Google Fonts import */
@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Stencil:opsz,wght@10..72,100..900&display=swap');

/* Global styles */
* {
    font-family: "Big Shoulders Stencil", sans-serif;
    color: black;
    box-sizing: border-box;
}

/* Style header element */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

h1 {
    font-size: 3em;
    margin: auto;
    text-align: center;
}

/* Modal style */
.modal-content {
    border-radius: 0;
}

.start-button {
    letter-spacing: 0.05em;
    border-radius: 0;
    background-color: darkslategray;
    margin: auto;
}

h3 {
    font-size: 1.3em;
}

.modal-body {
    letter-spacing: 0.03em;
}

/* Style board and game area */
main h2 {
    padding-top: 1em;
}

.board {
    display: grid;
    grid-template-columns: repeat(10, 30px);
    /* 10 columns */
    grid-template-rows: repeat(10, 30px);
    /* 10 rows */
    width: max-content;
    margin: 20px;
}

.cell {
    background-color: rgb(102, 187, 216);
    width: 30px;
    height: 30px;
    border: 1px solid black;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.computer-board-active .cell:hover {
    background-color: lightgray;
}

/* Smooth transition when coloring cells */
#computer-board .cell {
    transition: background-color 0.1s ease;
}

/* Game area style */
.game-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    padding-bottom: 20px;
}

.board-container {
    text-align: center;
}

/* Legend */
.board-labels-top,
.board-labels-left,
.board {
    margin: 0;
    padding: 0;
    border: 0;
}

.board-wrapper {
    display: grid;
    grid-template-columns: 30px auto;
    grid-template-rows: 30px auto;
    margin: 20px;
}

.corner-spacer {
    width: 30px;
    height: 30px;
}

.board-labels-top {
    display: grid;
    grid-template-columns: repeat(10, 30px);
    height: 30px;
    grid-column: 2;
}

.board-labels-left {
    display: grid;
    grid-template-rows: repeat(10, 30px);
    width: 30px;
    grid-row: 2;
}

.board {
    display: grid;
    grid-template-columns: repeat(10, 30px);
    grid-template-rows: repeat(10, 30px);
    grid-column: 2;
    grid-row: 2;
}

.board-labels-top div,
.board-labels-left div {
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-size: 14px;
    pointer-events: none;
}

/* Give visual feedback when orientation changed on mobile */
.orientation-hint {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.orientation-hint.visible {
    opacity: 1;
}


/* Style cells when there is an action on them */
.hit-cell {
    background-image: url('../images/hit.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.missed-cell {
    background-image: url('../images/miss.png');
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

/* Ship images */
.ship-segment {
    background-size: cover;
    background-repeat: no-repeat;
}

.ship-horizontal-front {
    background-image: url('../images/boat-front.png');
}

.ship-horizontal-middle {
    background-image: url('../images/boat-middle.png');
}

.ship-horizontal-back {
    background-image: url('../images/boat-back.png');
}

.ship-vertical-front {
    background-image: url('../images/boat-front.png');
    transform: rotate(90deg);
}

.ship-vertical-middle {
    background-image: url('../images/boat-middle.png');
    transform: rotate(90deg);
}

.ship-vertical-back {
    background-image: url('../images/boat-back.png');
    transform: rotate(90deg);
}

/* Prompt box styles */
.message-display {
    display: flex;
    justify-content: center;
}

.message-display p,
.score-display p {
    font-size: 1.3em;
    padding: 1em;
    margin-bottom: 0;
}

.score-display {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.space-between {
    display: inline-block;
    width: 5rem;
}

/* Footer */
footer {
    position: relative;
    bottom: 0;
    width: 100%;
    text-align: center;
    padding: 1em 1em 0 1em;
}

.github,
.copyright {
    padding-bottom: 0;
    padding-top: 1em;
    margin-bottom: 0;
}

@media screen and (min-width: 768px) {

    .mobile-hint {
        display: none;
    }
}