@import url('https://fonts.googleapis.com/css2?family=Pirata+One&family=Poppins:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('https://img.freepik.com/free-photo/beautiful-tropical-beach-sea-ocean-with-coconut-palm-tree_74190-7454.jpg') center/cover fixed;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 0;
}

/* Animated waves */
.wave {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: url('https://raw.githubusercontent.com/FrontEndMentor/wave-animation/main/wave.png');
    background-size: 1000px 100px;
    animation: wave 10s linear infinite;
    z-index: 1;
    opacity: 0.3;
}

.wave.wave1 {
    animation: wave 30s linear infinite;
    z-index: 1000;
    opacity: 0.2;
    animation-delay: 0s;
    bottom: 0;
}

.wave.wave2 {
    animation: wave 15s linear infinite;
    z-index: 999;
    opacity: 0.1;
    animation-delay: -5s;
    bottom: 10px;
}

@keyframes wave {
    0% { background-position-x: 0; }
    100% { background-position-x: 1000px; }
}

.container {
    position: relative;
    background: url('https://img.freepik.com/free-photo/old-wooden-texture-background-dark-wood-texture-grunge-background-vintage-wooden-texture-top-view_1253-1584.jpg');
    background-size: cover;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.4);
    border: 12px solid #2c1810;
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    z-index: 2;
    transform: scale(0.5);
    transform-origin: center center;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
}

.container::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: url('https://img.freepik.com/free-photo/vintage-grunge-paper-background_1048-11273.jpg');
    background-size: cover;
    z-index: -1;
    filter: brightness(0.8);
    border-radius: 20px;
    opacity: 0.9;
}

/* Pirate notification styling */
.pirate-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(44, 24, 16, 0.95);
    color: #f8d7b0;
    padding: 15px 30px;
    border-radius: 10px;
    font-family: 'Pirata One', cursive;
    font-size: 1.2rem;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 2px solid #8b4513;
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from { transform: translate(-50%, -100%); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.pirate-decorations {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 1.5rem;
}

.decoration {
    font-size: 2rem;
    animation: sway 3s ease-in-out infinite;
}

.decoration.left {
    transform-origin: top right;
}

.decoration.right {
    transform-origin: top left;
}

@keyframes sway {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

h1 {
    text-align: center;
    font-family: 'Pirata One', cursive;
    font-size: 3rem;
    color: #2c1810;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 2px;
}

.board-container {
    position: relative;
    padding: 10px;
    background: rgba(44, 24, 16, 0.1);
    border-radius: 10px;
    margin: 20px 0;
}

.buttons {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

button {
    color: #f8d7b0;
    background: linear-gradient(145deg, #2c1810 0%, #4a3423 100%);
    border: 2px solid #8b4513;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-family: 'Pirata One', cursive;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 150px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

button:hover {
    background: linear-gradient(145deg, #4a3423 0%, #2c1810 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.move-history {
    margin-top: 20px;
    border: 3px solid #2c1810;
    padding: 15px;
    border-radius: 8px;
    height: 120px;
    width: 100%;
    overflow-y: scroll;
    background: url('https://img.freepik.com/free-photo/old-paper-texture_1194-6280.jpg');
    background-size: cover;
    font-family: 'Pirata One', cursive;
    font-size: 1.1rem;
    color: #2c1810;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.move-history span {
    display: block;
    width: 100%;
    white-space: nowrap;
    margin-bottom: 4px;
}

/* Custom scrollbar for move history */
.move-history::-webkit-scrollbar {
    width: 12px;
}

.move-history::-webkit-scrollbar-track {
    background: #d4b483;
    border-radius: 6px;
}

.move-history::-webkit-scrollbar-thumb {
    background: #2c1810;
    border-radius: 6px;
    border: 2px solid #d4b483;
}

@media (max-width: 600px) {
    .container {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    .buttons {
        flex-direction: column;
        align-items: center;
    }
    
    button {
        width: 100%;
        max-width: 200px;
    }
}

.palm-tree {
    position: absolute;
    font-size: 3rem;
    z-index: 1;
    filter: drop-shadow(2px 2px 3px rgba(0,0,0,0.3));
    animation: palmSway 4s ease-in-out infinite;
}

.palm-tree.left {
    left: -40px;
    top: -30px;
    transform-origin: bottom right;
}

.palm-tree.right {
    right: -40px;
    top: -30px;
    transform-origin: bottom left;
    transform: scaleX(-1);
}

@keyframes palmSway {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.palm-tree.right {
    animation-delay: -2s;
}

.move-entry {
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    margin-bottom: 4px;
    width: 100%;
    transition: background-color 0.3s ease;
}

.move-entry:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Game modes styling */
.game-modes {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.mode-btn {
    opacity: 0.7;
    transform: scale(0.95);
}

.mode-btn.active {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* Timer styling */
.timer-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(44, 24, 16, 0.1);
    border-radius: 10px;
    border: 2px solid #2c1810;
}

.timer {
    font-family: 'Pirata One', cursive;
    font-size: 1.2rem;
    color: #2c1810;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    min-width: 150px;
    text-align: center;
}

.timer.active {
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.timer.low-time {
    color: #cc0000;
    animation: pulse 1s infinite;
}

.timer-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.timer-select {
    font-family: 'Pirata One', cursive;
    font-size: 1rem;
    padding: 8px;
    background: rgba(44, 24, 16, 0.9);
    color: #f8d7b0;
    border: 2px solid #8b4513;
    border-radius: 6px;
    cursor: pointer;
    outline: none;
}

.timer-select option {
    background: #2c1810;
    color: #f8d7b0;
}

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