/* =============================================
   HOVERTRON — Synthwave Theme
   ============================================= */

:root {
    /* Backgrounds */
    --bg-deep:        #0c0a14;
    --bg-body:        #14101e;
    --bg-surface:     #1a1428;
    --bg-surface-alt: #201830;

    /* Borders */
    --border:         #2e2540;
    --border-light:   #3a3050;

    /* Accents */
    --accent:         #e8a840;
    --accent-bright:  #f0c060;
    --accent-pink:    #e85a4f;
    --accent-green:   #5cc87a;
    --accent-brand:   #00d4ff;

    /* Text */
    --text-primary:   #d8d0c8;
    --text-muted:     #7a6e88;
    --text-heading:   #f0e8e0;

    /* Medals */
    --medal-gold:     #ffd700;
    --medal-silver:   #c0c0d0;
    --medal-bronze:   #cd7f32;

    /* Glow */
    --glow-accent:    0 0 12px rgba(232, 168, 64, 0.3);
    --glow-brand:     0 0 12px rgba(0, 212, 255, 0.3);
    --glow-pink:      0 0 12px rgba(232, 90, 79, 0.3);

    /* Sizing */
    --max-width:      1100px;
    --radius:         6px;
}

/* ---- Reset & Base ---- */

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Courier New', Courier, monospace;
    background: var(--bg-deep);
    background-image: url('clouds.jpg');
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(12, 10, 20, 0.78);
    z-index: 0;
    pointer-events: none;
}

body > * {
    position: relative;
    z-index: 1;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s, text-shadow 0.15s;
}
a:hover {
    color: var(--accent-bright);
    text-shadow: var(--glow-accent);
}

h1, h2, h3 {
    color: var(--text-heading);
    margin: 0 0 0.5em;
    font-weight: 600;
}

h1 { font-size: 1.6em; }
h2 { font-size: 1.25em; margin-top: 1.5em; }

/* ---- Page Header / Nav ---- */

.page-header {
    background: rgba(12, 10, 20, 0.85);
    border-bottom: 1px solid var(--border);
    padding: 0 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.page-header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    height: 52px;
    gap: 24px;
}

.brand {
    font-size: 1.15em;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--accent-brand);
    text-shadow: var(--glow-brand);
    text-decoration: none;
}
.brand:hover { color: #40e0ff; }

.nav-links {
    display: flex;
    gap: 16px;
    font-size: 0.85em;
}
.nav-links a { color: var(--text-muted); }
.nav-links a:hover { color: var(--accent); }

/* Breadcrumbs */
.breadcrumbs {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 10px 20px;
    font-size: 0.82em;
    color: var(--text-muted);
}
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 6px; opacity: 0.5; }

/* ---- Content ---- */

.content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px 20px 60px;
}

/* ---- Stats Row ---- */

.stats-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(26, 20, 40, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 20px;
    min-width: 120px;
    flex: 1;
}

.stat-card .stat-value {
    font-size: 1.4em;
    font-weight: 700;
    color: var(--text-heading);
}

.stat-card .stat-label {
    font-size: 0.78em;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ---- Data Tables ---- */

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    background: rgba(26, 20, 40, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.data-table th {
    background: rgba(12, 10, 20, 0.6);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    font-size: 0.92em;
}

.data-table tbody tr:nth-child(even) {
    background: rgba(32, 24, 48, 0.4);
}

.data-table tbody tr:hover {
    background: rgba(232, 168, 64, 0.06);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* ---- Medals ---- */

.medal-gold   { color: var(--medal-gold);   text-shadow: 0 0 6px rgba(255, 215, 0, 0.4); }
.medal-silver { color: var(--medal-silver); }
.medal-bronze { color: var(--medal-bronze); }

/* ---- Badges ---- */

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    font-weight: 700;
    letter-spacing: 0.5px;
    vertical-align: middle;
}

.badge-wr {
    background: rgba(232, 90, 79, 0.15);
    color: var(--accent-pink);
    border: 1px solid rgba(232, 90, 79, 0.3);
    text-shadow: var(--glow-pink);
}

.badge-pb {
    background: rgba(92, 200, 122, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(92, 200, 122, 0.25);
}

/* ---- Buttons ---- */

.btn {
    font-family: inherit;
    font-size: 0.95em;
    padding: 10px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    background: var(--bg-surface);
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.btn-confirm {
    border-color: var(--accent);
    color: var(--accent);
}
.btn-confirm:hover {
    box-shadow: var(--glow-accent);
    background: rgba(232, 168, 64, 0.08);
}

/* ---- Delta / Muted text ---- */

.delta {
    color: var(--text-muted);
    font-size: 0.9em;
}

/* ---- Info Block (score detail) ---- */

.info-block {
    background: rgba(26, 20, 40, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin-bottom: 24px;
    line-height: 2;
}

.info-block strong {
    display: inline-block;
    min-width: 130px;
    color: var(--text-muted);
    font-weight: 600;
}

/* ---- SVG Ghost Containers ---- */

.svg-container {
    background: rgba(26, 20, 40, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin: 12px 0;
    box-shadow: var(--glow-accent);
}

.svg-container svg {
    display: block;
    background: rgba(12, 10, 20, 0.7);
    border-radius: 4px;
}

.legend {
    font-size: 0.82em;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ---- Summary (under heading) ---- */

.summary {
    color: var(--text-muted);
    margin-bottom: 20px;
}

.summary .wr-inline {
    color: var(--accent-pink);
    font-weight: 600;
}

/* ---- Page Footer ---- */

.page-footer {
    padding: 24px 20px;
    text-align: center;
    font-size: 0.78em;
    color: var(--text-muted);
    background: rgba(20, 16, 30, 0.95);
}

/* ---- Mountain Silhouette Decoration ---- */

.mountain-deco {
    margin-top: 40px;
    margin-bottom: 0;
    line-height: 0;
}

.mountain-deco svg {
    display: block;
    width: 100%;
    height: 80px;
}

/* ---- Landing Page: Hero ---- */

.hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 32px;
}

.hero-img {
    display: block;
    width: 70%;
    height: auto;
   margin: auto;
}

/* ---- Landing Page: Video ---- */

.video {
   overflow: hidden;
   margin-bottom: 32px;
   text-align: center;
}

.coolvideo {
   border-radius: var(--radius);
   display: block;
   width: 70%;
   height: auto;
   margin: auto;
}

/* ---- Landing Page: CTA Cards ---- */

.cta-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: stretch;
}

.cta-card {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(26, 20, 40, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    padding: 12px;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.cta-card:hover {
    transform: translateY(-2px);
}

.cta-steam:hover {
    border-color: var(--accent);
    box-shadow: var(--glow-accent);
}

.cta-discord:hover {
    border-color: #5865F2;
    box-shadow: 0 0 12px rgba(88, 101, 242, 0.3);
}

.cta-img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.cta-img-steam {
    max-height: 130px;
    object-fit: contain;
}

.cta-img-discord {
    max-height: 80px;
    object-fit: contain;
}

/* ---- Landing Page: Link Cards ---- */

.landing-links {
    display: flex;
    gap: 16px;
}

.landing-link-card {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: rgba(26, 20, 40, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 18px 24px;
    text-align: center;
    text-decoration: none;
    color: var(--accent);
    transition: box-shadow 0.2s, transform 0.15s, background 0.2s;
}

.landing-link-card:hover {
    box-shadow: var(--glow-accent);
    transform: translateY(-2px);
    background: rgba(232, 168, 64, 0.06);
    color: var(--accent-bright);
}

.landing-link-icon {
    font-size: 1.4em;
}

.landing-link-label {
    font-weight: 700;
    font-size: 1.05em;
}

.landing-link-desc {
    font-size: 0.82em;
    color: var(--text-muted);
}

/* ---- Vehicle Filter Buttons ---- */

.vehicle-filter {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.vehicle-filter-label {
    color: var(--text-muted);
    font-size: 0.85em;
    font-weight: 600;
    margin-right: 4px;
}

.vehicle-btn {
    display: inline-block;
    padding: 6px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.85em;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s, box-shadow 0.2s, background 0.2s;
}

.vehicle-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: var(--glow-accent);
    background: rgba(232, 168, 64, 0.08);
}

.vehicle-btn-active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(232, 168, 64, 0.1);
    box-shadow: var(--glow-accent);
}

/* ---- Ghost Animation Controls ---- */

.ghost-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0 4px;
}

.ghost-btn {
    font-family: inherit;
    font-size: 1em;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.ghost-btn:hover {
    border-color: var(--accent);
    box-shadow: var(--glow-accent);
}

.ghost-speed {
    font-size: 0.8em;
    width: auto;
    padding: 0 10px;
}

.ghost-progress {
    flex: 1;
    accent-color: var(--accent);
    height: 6px;
    cursor: pointer;
}

.ghost-time {
    font-size: 0.82em;
    color: var(--text-muted);
    min-width: 44px;
    text-align: right;
}

/* ---- Custom Level Grid ---- */

.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.level-card {
    background: rgba(26, 20, 40, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.level-card:hover {
    border-color: var(--accent);
    box-shadow: var(--glow-accent);
    transform: translateY(-2px);
}

.level-card-thumb-container {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-deep);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.level-card-thumb {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    transition: opacity 0.15s;
}

.level-card-thumb-container:hover .level-card-thumb {
    opacity: 0.85;
}

.level-card-body {
    padding: 12px 14px;
}

.level-card-title {
    font-weight: 700;
    color: var(--text-heading);
    font-size: 1em;
    margin-bottom: 4px;
}

.level-card-meta {
    font-size: 0.82em;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}

.level-card-stars {
    color: var(--accent);
    font-size: 0.9em;
    letter-spacing: 1px;
}

.level-card-author {
    font-size: 0.82em;
    color: var(--text-muted);
}

.level-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.level-search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.level-search-bar input[type="text"] {
    font-family: inherit;
    font-size: 0.9em;
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    color: var(--text-primary);
    flex: 1;
    min-width: 200px;
    transition: border-color 0.2s;
}

.level-search-bar input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--glow-accent);
}

.level-search-bar button {
    font-family: inherit;
    font-size: 0.85em;
    padding: 8px 18px;
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    background: rgba(232, 168, 64, 0.1);
    color: var(--accent);
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s, box-shadow 0.2s;
}

.level-search-bar button:hover {
    background: rgba(232, 168, 64, 0.2);
    box-shadow: var(--glow-accent);
}

.level-pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.level-pagination a,
.level-pagination span {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85em;
    color: var(--text-muted);
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}

.level-pagination a:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.level-pagination .active {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(232, 168, 64, 0.1);
}

.level-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 1.1em;
}

/* ---- Level ID display ---- */

.level-id-row {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.level-id-code {
    background: var(--bg-deep);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 0.7em;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 160px;
}

/* ---- Level Lightbox ---- */

.level-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.level-lightbox.active {
    display: flex;
}

.level-lightbox-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.level-lightbox-inner img {
    display: block;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

.level-lightbox-title {
    text-align: center;
    color: var(--text-heading);
    font-weight: 700;
    margin-top: 10px;
    font-size: 1.1em;
}

.level-lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-primary);
    font-size: 1.2em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, color 0.2s;
}

.level-lightbox-close:hover {
    border-color: var(--accent-pink);
    color: var(--accent-pink);
}

/* ---- Responsive ---- */

@media (max-width: 640px) {
    .stats-row { flex-direction: column; }
    .page-header-inner { height: auto; padding: 10px 0; flex-wrap: wrap; }
    .data-table { font-size: 0.85em; }
    .data-table th, .data-table td { padding: 7px 8px; }
    .svg-container svg { max-width: 100%; height: auto; }
    .cta-row { flex-direction: column; }
    .landing-links { flex-direction: column; }
    .level-grid { grid-template-columns: 1fr; }
    .level-search-bar { flex-direction: column; }
    .level-search-bar input[type="text"] { min-width: 0; width: 100%; }
}
