/* 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;
}

/* 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;
}

/* 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-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;
}

.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: 90px 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: 90px 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);
}

.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.4) !important;
    border: 2px solid #f44336 !important;
    animation: pulsePreview 1s ease-in-out infinite;
}

.board-cell.ship-preview.valid {
    background: rgba(76, 175, 80, 0.4) !important;
    border: 2px solid #4caf50 !important;
}

@keyframes pulsePreview {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.7; }
}

/* 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;
}

/* Ships Container */
.ships-container {
    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);
    margin-bottom: 2rem;
}

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

.ships-list {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.ship {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.1) 0%, 
        rgba(255, 255, 255, 0.05) 100%);
    border: 2px solid #42a5f5;
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    backdrop-filter: blur(5px);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.ship:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(66, 165, 245, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: #64b5f6;
}

.ship.active {
    border-color: #81c784;
    background: linear-gradient(135deg, rgba(129, 199, 132, 0.2) 0%, rgba(129, 199, 132, 0.1) 100%);
    box-shadow:
        0 0 20px rgba(129, 199, 132, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.ship.ship-placed-ui {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.3) 0%, rgba(129, 199, 132, 0.3) 100%);
    border-color: #4caf50;
}

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

.ship.ship-placed-ui .ship-name::after {
    content: " \2713 PLACED";
    color: #4caf50;
    font-size: 0.8rem;
    font-weight: bold;
}

.ship-name {
    display: block;
    text-align: center;
    font-weight: bold;
    margin-bottom: 0.8rem;
    color: #e3f2fd;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
}

.ship-image {
    display: block;
    width: 100%;
    height: auto;
    margin: 0 auto 0.5rem auto;
    max-width: 120px;
}

.rotate-btn {
    display: block;
    margin: 0 auto 0.5rem auto;
    background: transparent;
    border: 1px solid #42a5f5;
    color: #e3f2fd;
    border-radius: 4px;
    cursor: pointer;
    padding: 0.2rem 0.5rem;
    transition: background 0.3s ease;
}

.rotate-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}



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

.ship-visual {
    display: flex;
    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: inline-block; /* Allows button and trigger to be next to each other */
    margin-left: 10px; /* Space between button and tooltip trigger */
}

.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);
    }
}

/* 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;
}

.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);
}

.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);
}

.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;
}


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

    .boards-wrapper {
        grid-template-columns: 1fr;
        justify-items: center;
    }
    
    .game-info {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
}

@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: 72px repeat(6, minmax(70px, 1fr));
    }

    .board-row {
        grid-template-columns: 72px repeat(6, minmax(70px, 1fr));
    }
    
    .verb-cell, .pronoun-cell {
        padding: 0.8rem;
        font-size: 0.8rem;
    }
    
    .board-cell {
        padding: 0.8rem;
        min-height: 45px;
    }
    
    .ships-list {
        flex-direction: column;
        align-items: center;
    }
    
    .ship {
        margin-bottom: 1rem;
        width: 100%;
        max-width: 300px;
    }
    
    .attack-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
}

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

    .board-row {
        grid-template-columns: 54px repeat(6, minmax(60px, 1fr));
    }
    
    .verb-cell, .pronoun-cell {
        padding: 0.5rem;
        font-size: 0.7rem;
    }
    
    .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;
    }
}

/* 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: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    padding: 0.5rem 0;
    z-index: 10;
}
