:root {
    --bg-dark: #0a1118;
    --bg-card: #121e2a;
    --bg-card-hover: #192a3a;
    --primary: #cba358;
    --primary-light: #e6c887;
    --primary-dark: #916f2b;
    --text-main: #f0f4f8;
    --text-muted: #8b9bb4;
    --accent-blue: #00a8ff;
    --accent-red: #e84118;
    --border-gold: rgba(203, 163, 88, 0.25);
    --border-glow: 0 0 15px rgba(203, 163, 88, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

body {
    background: radial-gradient(circle at top, #142232 0%, var(--bg-dark) 100%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* NAVBAR */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 3rem;
    background: rgba(10, 17, 24, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-gold);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    background: transparent !important;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
}

.hero-logo-img {
    max-width: 420px;
    width: 90%;
    height: auto;
    margin-bottom: 1.2rem;
    background: transparent !important;
    filter: drop-shadow(0 12px 35px rgba(0,0,0,0.85));
    animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.nav-links {
    display: flex;
    gap: 1.8rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--primary-light);
    background: rgba(203, 163, 88, 0.1);
}

.nav-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #0b1118 !important;
    font-weight: 700 !important;
    padding: 0.5rem 1.4rem !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 15px rgba(203, 163, 88, 0.3);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(203, 163, 88, 0.5);
}

/* HERO SECTION */
.hero {
    position: relative;
    padding: 6rem 2rem 5rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(16, 28, 42, 0.8) 0%, rgba(10, 17, 24, 0.95) 100%),
                url('https://images.unsplash.com/photo-1518709268805-4e9042af9f23?auto=format&fit=crop&w=1600&q=80') center/cover;
    border-bottom: 1px solid var(--border-gold);
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1rem;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    margin-bottom: 3rem;
}

.btn {
    padding: 0.9rem 2.2rem;
    border-radius: 6px;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #0b1118;
    box-shadow: 0 4px 15px rgba(203, 163, 88, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(203, 163, 88, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-gold);
}

.btn-secondary:hover {
    background: rgba(203, 163, 88, 0.15);
    border-color: var(--primary);
}

/* SERVER STATS BAR */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 3rem;
    background: rgba(18, 30, 42, 0.9);
    padding: 1.2rem 2rem;
    border-radius: 12px;
    border: 1px solid var(--border-gold);
    max-width: 750px;
    margin: 0 auto;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary-light);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.2rem;
}

.online-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4cd137;
    margin-right: 6px;
    box-shadow: 0 0 8px #4cd137;
}

/* CONTENT CONTAINER */
.container {
    max-width: 1200px;
    margin: 3.5rem auto;
    padding: 0 1.5rem;
    flex: 1;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.3rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
    margin-top: 0.5rem;
}

/* GRID LAYOUTS */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.8rem;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    padding: 1.8rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    background: var(--bg-card-hover);
    border-color: var(--primary);
    box-shadow: var(--border-glow);
}

.card-tag {
    align-self: flex-start;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.25rem 0.7rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.tag-news { background: rgba(0, 168, 255, 0.2); color: var(--accent-blue); }
.tag-announcement { background: rgba(232, 65, 24, 0.2); color: var(--accent-red); }
.tag-event { background: rgba(203, 163, 88, 0.2); color: var(--primary); }

.card-title {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    color: var(--text-main);
    line-height: 1.4;
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    flex: 1;
    margin-bottom: 1.2rem;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.8rem;
}

/* WIKI TABS */
.tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.7rem 1.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    color: var(--text-muted);
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tab-btn:hover, .tab-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #0b1118;
    border-color: var(--primary);
    box-shadow: 0 4px 15px rgba(203, 163, 88, 0.3);
}

.wiki-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-gold);
}

.wiki-table th, .wiki-table td {
    padding: 1.1rem 1.4rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.wiki-table th {
    background: rgba(203, 163, 88, 0.1);
    color: var(--primary-light);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.wiki-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* FOOTER */
footer {
    background: #080d13;
    border-top: 1px solid var(--border-gold);
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: auto;
}

footer a {
    color: var(--primary);
    text-decoration: none;
}

@media (max-width: 768px) {
    .navbar { padding: 1rem 1.5rem; flex-direction: column; gap: 1rem; }
    .hero h1 { font-size: 2.4rem; }
    .stats-bar { flex-direction: column; gap: 1.2rem; }
}

/* ========================================================
   PLAYER AUTH & CAPTAIN PORTAL STYLES
   ======================================================== */
.nav-auth-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.nav-auth-btn {
    background: rgba(203, 163, 88, 0.15);
    color: var(--primary-light);
    border: 1px solid var(--border-gold);
    padding: 0.45rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.nav-auth-btn:hover {
    background: var(--primary);
    color: #0b1118;
    transform: translateY(-1px);
}
.nav-auth-btn.register {
    background: linear-gradient(135deg, #10ac84, #1dd1a1);
    border: none;
    color: #fff;
}
.nav-auth-btn.register:hover {
    filter: brightness(1.1);
}

.captain-pill {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: rgba(18, 30, 42, 0.95);
    border: 1px solid var(--primary);
    padding: 0.35rem 0.9rem;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}
.captain-pill-name {
    font-weight: 700;
    color: var(--primary-light);
    font-size: 0.95rem;
}
.captain-pill-lvl {
    background: var(--primary);
    color: #0b1118;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
}
.captain-pill-stat {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.9rem;
    font-weight: 600;
}
.captain-pill-stat.gold { color: #ffd700; }
.captain-pill-stat.pearl { color: #00d2d3; }
.captain-logout-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    margin-left: 0.5rem;
    transition: color 0.2s;
}
.captain-logout-btn:hover { color: var(--accent-red); }

/* AUTH MODAL */
.auth-modal-backdrop {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.auth-modal-card {
    background: var(--bg-card);
    border: 1px solid var(--primary);
    box-shadow: 0 10px 40px rgba(0,0,0,0.8), var(--border-glow);
    border-radius: 12px;
    width: 90%;
    max-width: 440px;
    padding: 2.2rem;
    position: relative;
}

.auth-modal-close {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}
.auth-modal-close:hover { color: #fff; }

.auth-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-gold);
    margin-bottom: 1.8rem;
    padding-bottom: 0.5rem;
}
.auth-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.05rem;
    font-weight: 700;
    padding: 0.6rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.auth-tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.auth-form-group {
    margin-bottom: 1.2rem;
}
.auth-form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.auth-form-input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: rgba(10, 17, 24, 0.8);
    border: 1px solid rgba(203, 163, 88, 0.3);
    border-radius: 6px;
    color: #fff;
    font-size: 0.95rem;
    transition: border 0.2s;
}
.auth-form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 10px rgba(203, 163, 88, 0.3);
}

.auth-submit-btn {
    width: 100%;
    padding: 0.9rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #0b1118;
    font-size: 1rem;
    font-weight: 800;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 0.6rem;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(203, 163, 88, 0.3);
}
.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(203, 163, 88, 0.5);
}

.auth-msg {
    margin-top: 1rem;
    font-size: 0.9rem;
    text-align: center;
    min-height: 1.2rem;
}
.auth-msg.error { color: #ff6b6b; }
.auth-msg.success { color: #1dd1a1; }

/* CAPTAIN OVERVIEW CARD IN HERO */
.captain-overview-card {
    background: rgba(18, 30, 42, 0.95);
    border: 1px solid var(--primary);
    border-radius: 12px;
    padding: 1.8rem 2.2rem;
    max-width: 780px;
    margin: 2rem auto 0;
    box-shadow: 0 8px 30px rgba(0,0,0,0.6), var(--border-glow);
    animation: fadeIn 0.3s ease;
    text-align: left;
}
.captain-overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-gold);
    padding-bottom: 1rem;
    margin-bottom: 1.2rem;
}
.captain-overview-title {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}
.captain-overview-title h3 {
    color: var(--primary);
    font-size: 1.4rem;
    letter-spacing: 1px;
}
.captain-level-tag {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #0b1118;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 0.2rem 0.7rem;
    border-radius: 20px;
}

.captain-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.captain-stat-box {
    background: rgba(10, 17, 24, 0.6);
    border: 1px solid rgba(203, 163, 88, 0.2);
    border-radius: 8px;
    padding: 0.8rem 1rem;
    text-align: center;
}
.captain-stat-val {
    font-size: 1.25rem;
    font-weight: 800;
    display: block;
    margin-bottom: 0.2rem;
}
.captain-stat-val.gold { color: #ffd700; }
.captain-stat-val.pearl { color: #00d2d3; }
.captain-stat-val.hp { color: #2ed573; }
.captain-stat-val.tp { color: #ffa502; }
.captain-stat-val.ep { color: #9b59b6; }
.captain-stat-val.map { color: #3498db; }
.captain-stat-lbl {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
