﻿@import url("open-iconic/font/css/open-iconic-bootstrap.min.css");
/*
 * Globals
 */

/* Links */
a,
a:focus,
a:hover {
    color: #fff;
}

/* Custom default button */
.btn-secondary,
.btn-secondary:hover,
.btn-secondary:focus {
    color: #333;
    text-shadow: none;
    /* Prevent inheritance from `body` */
    background-color: #fff;
    border: 0.05rem solid #fff;
}

/*
 * Base structure
 */

html,
body {
    height: 100%;
    background-color: #333;
    background-image: linear-gradient(#111, #555);
}

body {
    display: -ms-flexbox;
    display: -webkit-box;
    display: flex;
    -ms-flex-pack: center;
    -webkit-box-pack: center;
    justify-content: center;
    color: #fff;
    text-shadow: 0 0.05rem 0.1rem rgba(0, 0, 0, 0.5);
    box-shadow: inset 0 0 5rem rgba(0, 0, 0, 0.5);
}

.cover-container {
    max-width: 55em;
    min-width: 55em;
    overflow-y: scroll;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

    .cover-container::-webkit-scrollbar {
        display: none;
    }

.fixed-top {
    top: 5em;
}

/*
 * Header
 */
.masthead {
    margin-bottom: 2rem;
}

.masthead-brand {
    margin-bottom: 0;
}

.nav-masthead .nav-link {
    padding: 0.25rem 0;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    background-color: transparent;
    border-bottom: 0.25rem solid transparent;
}

    .nav-masthead .nav-link:hover,
    .nav-masthead .nav-link:focus {
        border-bottom-color: rgba(255, 255, 255, 0.25);
    }

    .nav-masthead .nav-link + .nav-link {
        margin-left: 1rem;
    }

.nav-masthead .active {
    color: #fff;
    border-bottom-color: #fff;
}

@media (min-width: 48em) {
    .masthead-brand {
        float: left;
    }

    .nav-masthead {
        float: right;
    }
}

@media (max-width: 30em) {
    .cover-container {
        max-width: 22em;
        min-width: 22em;
    }

    .masthead-brand {
        float: left;
    }

    .nav-masthead {
        float: right;
    }
}

@media (min-width: 35em) {
    .cover-container {
        max-width: 38em;
        min-width: 38em;
    }

    .masthead-brand {
        float: left;
    }

    .nav-masthead {
        float: right;
    }
}

@media (min-width: 60em) {
    .cover-container {
        max-width: 55em;
        min-width: 55em;
    }

    .masthead-brand {
        float: left;
    }

    .nav-masthead {
        float: right;
    }
}

/*
 * Cover
 */
.cover {
    padding: 0 1.5rem;
}

    .cover .btn-lg {
        padding: 0.75rem 1.25rem;
        font-weight: 700;
    }

/*
 * Footer
 */
.mastfoot {
    color: rgba(255, 255, 255, 0.5);
}

.hide {
    display: none;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.boards-row {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: flex-start;
    gap: 1.25rem;
    margin: 1rem 0;
}

.board-panel {
    flex: 0 0 auto;
    padding: 0.6rem 0.75rem 0.8rem;
    background: linear-gradient(160deg, rgba(10, 22, 40, 0.85), rgba(6, 14, 28, 0.95));
    border: 1px solid rgba(120, 170, 220, 0.25);
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), inset 0 0 24px rgba(40, 90, 140, 0.15);
    text-align: center;
}

.board-panel * {
    box-sizing: border-box;
}

.board-heading {
    margin: 0 0 0.75rem;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #cfe7ff;
    text-shadow: 0 0 8px rgba(80, 160, 230, 0.6);
}

.battle-board {
    display: grid;
    grid-template-columns: 18px repeat(10, 28px);
    grid-template-rows: 18px repeat(10, 28px);
    gap: 2px;
    padding: 6px;
    margin: 0 auto;
    background:
        radial-gradient(ellipse at top, rgba(80, 160, 220, 0.12), transparent 60%),
        linear-gradient(180deg, #0b2a4a, #061629);
    border: 1px solid rgba(120, 170, 220, 0.35);
    border-radius: 10px;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.7);
}

.battle-board__corner {
    background: transparent;
}

.battle-board__header {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: rgba(205, 225, 245, 0.65);
    text-shadow: none;
}

.battle-board__cell {
    position: relative;
    border-radius: 4px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0) 40%),
        linear-gradient(180deg, #114874 0%, #0a2f50 100%);
    border: 1px solid rgba(120, 170, 220, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.battle-board__cell--clickable {
    cursor: crosshair;
}

.battle-board__cell--clickable.cell--water:hover {
    background: linear-gradient(180deg, #1a5a8a 0%, #0e3c66 100%);
    box-shadow: inset 0 0 10px rgba(120, 200, 255, 0.3);
    transform: translateY(-1px);
}

/* Ship tile on own board */
.cell--ship {
    background:
        radial-gradient(circle at 4px 4px, rgba(255, 255, 255, 0.55) 0 1px, transparent 1.6px),
        radial-gradient(circle at calc(100% - 4px) 4px, rgba(255, 255, 255, 0.55) 0 1px, transparent 1.6px),
        radial-gradient(circle at 4px calc(100% - 4px), rgba(255, 255, 255, 0.55) 0 1px, transparent 1.6px),
        radial-gradient(circle at calc(100% - 4px) calc(100% - 4px), rgba(255, 255, 255, 0.55) 0 1px, transparent 1.6px),
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 4px),
        linear-gradient(160deg, #a4afbc 0%, #6d7886 38%, #3a4350 75%, #252b35 100%);
    border: 1px solid rgba(15, 22, 32, 0.75);
    border-radius: 4px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        inset 0 -2px 5px rgba(0, 0, 0, 0.6),
        0 0 8px rgba(120, 160, 200, 0.22);
}

.cell--ship::before {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 2px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 35%, rgba(0, 0, 0, 0.35) 100%);
    border: 1px solid rgba(15, 22, 32, 0.65);
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.5);
}

.cell--ship::after {
    content: attr(data-ship);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Consolas", "Courier New", monospace;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: rgba(220, 230, 245, 0.55);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.7);
    pointer-events: none;
}

/* Ship tile that took a hit (own board) */
.cell--ship-hit {
    background:
        radial-gradient(circle at 50% 45%, #ffd27a 0%, #ff5722 35%, #7a1810 80%);
    border: 1px solid rgba(255, 180, 120, 0.6);
    box-shadow:
        0 0 12px rgba(255, 90, 40, 0.7),
        inset 0 0 10px rgba(0, 0, 0, 0.6);
    animation: cell-hit-flash 500ms ease-out;
}

.cell--ship-hit::before,
.cell--ship-hit::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 70%;
    height: 3px;
    background: #1a0606;
    border-radius: 2px;
    transform: translate(-50%, -50%) rotate(45deg);
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

.cell--ship-hit::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* Hit on firing board */
.cell--hit {
    background:
        radial-gradient(circle at 50% 45%, #fff2b0 0%, #ff7043 30%, #b11818 70%, #3b0a0a 100%);
    border: 1px solid rgba(255, 170, 100, 0.6);
    box-shadow:
        0 0 14px rgba(255, 80, 40, 0.75),
        inset 0 0 10px rgba(0, 0, 0, 0.55);
    animation: cell-hit-flash 500ms ease-out;
}

.cell--hit::after {
    content: "";
    position: absolute;
    inset: 30%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.8), rgba(255, 150, 60, 0));
}

/* Miss marker (both boards) */
.cell--miss::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, #f5faff 0%, #a8c4dc 65%, rgba(168, 196, 220, 0) 100%);
    box-shadow: 0 0 6px rgba(200, 220, 240, 0.6);
}

.cell--miss {
    box-shadow: inset 0 0 8px rgba(80, 140, 200, 0.25);
}

/* Selected firing target */
.cell--selected {
    background: linear-gradient(180deg, #f6c90e 0%, #c98a00 100%);
    border: 1px solid #fff2a8;
    box-shadow:
        0 0 0 2px rgba(255, 220, 80, 0.6),
        0 0 14px rgba(255, 210, 60, 0.8);
    animation: cell-selected-pulse 1.2s ease-in-out infinite;
}

.cell--selected::before {
    content: "";
    position: absolute;
    inset: 4px;
    border: 1.5px dashed rgba(60, 40, 0, 0.7);
    border-radius: 3px;
}

@keyframes cell-hit-flash {
    0% {
        transform: scale(1.25);
        filter: brightness(1.8);
    }
    60% {
        transform: scale(0.97);
        filter: brightness(1.1);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

@keyframes cell-selected-pulse {
    0%, 100% {
        box-shadow:
            0 0 0 2px rgba(255, 220, 80, 0.5),
            0 0 10px rgba(255, 210, 60, 0.6);
    }
    50% {
        box-shadow:
            0 0 0 3px rgba(255, 235, 130, 0.75),
            0 0 18px rgba(255, 215, 80, 0.95);
    }
}