/* Pirate Scoreboard CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cinzel', serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #4a7c9b 100%);
    color: #f4d03f;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Ocean Background Animation */
.ocean-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        linear-gradient(transparent, rgba(72, 139, 198, 0.1)),
        radial-gradient(ellipse at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: wave 8s ease-in-out infinite;
    z-index: -2;
}

@keyframes wave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Ship Decoration */
.ship-decoration {
    position: fixed;
    top: 20%;
    right: -200px;
    width: 300px;
    height: 200px;
    background: 
        linear-gradient(45deg, #8B4513 0%, #A0522D 50%, #D2691E 100%);
    clip-path: polygon(20% 100%, 0% 80%, 0% 40%, 20% 0%, 100% 0%, 100% 100%);
    opacity: 0.1;
    z-index: -1;
    animation: sail 15s linear infinite;
}

@keyframes sail {
    from { transform: translateX(0); }
    to { transform: translateX(-150vw); }
}

/* Header Styles */
header {
    text-align: center;
    padding: 2rem 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-bottom: 3px solid #f4d03f;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.skull-decoration {
    font-size: 3rem;
    position: absolute;
    top: 1rem;
    left: 2rem;
    animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

h1 {
    font-family: 'Pirata One', cursive;
    font-size: 3rem;
    color: #f4d03f;
    text-shadow: 3px 3px 0px #8B4513, 6px 6px 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.subtitle {
    font-size: 1.2rem;
    color: #fdeaa7;
    font-style: italic;
    margin-bottom: 1rem;
}

.last-updated {
    background: rgba(139, 69, 19, 0.8);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: inline-block;
    border: 2px solid #f4d03f;
    font-size: 0.9rem;
}

/* Main Content */
main {
    padding: 2rem 1rem;
    display: flex;
    justify-content: center;
    min-height: 60vh;
}

.treasure-chest {
    background: 
        linear-gradient(135deg, #8B4513 0%, #A0522D 30%, #CD853F 100%);
    border: 4px solid #f4d03f;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 
        0 0 30px rgba(244, 208, 63, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.2);
    position: relative;
    max-width: 1000px;
    width: 100%;
}

.treasure-chest::before {
    content: "💰";
    position: absolute;
    top: -20px;
    left: 20px;
    font-size: 2rem;
    background: #8B4513;
    padding: 0.5rem;
    border-radius: 50%;
    border: 2px solid #f4d03f;
}

.treasure-chest::after {
    content: "🗡️";
    position: absolute;
    top: -20px;
    right: 20px;
    font-size: 2rem;
    background: #8B4513;
    padding: 0.5rem;
    border-radius: 50%;
    border: 2px solid #f4d03f;
}

/* Loading and Error Messages */
.loading-message, .error-message {
    text-align: center;
    font-size: 1.5rem;
    color: #fdeaa7;
    padding: 2rem;
}

.loading-message {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.error-message {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border-radius: 10px;
    border: 2px dashed #ff6b6b;
}

/* Scoreboard Table */
.scoreboard-container {
    overflow-x: auto;
}

.scoreboard-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.scoreboard-table thead {
    background: rgba(0, 0, 0, 0.4);
}

.scoreboard-table th {
    padding: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: #f4d03f;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 3px solid #f4d03f;
}

.scoreboard-table tbody tr {
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.scoreboard-table tbody tr:hover {
    background: rgba(244, 208, 63, 0.2);
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.scoreboard-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.08);
}

.scoreboard-table td {
    padding: 1rem;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(244, 208, 63, 0.3);
}

/* Rank Styling */
.rank-1 {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.05)) !important;
    border-left: 5px solid gold;
}

.rank-2 {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.05)) !important;
    border-left: 5px solid silver;
}

.rank-3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.05)) !important;
    border-left: 5px solid #cd7f32;
}

.crew-name {
    font-weight: bold;
    color: #fdeaa7;
}

.score {
    font-family: 'Pirata One', cursive;
    font-size: 1.3rem;
    color: #f4d03f;
    text-align: center;
}

.rank {
    text-align: center;
    font-weight: bold;
    font-size: 1.2rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    background: rgba(0, 0, 0, 0.4);
    border-top: 2px solid #f4d03f;
    color: #fdeaa7;
    position: relative;
    margin-top: auto;
}

.compass {
    position: absolute;
    top: 1rem;
    left: 2rem;
    font-size: 2rem;
    animation: spin 10s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.anchor {
    position: absolute;
    top: 1rem;
    right: 2rem;
    font-size: 2rem;
    animation: bob 3s ease-in-out infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .treasure-chest {
        padding: 1rem;
        margin: 0 0.5rem;
    }
    
    .scoreboard-table th,
    .scoreboard-table td {
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .skull-decoration,
    .compass,
    .anchor {
        font-size: 1.5rem;
    }
    
    .ship-decoration {
        display: none;
    }
}

@media (max-width: 480px) {
    header {
        padding: 1rem 0.5rem;
    }
    
    h1 {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }
    
    .last-updated {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
    
    .treasure-chest::before,
    .treasure-chest::after {
        font-size: 1.5rem;
        padding: 0.3rem;
    }
    
    .scoreboard-table th,
    .scoreboard-table td {
        padding: 0.3rem;
        font-size: 0.8rem;
    }
}

/* Special Effects */
@keyframes treasure-glow {
    0%, 100% { 
        box-shadow: 
            0 0 30px rgba(244, 208, 63, 0.3),
            inset 0 0 20px rgba(0, 0, 0, 0.2);
    }
    50% { 
        box-shadow: 
            0 0 40px rgba(244, 208, 63, 0.6),
            inset 0 0 30px rgba(0, 0, 0, 0.1);
    }
}

.treasure-chest:hover {
    animation: treasure-glow 2s ease-in-out infinite;
}

/* Smooth transitions for all interactive elements */
* {
    transition: all 0.3s ease;
}