* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    background: #020010;
    font-family: "Segoe UI", system-ui, sans-serif;
    color: #ddd;
}

#container {
    width: 100vw;
    height: 100vh;
}

/* --- Tooltip (hover) --- */

.tooltip {
    position: fixed;
    pointer-events: none;
    opacity: 0;
    background: rgba(6, 6, 24, 0.92);
    color: #eee;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    z-index: 100;
    max-width: 300px;
    transition: opacity 0.15s ease;
    border: 1px solid rgba(100, 140, 255, 0.25);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5),
                0 0 15px rgba(80, 120, 255, 0.08);
}

.tooltip.visible {
    opacity: 1;
}

.tt-header { margin-bottom: 4px; }
.tt-name { color: #fff; font-size: 14px; display: block; font-weight: 600; }
.tt-author { color: #7788aa; font-size: 12px; }
.tt-stats { display: flex; gap: 4px; font-size: 11px; color: #8899aa; margin-top: 4px; }
.tt-sep { opacity: 0.4; }

/* --- Search bar --- */

.search-container {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    display: flex;
    align-items: center;
    background: rgba(6, 6, 24, 0.85);
    border: 1px solid rgba(100, 140, 255, 0.2);
    border-radius: 8px;
    padding: 0 12px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-container:focus-within {
    border-color: rgba(100, 140, 255, 0.5);
    box-shadow: 0 2px 20px rgba(60, 100, 255, 0.15);
}

.search-icon {
    color: #556;
    margin-right: 8px;
    flex-shrink: 0;
}

#search-input {
    background: none;
    border: none;
    outline: none;
    color: #ddd;
    font-size: 14px;
    padding: 10px 0;
    width: 280px;
    font-family: inherit;
}

#search-input::placeholder { color: #445; }

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: rgba(6, 6, 24, 0.95);
    border: 1px solid rgba(100, 140, 255, 0.2);
    border-radius: 8px;
    max-height: 320px;
    overflow-y: auto;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.search-results.hidden { display: none; }

.search-result {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid rgba(100, 140, 255, 0.06);
    transition: background 0.1s;
}

.search-result:hover { background: rgba(60, 80, 160, 0.2); }
.search-result:last-child { border-bottom: none; }
.sr-name { color: #dde; font-size: 13px; }
.sr-author { color: #667; font-size: 11px; margin-left: 12px; flex-shrink: 0; }
.search-empty { padding: 12px 14px; color: #556; font-size: 13px; text-align: center; }

/* --- Info Panel (click) --- */

.info-panel {
    position: fixed;
    right: 0;
    top: 0;
    width: 380px;
    height: 100vh;
    background: rgba(6, 6, 24, 0.96);
    padding: 0;
    overflow-y: auto;
    z-index: 200;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 1px solid rgba(100, 140, 255, 0.15);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.5);
}

.info-panel.hidden {
    transform: translateX(100%);
}

.info-panel img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
    background: #111;
}

.info-panel h2,
.info-panel p,
.info-panel .panel-author-row,
.info-panel .panel-launch-btn,
.info-panel .panel-stats-grid,
.info-panel #panel-tags {
    margin-left: 20px;
    margin-right: 20px;
}

.info-panel h2 {
    font-size: 18px;
    font-weight: 600;
    margin-top: 16px;
    margin-bottom: 2px;
    color: #fff;
}

.panel-author-row {
    font-size: 13px;
    color: #7788aa;
    margin-bottom: 10px;
}

.panel-launch-btn {
    display: inline-block;
    background: rgba(60, 80, 180, 0.3);
    color: #aac;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    margin-bottom: 12px;
    border: 1px solid rgba(100, 140, 255, 0.2);
}

.panel-launch-btn:hover {
    background: rgba(60, 80, 180, 0.5);
    color: #fff;
}

#panel-description {
    max-height: 120px;
    overflow-y: auto;
    font-size: 13px;
    color: #99a;
    line-height: 1.5;
    margin-bottom: 14px;
}

.panel-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}

.stat-item {
    display: flex;
    flex-direction: column;
    background: rgba(20, 20, 50, 0.5);
    padding: 8px 10px;
    border-radius: 6px;
}

.stat-label {
    font-size: 10px;
    color: #556;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #ccd;
}

#panel-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding-bottom: 24px;
}

.tag {
    display: inline-block;
    background: rgba(50, 60, 120, 0.4);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    color: #99b;
    border: 1px solid rgba(80, 100, 180, 0.2);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.tag:hover {
    background: rgba(60, 80, 180, 0.5);
    color: #cdf;
    border-color: rgba(100, 140, 255, 0.4);
}

.tag-active {
    background: rgba(80, 100, 220, 0.6);
    color: #fff;
    border-color: rgba(120, 160, 255, 0.6);
}

/* --- Filter indicator --- */

.filter-indicator {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 150;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(6, 6, 24, 0.85);
    border: 1px solid rgba(100, 140, 255, 0.25);
    border-radius: 8px;
    padding: 6px 12px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
    font-size: 13px;
    color: #99b;
    transition: opacity 0.2s, transform 0.2s;
}

.filter-indicator.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(-8px);
}

#filter-tag-name {
    color: #cdf;
    font-weight: 600;
}

#filter-clear {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #889;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

#filter-clear:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

#close-panel {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #889;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    transition: background 0.15s, color 0.15s;
}

#close-panel:hover {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
}

/* --- Help box --- */

.help-box {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 150;
    background: rgba(6, 6, 24, 0.88);
    border: 1px solid rgba(100, 140, 255, 0.2);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.4);
    max-width: 280px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.help-box:hover {
    border-color: rgba(100, 140, 255, 0.35);
}

.help-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: none;
    color: #99a;
    padding: 9px 14px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    text-align: left;
    transition: color 0.15s;
}

.help-toggle:hover { color: #ccd; }

.help-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(60, 80, 180, 0.3);
    color: #aac;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.help-title { flex: 1; }

.help-chevron {
    flex-shrink: 0;
    transition: transform 0.25s ease;
}

.help-box.collapsed .help-chevron {
    transform: rotate(-90deg);
}

.help-content {
    padding: 0 14px 14px;
    transition: max-height 0.3s ease, opacity 0.2s ease, padding 0.3s ease;
    max-height: 300px;
    opacity: 1;
    overflow: hidden;
}

.help-box.collapsed .help-content {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.help-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
    font-size: 12px;
    line-height: 1.6;
}

.help-list dt {
    color: #aac;
    font-weight: 600;
    white-space: nowrap;
}

.help-list dd {
    color: #778;
}

.help-hint {
    margin-top: 10px;
    font-size: 11px;
    color: #556;
    line-height: 1.5;
    border-top: 1px solid rgba(100, 140, 255, 0.1);
    padding-top: 10px;
}

/* --- Heat legend --- */

.heat-legend {
    position: fixed;
    bottom: 16px;
    right: 16px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    color: #556;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.legend-gradient {
    width: 120px;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(
        to right,
        rgb(25, 51, 204),
        rgb(25, 204, 204),
        rgb(255, 255, 0),
        rgb(255, 128, 0),
        rgb(255, 255, 255)
    );
}

/* --- HUD --- */

.hud {
    position: fixed;
    bottom: 16px;
    left: 16px;
    font-size: 12px;
    color: #667;
    z-index: 50;
}

.hud-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.hud-sep { opacity: 0.3; }

.hud-secondary {
    font-size: 10px;
    color: #445;
    margin-top: 2px;
}

/* --- About button & modal --- */

.about-btn {
    background: none;
    border: none;
    color: #556;
    font-family: inherit;
    font-size: 10px;
    cursor: pointer;
    padding: 2px 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.15s;
}

.about-btn:hover { color: #aac; }

.about-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(60, 80, 180, 0.3);
    color: #88a;
    font-family: Georgia, serif;
    font-style: italic;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.about-btn:hover .about-btn-icon {
    background: rgba(60, 80, 180, 0.5);
    color: #cdf;
}

.about-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(2, 0, 16, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: opacity 0.2s ease;
}

.about-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.about-modal {
    position: relative;
    background: rgba(6, 6, 24, 0.95);
    border: 1px solid rgba(100, 140, 255, 0.2);
    border-radius: 12px;
    padding: 32px 28px 24px;
    max-width: 380px;
    width: 90%;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6),
                0 0 20px rgba(60, 80, 200, 0.08);
}

.about-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: #778;
    font-size: 18px;
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.about-close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.about-title {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 10px;
}

.about-text {
    font-size: 13px;
    color: #889;
    line-height: 1.6;
    margin-bottom: 16px;
}

.about-section {
    margin-bottom: 14px;
}

.about-section h3 {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #556;
    margin-bottom: 6px;
    font-weight: 600;
}

.about-section p {
    font-size: 13px;
    color: #ccd;
}

.about-credits {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.about-credits li a {
    display: inline-block;
    background: rgba(50, 60, 120, 0.35);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    color: #99b;
    text-decoration: none;
    border: 1px solid rgba(80, 100, 180, 0.2);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.about-credits li a:hover {
    background: rgba(60, 80, 180, 0.5);
    color: #cdf;
    border-color: rgba(100, 140, 255, 0.4);
}

.about-disclaimer {
    font-size: 11px;
    color: #445;
    line-height: 1.5;
    border-top: 1px solid rgba(100, 140, 255, 0.1);
    padding-top: 12px;
    margin-top: 4px;
}

/* Scrollbar styling for panels */

.info-panel::-webkit-scrollbar,
#panel-description::-webkit-scrollbar,
.search-results::-webkit-scrollbar {
    width: 4px;
}

.info-panel::-webkit-scrollbar-track,
#panel-description::-webkit-scrollbar-track,
.search-results::-webkit-scrollbar-track {
    background: transparent;
}

.info-panel::-webkit-scrollbar-thumb,
#panel-description::-webkit-scrollbar-thumb,
.search-results::-webkit-scrollbar-thumb {
    background: rgba(100, 120, 200, 0.2);
    border-radius: 2px;
}

