/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Exo:wght@300;400;600;700&family=Rajdhani:wght@300;400;500;600;700&display=swap');

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


body {
    font-family: 'Exo', sans-serif;
    background-color: #123; /* Deep blue background for the sky/deep sea */
    min-height: 100vh;
    color: #e3f2fd;
    overflow-x: hidden; /* Prevent horizontal scroll */
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, 
        rgba(13, 71, 161, 0.95) 0%, 
        rgba(21, 101, 192, 0.95) 50%, 
        rgba(25, 118, 210, 0.95) 100%);
    padding: 1.5rem 2rem;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-bottom: 2px solid rgba(66, 165, 245, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 100%);
    animation: headerShine 3s ease-in-out infinite;
}

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

header h1 {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff 0%, #b3e5fc 50%, #81d4fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 
        0 0 20px rgba(179, 229, 252, 0.5),
        0 0 40px rgba(129, 212, 250, 0.3),
        0 0 60px rgba(66, 165, 245, 0.2);
    letter-spacing: 2px;
    position: relative;
    z-index: 1;
    animation: titleGlow 4s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% {
        filter: brightness(1) drop-shadow(0 0 10px rgba(179, 229, 252, 0.3));
    }
    50% {
        filter: brightness(1.2) drop-shadow(0 0 20px rgba(179, 229, 252, 0.6));
    }
}

.game-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    z-index: 1;
    position: relative;
}

/* Naval Button Styles */
.btn {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(255, 255, 255, 0.2), 
        transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 100%);
    color: white;
    border: 1px solid #0d47a1;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(13, 71, 161, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-secondary {
    background: linear-gradient(135deg, #455a64 0%, #546e7a 100%);
    color: white;
    border: 1px solid #37474f;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #37474f 0%, #455a64 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(55, 71, 79, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-success {
    background: linear-gradient(135deg, #2e7d32 0%, #388e3c 100%);
    color: white;
    border: 1px solid #1b5e20;
}

.btn-success:hover {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(27, 94, 32, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #666 !important;
}

.btn-disabled:hover {
    transform: none !important;
    box-shadow: none !important;
}

.btn-state {
    font-family: 'Exo', sans-serif;
    font-size: 1.1rem;
    padding: 1rem 1.2rem;
    border: 2px solid transparent;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    color: #e3f2fd;
    backdrop-filter: blur(5px);
}

.btn-state.active {
    border-color: #42a5f5;
    background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%);
    color: white;
    box-shadow: 
        0 0 20px rgba(66, 165, 245, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-state:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.1) 100%);
}

main {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    width: 100%;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    overflow-y: auto;
}

.modal-content {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow:
        0 20px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(66, 165, 245, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    font-family: 'Rajdhani', sans-serif;
    color: #e3f2fd;
    font-size: 1.6rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.close {
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
    color: #b3e5fc;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 50%;
}

.close:hover {
    color: #ffffff;
    background: rgba(244, 67, 54, 0.2);
    transform: scale(1.1);
}

.modal-body {
    padding: 2rem;
    color: #e3f2fd;
}

.modal-footer {
    padding: 1rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.05) 100%);
    border-radius: 0 0 12px 12px;
}

/* Search and Verb Selection */
.search-container {
    margin-bottom: 1.5rem;
}

.search-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(66, 165, 245, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: #e3f2fd;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.search-input:focus {
    outline: none;
    border-color: #42a5f5;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(66, 165, 245, 0.3);
}

.search-input::placeholder {
    color: rgba(227, 242, 253, 0.7);
}

.verb-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(66, 165, 245, 0.3);
    border-radius: 8px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
}

.verb-selection-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.verb-selection-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.verb-selection-heading {
    margin: 0;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: #e3f2fd;
    text-transform: uppercase;
}

.selected-verbs-hint {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(179, 229, 252, 0.9);
    font-family: 'Exo', sans-serif;
}

.selected-verbs-list {
    min-height: 300px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(66, 165, 245, 0.3);
    border-radius: 8px;
    padding: 1rem;
    background: rgba(8, 30, 55, 0.55);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.selected-verb-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 6px;
    background: linear-gradient(135deg, rgba(21, 101, 192, 0.3), rgba(41, 121, 255, 0.25));
    border: 1px solid rgba(66, 165, 245, 0.4);
    cursor: grab;
    transition: background 0.2s ease, border 0.2s ease, transform 0.2s ease;
}

.selected-verb-item:hover {
    background: rgba(66, 165, 245, 0.3);
    border-color: rgba(144, 202, 249, 0.6);
}

.selected-verb-item.dragging {
    opacity: 0.6;
    cursor: grabbing;
    transform: scale(0.98);
}

.selected-verb-item.drag-over-top {
    box-shadow: 0 -4px 0 rgba(144, 202, 249, 0.9);
}

.selected-verb-item.drag-over-bottom {
    box-shadow: 0 4px 0 rgba(144, 202, 249, 0.9);
}

.selected-verb-name {
    flex: 1;
    font-family: 'Exo', sans-serif;
    font-size: 1rem;
    color: #e3f2fd;
}

.remove-verb-btn {
    background: rgba(229, 57, 53, 0.25);
    border: 1px solid rgba(244, 67, 54, 0.5);
    color: #ffcdd2;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease, border 0.2s ease;
}

.remove-verb-btn:hover {
    background: rgba(229, 57, 53, 0.4);
    border-color: rgba(244, 67, 54, 0.7);
    transform: scale(1.05);
}

.selected-verbs-column {
    position: relative;
}

.selected-verbs-column::after {
    content: '';
    position: absolute;
    inset: -10px;
    border-radius: 12px;
    border: 1px dashed rgba(66, 165, 245, 0.25);
    pointer-events: none;
}

.verb-item {
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background 0.3s ease;
}

.verb-item:hover {
    background: rgba(66, 165, 245, 0.1);
}

.verb-item:last-child {
    border-bottom: none;
}

.verb-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    color: #e3f2fd;
    font-family: 'Exo', sans-serif;
}

.verb-item input[type="checkbox"] {
    margin-right: 1rem;
    transform: scale(1.3);
    accent-color: #42a5f5;
}

/* Game Phase */
.game-phase {
    background: linear-gradient(135deg, 
        rgba(30, 60, 114, 0.9) 0%, 
        rgba(42, 82, 152, 0.9) 100%);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(66, 165, 245, 0.3);
    backdrop-filter: blur(10px);
}

.game-phase span {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: #e3f2fd;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.ship-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.ship-counter {
    font-family: 'Exo', sans-serif;
    font-size: 1rem;
    color: #b3e5fc;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Board Styles */
.boards-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
    justify-items: center;
    align-items: start;
}

/* Layout for the two boards */
.boards-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    justify-items: center;
    align-items: start;
}

.boards-wrapper .board-legend,
.boards-wrapper .attack-controls {
    grid-column: 1 / -1;
}

.board-section {
    background: linear-gradient(135deg,
        rgba(30, 60, 114, 0.9) 0%,
        rgba(42, 82, 152, 0.9) 100%);
    padding: 2rem;
    border-radius: 16px;
    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(66, 165, 245, 0.3);
    backdrop-filter: blur(10px);
    width: 100%;
    margin: 0 auto;
}

.board-section.enemy-board.hidden {
    display: none;
}

.board-section h2 {
    font-family: 'Rajdhani', sans-serif;
    text-align: center;
    margin-bottom: 1.5rem;
    color: #e3f2fd;
    font-size: 1.6rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.board-tip {
    text-align: center;
    font-size: 0.9rem;
    font-style: italic;
    color: #555;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

.attack-tip {
    text-align: center;
    font-size: 0.9rem;
    font-style: italic;
    color: #b3e5fc;
    margin-top: -0.5rem;
    margin-bottom: 1rem;
}

.board-wrapper {
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

/* Scroll hint for mobile */
@media (max-width: 768px) {
    .board-wrapper::after {
        content: "← swipe to scroll →";
        display: block;
        text-align: center;
        font-size: 0.75rem;
        color: rgba(179, 229, 252, 0.5);
        padding-top: 0.4rem;
        font-family: 'Exo', sans-serif;
    }
}

.game-board {
    display: flex;
    flex-direction: column;
    border: 2px solid #1976d2;
    border-radius: 12px;
    overflow: hidden;
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.05);
    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.board-header {
    display: grid;
    grid-template-columns: 132px repeat(6, minmax(90px, 1fr));
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%);
    color: white;
}

.corner-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    font-weight: bold;
    background: linear-gradient(135deg, #01579b 0%, #0d47a1 100%);
    font-family: 'Rajdhani', sans-serif;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.pronoun-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    font-weight: bold;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9rem;
    font-family: 'Exo', sans-serif;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

.board-grid {
    display: flex;
    flex-direction: column;
}

.board-row {
    display: grid;
    grid-template-columns: 132px repeat(6, minmax(90px, 1fr));
    border-bottom: 1px solid rgba(66, 165, 245, 0.3);
}

.board-row:last-child {
    border-bottom: none;
}

.verb-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-right: 1px solid rgba(66, 165, 245, 0.3);
    color: #e3f2fd;
    font-size: 0.9rem;
    font-family: 'Exo', sans-serif;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.verb-label-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    width: 100%;
    min-width: 0;
    position: relative;
}

.verb-label-text {
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    line-height: 1;
    font-size: 0.86rem;
    text-align: left;
}

.verb-label-text.verb-label-compact {
    font-size: 0.74rem;
    letter-spacing: -0.015em;
}

.verb-label-text.verb-label-tight {
    font-size: 0.63rem;
    letter-spacing: -0.025em;
}

.verb-reference-btn {
    position: absolute;
    top: 50%;
    right: 0;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 999px;
    background: rgba(66, 165, 245, 0.06);
    color: rgba(255, 255, 255, 0.28);
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transform: translateY(-50%);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    box-shadow: none;
}

.verb-reference-btn:hover,
.verb-reference-btn:focus {
    transform: translateY(-50%) scale(1.04);
    background: rgba(66, 165, 245, 0.18);
    color: rgba(255, 255, 255, 0.72);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
    outline: none;
}

.board-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-right: 1px solid rgba(66, 165, 245, 0.3);
    border-left: 1px solid rgba(66, 165, 245, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-height: 54px;
    background: rgba(255, 255, 255, 0.02);
}

.board-cell:hover {
    background: rgba(66, 165, 245, 0.2);
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(66, 165, 245, 0.3);
}

.board-cell:last-child {
    border-right: none;
}

/* Ship States */
.ship-placed {
    background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%) !important;
    color: white;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.ship-fixed {
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.4) 0%, rgba(33, 150, 243, 0.4) 100%) !important;
    color: #e3f2fd;
    border: 1px solid rgba(66, 165, 245, 0.5);
}

/* Ship Hover Preview */
.board-cell.ship-preview {
    background: rgba(244, 67, 54, 0.5) !important;
    border: 2px solid #e53935 !important;
    animation: none;
    position: relative;
}

.board-cell.ship-preview.valid {
    background: rgba(255, 255, 255, 0.25) !important;
    border: 2px dashed rgba(255, 255, 255, 0.7) !important;
    animation: none;
}

/* Cells available for placement */
.board-cell.zone-available {
    background: rgba(100, 181, 246, 0.12) !important;
}

/* Cells prohibited (adjacent buffer zone) */
.board-cell.zone-prohibited {
    background: rgba(244, 67, 54, 0.08) !important;
}

/* Placement error tooltip */
.placement-tooltip {
    position: fixed;
    padding: 0.5rem 0.9rem;
    background: rgba(30, 30, 30, 0.95);
    color: #ef9a9a;
    border: 1px solid rgba(244, 67, 54, 0.6);
    border-radius: 6px;
    font-family: 'Exo', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    animation: tooltipFadeIn 0.15s ease;
}

.placement-tooltip::before {
    content: "⚠ ";
}

@keyframes tooltipFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Attack States */
.board-cell.water {
    background: linear-gradient(135deg, #0288d1 0%, #03a9f4 100%);
    color: white;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.board-cell.water::before {
    content: "💧";
    font-size: 1.4rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.board-cell.hit {
    background: linear-gradient(135deg, #d32f2f 0%, #f44336 100%);
    color: white;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.board-cell.hit::before {
    content: "💥";
    font-size: 1.4rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.board-cell.sunk {
    background: linear-gradient(135deg, #424242 0%, #616161 100%);
    color: white;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.board-cell.sunk::before {
    content: "💀";
    font-size: 1.4rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Board Legend */
.board-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #b3e5fc;
    font-family: 'Exo', sans-serif;
}

.legend-color {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.legend-color.water {
    background: linear-gradient(135deg, #0288d1 0%, #03a9f4 100%);
}

.legend-color.hit {
    background: linear-gradient(135deg, #d32f2f 0%, #f44336 100%);
}

.legend-color.sunk {
    background: linear-gradient(135deg, #424242 0%, #616161 100%);
}

/* Attack Controls */
.attack-controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Enemy Fleet Tracker */
.fleet-tracker {
    margin-top: 1.2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(66, 165, 245, 0.2);
}

.fleet-tracker h4 {
    font-family: 'Rajdhani', sans-serif;
    color: #e3f2fd;
    text-align: center;
    margin-bottom: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.tracker-ships {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.tracker-ship {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.tracker-ship.tracker-sunk {
    opacity: 0.4;
    text-decoration: line-through;
    filter: grayscale(60%);
}

.tracker-img {
    width: 36px;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.3));
}

.tracker-name {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.85rem;
    color: #b3e5fc;
    flex: 1;
    white-space: nowrap;
}

.tracker-status {
    font-size: 0.75rem;
    letter-spacing: 2px;
}

/* Ships Container */
.ships-container {
    background: linear-gradient(180deg, 
        rgba(20, 50, 100, 0.95) 0%, 
        rgba(30, 65, 130, 0.95) 60%,
        rgba(50, 90, 160, 0.9) 100%);
    padding: 1.5rem 1.5rem 1rem;
    border-radius: 16px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(66, 165, 245, 0.3);
    backdrop-filter: blur(10px);
    margin-bottom: 2rem;
}

.ships-container h3 {
    font-family: 'Rajdhani', sans-serif;
    text-align: center;
    margin-bottom: 1rem;
    color: #e3f2fd;
    font-size: 1.4rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 1px;
}

.ships-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 1rem;
    justify-items: center;
}

.ship {
    background: linear-gradient(180deg, 
        rgba(15, 40, 80, 0.7) 0%,
        rgba(20, 55, 110, 0.8) 100%);
    border: 2px solid rgba(66, 165, 245, 0.35);
    border-radius: 12px;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 220px;
    min-width: 0;
    position: relative;
}

.ship:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 8px 25px rgba(66, 165, 245, 0.25),
        0 0 15px rgba(66, 165, 245, 0.15);
    border-color: #64b5f6;
}

.ship.active {
    border-color: #81c784;
    background: linear-gradient(180deg, rgba(30, 70, 50, 0.7) 0%, rgba(40, 90, 70, 0.8) 100%);
    box-shadow:
        0 0 20px rgba(129, 199, 132, 0.4),
        0 0 40px rgba(129, 199, 132, 0.15);
}

.ship.ship-placed-ui {
    opacity: 0.45;
    cursor: not-allowed;
    border-color: #4caf50;
    filter: grayscale(30%);
}

.ship.ship-placed-ui:hover {
    transform: none;
    box-shadow: none;
}

.ship.ship-placed-ui .ship-card-info::after {
    content: "✓ PLACED";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #4caf50;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
    background: rgba(0, 0, 0, 0.5);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    z-index: 2;
}

/* Ship card top: image area */
.ship-card-top {
    background: linear-gradient(180deg, 
        rgba(200, 220, 240, 0.12) 0%, 
        rgba(100, 150, 200, 0.08) 100%);
    padding: 0.6rem 0.5rem 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
}

.ship-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 55px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
    transition: transform 0.3s ease;
}

.ship:hover .ship-image {
    transform: scale(1.05);
}

.ship.active .ship-image {
    filter: drop-shadow(0 2px 8px rgba(129, 199, 132, 0.6));
}

/* Ship card info: name + size pips + rotate */
.ship-card-info {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
        "name rotate"
        "size rotate";
    align-items: center;
    column-gap: 0.55rem;
    row-gap: 0.3rem;
    padding: 0.6rem 0.75rem;
    position: relative;
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(66, 165, 245, 0.15);
}

.ship-name {
    grid-area: name;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 0.78rem;
    color: #e3f2fd;
    white-space: normal;
    line-height: 1.05;
    min-width: 0;
}

/* Size bar: shows pips representing cells */
.ship-size-bar {
    grid-area: size;
    display: flex;
    gap: 3px;
    flex: 1;
    justify-content: flex-start;
    transition: all 0.3s ease;
}

.ship-size-bar.vertical {
    flex-direction: column;
    align-items: flex-start;
}

.ship-size-pip {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    background: linear-gradient(135deg, #1976d2 0%, #42a5f5 100%);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), 0 1px 3px rgba(0,0,0,0.3);
}

.ship.active .ship-size-pip {
    background: linear-gradient(135deg, #388e3c 0%, #66bb6a 100%);
    border-color: rgba(255, 255, 255, 0.35);
}

.rotate-btn {
    grid-area: rotate;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    background: rgba(66, 165, 245, 0.2);
    border: 1px solid rgba(66, 165, 245, 0.4);
    color: #e3f2fd;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    flex-shrink: 0;
    touch-action: manipulation;
}

.rotate-btn:hover {
    background: rgba(66, 165, 245, 0.4);
    transform: rotate(90deg);
}

.ship.dragging-ship {
    opacity: 0.5;
    transform: scale(0.95);
}



@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ship-visual {
    display: none;
    gap: 3px;
    justify-content: center;
    align-items: center;
}

.ship-visual.vertical {
    flex-direction: column;
}

.ship-cell {
    width: 27px;
    height: 27px;
    background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%);
    border: 2px solid #0d47a1;
    border-radius: 4px;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Game Info */
.game-info {
    background: linear-gradient(135deg, 
        rgba(30, 60, 114, 0.9) 0%, 
        rgba(42, 82, 152, 0.9) 100%);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(66, 165, 245, 0.3);
    backdrop-filter: blur(10px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.info-section h3 {
    font-family: 'Rajdhani', sans-serif;
    color: #e3f2fd;
    margin-bottom: 1rem;
    font-size: 1.3rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.info-section p {
    color: #b3e5fc;
    line-height: 1.6;
    font-family: 'Exo', sans-serif;
}

.selected-verbs-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}


.verb-tag {
    background: linear-gradient(135deg, #1976d2 0%, #2196f3 100%);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: 'Exo', sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    body.custom-game .verb-tag {
        font-size: 0.8rem;
    }
}

/* Tooltip Styles */
.tooltip-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-left: 10px;
}

.tooltip-trigger {
    font-family: 'Orbitron', monospace;
    font-weight: 700;
    font-size: 0.9rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #42a5f5 0%, #2196f3 100%);
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tooltip-trigger:hover,
.tooltip-trigger:focus {
    background: linear-gradient(135deg, #64b5f6 0%, #42a5f5 100%);
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
    outline: none; /* Remove default focus outline */
}

.tooltip-content {
    visibility: hidden;
    opacity: 0;
    width: 250px; /* Adjust width as needed */
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #e3f2fd;
    text-align: left;
    border-radius: 8px;
    padding: 15px;
    position: absolute;
    z-index: 10;
    bottom: 125%; /* Position above the trigger */
    left: 50%;
    transform: translateX(-50%) translateY(10px); /* Initial offset for animation */
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(66, 165, 245, 0.3);
    backdrop-filter: blur(5px);
    font-size: 0.9rem;
}

.tooltip-trigger:hover + .tooltip-content,
.tooltip-trigger:focus + .tooltip-content {
    visibility: visible;
    opacity: 1;
    transform: translateX(-50%) translateY(0); /* Move to final position */
}

.tooltip-content p {
    margin-bottom: 10px;
    line-height: 1.5;
    font-family: 'Exo', sans-serif;
}

.tooltip-content .tooltip-arrow {
    content: '';
    position: absolute;
    top: 100%; /* At the bottom of the tooltip content */
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: #2a5298 transparent transparent transparent; /* Arrow pointing down */
    filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.2)); /* Shadow for the arrow */
}

/* Responsive adjustments for tooltip */
@media (max-width: 768px) {
    .tooltip-content {
        width: 200px; /* Smaller width on small screens */
        padding: 10px;
        font-size: 0.8rem;
        bottom: 100%; /* Adjust position slightly */
        left: 0;
        transform: translateX(0) translateY(10px); /* Align left, no X translate */
    }
    .tooltip-trigger:hover + .tooltip-content,
    .tooltip-trigger:focus + .tooltip-content {
        transform: translateX(0) translateY(0);
    }
    .tooltip-content .tooltip-arrow {
        left: 15px; /* Adjust arrow position for left-aligned tooltip */
        transform: translateX(0);
    }

    .tooltip-container {
        margin-left: 0;
        justify-content: flex-start;
    }

    .verb-reference-toolbar {
        grid-template-columns: 1fr;
    }

    .verb-reference-table th,
    .verb-reference-table td {
        min-width: 220px;
    }
}

.verb-reference-modal-content {
    max-width: 720px;
}

.verb-reference-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.verb-reference-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
    gap: 1rem;
    align-items: end;
}

.verb-reference-summary h3 {
    margin: 0;
    font-size: 1.4rem;
}

.verb-reference-summary p {
    margin: 0.35rem 0 0;
    color: rgba(179, 229, 252, 0.9);
}

.verb-reference-tense-picker {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.verb-reference-tense-picker label {
    font-weight: 600;
    color: #e3f2fd;
}

.verb-reference-table-wrap {
    overflow-x: auto;
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(66, 165, 245, 0.25);
    background: rgba(8, 30, 55, 0.4);
}

.verb-reference-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.verb-reference-table th,
.verb-reference-table td {
    padding: 0.95rem;
    vertical-align: top;
    border-bottom: 1px solid rgba(66, 165, 245, 0.2);
}

.verb-reference-table th {
    text-align: left;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #b3e5fc;
    background: rgba(13, 71, 161, 0.45);
}

.verb-reference-table tr:last-child td {
    border-bottom: none;
}

.reference-pronoun-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.reference-pronoun-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(179, 229, 252, 0.9);
}

.reference-pronoun-value {
    font-size: 1rem;
    color: #fff;
    overflow-wrap: anywhere;
}

.reference-inline-variant {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: rgba(227, 242, 253, 0.9);
}

/* Attack Modal */
.attack-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
}

.attack-info p {
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
    font-family: 'Exo', sans-serif;
}

.attack-info span {
    font-weight: bold;
    color: #81d4fa;
    font-family: 'Rajdhani', sans-serif;
}

.verb-translation {
    font-weight: 400 !important;
    font-style: italic;
    color: #90caf9 !important;
    font-size: 0.95rem;
    opacity: 0.8;
}

.conjugation-input {
    margin-bottom: 1.5rem;
}

.conjugation-input label {
    display: block;
    margin-bottom: 0.8rem;
    font-weight: 500;
    color: #e3f2fd;
    font-family: 'Exo', sans-serif;
    font-size: 1.1rem;
}

.conjugation-input input {
    width: 100%;
    padding: 1rem;
    border: 2px solid rgba(66, 165, 245, 0.3);
    border-radius: 8px;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.1);
    color: #e3f2fd;
    font-family: 'Exo', sans-serif;
    backdrop-filter: blur(5px);
}

.conjugation-input input:focus {
    outline: none;
    border-color: #42a5f5;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 20px rgba(66, 165, 245, 0.3);
}

.conjugation-input input::placeholder {
    color: rgba(227, 242, 253, 0.7);
}

.conjugation-result {
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-family: 'Exo', sans-serif;
    font-size: 1.1rem;
}

.success {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.2) 0%, rgba(129, 199, 132, 0.2) 100%);
    color: #81c784;
    border: 1px solid rgba(129, 199, 132, 0.5);
    padding: 1rem;
    border-radius: 8px;
    backdrop-filter: blur(5px);
    animation: successPop 0.4s ease;
}

@keyframes successPop {
    0% { transform: scale(0.9); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.error {
    background: linear-gradient(135deg, rgba(244, 67, 54, 0.2) 0%, rgba(229, 115, 115, 0.2) 100%);
    color: #ef5350;
    border: 1px solid rgba(229, 115, 115, 0.5);
    padding: 1rem;
    border-radius: 8px;
    backdrop-filter: blur(5px);
    animation: shakeError 0.5s ease;
}

@keyframes shakeError {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-8px); }
    30% { transform: translateX(8px); }
    45% { transform: translateX(-6px); }
    60% { transform: translateX(6px); }
    75% { transform: translateX(-3px); }
    90% { transform: translateX(3px); }
}

/* Cell unlock animation */
.board-cell.cell-correct {
    animation: cellCorrect 0.6s ease;
}

@keyframes cellCorrect {
    0% { box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7); }
    50% { box-shadow: 0 0 20px 8px rgba(76, 175, 80, 0.4); }
    100% { box-shadow: none; }
}

.board-cell.cell-incorrect {
    animation: cellShake 0.5s ease;
}

@keyframes cellShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

.game-over-modal .modal-content {
    background: linear-gradient(135deg, #d32f2f 0%, #f44336 100%);
    border: 2px solid #b71c1c;
    text-align: center;
}

.game-over-message h3 {
    font-family: 'Orbitron', monospace;
    font-size: 2rem;
    color: #ffebee;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.game-over-message p {
    font-size: 1.2rem;
    color: #ffcdd2;
    margin-bottom: 2rem;
}

.game-over-message strong {
    color: #fff;
    font-weight: bold;
}

/* Pass Device Modal (2-player) */
.pass-device-content {
    background: linear-gradient(135deg, #0d47a1 0%, #1565c0 100%) !important;
    border: 2px solid #42a5f5;
    max-width: 420px;
    text-align: center;
}


/* Responsive Design */
@media (max-width: 1200px) {
    .boards-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        justify-items: center;
    }

    .boards-wrapper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
        justify-items: center;
        width: 100%;
    }

    .board-section {
        padding: 1rem;
    }

    .board-section h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .board-header {
        grid-template-columns: 94px repeat(6, minmax(52px, 1fr));
    }

    .board-row {
        grid-template-columns: 94px repeat(6, minmax(52px, 1fr));
    }

    .verb-cell,
    .pronoun-cell {
        padding: 0.55rem;
        font-size: 0.72rem;
    }

    .verb-label-text {
        font-size: 0.76rem;
    }

    .verb-label-text.verb-label-compact {
        font-size: 0.68rem;
    }

    .verb-label-text.verb-label-tight {
        font-size: 0.58rem;
    }

    .verb-reference-btn {
        width: 24px;
        height: 24px;
        font-size: 0.78rem;
    }

    .board-cell {
        min-height: 40px;
        padding: 0.55rem;
    }

    .board-cell::before {
        font-size: 1.1rem;
    }

    .attack-tip,
    .legend-item,
    .tracker-name {
        font-size: 0.78rem;
    }
    
    .game-info {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
}

@media (max-width: 920px) {
    .boards-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    main {
        padding: 1rem;
    }
    
    header {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 1.6rem;
    }
    
    .game-controls {
        gap: 0.5rem;
    }
    
    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .board-header {
        grid-template-columns: 108px repeat(6, minmax(70px, 1fr));
    }

    .board-row {
        grid-template-columns: 108px repeat(6, minmax(70px, 1fr));
    }
    
    .verb-cell, .pronoun-cell {
        padding: 0.8rem;
        font-size: 0.8rem;
    }

    .verb-label-text {
        font-size: 0.78rem;
    }

    .verb-label-text.verb-label-compact {
        font-size: 0.69rem;
    }

    .verb-label-text.verb-label-tight {
        font-size: 0.61rem;
    }

    .verb-reference-btn {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }
    
    .board-cell {
        padding: 0.8rem;
        min-height: 45px;
    }
    
    .ships-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.7rem;
    }

    .ship {
        max-width: none;
    }

    .ship-card-info {
        padding: 0.55rem 0.6rem;
    }

    .ship-name {
        font-size: 0.72rem;
    }

    .rotate-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .attack-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
}

@media (max-width: 480px) {
    .board-header {
        grid-template-columns: 86px repeat(6, minmax(60px, 1fr));
    }

    .board-row {
        grid-template-columns: 86px repeat(6, minmax(60px, 1fr));
    }
    
    .verb-cell, .pronoun-cell {
        padding: 0.5rem;
        font-size: 0.7rem;
    }

    .verb-label-content {
        gap: 0.35rem;
    }

    .verb-label-text {
        font-size: 0.69rem;
    }

    .verb-label-text.verb-label-compact {
        font-size: 0.62rem;
    }

    .verb-label-text.verb-label-tight {
        font-size: 0.56rem;
    }

    .verb-reference-btn {
        width: 22px;
        height: 22px;
        font-size: 0.75rem;
    }
    
    .board-cell {
        padding: 0.5rem;
        min-height: 36px;
    }
    
    .board-cell::before {
        font-size: 1.2rem;
    }
    
    .game-phase {
        flex-direction: column;
        text-align: center;
    }
    
    .ship-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    header h1 {
        font-size: 1.4rem;
    }
}

@media (max-width: 560px) {
    .ships-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Accessibility */
.board-cell:focus {
    outline: 3px solid #42a5f5;
    outline-offset: 2px;
}

.btn:focus {
    outline: 3px solid #42a5f5;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .board-cell.water {
        background: #000080;
        color: #ffffff;
    }
    
    .board-cell.hit {
        background: #800000;
        color: #ffffff;
    }
    
    .board-cell.sunk {
        background: #000000;
        color: #ffffff;
    }
}

/* Tense dropdown styles */
.tense-selection select#tense-select option {
    background-color: #1e3c72;
    color: #e3f2fd;
    padding: 0.5rem 1rem;
    font-size: 1rem;
}

.tense-selection select#custom-tense-select option {
    background-color: #1e3c72;
    color: #e3f2fd;
    padding: 0.5rem 1rem;
    font-size: 1rem;
}

.tense-selection select#tense-select option:hover {
    background-color: #2a5298;
}

.tense-selection select#custom-tense-select option:hover {
    background-color: #2a5298;
}

.search-input.active-select {
    border-color: #42a5f5;
    box-shadow: 0 0 20px rgba(66, 165, 245, 0.3);
}



#animated-ships-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px; /* Area where ships will appear */
    pointer-events: none;
    z-index: 1; /* Above waves, below content */
}

/* New Wave Background Styles */
#wave-background {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70vh; 
    z-index: 0; /* Behind content and ships */
    pointer-events: none; /* Allow clicks through */
}
#wave-background svg {
    width: 100%;
    height: 100%;
}
#wave-background use {
    animation: move-forever 15s linear infinite;
}
#wave-background use:nth-child(2) {
    animation-duration: 30s;
    animation-delay: -10s;
}
#wave-background use:nth-child(1) {
    animation-duration: 40s;
}
@keyframes move-forever {
    0% { transform: translate(-2px, 0); }
    100% { transform: translate(0px, 0); }
}

.animated-ship {
    position: absolute;
    width: 300px; /* Ajusta el tamaño del barco según tu imagen */
    height: 150px; /* Ajusta el tamaño del barco según tu imagen */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: shipSlide 25s linear forwards, shipVerticalMotion 4s ease-in-out infinite; /* Duración y tipo de animación */
    opacity: 0.8; /* Ligeramente transparente para efecto de "dentro del agua" */
    filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5));
    bottom: 0;
}

@keyframes shipSlide {
    from { left: -450px; } /* Empieza fuera de la pantalla a la izquierda */
    to { left: calc(100vw + 450px); } /* Termina fuera de la pantalla a la derecha */
}

@keyframes shipVerticalMotion {
    0% { transform: translateY(0px); }
    25% { transform: translateY(-5px); }
    50% { transform: translateY(0px); }
    75% { transform: translateY(5px); }
    100% { transform: translateY(0px); }
}

/* Responsive Design (asegúrate de mantener tus media queries existentes) */
@media (max-width: 768px) {
    .animated-ship {
        width: 210px; /* Ajusta el tamaño en pantallas pequeñas */
        height: 105px;
    }
    @keyframes shipSlide {
        from { left: -300px; }
        to { left: calc(100vw + 300px); }
    }
}

/* Footer Styles */
footer.page-footer {
    position: relative;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    padding: 1rem 0 1.25rem;
    margin-top: 0.5rem;
    z-index: 1;
}

/* Toggle Switch Styles */
.toggle-switch-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.toggle-label {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    color: white;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    transform: translateX(26px);
}
