/* ============================================================
   SpeedyRuns — Consolidated Stylesheet
   Extracted from inline <style> blocks in index.html, map.html
   and player.html so every page shares a single cached file.
   ============================================================ */

/* ----- CSS Custom Properties ----- */
:root {
    --gold: #ffd700;
    --cyan: #4ECDC4;
    --accent-red: #ff6b6b;
    --bg-gradient: linear-gradient(135deg, #1e3c72, #2a5298);
    --panel-bg: rgba(255, 255, 255, 0.08);
    --panel-border: rgba(255, 255, 255, 0.15);
    --text-color: #fff;
    --link-color: #48dbfb;
    --ranking-time: #4ECDC4;
    --ranking-distance: #2ECC71;
    --ranking-speed: #FF9F43;
    --ranking-combined: #FFD700;
}

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

/* ----- Body ----- */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-color);
    min-height: 100vh;
}

/* ----- Container ----- */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ----- Header ----- */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.8;
}

/* ----- Back Link (map & player pages) ----- */
.back-link {
    display: inline-block;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    text-decoration: none;
    color: #fff;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* ----- Panel (glass card) ----- */
.panel {
    background: var(--panel-bg);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 18px;
    border: 1px solid var(--panel-border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.panel:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

.panel h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.panel h2 span {
    font-size: 1.4rem;
}

.panel-icon {
    font-size: 1.8rem;
}

/* ----- Chart Container ----- */
.chart-container {
    position: relative;
    height: 400px;
    margin-top: 15px;
}

/* ----- Record List & Scrollbar ----- */
.record-list {
    max-height: 450px;
    overflow-y: auto;
    padding-right: 4px;
}

.record-list::-webkit-scrollbar {
    width: 6px;
}

.record-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.record-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gold), var(--cyan));
    border-radius: 3px;
}

.record-list::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #ffed4e, #5eddd4);
}

/* ----- Record Item ----- */
.record-item {
    background: linear-gradient(90deg, rgba(78, 205, 196, 0.08) 0%, rgba(255, 215, 0, 0.08) 100%);
    margin-bottom: 6px;
    padding: 10px 12px;
    border-radius: 6px;
    border-left: 3px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.record-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(180deg, var(--cyan) 0%, var(--gold) 100%);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.record-item:hover {
    background: linear-gradient(90deg, rgba(78, 205, 196, 0.15) 0%, rgba(255, 215, 0, 0.15) 100%);
    transform: translateX(4px);
    box-shadow: -3px 0 8px rgba(78, 205, 196, 0.3);
}

.record-item:hover::before {
    transform: scaleY(1);
}

.record-item.clickable:hover {
    box-shadow: -3px 0 8px rgba(255, 107, 107, 0.4);
}

.record-item.clickable:hover::before {
    background: linear-gradient(180deg, var(--accent-red) 0%, var(--gold) 100%);
}

/* ----- Record Rank (map page) ----- */
.record-rank {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a9a0 100%);
    color: white;
    border-radius: 4px;
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.record-item:hover .record-rank {
    transform: scale(1.1);
}

.record-rank.first {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
}

.record-rank.second {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: #333;
    box-shadow: 0 0 12px rgba(192, 192, 192, 0.5);
}

.record-rank.third {
    background: linear-gradient(135deg, #cd7f32 0%, #e9a35e 100%);
    color: white;
    box-shadow: 0 0 12px rgba(205, 127, 50, 0.5);
}

/* ----- Record Info / Details ----- */
.record-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.top-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    gap: 10px;
}

.record-details {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
}

.record-time {
    font-weight: 700;
    color: #feca57;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(254, 202, 87, 0.3);
}

.record-date {
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 3px;
    white-space: nowrap;
}

/* ----- Record Meta ----- */
.record-meta {
    margin-top: 4px;
    font-size: 0.75rem;
    color: #ddd;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.meta-item {
    background: rgba(255, 255, 255, 0.08);
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid var(--panel-border);
    font-size: 0.7rem;
    white-space: nowrap;
    flex: 1;
    text-align: center;
    line-height: 1.3;
}

/* ----- Player Info / Name ----- */
.player-info {
    font-size: 0.85rem;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.player-name {
    font-weight: 600;
    color: var(--link-color);
    font-size: 0.95rem;
    margin-bottom: 2px;
    transition: color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ----- Map Name ----- */
.map-name {
    font-weight: 600;
    color: var(--link-color);
    font-size: 0.95rem;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.map-name:hover {
    color: var(--gold);
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

/* ----- Time ----- */
.time {
    font-weight: 700;
    color: var(--cyan);
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    text-shadow: 0 0 8px rgba(78, 205, 196, 0.3);
}

/* ----- Rank (index page top-players list) ----- */
.rank {
    background: var(--cyan);
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    margin-right: 10px;
}

.rank.first  { background: var(--gold); color: #333; }
.rank.second { background: #c0c0c0; color: #333; }
.rank.third  { background: #cd7f32; }

/* ----- Rank Badge (player page) ----- */
.rank-badge {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a9a0 100%);
    color: white;
    border-radius: 4px;
    min-width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.record-item:hover .rank-badge {
    transform: scale(1.1);
}

.rank-badge.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #333;
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.5);
}

.rank-badge.silver {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    color: #333;
    box-shadow: 0 0 12px rgba(192, 192, 192, 0.5);
}

.rank-badge.bronze {
    background: linear-gradient(135deg, #cd7f32 0%, #e9a35e 100%);
    color: white;
    box-shadow: 0 0 12px rgba(205, 127, 50, 0.5);
}

/* ----- Stats Item (index page top-players list) ----- */
.stats-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.stats-item:hover {
    padding-left: 8px;
    background: linear-gradient(90deg, rgba(78, 205, 196, 0.1) 0%, transparent 100%);
}

.stats-item:last-child {
    border-bottom: none;
}

.stat-value {
    color: var(--gold);
    font-weight: bold;
}

/* ----- Medal / Points (index page) ----- */
.medal {
    display: inline-block;
    font-size: 1.1rem;
    margin: 0 2px;
}

.medal-count {
    font-weight: 600;
    margin-left: 2px;
}

.points-display {
    background: linear-gradient(135deg, var(--gold), #ffed4e);
    color: #333;
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4);
}

/* ----- Loading / Error ----- */
.loading {
    background: rgba(78, 205, 196, 0.1);
    border: 1px solid rgba(78, 205, 196, 0.3);
    color: var(--cyan);
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    text-align: center;
    animation: pulse 1.5s ease-in-out infinite;
}

.error {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.4);
    color: #ffcccc;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
}

/* ----- Badge / Aliases (player page) ----- */
.badge {
    background: linear-gradient(45deg, var(--accent-red), var(--gold));
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-block;
    margin: 5px 5px 5px 0;
}

.aliases {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 10px;
}

/* ===========================================================
   Index-page-specific styles
   =========================================================== */

/* Dashboard grid (best / recent records) */
.dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

/* Stats grid (Top Players + Charts side-by-side) */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 30px;
}

.charts-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.chart-panel {
    /* no default margin — standalone chart panels use .chart-section or inline margin */
}

.top-players-chart {
    height: 300px;
}

/* Records grid (player page — 3 columns on wide screens) */
.records-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* World Record badge (index page) */
.world-record-badge {
    background: linear-gradient(135deg, var(--accent-red), var(--gold));
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    margin-left: 8px;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(255, 215, 0, 0.4);
    animation: glow 2s ease-in-out infinite;
}

/* All Maps panel (index page) */
.maps-panel .maps-search {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: #fff;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.maps-list {
    max-height: 420px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 10px;
}

.map-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 8px;
    border-left: 4px solid var(--gold);
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.map-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.map-item.clickable:hover {
    border-left-color: var(--accent-red);
}

.map-item .map-name {
    color: var(--gold);
    font-weight: 700;
    text-decoration: none;
}

.map-item .map-meta {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
}

/* ===========================================================
   Map-page-specific styles
   =========================================================== */

/* Content grid (3-column on wide, 2-column on medium) */
.content-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* World record info block */
.world-record-info {
    background: rgba(255, 107, 107, 0.2);
    border: 2px solid var(--accent-red);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    text-align: center;
}

.world-record-info h3 {
    color: var(--accent-red);
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.world-record-time {
    font-size: 2rem;
    font-weight: bold;
    color: var(--gold);
    margin: 10px 0;
}

/* Highcharts tooltip z-index overrides (map page charts) */
.highcharts-tooltip {
    z-index: 100000 !important;
    pointer-events: auto;
    position: absolute;
}

.highcharts-data-label,
.highcharts-data-label tspan,
.highcharts-data-label-box {
    z-index: 1000 !important;
    pointer-events: none;
}

.highcharts-series .highcharts-point {
    z-index: 2000;
}

/* Map page: chart panel spans full width */
.content-grid .chart-panel {
    grid-column: 1 / -1;
    margin-bottom: 30px;
}

/* ===========================================================
   Player-page-specific styles
   =========================================================== */

/* Standalone section panel (chart between grids — needs bottom margin) */
.chart-section {
    margin-bottom: 20px !important;
}

/* Player stat cards — single row on wide screens */
.player-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

/* Player stat cards grid */
.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--gold);
    display: block;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 5px;
}

/* Player page panel margin */
.records-grid .panel {
    margin-bottom: 15px;
}

/* Wrapper div in player page record items (anonymous div containing rank-badge + name) */
.record-item > div:first-child:not(.record-rank):not(.record-info) {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.record-item-vertical {
    flex-direction: column;
    align-items: stretch !important;
    gap: 6px !important;
}

.record-row-main {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.record-row-main .map-name {
    flex: 1;
    min-width: 0;
}

.record-row-main .record-time {
    margin-left: auto;
}

.record-row-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 38px;
}

.record-row-details .record-date {
    margin-top: 0;
}

.record-row-details .record-meta {
    margin-top: 0;
}

/* ===========================================================
   Map Card Grid (Task 7 — map thumbnails on index page)
   =========================================================== */

.map-card-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-height: 800px;
    overflow-y: auto;
}

.map-card {
    background: var(--panel-bg);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--panel-border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.map-card-img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
}

.map-card-placeholder {
    width: 100%;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a2a4a, #2a3a5a);
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    padding: 10px;
}

.map-card-body {
    padding: 10px 12px;
}

.map-card-name {
    color: var(--gold);
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-card-meta {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

/* ===========================================================
   Map Hero Banner (Task 8 — map detail page)
   =========================================================== */

.map-hero {
    position: relative;
    width: 100%;
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
}

.map-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.map-hero-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a2a4a, #2a3a5a);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 2rem;
    font-weight: 700;
}

.map-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.map-hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.map-hero-record {
    font-size: 1.1rem;
    margin-top: 6px;
    color: rgba(255, 255, 255, 0.9);
}

/* ===========================================================
   Ranking Tab System
   =========================================================== */

.ranking-tabs {
    display: flex;
    gap: 3px;
    margin-bottom: 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 3px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.ranking-tab {
    flex: 1;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    letter-spacing: 0.02em;
    position: relative;
    white-space: nowrap;
}

.ranking-tab:hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.06);
}

.ranking-tab.active {
    color: #1a1a2e;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 20px rgba(var(--active-glow, 255,255,255), 0.15);
}

.ranking-tab.active[data-ranking="time"] {
    background: var(--ranking-time);
    --active-glow: 78, 205, 196;
}
.ranking-tab.active[data-ranking="distance"] {
    background: var(--ranking-distance);
    --active-glow: 46, 204, 113;
}
.ranking-tab.active[data-ranking="speed"] {
    background: var(--ranking-speed);
    color: #1a1a2e;
    --active-glow: 255, 159, 67;
}
.ranking-tab.active[data-ranking="combined"] {
    background: var(--ranking-combined);
    --active-glow: 255, 215, 0;
}

/* Point Badges */
.point-badges {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.point-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
}

.point-badge-time {
    background: rgba(78, 205, 196, 0.2);
    color: var(--ranking-time);
    border: 1px solid rgba(78, 205, 196, 0.3);
}

.point-badge-distance {
    background: rgba(46, 204, 113, 0.2);
    color: var(--ranking-distance);
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.point-badge-speed {
    background: rgba(255, 159, 67, 0.2);
    color: var(--ranking-speed);
    border: 1px solid rgba(255, 159, 67, 0.3);
}

.point-badge-combined {
    background: rgba(255, 215, 0, 0.2);
    color: var(--ranking-combined);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

/* Empty ranking state */
.ranking-empty {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.4);
}

.ranking-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
    opacity: 0.5;
}

.ranking-empty-text {
    font-size: 0.95rem;
}

/* Gap bar chart (map page) */
.gap-chart {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 0;
}

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

.gap-bar-rank {
    min-width: 28px;
    text-align: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.gap-bar-player {
    min-width: 120px;
    font-size: 0.85rem;
    color: var(--link-color);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gap-bar-container {
    flex: 1;
    height: 28px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.gap-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    padding-left: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
}

.gap-bar-label {
    min-width: 80px;
    text-align: right;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
    color: rgba(255, 255, 255, 0.7);
}

/* ===========================================================
   Animations
   =========================================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 2px 6px rgba(255, 215, 0, 0.4); }
    50%      { box-shadow: 0 2px 12px rgba(255, 215, 0, 0.8); }
}

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

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50%      { opacity: 1; }
}

/* ===========================================================
   Responsive Breakpoints
   =========================================================== */

@media (max-width: 1400px) {
    .content-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1200px) {
    .records-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    .map-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard {
        grid-template-columns: 1fr;
    }

    .records-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 2rem;
    }

    .record-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .map-card-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 5px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ----- Mode Toggle ----- */
.mode-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    background: rgba(255,255,255,0.04);
    border-radius: 8px;
    padding: 3px;
}
.mode-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}
.mode-btn:hover {
    color: rgba(255,255,255,0.8);
    background: rgba(255,255,255,0.06);
}
.mode-btn.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
