/* === Pilot Handbook === */

/* The game client sets body { overflow: hidden } in main.css to lock the
   3D canvas. The guide is a normal scrollable page, so we override that
   here. overflow:visible (not auto) lets the viewport be the scroll
   container, which is what `position: sticky` on the sidebar needs. */
html,
body.guide-page {
    overflow: visible !important;
    height: auto !important;
}
body.guide-page {
    /* Match the main app background so the guide sits in the same
       visual universe. Was a radial gradient that clashed with the
       rest of the app's flat dark-bg. */
    background: var(--dark-bg);
    color: #c8e4ff;
    font-family: 'Rajdhani', 'Share Tech Mono', monospace;
    min-height: 100vh;
    margin: 0;
}

/* Header */
.guide-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(5, 10, 22, 0.92);
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
    backdrop-filter: blur(8px);
}
.guide-header-inner {
    max-width: 1300px;
    margin: 0 auto;
    padding: 14px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.guide-logo {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 1.1rem;
    color: #00f0ff;
    text-decoration: none;
    letter-spacing: 2px;
    text-shadow: 0 0 12px rgba(0, 240, 255, 0.5);
}
.guide-topnav {
    display: flex;
    gap: 22px;
}
.guide-topnav a {
    color: #7fa8c8;
    text-decoration: none;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 1.5px;
    padding: 6px 12px;
    border: 1px solid transparent;
    transition: color .15s, border-color .15s;
}
.guide-topnav a:hover { color: #00f0ff; border-color: rgba(0, 240, 255, 0.35); }
.guide-topnav a.active { color: #ff2e88; border-color: rgba(255, 46, 136, 0.4); }

/* Layout */
.guide-layout {
    max-width: 1300px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 40px;
    padding: 40px 28px 80px;
}
@media (max-width: 900px) {
    .guide-layout { grid-template-columns: 1fr; }
    .guide-sidebar { position: static !important; }
}

/* Sidebar */
.guide-sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
    border: 1px solid rgba(0, 240, 255, 0.2);
    padding: 18px 16px;
    background: rgba(5, 12, 24, 0.6);
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
}
.guide-sidebar-title {
    font-family: 'Orbitron', sans-serif;
    color: #00f0ff;
    font-size: 0.75rem;
    letter-spacing: 2px;
    margin-bottom: 10px;
    opacity: 0.75;
}
.guide-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.guide-sidebar li { margin: 0; }
.guide-sidebar a {
    display: block;
    color: #9bbcdc;
    text-decoration: none;
    padding: 6px 10px;
    font-size: 0.9rem;
    border-left: 2px solid transparent;
    transition: all .12s ease;
}
.guide-sidebar a:hover { color: #00f0ff; border-left-color: rgba(0, 240, 255, 0.4); background: rgba(0, 240, 255, 0.05); }
.guide-sidebar a.active {
    color: #ff2e88;
    border-left-color: #ff2e88;
    background: rgba(255, 46, 136, 0.06);
}

/* Main */
.guide-main { min-width: 0; }
.guide-hero { margin-bottom: 40px; }
.guide-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: clamp(2rem, 5vw, 3.2rem);
    color: #00f0ff;
    letter-spacing: 3px;
    margin: 0 0 10px;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.45);
    position: relative;
}
.guide-lead {
    font-size: 1.05rem;
    color: #b4cde3;
    max-width: 760px;
    line-height: 1.6;
}

.guide-section {
    margin: 52px 0;
    scroll-margin-top: 80px;
}
.guide-section h2 {
    font-family: 'Orbitron', sans-serif;
    color: #00f0ff;
    font-size: 1.5rem;
    letter-spacing: 2px;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.22);
}
.guide-section h3 {
    color: #ffb43a;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    letter-spacing: 1.5px;
    margin: 0 0 8px;
}
.guide-section p { line-height: 1.6; color: #c4dcf0; }
.guide-section strong { color: #ffd26b; font-weight: 600; }
.guide-section em { color: #9be3ff; font-style: normal; }

.guide-bullets {
    list-style: none;
    padding: 0;
    margin: 14px 0;
}
.guide-bullets li {
    padding: 8px 0 8px 26px;
    position: relative;
    line-height: 1.55;
    border-bottom: 1px dashed rgba(0, 240, 255, 0.1);
}
.guide-bullets li::before {
    content: '>>';
    position: absolute;
    left: 0;
    color: #00f0ff;
    font-family: 'Share Tech Mono', monospace;
    font-weight: bold;
}

.guide-note {
    margin: 16px 0;
    padding: 12px 16px;
    background: rgba(255, 180, 58, 0.07);
    border-left: 3px solid #ffb43a;
    color: #e3c99e;
    font-size: 0.95rem;
}

/* Keybinds */
.guide-keybinds {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 6px;
    margin: 18px 0;
}
.kb {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.15);
}
.kb-key {
    min-width: 66px;
    font-family: 'Share Tech Mono', monospace;
    color: #ff2e88;
    font-weight: bold;
    letter-spacing: 1px;
}
.kb-desc { color: #c4dcf0; font-size: 0.92rem; }

/* Tables */
.guide-table-wrap {
    margin: 16px 0;
    overflow-x: auto;
    border: 1px solid rgba(0, 240, 255, 0.15);
}
.guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: rgba(0, 240, 255, 0.02);
}
.guide-table th {
    text-align: left;
    padding: 10px 14px;
    background: rgba(0, 240, 255, 0.1);
    color: #00f0ff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.78rem;
    letter-spacing: 1.5px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.3);
}
.guide-table td {
    padding: 9px 14px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.08);
    color: #c4dcf0;
}
.guide-table td.name { color: #ffd26b; font-weight: 600; }
.guide-table tbody tr:hover { background: rgba(0, 240, 255, 0.04); }
.guide-table.doctrines td:first-child { width: 140px; }

/* Ship cards */
.ship-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 18px;
    margin: 20px 0;
}
.ship-card {
    background: linear-gradient(180deg, rgba(0, 240, 255, 0.04), rgba(5, 12, 24, 0.7));
    border: 1px solid rgba(0, 240, 255, 0.22);
    display: flex;
    flex-direction: column;
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
    transition: border-color .15s, box-shadow .15s;
}
.ship-card:hover {
    border-color: rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 24px rgba(0, 240, 255, 0.18);
}
.ship-card-preview {
    width: 100%;
    height: 180px;
    background: radial-gradient(ellipse at center, rgba(0, 240, 255, 0.06) 0%, transparent 70%);
    border-bottom: 1px solid rgba(0, 240, 255, 0.15);
}
.ship-card-preview canvas {
    width: 100% !important;
    height: 100% !important;
}
.ship-card-body {
    padding: 14px 18px 18px;
}
.ship-card-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}
.ship-card-name {
    font-family: 'Orbitron', sans-serif;
    color: #ffd26b;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: 1.5px;
}
.ship-card-category {
    font-family: 'Share Tech Mono', monospace;
    color: #ff2e88;
    font-size: 0.72rem;
    letter-spacing: 1.5px;
    padding: 2px 8px;
    border: 1px solid rgba(255, 46, 136, 0.3);
}
.ship-card-desc {
    font-size: 0.9rem;
    color: #a4c2dc;
    line-height: 1.45;
    margin: 0 0 12px;
    min-height: 40px;
}
.ship-card-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px 14px;
    font-size: 0.85rem;
    padding-top: 10px;
    border-top: 1px dashed rgba(0, 240, 255, 0.15);
}
.ship-card-stats > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ship-card-stats span {
    color: #7fa8c8;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 1px;
}
.ship-card-stats strong {
    color: #c8e4ff;
    font-weight: 600;
    font-size: 0.95rem;
}
.ship-card-stats strong.price { color: #ffb43a; }

/* Zone cards */
.zone-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 18px 0;
}
.zone-card {
    border: 1px solid;
    padding: 16px;
    background: rgba(0, 0, 0, 0.35);
}
.zone-card .zone-header {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 2.5px;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid;
}
.zone-card p { margin: 0; font-size: 0.92rem; }
.zone-safe { border-color: rgba(80, 255, 160, 0.4); }
.zone-safe .zone-header { color: #50ffa0; border-color: rgba(80, 255, 160, 0.25); }
.zone-neutral { border-color: rgba(255, 180, 58, 0.4); }
.zone-neutral .zone-header { color: #ffb43a; border-color: rgba(255, 180, 58, 0.25); }
.zone-pvp { border-color: rgba(255, 46, 136, 0.5); }
.zone-pvp .zone-header { color: #ff2e88; border-color: rgba(255, 46, 136, 0.3); }
.zone-frontier { border-color: rgba(170, 102, 255, 0.5); }
.zone-frontier .zone-header { color: #aa66ff; border-color: rgba(170, 102, 255, 0.3); }

/* Role cards */
.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 18px 0;
}
.role-card {
    border: 1px solid rgba(0, 240, 255, 0.18);
    padding: 16px 18px;
    background: rgba(5, 15, 28, 0.5);
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}
.role-card p { margin: 0; font-size: 0.92rem; }

/* Faction chips */
.guide-chip {
    display: inline-block;
    padding: 3px 10px;
    margin: 0 4px;
    background: rgba(255, 46, 136, 0.1);
    border: 1px solid rgba(255, 46, 136, 0.35);
    color: #ff8eb5;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.82rem;
    letter-spacing: 0.5px;
}

/* Footer */
.guide-footer {
    margin-top: 70px;
    padding: 26px 0;
    border-top: 1px solid rgba(0, 240, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #6a8aa5;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.82rem;
    letter-spacing: 1.5px;
}
.guide-cta {
    position: relative;
    padding: 14px 34px;
    background: transparent;
    color: #00f0ff;
    text-decoration: none;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    letter-spacing: 3px;
    font-size: 0.95rem;
    border: 1px solid rgba(0, 240, 255, 0.6);
    clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
    transition: color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
    box-shadow:
        0 0 18px rgba(0, 240, 255, 0.20),
        inset 0 0 20px rgba(0, 240, 255, 0.04);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}
.guide-cta:hover {
    color: #05080f;
    background: rgba(0, 240, 255, 0.9);
    transform: translateY(-2px);
    box-shadow:
        0 0 28px rgba(0, 240, 255, 0.6),
        inset 0 0 20px rgba(0, 240, 255, 0.15);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.35);
}
.guide-cta:active { transform: translateY(0); }

/* ===== Leaderboards page ===== */
.lb-main {
    max-width: 1300px;
    margin: 0 auto;
    padding: 40px 28px 80px;
    width: 100%;
    box-sizing: border-box;
}
.lb-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    margin-bottom: 48px;
}
.lb-panel {
    background: linear-gradient(180deg, rgba(0, 240, 255, 0.04), rgba(5, 12, 24, 0.7));
    border: 1px solid rgba(0, 240, 255, 0.22);
    padding: 18px 20px 20px;
    clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
}
.lb-panel-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.2);
}
.lb-panel-header h2 {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    letter-spacing: 2px;
    color: #00f0ff;
    text-transform: uppercase;
}
.lb-panel-icon {
    font-size: 1.2em;
    color: #ffb43a;
}

.lb-list {
    list-style: none;
    padding: 0;
    margin: 0;
    counter-reset: rank;
}
.lb-list li {
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 7px 4px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.88em;
    border-bottom: 1px dashed rgba(0, 240, 255, 0.08);
}
.lb-list li:last-child { border-bottom: none; }
.lb-list li .rank {
    color: #ff2e88;
    font-weight: 700;
    font-size: 0.78em;
    letter-spacing: 1px;
}
.lb-list li .name {
    color: #e0eaf5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lb-list li .value {
    color: #ffd26b;
    font-weight: 600;
    font-size: 0.85em;
    text-align: right;
}
.lb-list li.empty {
    grid-template-columns: 1fr;
    color: #6a8aa5;
    font-style: italic;
    text-align: center;
    padding: 16px;
}

/* Skill section */
.lb-skill-section {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid rgba(0, 240, 255, 0.2);
}
.lb-skill-title {
    font-family: 'Orbitron', sans-serif;
    color: #00f0ff;
    font-size: 1.4rem;
    letter-spacing: 2.5px;
    margin: 0 0 6px;
}
.lb-skill-sub {
    color: #9bbcdc;
    margin: 0 0 20px;
    font-size: 0.95rem;
}
.lb-skill-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}
.lb-skill-panel {
    background: rgba(5, 12, 24, 0.55);
    border: 1px solid rgba(255, 180, 58, 0.25);
    padding: 14px 16px;
    clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}
.lb-skill-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 10px;
    border-bottom: 1px dashed rgba(255, 180, 58, 0.25);
}
.lb-skill-header h3 {
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 2px;
    color: #ffb43a;
    text-transform: uppercase;
}
.lb-skill-panel .lb-list li { font-size: 0.82em; padding: 5px 2px; }
