/* 1. Font Setup */
@font-face {
    font-family: 'PirateFont';
    src: url('./fonts/pieces_of_eight.ttf?v=3') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'Inter', sans-serif;
    background: #000 url('night_ocean.png') no-repeat center center fixed;
    background-size: cover;
    color: #f0f0f0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    position: relative;
}

/* 2. Hero Header */
.hero {
    text-align: center;
    padding: clamp(2rem, 5vw, 3.75rem) clamp(1rem, 3vw, 1.25rem) clamp(1.5rem, 4vw, 2.5rem);
    position: relative;
    z-index: 1;
}

.brand-title {
    font-family: 'PirateFont', Georgia, serif !important;
    font-size: clamp(3rem, 8vw, 6.5rem);
    margin: 0;
    background: linear-gradient(to bottom, #f1c40f 0%, #d4af37 50%, #8e6d13 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(4px 4px 2px rgba(0,0,0,0.8));
    text-transform: lowercase;
}

.brand-subtitle {
    margin-top: -10px;
    text-transform: uppercase;
    letter-spacing: clamp(2px, 0.5vw, 6px);
    color: #666;
    font-weight: 300;
    font-size: clamp(0.65rem, 1.2vw, 0.85rem);
}

/* 3. Grid & Cards */
.main-content {
    position: relative;
    z-index: 1;
}

.container {
    display: flex;
    gap: clamp(1rem, 3vw, 2rem);
    justify-content: center;
    flex-wrap: wrap;
    padding: clamp(1rem, 2vw, 1.25rem);
    max-width: 1400px;
    margin: 0 auto;
}

.server-card {
    background: #1a1a1a;
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: clamp(1.5rem, 3vw, 2rem);
    width: 280px;
    text-align: center;
    transition: all 0.3s ease;
}

@media (max-width: 640px) {
    .server-card {
        width: 100%;
        max-width: 350px;
    }
}

.server-card:hover {
    border-color: #d4af37;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.server-card h2 {
    margin-top: 0;
    font-weight: 600;
    color: #eee;
}

/* 4. Status Styles */
.status-box {
    margin: clamp(1rem, 2vw, 1.25rem) 0;
    font-size: clamp(0.85rem, 1.2vw, 0.9rem);
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* The actual dot */
.status-dot {
    height: 10px;
    width: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dot-online { 
    background-color: #2ecc71; 
    box-shadow: 0 0 8px #2ecc71; 
}

.dot-offline { 
    background-color: #e74c3c; 
}

.text-online { color: #2ecc71; font-weight: bold; }
.text-offline { color: #e74c3c; font-weight: bold; }

/* 5. Buttons */
.btn {
    display: inline-block;
    padding: clamp(0.7rem, 1.5vw, 0.75rem) clamp(1.2rem, 2vw, 1.5rem);
    text-decoration: none;
    color: white;
    border-radius: 6px;
    font-size: clamp(0.9rem, 1.2vw, 1rem);
    font-weight: bold;
    border: 2px solid transparent;
    transition: 0.3s;
}

.refresh-btn {
    all: unset; /* Nukes default browser button styling */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    
    background-color: transparent !important;
    border: 2px solid #d4af37 !important;
    color: #d4af37 !important;
    
    padding: clamp(0.6rem, 1.5vw, 0.75rem) clamp(1rem, 2vw, 1.25rem);
    margin: clamp(1rem, 2vw, 1.25rem) 0;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: clamp(0.9rem, 1.2vw, 1rem);
    font-weight: bold;
    transition: 0.3s;
}

.refresh-btn:hover {
    background-color: #d4af37 !important;
    color: #000 !important;
}

/* Target the icon span for spinning animation */
#refresh-icon {
    display: inline-block;
    font-size: 1.2em;
    line-height: 1;
    transition: transform 0.1s ease;
}

#refresh-icon.spinning {
    animation: spin 0.8s ease-in-out !important;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Styling for the Toggle Link */
.toggle-players {
    display: block;
    margin: 10px auto 0;
    font-size: 0.75rem;
    color: #d4af37; /* Gold to match your theme */
    text-decoration: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.toggle-players:hover {
    opacity: 1;
}

/* Container for the hidden names */
.player-list {
    display: none; /* Hidden by default */
    margin-top: 10px;
    font-size: 0.85rem;
    color: #a0a0a0;
    font-family: 'Inter', sans-serif;
    line-height: 1.4;
    text-align: center;
}

.btn-standard { background: #3498db; }
.btn-standard:hover { background: transparent; border-color: #3498db; color: #3498db; }

.btn-mason { background: #e74c3c; }
.btn-mason:hover { background: transparent; border-color: #e74c3c; color: #e74c3c; }

/* System Architecture Link */
.system-link {
    display: inline-block;
    padding: clamp(0.7rem, 1.5vw, 0.75rem) clamp(1.2rem, 2vw, 1.5rem);
    text-decoration: none;
    color: #d4af37;
    border: 2px solid #d4af37;
    background: transparent;
    border-radius: 6px;
    font-size: clamp(0.9rem, 1.2vw, 1rem);
    font-weight: bold;
    margin: 20px 0;
    transition: 0.3s;
}

.system-link:hover {
    background: #d4af37;
    color: #000;
}
/* ========== VISITOR COUNTER / SHIP'S LOG ========== */
.ships-log {
    background: rgba(20, 20, 20, 0.85);
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: clamp(1.25rem, 2.5vw, 2rem);
    margin: 0 1rem 2rem 1rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
}

.ships-log h3 {
    font-family: 'PirateFont', Georgia, serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: #d4af37;
    margin: 0 0 1.25rem 0;
    text-transform: lowercase;
}

.log-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    font-size: clamp(0.9rem, 1.1vw, 1rem);
}

.stat-icon {
    font-size: 1.25em;
}

.stat-label {
    color: #ccc;
}

.stat-value {
    font-weight: bold;
    color: #d4af37;
    font-size: 1.1em;
    min-width: 3ch;
}

.crew-btn {
    all: unset;
    display: inline-block;
    padding: clamp(0.7rem, 1.5vw, 0.85rem) clamp(1.2rem, 2vw, 1.75rem);
    background: transparent;
    border: 2px solid #d4af37;
    color: #d4af37;
    border-radius: 6px;
    font-size: clamp(0.9rem, 1.1vw, 1rem);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.crew-btn:hover:not(:disabled) {
    background: #d4af37;
    color: #000;
    transform: translateY(-2px);
}

.crew-btn:active:not(:disabled) {
    transform: translateY(0);
}