/* ==========================================
   STYLE SHEET FOR BATTLESHIP (TACTICAL)
   ========================================== */

/* --- CSS Variables & Design System --- */
:root {
    --bg-deep: #0a1128;
    --bg-card: rgba(13, 27, 42, 0.65);
    --border-glow: rgba(0, 180, 216, 0.35);
    --border-glow-focus: rgba(0, 180, 216, 0.75);
    
    /* Neon HUD Colors */
    --hud-cyan: #00b4d8;
    --hud-cyan-glow: rgba(0, 180, 216, 0.5);
    --hud-green: #06d6a0;
    --hud-green-glow: rgba(6, 214, 160, 0.5);
    --hud-red: #ef476f;
    --hud-red-glow: rgba(239, 71, 111, 0.6);
    --hud-orange: #ffd166;
    --hud-orange-glow: rgba(255, 209, 102, 0.5);
    --hud-blue: #118ab2;
    --hud-text: #e0f2f1;
    
    /* Cell sizes */
    --cell-size: 38px;
    --cell-gap: 2px;
}

/* --- Global Reset & Scrollbars --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    user-select: none;
}

body {
    background-color: var(--bg-deep);
    color: var(--hud-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* --- Atmospheric Background & Sonar Sweep --- */
.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 119, 182, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(10, 147, 150, 0.15) 0%, transparent 40%),
        #020813;
}

.radar-sweep {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent 50%, rgba(0, 180, 216, 0.04) 95%, rgba(0, 180, 216, 0.08) 100%);
    z-index: -1;
    animation: sweep 12s linear infinite;
    transform-origin: center center;
    pointer-events: none;
}

@keyframes sweep {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* --- Header & Typography --- */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    border-bottom: 1px solid var(--border-glow);
    background: rgba(2, 8, 19, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10;
}

.logo {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    letter-spacing: clamp(2px, 0.35vw, 6px);
    font-size: clamp(1rem, 2.1vw, 1.55rem);
    color: #fff;
    text-shadow: 0 0 10px var(--hud-cyan-glow), 0 0 20px var(--hud-cyan-glow);
    display: flex;
    align-items: center;
    line-height: 1.1;
}

.global-controls {
    display: flex;
    gap: 15px;
}

/* --- Glassmorphic UI Cards & Panels --- */
.glass {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: 8px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: border 0.3s ease, box-shadow 0.3s ease;
}

.glass:hover {
    border-color: var(--border-glow-focus);
    box-shadow: 0 8px 32px 0 rgba(0, 180, 216, 0.1);
}

.card {
    padding: 30px;
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
}

.text-glow {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 0 8px var(--hud-cyan-glow);
    letter-spacing: 2px;
    margin-bottom: 15px;
}

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

.highlight {
    color: var(--hud-cyan);
    text-shadow: 0 0 5px rgba(0, 180, 216, 0.4);
}

.subtitle {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #b0c4de;
    margin-bottom: 25px;
}

/* --- Mode Panels inside Welcome --- */
.mode-panel {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(0, 180, 216, 0.2);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.selection-section h3 {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    color: #64dfdf;
    margin-bottom: 8px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.btn-group-row {
    display: flex;
    gap: 10px;
    width: 100%;
}

.btn-group-row .btn {
    flex: 1;
}

.btn-mode.active, .btn-diff.active {
    background: rgba(0, 180, 216, 0.25);
    border-color: var(--hud-cyan);
    color: #fff;
    box-shadow: 0 0 10px var(--hud-cyan-glow);
}

/* --- Buttons --- */
.btn {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    letter-spacing: 1.5px;
    font-size: 0.85rem;
    padding: 10px 20px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: rgba(0, 180, 216, 0.15);
    color: #fff;
    border-color: var(--hud-cyan);
    box-shadow: 0 0 10px rgba(0, 180, 216, 0.2);
}

.btn-primary:hover {
    background: var(--hud-cyan);
    color: #000;
    box-shadow: 0 0 15px var(--hud-cyan-glow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #b0c4de;
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-danger {
    background: rgba(239, 71, 111, 0.1);
    color: var(--hud-red);
    border-color: var(--hud-red);
}

.btn-danger:hover {
    background: var(--hud-red);
    color: #fff;
    box-shadow: 0 0 15px var(--hud-red-glow);
    transform: translateY(-2px);
}

.btn-large {
    padding: 15px 35px;
    font-size: 1rem;
    width: 100%;
    margin-top: 15px;
}

.btn-icon {
    background: transparent;
    border: 1px solid var(--border-glow);
    color: #b0c4de;
}

.btn-icon:hover {
    border-color: var(--hud-cyan);
    color: #fff;
}

/* --- Containers & Core Layout --- */
.game-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 5%;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
    position: relative;
}

.game-screen {
    display: none;
    width: 100%;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.game-screen.active {
    display: block;
    opacity: 1;
}

/* --- Screen 1: Welcome Extra Details --- */
.rules-box {
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid var(--hud-cyan);
    padding: 15px 20px;
    margin-bottom: 25px;
    border-radius: 0 4px 4px 0;
}

.rules-box h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95rem;
    margin-bottom: 10px;
    letter-spacing: 1px;
    color: var(--hud-cyan);
}

.rules-box ul {
    list-style: none;
}

.rules-box li {
    font-size: 0.85rem;
    margin: 6px 0;
    color: #9cb2cd;
}

.ship-name {
    font-weight: bold;
    color: #fff;
}

/* --- Screen 2: Deployment Layout --- */
.deployment-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
}

.control-panel {
    flex: 0 0 350px;
    padding: 25px;
}

.player-title {
    font-size: 1.4rem;
    margin-bottom: 8px;
}

.instruction {
    font-size: 0.8rem;
    line-height: 1.5;
    color: #9cb2cd;
    margin-bottom: 20px;
}

.ship-selector {
    background: rgba(0, 0, 0, 0.4);
    border: 1px dashed var(--border-glow);
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.ship-select-title {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    color: #64dfdf;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.current-ship-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
}

.badge {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    padding: 3px 8px;
    background: rgba(0, 180, 216, 0.2);
    border: 1px solid var(--hud-cyan);
    border-radius: 4px;
    color: #fff;
}

.ship-preview-visual {
    display: flex;
    gap: 3px;
    margin-top: 15px;
    justify-content: center;
}

.ship-preview-cell {
    width: 20px;
    height: 20px;
    background: var(--hud-cyan);
    border-radius: 2px;
    box-shadow: 0 0 6px var(--hud-cyan-glow);
}

.placement-controls {
    margin-bottom: 20px;
}

.placement-controls .btn {
    width: 100%;
}

.deployment-status h4 {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: #9cb2cd;
    margin-bottom: 10px;
    letter-spacing: 1.5px;
}

.placement-ship-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.placement-ship-item {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    display: flex;
    justify-content: space-between;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    border-left: 3px solid #ccc;
    color: #9cb2cd;
}

.placement-ship-item.pending {
    border-left-color: var(--hud-orange);
}

.placement-ship-item.placed {
    border-left-color: var(--hud-green);
    color: #fff;
    background: rgba(6, 214, 160, 0.05);
}

.placement-ship-item.placed .status-icon::after {
    content: "READY";
    color: var(--hud-green);
    font-weight: bold;
}

.placement-ship-item.pending .status-icon::after {
    content: "PENDING";
    color: var(--hud-orange);
}

/* --- GRID SYSTEM (Ocean Style Map) --- */
.board-container {
    padding: 25px;
    display: inline-block;
}

.board-header {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 15px;
    color: #fff;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.board-header.defensive {
    color: var(--hud-cyan);
    text-shadow: 0 0 5px rgba(0, 180, 216, 0.3);
}

.board-header.offensive {
    color: var(--hud-red);
    text-shadow: 0 0 5px rgba(239, 71, 111, 0.3);
}

.board-body-layout {
    display: flex;
}

/* Row Labels on left: 1-10 */
.grid-labels-col {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    width: 25px;
    margin-right: 5px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: #748cab;
}

/* Col Labels on top: A-J */
.grid-labels-row {
    display: flex;
    margin-left: 30px; /* offset of label col + gap */
    margin-bottom: 5px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    color: #748cab;
}

.grid-labels-row div {
    width: var(--cell-size);
    text-align: center;
    margin-right: var(--cell-gap);
}

/* Grid layout itself */
.grid {
    display: grid;
    grid-template-columns: repeat(10, var(--cell-size));
    grid-template-rows: repeat(10, var(--cell-size));
    gap: var(--cell-gap);
    background: rgba(0, 180, 216, 0.08);
    border: 1px solid var(--border-glow);
    padding: var(--cell-gap);
    border-radius: 4px;
    box-shadow: inset 0 0 20px rgba(0, 119, 182, 0.15);
}

.grid-cell {
    width: var(--cell-size);
    height: var(--cell-size);
    background: rgba(13, 27, 42, 0.8);
    border: 1px solid rgba(0, 180, 216, 0.15);
    border-radius: 2px;
    cursor: crosshair;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
}

/* Placing hover states */
.grid-cell.valid-preview {
    background: rgba(6, 214, 160, 0.25);
    border-color: var(--hud-green);
    box-shadow: inset 0 0 10px rgba(6, 214, 160, 0.3);
}

.grid-cell.invalid-preview {
    background: rgba(239, 71, 111, 0.25);
    border-color: var(--hud-red);
    box-shadow: inset 0 0 10px rgba(239, 71, 111, 0.3);
    cursor: not-allowed;
}

/* ============================================================================
   PROCEDURAL TOP-DOWN BIRD'S EYE SHIPS (REALISTIC VECTOR GRAPHICS)
   ============================================================================ */
.grid-cell.cell-ship {
    background: rgba(10, 34, 64, 0.95);
    border-color: rgba(0, 180, 216, 0.5);
    box-shadow: inset 0 0 6px rgba(0, 180, 216, 0.4);
    position: relative;
}

/* Base Ship Layer representation */
.grid-cell.cell-ship::before {
    content: '';
    position: absolute;
    background: linear-gradient(135deg, #1b4965, #0a2240);
    border: 1.5px solid var(--hud-cyan);
    box-shadow: 0 0 8px var(--hud-cyan-glow);
    z-index: 1;
}

/* Deck Superstructure (Funnel / Bridge / Cannon turret) on mid section */
.grid-cell.cell-ship::after {
    content: '';
    position: absolute;
    background: rgba(0, 255, 230, 0.8);
    box-shadow: 0 0 6px #00ffe6;
    border-radius: 50%;
    z-index: 2;
}

/* --- HORIZONTAL SHIPS --- */
/* Bow (Front tip) */
.grid-cell.cell-ship[data-ship-part="bow"][data-ship-orient="horizontal"]::before {
    top: 15%;
    left: 20%;
    width: 80%;
    height: 70%;
    border-radius: 50% 0 0 50% / 100% 0 0 100%;
    border-right: none;
}
.grid-cell.cell-ship[data-ship-part="bow"][data-ship-orient="horizontal"]::after {
    top: 40%;
    left: 55%;
    width: 20%;
    height: 20%;
    border-radius: 50%; /* Bridge radar */
}

/* Stern (Rear edge) */
.grid-cell.cell-ship[data-ship-part="stern"][data-ship-orient="horizontal"]::before {
    top: 15%;
    left: 0;
    width: 75%;
    height: 70%;
    border-radius: 0 4px 4px 0;
    border-left: none;
}
.grid-cell.cell-ship[data-ship-part="stern"][data-ship-orient="horizontal"]::after {
    top: 35%;
    left: 15%;
    width: 30%;
    height: 30%;
    background: #0077b6;
    border: 1px solid var(--hud-cyan);
    border-radius: 1px; /* Heli-pad indicator */
    box-shadow: none;
}

/* Deck/Body (Middle parts) */
.grid-cell.cell-ship[data-ship-part="deck"][data-ship-orient="horizontal"]::before {
    top: 15%;
    left: 0;
    width: 100%;
    height: 70%;
    border-left: none;
    border-right: none;
}
/* Alternating superstructures for cool modular details */
.grid-cell.cell-ship[data-ship-part="deck"][data-ship-orient="horizontal"]:nth-child(2n)::after {
    top: 35%;
    left: 35%;
    width: 30%;
    height: 30%;
    background: #0d1b2a;
    border: 1px solid var(--hud-orange);
    border-radius: 2px; /* Guided Missile turret launcher */
}
.grid-cell.cell-ship[data-ship-part="deck"][data-ship-orient="horizontal"]:nth-child(2n+1)::after {
    top: 25%;
    left: 40%;
    width: 20%;
    height: 50%;
    background: #1b4965;
    border: 1px solid var(--hud-cyan);
    border-radius: 3px; /* Engine / Funnels */
}

/* --- VERTICAL SHIPS --- */
/* Bow (Front tip pointing UP) */
.grid-cell.cell-ship[data-ship-part="bow"][data-ship-orient="vertical"]::before {
    top: 20%;
    left: 15%;
    width: 70%;
    height: 80%;
    border-radius: 50% 50% 0 0 / 100% 100% 0 0;
    border-bottom: none;
}
.grid-cell.cell-ship[data-ship-part="bow"][data-ship-orient="vertical"]::after {
    top: 55%;
    left: 40%;
    width: 20%;
    height: 20%;
    border-radius: 50%;
}

/* Stern (Rear edge pointing DOWN) */
.grid-cell.cell-ship[data-ship-part="stern"][data-ship-orient="vertical"]::before {
    top: 0;
    left: 15%;
    width: 70%;
    height: 75%;
    border-radius: 0 0 4px 4px;
    border-top: none;
}
.grid-cell.cell-ship[data-ship-part="stern"][data-ship-orient="vertical"]::after {
    top: 15%;
    left: 35%;
    width: 30%;
    height: 30%;
    background: #0077b6;
    border: 1px solid var(--hud-cyan);
    border-radius: 1px;
    box-shadow: none;
}

/* Deck/Body (Middle parts) */
.grid-cell.cell-ship[data-ship-part="deck"][data-ship-orient="vertical"]::before {
    top: 0;
    left: 15%;
    width: 70%;
    height: 100%;
    border-top: none;
    border-bottom: none;
}
.grid-cell.cell-ship[data-ship-part="deck"][data-ship-orient="vertical"]:nth-child(2n)::after {
    top: 35%;
    left: 35%;
    width: 30%;
    height: 30%;
    background: #0d1b2a;
    border: 1px solid var(--hud-orange);
    border-radius: 2px;
}
.grid-cell.cell-ship[data-ship-part="deck"][data-ship-orient="vertical"]:nth-child(2n+1)::after {
    top: 40%;
    left: 25%;
    width: 50%;
    height: 20%;
    background: #1b4965;
    border: 1px solid var(--hud-cyan);
    border-radius: 3px;
}

/* Hide ship structures completely on offensive target grid covered by fog of war */
#offensive-grid .grid-cell.cell-ship::before,
#offensive-grid .grid-cell.cell-ship::after {
    display: none !important;
}

/* Hit state */
.grid-cell.cell-hit {
    background: rgba(239, 71, 111, 0.15) !important;
    border-color: var(--hud-red) !important;
    cursor: not-allowed;
}

.grid-cell.cell-hit::before {
    content: '💥';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    z-index: 5;
    animation: bounce-small 0.5s ease;
}

.grid-cell.cell-hit::after {
    content: '';
    position: absolute;
    top: 15%;
    left: 15%;
    width: 70%;
    height: 70%;
    border-radius: 50%;
    border: 2px dashed rgba(239, 71, 111, 0.6);
    background: transparent !important; /* Override ship deck */
    box-shadow: none !important;
    animation: spin 8s linear infinite;
    z-index: 4;
}

/* Miss state */
.grid-cell.cell-miss {
    background: rgba(0, 119, 182, 0.2) !important;
    border-color: rgba(0, 180, 216, 0.4) !important;
    cursor: not-allowed;
}

.grid-cell.cell-miss::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--hud-cyan);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px var(--hud-cyan);
    z-index: 4;
}

.grid-cell.cell-miss::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(0, 180, 216, 0.3);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: transparent !important; /* Override ship deck */
    box-shadow: none !important;
    animation: ping-wave 2s infinite ease-out;
    z-index: 3;
}

@keyframes ping-wave {
    0% { width: 4px; height: 4px; opacity: 1; }
    100% { width: 32px; height: 32px; opacity: 0; }
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

@keyframes bounce-small {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.3); }
}

/* --- Screen 3: Turn Pass (Security Curtain) --- */
.pass-container {
    max-width: 500px;
    padding: 50px 30px;
}

.warning-radar {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 0 auto 30px auto;
}

.radar-circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 2px solid var(--hud-cyan);
    border-radius: 50%;
    animation: radar-ping 3s infinite linear;
    opacity: 0;
}

.radar-circle.delay-1 { animation-delay: 1s; }
.radar-circle.delay-2 { animation-delay: 2s; }

@keyframes radar-ping {
    0% { transform: scale(0.2); opacity: 0; }
    10% { opacity: 0.8; }
    90% { opacity: 0.1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.pass-instruction {
    font-size: 1.25rem;
    margin-bottom: 10px;
}

.pass-sub-instruction {
    font-size: 0.85rem;
    color: #748cab;
    margin-bottom: 30px;
}

/* --- Screen 4: Battle Board (Main Combat Mode) --- */
.battle-header-info {
    max-width: 100%;
    margin-bottom: 25px;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    width: 100%;
}

.turn-indicator-box {
    display: flex;
    flex-direction: column;
}

.turn-indicator-box .label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: #748cab;
    letter-spacing: 1px;
}

.player-name-val {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
}

.battle-status-msg {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.95rem;
    color: #9cb2cd;
    text-transform: uppercase;
    max-width: 450px;
    border-left: 2px solid var(--hud-orange);
    padding-left: 15px;
}

.battle-stats-container {
    display: flex;
    gap: 20px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 15px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    min-width: 120px;
}

.stat-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: #748cab;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    margin-top: 3px;
}

.battle-layout {
    display: flex;
    justify-content: center;
    gap: 40px;
    width: 100%;
    align-items: flex-start;
}

.battle-board-wrapper {
    padding: 20px;
    flex: 1;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.board-layout-inner {
    display: inline-block;
    margin-top: 10px;
}

.panel-defensive {
    opacity: 0.85;
}

/* Offensive board cell customization */
.grid-offensive .grid-cell {
    /* cursor is special launch crosshair */
}

.grid-offensive .grid-cell:not(.cell-hit):not(.cell-miss):hover {
    background: rgba(239, 71, 111, 0.15);
    border-color: var(--hud-red);
    box-shadow: 0 0 8px rgba(239, 71, 111, 0.4);
}

/* Defensive board shouldn't hover-highlight like targeting */
.grid-defensive .grid-cell {
    cursor: default;
    pointer-events: none;
}

/* --- Animations & Overlay Elements --- */
.pointer-none {
    pointer-events: none;
}

.animation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100;
}

/* CSS-based missile projectile */
.missile {
    position: absolute;
    width: 8px;
    height: 35px;
    background: linear-gradient(to top, var(--hud-orange), var(--hud-red));
    border-radius: 4px 4px 0 0;
    box-shadow: 0 4px 15px var(--hud-orange-glow);
    transform-origin: center bottom;
    z-index: 101;
}

.missile::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 15px;
    background: linear-gradient(to bottom, #ffaa00, transparent);
    animation: flame-pulse 0.1s infinite alternate;
}

@keyframes flame-pulse {
    0% { height: 10px; opacity: 0.8; }
    100% { height: 18px; opacity: 1; }
}

/* CSS-based explosions and splashes */
.explosion {
    position: absolute;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #ff0055 10%, #ff7700 50%, transparent 70%);
    border-radius: 50%;
    z-index: 102;
    transform: translate(-50%, -50%) scale(0.1);
    animation: explode-anim 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes explode-anim {
    0% { transform: translate(-50%, -50%) scale(0.1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.5); box-shadow: 0 0 30px #ff3300; opacity: 0.9; }
    100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0; }
}

.splash {
    position: absolute;
    width: 50px;
    height: 50px;
    border: 3px solid #00b4d8;
    background: radial-gradient(circle, rgba(0, 180, 216, 0.2) 20%, transparent 60%);
    border-radius: 50%;
    z-index: 102;
    transform: translate(-50%, -50%) scale(0.1);
    animation: splash-anim 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
}

@keyframes splash-anim {
    0% { transform: translate(-50%, -50%) scale(0.1) rotate(0deg); border-width: 4px; opacity: 1; }
    70% { transform: translate(-50%, -50%) scale(1.3) rotate(45deg); border-width: 2px; opacity: 0.7; }
    100% { transform: translate(-50%, -50%) scale(1.5) rotate(90deg); border-width: 1px; opacity: 0; }
}

/* --- Modal/Alert Overlays --- */
.alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(1, 4, 10, 0.8);
    backdrop-filter: blur(5px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.alert-overlay.hidden {
    display: none;
    opacity: 0;
}

.alert-box {
    max-width: 420px;
    width: 90%;
    padding: 30px;
    text-align: center;
    border-color: var(--hud-orange);
    box-shadow: 0 0 25px var(--hud-orange-glow);
}

.alert-title {
    font-family: 'Orbitron', sans-serif;
    color: var(--hud-orange);
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 15px;
    letter-spacing: 2px;
}

.alert-msg {
    font-size: 0.95rem;
    color: #e0f2f1;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* --- Screen 5: Victory Cards --- */
.victory-card {
    border-color: var(--hud-green);
    box-shadow: 0 0 35px var(--hud-green-glow);
    max-width: 550px;
}

.crown-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

.victory-title {
    color: var(--hud-green);
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 4px;
}

.winner-announcement {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.victory-stats {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: left;
    display: inline-block;
    width: 80%;
}

.victory-stats p {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.95rem;
    margin: 10px 0;
    display: flex;
    justify-content: space-between;
    color: #9cb2cd;
}

.stat-highlight {
    color: #fff;
    font-size: 1.1rem;
}

/* --- Animation Classes --- */
.hidden {
    display: none !important;
}

.animate-pulse {
    animation: pulse 2s infinite ease-in-out;
}

.animate-pulse-fast {
    animation: pulse-fast 1s infinite ease-in-out;
}

.animate-scale-up {
    animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes pulse-fast {
    0%, 100% { color: var(--hud-red); text-shadow: 0 0 5px var(--hud-red-glow); }
    50% { color: #fff; text-shadow: 0 0 15px var(--hud-red-glow); }
}

@keyframes scaleUp {
    0% { transform: scale(0.75); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Screen shake effect on Hit */
.screen-shake {
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translate(0, 0); }
    10%, 30%, 50%, 70%, 90% { transform: translate(-4px, -2px); }
    20%, 40%, 60%, 80% { transform: translate(4px, 2px); }
}

/* --- Footer --- */
.game-footer {
    text-align: center;
    padding: 15px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: #435a6f;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* --- Responsive Layout Adjustments --- */
@media (max-width: 1050px) {
    .battle-layout {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    
    .deployment-layout {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    
    .control-panel {
        width: 100%;
        max-width: 450px;
    }
    
    .battle-board-wrapper {
        width: 100%;
        max-width: 450px;
    }
}

@media (max-width: 600px) {
    :root {
        --cell-size: 28px;
    }
    
    .logo {
        font-size: 0.95rem;
        letter-spacing: 2px;
    }
    
    .game-header {
        padding: 10px 15px;
    }
    
    .global-controls {
        gap: 8px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    .btn-text {
        display: none; /* Hide button text to keep it compact on mobile */
    }
    
    .game-container {
        padding: 15px 10px;
    }
    
    .card {
        padding: 20px 15px;
    }
    
    .battle-header-info {
        padding: 12px;
        flex-direction: column;
        align-items: stretch;
    }
    
    .battle-stats-container {
        justify-content: space-between;
    }
    
    .stat-box {
        min-width: 45%;
        padding: 6px;
    }
    
    .grid-labels-col {
        width: 18px;
    }
    
    .grid-labels-row {
        margin-left: 23px;
    }
    
    .grid-labels-row div {
        width: var(--cell-size);
    }
}

/* --- Online Private Room Panel --- */
.online-room-card {
    border: 1px solid rgba(0, 180, 216, 0.22);
    border-radius: 8px;
    padding: 14px;
    background: rgba(0, 0, 0, 0.22);
}

.online-label {
    display: block;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.78rem;
    color: #9be7ff;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.online-input {
    width: 100%;
    min-height: 41px;
    border: 1px solid rgba(0, 180, 216, 0.38);
    border-radius: 6px;
    background: rgba(2, 8, 19, 0.75);
    color: #e0f2f1;
    padding: 10px 12px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.95rem;
    outline: none;
}

.online-input:focus {
    border-color: var(--hud-cyan);
    box-shadow: 0 0 10px rgba(0, 180, 216, 0.25);
}

.online-actions {
    margin-top: 10px;
    align-items: stretch;
}

.room-code-input {
    flex: 0.8;
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.online-status {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.045);
    color: #b0c4de;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.82rem;
    line-height: 1.35;
}

.online-status.ok {
    color: var(--hud-green);
    background: rgba(6, 214, 160, 0.08);
}

.online-status.bad {
    color: var(--hud-red);
    background: rgba(239, 71, 111, 0.09);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: grayscale(0.35);
}

@media (max-width: 720px) {
    .online-actions {
        flex-direction: column;
    }
    .room-code-input {
        flex: 1;
    }
}

/* Battleship Debug Reporter - V175 */
#bs-debug-widget {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 99999;
    font-family: 'Share Tech Mono', monospace;
}

#bs-debug-toggle {
    border: 1px solid rgba(0, 229, 255, 0.8);
    background: rgba(3, 18, 31, 0.92);
    color: #7ff5ff;
    padding: 8px 11px;
    border-radius: 10px;
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.25);
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.06em;
}

#bs-debug-count {
    display: inline-block;
    min-width: 20px;
    margin-left: 5px;
    padding: 1px 5px;
    border-radius: 999px;
    background: rgba(255, 64, 129, 0.25);
    color: #ff9ec2;
}

#bs-debug-panel {
    width: min(720px, calc(100vw - 28px));
    max-height: min(620px, calc(100vh - 80px));
    margin-bottom: 10px;
    padding: 14px;
    border: 1px solid rgba(0, 229, 255, 0.55);
    border-radius: 14px;
    background: rgba(2, 12, 22, 0.97);
    box-shadow: 0 0 35px rgba(0, 229, 255, 0.18);
    color: #d9f9ff;
}

#bs-debug-panel.hidden {
    display: none;
}

.bs-debug-title {
    font-family: 'Orbitron', sans-serif;
    color: #00e5ff;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.bs-debug-help {
    color: #aac0d7;
    font-size: 0.92rem;
    margin-bottom: 10px;
}

.bs-debug-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 8px;
}

.bs-debug-actions button {
    border: 1px solid rgba(0, 229, 255, 0.45);
    border-radius: 8px;
    background: rgba(0, 70, 96, 0.35);
    color: #d9f9ff;
    padding: 7px 9px;
    cursor: pointer;
    font-family: inherit;
}

.bs-debug-actions button:hover {
    background: rgba(0, 160, 190, 0.35);
}

.bs-debug-message {
    min-height: 18px;
    color: #ffcf66;
    margin-bottom: 7px;
    font-size: 0.9rem;
}

#bs-debug-output {
    width: 100%;
    height: min(380px, 48vh);
    resize: vertical;
    background: rgba(0, 0, 0, 0.42);
    border: 1px solid rgba(0, 229, 255, 0.28);
    color: #d9f9ff;
    border-radius: 10px;
    padding: 10px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.82rem;
    line-height: 1.35;
}

@media (max-width: 720px) {
    #bs-debug-widget {
        right: 8px;
        bottom: 8px;
    }
    .bs-debug-actions button {
        flex: 1 1 44%;
    }
}

.btn-online-leave {
    width: 100%;
    margin-top: 0.8rem;
    letter-spacing: 0.12em;
}

.online-room-card .btn-online-leave.hidden {
    display: none;
}


/* --- Carrom-style Online Lobby Panel - V193 --- */
.online-lobby-panel {
    position: fixed;
    left: 18px;
    bottom: 18px;
    width: min(390px, calc(100vw - 36px));
    z-index: 99980;
    pointer-events: auto;
}

.online-lobby-panel.hidden,
.online-lobby-minibar.hidden {
    display: none !important;
}

.online-lobby-card {
    border: 1px solid rgba(0, 229, 255, 0.42);
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(2, 12, 26, 0.96), rgba(0, 32, 48, 0.88));
    box-shadow: 0 0 28px rgba(0, 229, 255, 0.16), inset 0 0 18px rgba(0, 229, 255, 0.04);
    overflow: hidden;
}

.online-lobby-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(0, 229, 255, 0.16);
    background: rgba(0, 0, 0, 0.22);
}

.online-lobby-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.86rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    color: #7ff5ff;
    text-transform: uppercase;
}

.online-lobby-subtitle {
    margin-top: 3px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.76rem;
    color: #9bb7c9;
}

.online-lobby-icon,
.online-lobby-copy {
    border: 1px solid rgba(0, 229, 255, 0.35);
    background: rgba(0, 80, 105, 0.25);
    color: #d9fbff;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Share Tech Mono', monospace;
}

.online-lobby-icon {
    width: 34px;
    height: 30px;
    font-size: 1.1rem;
}

.online-lobby-body {
    padding: 13px 14px 14px;
}

.online-lobby-roomline {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 9px;
    font-family: 'Share Tech Mono', monospace;
    color: #9be7ff;
    font-size: 0.78rem;
    letter-spacing: 0.09em;
}

.online-lobby-roomline strong {
    text-align: center;
    padding: 7px 8px;
    border-radius: 8px;
    background: rgba(0, 229, 255, 0.08);
    color: #ffffff;
    letter-spacing: 0.18em;
}

.online-lobby-copy {
    padding: 7px 9px;
    font-size: 0.72rem;
}

.online-lobby-status {
    margin: 10px 0;
    padding: 9px 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.045);
    color: #cfe9f7;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    line-height: 1.35;
}

.online-lobby-players {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin-bottom: 12px;
}

.online-lobby-player {
    min-width: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.20);
}

.online-lobby-player-label {
    display: block;
    color: #64dfdf;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    margin-bottom: 4px;
}

.online-lobby-player strong {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ffffff;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.78rem;
}

.online-lobby-player small {
    display: block;
    margin-top: 4px;
    color: #9bb7c9;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.72rem;
}

.online-lobby-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.online-lobby-actions .btn {
    padding: 9px 10px;
    font-size: 0.72rem;
    letter-spacing: 0.09em;
}

.online-lobby-minibar {
    position: fixed;
    left: 18px;
    bottom: 18px;
    z-index: 99980;
    max-width: min(380px, calc(100vw - 36px));
    border: 1px solid rgba(0, 229, 255, 0.45);
    border-radius: 999px;
    padding: 10px 15px;
    background: rgba(2, 12, 26, 0.96);
    color: #d9fbff;
    box-shadow: 0 0 22px rgba(0, 229, 255, 0.18);
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.09em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 720px) {
    .online-lobby-panel,
    .online-lobby-minibar {
        left: 10px;
        bottom: 10px;
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
    }
    .online-lobby-players,
    .online-lobby-actions {
        grid-template-columns: 1fr;
    }
}


/* Battleship game-specific service record / leaderboard */
.battleship-service-section {
  margin-top: 1rem;
  border: 1px solid rgba(202, 162, 83, 0.28);
  border-radius: 18px;
  padding: 1rem;
  background: linear-gradient(135deg, rgba(11, 18, 32, 0.84), rgba(23, 20, 37, 0.72));
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.24);
}
.battleship-service-head,
.battleship-panel-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
}
.battleship-service-head h3 { margin-bottom: 0.2rem; }
.battleship-service-head p {
  margin: 0;
  color: rgba(235, 229, 214, 0.68);
  font-size: 0.86rem;
}
.battleship-stats-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(86px, 1fr));
  gap: 0.65rem;
  margin: 0.85rem 0;
}
.battleship-stat-tile {
  border: 1px solid rgba(202, 162, 83, 0.24);
  border-radius: 14px;
  padding: 0.7rem 0.55rem;
  background: rgba(255, 255, 255, 0.045);
  text-align: center;
}
.battleship-stat-tile span {
  display: block;
  color: rgba(235, 229, 214, 0.65);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.battleship-stat-tile strong {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.28rem;
  color: var(--accent-gold, #d7b46a);
}
.battleship-service-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.battleship-service-panel {
  border: 1px solid rgba(202, 162, 83, 0.2);
  border-radius: 16px;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.18);
}
.battleship-panel-title {
  color: var(--accent-gold, #d7b46a);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  margin-bottom: 0.5rem;
}
.battleship-filter-row {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.battleship-filter {
  border: 1px solid rgba(202, 162, 83, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(235, 229, 214, 0.78);
  padding: 0.28rem 0.55rem;
  font-size: 0.7rem;
  cursor: pointer;
}
.battleship-filter.active,
.battleship-filter:hover {
  background: rgba(202, 162, 83, 0.18);
  color: #fff4d1;
}
.battleship-mini-list {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  max-height: 220px;
  overflow: auto;
  color: rgba(235, 229, 214, 0.75);
  font-size: 0.82rem;
}
.battleship-mini-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  padding: 0.45rem 0.55rem;
  background: rgba(255, 255, 255, 0.035);
}
.battleship-mini-rank,
.battleship-mini-result {
  color: var(--accent-gold, #d7b46a);
  font-weight: 800;
}
.battleship-mini-meta {
  color: rgba(235, 229, 214, 0.56);
  font-size: 0.72rem;
}
@media (max-width: 900px) {
  .battleship-stats-grid { grid-template-columns: repeat(3, 1fr); }
  .battleship-service-panels { grid-template-columns: 1fr; }
  .battleship-service-head { align-items: flex-start; flex-direction: column; }
}

/* v198: Carrom-style Battleship profile/leaderboard/replay modal. */
.battleship-leaderboard-overlay {
    position: fixed;
    inset: 0;
    z-index: 2600000;
    display: grid;
    place-items: center;
    padding: 22px;
    background: rgba(2, 4, 10, .72);
    backdrop-filter: blur(7px);
}
.battleship-leaderboard-modal {
    width: min(680px, calc(100vw - 30px));
    max-height: min(780px, calc(100dvh - 30px));
    overflow: hidden;
    padding: 22px;
    border: 1px solid rgba(0, 220, 255, .32);
    border-radius: 20px;
    background: linear-gradient(160deg, rgba(15, 17, 30, .98), rgba(3, 12, 20, .98));
    box-shadow: 0 28px 80px rgba(0,0,0,.62), inset 0 1px 0 rgba(255,255,255,.08);
    color: var(--text-primary);
}
.battleship-leaderboard-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}
.battleship-leaderboard-head small {
    color: var(--accent-cyan, #00d9ff);
    font-weight: 900;
    letter-spacing: .15em;
    text-transform: uppercase;
}
.battleship-leaderboard-head h2 {
    margin: 4px 0 6px;
    font-size: clamp(1.7rem, 4vw, 2.3rem);
    letter-spacing: .08em;
    text-transform: uppercase;
}
.battleship-leaderboard-head p {
    margin: 0;
    color: var(--text-secondary);
    font-size: .9rem;
}
.battleship-leaderboard-controls {
    display: flex;
    gap: 8px;
}
.battleship-leaderboard-icon {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 13px;
    background: rgba(255,255,255,.08);
    color: #fff;
    cursor: pointer;
    font-size: 1.4rem;
    font-weight: 900;
}
.battleship-leaderboard-icon:hover { border-color: var(--accent-cyan, #00d9ff); color: var(--accent-cyan, #00d9ff); }
.battleship-leaderboard-filter-row {
    justify-content: flex-start;
    margin-bottom: 12px;
}
.battleship-leaderboard-list {
    display: grid;
    gap: 9px;
    max-height: min(540px, calc(100dvh - 230px));
    overflow-y: auto;
    padding-right: 4px;
}
.battleship-leaderboard-row {
    display: grid;
    grid-template-columns: 44px 42px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 13px;
    background: rgba(255,255,255,.055);
}
.battleship-leaderboard-rank {
    color: #c8b8ff;
    font-weight: 900;
    text-align: center;
}
.battleship-leaderboard-avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,.18);
    background: linear-gradient(145deg, rgba(0, 220, 255, .34), rgba(255, 169, 77, .42));
    color: #fff;
    font-weight: 900;
}
.battleship-leaderboard-main strong,
.battleship-leaderboard-main span {
    display: block;
}
.battleship-leaderboard-main strong {
    color: #fff;
    font-weight: 900;
    letter-spacing: .04em;
}
.battleship-leaderboard-main span {
    margin-top: 3px;
    color: rgba(255,255,255,.58);
    font-size: .82rem;
}
.battleship-leaderboard-score {
    color: var(--accent-gold, #d7b46a);
    font-size: 1.35rem;
    font-weight: 900;
    text-align: right;
}
.battleship-leaderboard-score span {
    display: block;
    color: rgba(255,255,255,.54);
    font-size: .62rem;
    letter-spacing: .12em;
}
@media (max-width: 620px) {
    .battleship-leaderboard-modal { padding: 16px; }
    .battleship-leaderboard-row { grid-template-columns: 34px 36px 1fr; }
    .battleship-leaderboard-score { grid-column: 3; font-size: 1rem; }
}


/* v198: saved replay modal */
.battleship-replays-modal { max-width: 820px; }
.battleship-replays-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.battleship-replay-row {
  width: 100%;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.045);
  color: rgba(255,255,255,.88);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
}
.battleship-replay-row:hover { border-color: var(--accent-cyan, #00d9ff); }
.battleship-replay-row strong { display: block; color: #fff; font-family: var(--font-display, inherit); letter-spacing: .05em; }
.battleship-replay-row small { display: block; color: rgba(255,255,255,.62); margin-top: 3px; }
.battleship-replay-row em { color: #ffe2a0; font-style: normal; font-weight: 900; text-transform: uppercase; font-size: 12px; }
.battleship-replay-proof {
  margin-top: 16px;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  background: rgba(0,0,0,.22);
  color: rgba(255,255,255,.72);
  padding: 14px;
  min-height: 68px;
}
.battleship-proof-card strong { display: block; color: #fff; font-size: 16px; margin-bottom: 4px; }
.battleship-proof-card span { display: block; color: rgba(255,255,255,.68); margin-bottom: 10px; }
.battleship-proof-card ul { margin: 0; padding-left: 18px; color: rgba(255,255,255,.78); }
.battleship-proof-card li { margin: 4px 0; }

/* v199: Battleship saved replay step-through viewer */
.battleship-replays-modal {
    width: min(1040px, calc(100vw - 28px));
    max-width: 1040px;
}
.battleship-proof-shell {
    display: grid;
    grid-template-columns: minmax(240px, 310px) 1fr;
    gap: 14px;
    min-height: 520px;
}
.battleship-replays-list {
    align-content: start;
    max-height: min(610px, calc(100dvh - 210px));
    overflow-y: auto;
    padding-right: 4px;
}
.battleship-replay-row.active {
    border-color: var(--accent-cyan, #00d9ff);
    background: linear-gradient(145deg, rgba(0,217,255,.14), rgba(255,214,128,.07));
}
.battleship-replay-proof {
    margin-top: 0;
    min-height: 520px;
    overflow: auto;
}
.proof-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.proof-step-count {
    color: var(--accent-gold, #d7b46a);
    font-weight: 900;
    letter-spacing: .08em;
    white-space: nowrap;
}
.proof-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.proof-controls button {
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 10px;
    padding: 8px 12px;
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.9);
    font-weight: 900;
    cursor: pointer;
}
.proof-controls button:hover:not(:disabled) {
    border-color: var(--accent-cyan, #00d9ff);
    color: var(--accent-cyan, #00d9ff);
}
.proof-controls button:disabled {
    opacity: .42;
    cursor: not-allowed;
}
.proof-shot-current {
    border: 1px solid rgba(0,217,255,.18);
    border-radius: 13px;
    background: rgba(0,217,255,.07);
    padding: 11px 12px;
    margin-bottom: 13px;
}
.proof-shot-current strong,
.proof-shot-current span { display: block; }
.proof-shot-current strong { color: #fff; }
.proof-shot-current span { color: rgba(255,255,255,.68); margin-top: 4px; }
.proof-board-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}
.proof-board-card {
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 14px;
    background: rgba(255,255,255,.035);
    padding: 10px;
}
.proof-board-title {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}
.proof-board-title strong { color: #fff; font-size: 13px; }
.proof-board-title span { color: rgba(255,255,255,.48); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.proof-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 3px;
}
.proof-cell {
    aspect-ratio: 1 / 1;
    min-width: 0;
    display: grid;
    place-items: center;
    border-radius: 4px;
    background: rgba(8, 20, 30, .88);
    border: 1px solid rgba(255,255,255,.045);
    color: rgba(255,255,255,.30);
    font-size: 10px;
    font-weight: 900;
}
.proof-cell.has-ship {
    background: rgba(215,180,106,.18);
    border-color: rgba(215,180,106,.28);
    color: rgba(255,232,180,.74);
}
.proof-cell.shot-miss {
    background: rgba(255,255,255,.08);
    color: rgba(255,255,255,.62);
}
.proof-cell.shot-hit {
    background: rgba(255,82,82,.28);
    border-color: rgba(255,82,82,.55);
    color: #fff;
}
.proof-cell.shot-sunk {
    background: rgba(255,0,80,.42);
    box-shadow: 0 0 10px rgba(255,0,80,.25);
}
.proof-log {
    border-top: 1px solid rgba(255,255,255,.08);
    padding-top: 11px;
    display: grid;
    gap: 6px;
    max-height: 210px;
    overflow-y: auto;
}
.proof-log-title {
    color: var(--accent-cyan, #00d9ff);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
    margin-bottom: 2px;
}
.proof-log-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid rgba(255,255,255,.07);
    border-radius: 10px;
    background: rgba(255,255,255,.04);
    color: rgba(255,255,255,.72);
    padding: 8px 10px;
    text-align: left;
    cursor: pointer;
}
.proof-log-row strong { color: rgba(255,255,255,.9); }
.proof-log-row.active {
    border-color: var(--accent-gold, #d7b46a);
    background: rgba(215,180,106,.12);
}
@media (max-width: 840px) {
    .battleship-proof-shell,
    .proof-board-layout { grid-template-columns: 1fr; }
    .battleship-replay-proof { min-height: 360px; }
}


/* v200: public polish for Battleship profile, leaderboard and saved replays */
.battleship-empty-state {
  border: 1px dashed rgba(255,255,255,.14);
  border-radius: 14px;
  padding: 18px;
  background: rgba(255,255,255,.035);
  color: rgba(255,255,255,.68);
  text-align: center;
}
.battleship-empty-state strong {
  display: block;
  color: #fff;
  margin-bottom: 5px;
  letter-spacing: .04em;
}
.battleship-empty-state span {
  display: block;
  color: rgba(255,255,255,.56);
  font-size: .88rem;
  line-height: 1.35;
}
.battleship-leaderboard-modal {
  scrollbar-color: rgba(0,217,255,.45) rgba(255,255,255,.06);
}
.battleship-leaderboard-list,
.battleship-replays-list,
.battleship-replay-proof,
.proof-log {
  scrollbar-width: thin;
  scrollbar-color: rgba(0,217,255,.48) rgba(255,255,255,.06);
}
.battleship-leaderboard-row:first-child {
  background: linear-gradient(145deg, rgba(215,180,106,.12), rgba(0,217,255,.07));
  border-color: rgba(215,180,106,.26);
}
.battleship-leaderboard-row:first-child .battleship-leaderboard-rank,
.battleship-leaderboard-row:first-child .battleship-leaderboard-score {
  color: #ffe3a6;
}
.battleship-replay-row {
  min-height: 70px;
}
.battleship-replay-row.active em {
  color: var(--accent-cyan, #00d9ff);
}
.proof-viewer {
  min-width: 0;
}
.proof-shot-current {
  position: sticky;
  top: 0;
  z-index: 2;
  backdrop-filter: blur(8px);
}
.proof-log-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.proof-log-row strong {
  white-space: nowrap;
}
@media (max-width: 760px) {
  .battleship-leaderboard-overlay {
    align-items: stretch;
    place-items: stretch;
    padding: 10px;
  }
  .battleship-leaderboard-modal,
  .battleship-replays-modal {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 20px);
    padding: 14px;
    border-radius: 16px;
  }
  .battleship-leaderboard-head {
    gap: 10px;
    margin-bottom: 10px;
  }
  .battleship-leaderboard-head h2 {
    font-size: 1.45rem;
    line-height: 1.05;
  }
  .battleship-leaderboard-head p {
    font-size: .78rem;
  }
  .battleship-leaderboard-icon {
    width: 38px;
    height: 38px;
  }
  .battleship-leaderboard-list {
    max-height: calc(100dvh - 195px);
  }
  .battleship-leaderboard-row {
    grid-template-columns: 34px 36px minmax(0,1fr) auto;
    gap: 9px;
    padding: 10px;
  }
  .battleship-leaderboard-main span {
    font-size: .74rem;
  }
  .battleship-leaderboard-score {
    font-size: 1rem;
  }
  .battleship-proof-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .battleship-replays-list {
    max-height: 170px;
  }
  .battleship-replay-proof {
    max-height: calc(100dvh - 285px);
    min-height: 300px;
  }
  .proof-summary {
    flex-direction: column;
    align-items: flex-start;
  }
  .proof-board-layout {
    grid-template-columns: 1fr;
  }
  .proof-grid {
    gap: 2px;
  }
  .proof-cell {
    border-radius: 3px;
    font-size: 8px;
  }
}
@media (max-width: 420px) {
  .battleship-leaderboard-row {
    grid-template-columns: 28px 32px minmax(0,1fr);
  }
  .battleship-leaderboard-score {
    grid-column: 3;
    justify-self: start;
    text-align: left;
  }
  .battleship-replay-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}


/* v201: optional 3-slot saved replay controls */
.battleship-replay-row {
  gap: 10px;
}
.battleship-replay-row.empty {
  opacity: .88;
  border-style: dashed;
}
.battleship-replay-open {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.battleship-replay-slot-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.battleship-replay-save-slot,
.battleship-replay-delete-slot {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
}
.battleship-replay-save-slot:hover {
  border-color: rgba(255,216,140,.7);
  background: rgba(255,216,140,.14);
}
.battleship-replay-delete-slot:hover {
  border-color: rgba(255,92,120,.65);
  background: rgba(255,92,120,.14);
}
#btn-online-save-replay-victory.hidden { display: none !important; }
@media (max-width: 720px) {
  .battleship-replay-row,
  .battleship-replay-open {
    align-items: stretch;
  }
  .battleship-replay-open {
    flex-direction: column;
  }
  .battleship-replay-slot-actions {
    justify-content: flex-start;
  }
}


/* v203: Replay modal containment + usable slot/viewer layout */
.battleship-replays-modal {
  width: min(1120px, calc(100vw - 32px));
  max-width: 1120px;
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(14px, 2vw, 20px);
}
.battleship-replays-modal .battleship-leaderboard-head {
  flex: 0 0 auto;
  margin-bottom: 12px;
}
.battleship-proof-shell {
  flex: 1 1 auto;
  min-height: 0;
  height: min(640px, calc(100dvh - 155px));
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 14px;
}
.battleship-replays-list {
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  padding: 2px 6px 2px 2px;
  margin-top: 0;
}
.battleship-replay-row {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
}
.battleship-replay-row.empty {
  min-height: 76px;
}
.battleship-replay-open {
  min-width: 0;
  width: 100%;
}
.battleship-replay-row span,
.battleship-replay-open span {
  min-width: 0;
}
.battleship-replay-row strong,
.battleship-replay-row small {
  overflow: hidden;
  text-overflow: ellipsis;
}
.battleship-replay-slot-actions {
  flex-shrink: 0;
}
.battleship-replay-proof {
  min-height: 0;
  height: 100%;
  max-height: none;
  overflow: auto;
  box-sizing: border-box;
}
.proof-viewer {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.proof-board-layout {
  grid-template-columns: repeat(2, minmax(230px, 1fr));
  align-items: start;
}
.proof-board-card {
  min-width: 0;
  overflow: hidden;
}
.proof-grid {
  width: 100%;
  min-width: 0;
}
.proof-log {
  min-height: 120px;
  max-height: min(220px, 28dvh);
  overflow-y: auto;
}
.proof-controls button,
.battleship-replay-save-slot,
.battleship-replay-delete-slot {
  touch-action: manipulation;
}
@media (max-width: 900px) {
  .battleship-replays-modal {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    padding: 14px;
  }
  .battleship-proof-shell {
    grid-template-columns: 1fr;
    height: calc(100dvh - 140px);
    gap: 10px;
  }
  .battleship-replays-list {
    max-height: 210px;
  }
  .battleship-replay-proof {
    min-height: 0;
  }
  .proof-board-layout {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 520px) {
  .battleship-replay-row {
    grid-template-columns: 1fr;
  }
  .battleship-replay-slot-actions {
    justify-content: flex-start;
  }
  .proof-controls button {
    flex: 1 1 44%;
  }
}

/* v204: Replay polish + no shot list */
.battleship-replays-modal {
  width: min(1040px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
}
.battleship-proof-shell {
  grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
  height: min(590px, calc(100dvh - 150px));
}
.battleship-replays-list {
  border-right: 1px solid rgba(255,255,255,.08);
  padding-right: 10px;
}
.battleship-replay-row {
  border-radius: 16px;
  padding: 11px;
}
.battleship-replay-row.empty {
  min-height: 68px;
}
.replay-viewer-clean {
  gap: 12px;
  padding: 10px;
}
.replay-viewer-clean .proof-summary,
.replay-viewer-clean .proof-shot-current {
  flex: 0 0 auto;
}
.replay-controls-clean {
  flex: 0 0 auto;
  gap: 8px;
}
.replay-controls-clean button,
.battleship-replay-exit {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
  border-radius: 12px;
  padding: 9px 12px;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.battleship-replay-exit {
  margin-left: auto;
  border-color: rgba(255,180,90,.28);
  color: #ffd77e;
}
.replay-shot-card {
  border-radius: 14px;
  margin-bottom: 0;
}
.replay-board-layout-clean {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}
.replay-board-layout-clean .proof-board-card {
  min-height: 0;
}
.proof-log,
.proof-log-title,
.proof-log-row,
.proof-empty-log {
  display: none !important;
}
.battleship-replay-proof {
  overflow: auto;
}
@media (max-width: 900px) {
  .battleship-proof-shell {
    grid-template-columns: 1fr;
    height: calc(100dvh - 135px);
  }
  .battleship-replays-list {
    border-right: 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
    max-height: 190px;
    padding-right: 4px;
    padding-bottom: 8px;
  }
  .replay-board-layout-clean {
    grid-template-columns: 1fr;
  }
  .battleship-replay-exit {
    margin-left: 0;
  }
}
@media (max-width: 520px) {
  .replay-controls-clean button {
    flex: 1 1 44%;
  }
  .battleship-replay-exit {
    flex-basis: 100%;
  }
}


/* v205: Battleship public polish + trophy identity for leaderboard rows */
.battleship-leaderboard-avatar.battleship-trophy-avatar {
    background: radial-gradient(circle at 34% 28%, rgba(255,255,255,.38), transparent 28%), linear-gradient(145deg, rgba(255, 208, 92, .92), rgba(139, 86, 22, .88));
    border-color: rgba(255, 224, 140, .45);
    box-shadow: 0 0 14px rgba(255, 191, 73, .18), inset 0 0 10px rgba(0,0,0,.2);
    font-size: 19px;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,.55);
}
.battleship-trophy-row:first-child .battleship-trophy-avatar {
    transform: scale(1.04);
    box-shadow: 0 0 18px rgba(255, 210, 105, .28), inset 0 0 12px rgba(0,0,0,.22);
}


/* v206: Battleship public polish final — mobile/layout, empty states, victory and replay cleanup. */
.battleship-leaderboard-modal {
  width: min(760px, calc(100vw - 26px));
  max-height: calc(100dvh - 26px);
  display: flex;
  flex-direction: column;
}
.battleship-leaderboard-head {
  flex: 0 0 auto;
}
.battleship-leaderboard-list {
  min-height: 0;
  padding-right: 6px;
}
.battleship-leaderboard-row {
  grid-template-columns: 46px 46px minmax(0, 1fr) minmax(64px, auto);
  min-height: 78px;
}
.battleship-leaderboard-main { min-width: 0; }
.battleship-leaderboard-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.battleship-leaderboard-main span {
  overflow-wrap: anywhere;
}
.battleship-leaderboard-score {
  min-width: 62px;
}
.battleship-trophy-row:first-child {
  outline: 1px solid rgba(255, 217, 125, .10);
}
.battleship-empty-state-strong {
  min-height: 150px;
  display: grid;
  place-content: center;
}
.battleship-replays-modal {
  width: min(1120px, calc(100vw - 26px));
}
.battleship-replays-list {
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 14px;
  background: rgba(255,255,255,.02);
  padding: 8px;
}
.battleship-replay-row {
  border-radius: 13px;
}
.battleship-replay-open strong,
.battleship-replay-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.replay-viewer-clean .proof-summary {
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding-bottom: 10px;
}
.replay-controls-clean {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 0;
  background: linear-gradient(180deg, rgba(7,13,23,.98), rgba(7,13,23,.80));
  backdrop-filter: blur(4px);
}
.replay-board-layout-clean {
  align-items: start;
}
.proof-board-card {
  overflow: hidden;
}
.proof-grid {
  max-width: 100%;
}
.victory-card {
  width: min(560px, calc(100vw - 28px));
  padding: clamp(20px, 3vw, 34px);
}
.victory-card .btn-large {
  width: min(100%, 360px);
  margin-left: auto;
  margin-right: auto;
}
.victory-card .btn-large + .btn-large {
  margin-top: 10px;
}
.battleship-finish-subtitle {
  width: min(100%, 410px);
  margin: 0 auto 16px;
  border: 1px solid rgba(0,217,255,.16);
  border-radius: 12px;
  background: rgba(0,217,255,.06);
  padding: 10px 12px;
  color: rgba(235,245,255,.74);
  font-size: .86rem;
  line-height: 1.35;
}
.battleship-finish-save {
  border-color: rgba(255, 217, 125, .42) !important;
  background: linear-gradient(145deg, rgba(117, 76, 20, .72), rgba(52, 38, 16, .74)) !important;
  color: #ffe6ad !important;
}
.battleship-finish-leave {
  opacity: .94;
}
@media (max-width: 720px) {
  .battleship-leaderboard-overlay {
    align-items: stretch;
    justify-items: stretch;
    padding: 8px;
  }
  .battleship-leaderboard-modal,
  .battleship-replays-modal {
    width: 100%;
    max-height: calc(100dvh - 16px);
    border-radius: 16px;
    padding: 14px;
  }
  .battleship-leaderboard-head {
    gap: 10px;
  }
  .battleship-leaderboard-head h2 {
    font-size: clamp(1.35rem, 8vw, 1.9rem);
    letter-spacing: .05em;
  }
  .battleship-leaderboard-head p {
    font-size: .82rem;
  }
  .battleship-leaderboard-icon {
    width: 38px;
    height: 38px;
  }
  .battleship-leaderboard-row {
    grid-template-columns: 34px 38px minmax(0, 1fr);
    gap: 9px;
    min-height: 88px;
    padding: 11px;
  }
  .battleship-leaderboard-score {
    grid-column: 3;
    text-align: left;
    display: flex;
    align-items: baseline;
    gap: 7px;
    font-size: 1rem;
  }
  .battleship-leaderboard-score span {
    display: inline;
  }
  .battleship-proof-shell {
    grid-template-columns: 1fr;
    height: calc(100dvh - 150px);
  }
  .battleship-replays-list {
    max-height: 190px;
  }
  .battleship-replay-proof {
    min-height: 0;
  }
  .proof-board-layout {
    grid-template-columns: 1fr;
  }
  .victory-title {
    font-size: clamp(1.45rem, 8vw, 2rem);
    letter-spacing: .08em;
  }
  .winner-announcement {
    font-size: 1rem;
    margin-bottom: 18px;
  }
  .victory-stats {
    width: 100%;
    padding: 14px;
    margin-bottom: 18px;
  }
}
@media (max-width: 460px) {
  .battleship-leaderboard-filter-row {
    flex-wrap: wrap;
  }
  .proof-controls button {
    flex: 1 1 42%;
  }
  .battleship-replay-exit {
    flex-basis: 100%;
  }
}

/* v206-no-shot-log-safety */
.proof-log, .proof-log-title, .proof-log-row { display: none !important; }

/* v207: public Battleship player profiles + public saved replay viewer */
.battleship-profile-open-row {
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.battleship-profile-open-row:hover,
.battleship-profile-open-row:focus-visible {
  border-color: rgba(0,217,255,.38);
  box-shadow: 0 0 0 1px rgba(0,217,255,.12), 0 0 24px rgba(0,217,255,.08);
  transform: translateY(-1px);
}
.battleship-leaderboard-score em {
  display: block;
  margin-top: 3px;
  font-size: .62rem;
  font-style: normal;
  color: rgba(0,217,255,.72);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.battleship-public-profile-modal {
  width: min(1160px, calc(100vw - 26px));
}
.battleship-public-profile-body {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}
.battleship-public-profile-card {
  display: grid;
  gap: 14px;
}
.battleship-public-profile-title {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.018));
}
.battleship-public-profile-title .battleship-trophy-avatar {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
}
.battleship-public-profile-title h3 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: .04em;
  color: #fff;
}
.battleship-public-profile-title p {
  margin: 2px 0 0;
  color: rgba(235,245,255,.68);
}
.battleship-public-stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.battleship-public-stat-grid div {
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 14px;
  padding: 13px 10px;
  background: rgba(255,255,255,.035);
  text-align: center;
}
.battleship-public-stat-grid b {
  display: block;
  color: #ffd978;
  font-size: 1.35rem;
  line-height: 1;
}
.battleship-public-stat-grid span {
  display: block;
  margin-top: 6px;
  color: rgba(235,245,255,.62);
  font-size: .68rem;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.battleship-public-profile-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .95fr);
  gap: 14px;
}
.battleship-public-results,
.battleship-public-replays,
.public-profile-replay-box {
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  background: rgba(3,8,16,.42);
  padding: 12px;
}
.battleship-public-results h4,
.battleship-public-replays h4 {
  margin: 0 0 10px;
  color: #ffd978;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.public-replay-list {
  max-height: 260px;
  overflow: auto;
}
.battleship-public-replay-row {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.battleship-public-replay-row:hover,
.battleship-public-replay-row:focus-visible {
  border-color: rgba(255,217,125,.28);
}
.public-profile-replay-box {
  min-height: 340px;
  overflow: auto;
}
.public-replay-viewer-clean .proof-board-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 900px) {
  .battleship-public-stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .battleship-public-profile-grid {
    grid-template-columns: 1fr;
  }
  .public-profile-replay-box {
    min-height: 260px;
  }
}
@media (max-width: 560px) {
  .battleship-public-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .battleship-public-profile-title h3 {
    font-size: 1.15rem;
  }
  .public-replay-viewer-clean .proof-board-layout {
    grid-template-columns: 1fr;
  }
}
