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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f1117;
    color: #e0e0e0;
    min-height: 100vh;
}

a { color: #60a5fa; text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1200px; margin: 0 auto; padding: 1rem; }

/* Header */
header {
    background: #1a1d27;
    border-bottom: 1px solid #2a2d3a;
    padding: 1rem 0;
}
header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
header h1 { font-size: 1.3rem; font-weight: 600; }
header h1 span { color: #f97316; }
.sync-btn {
    background: #f97316;
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
}
.sync-btn:hover { background: #ea580c; }
.sync-btn:disabled { opacity: 0.5; cursor: wait; }

/* Activity List */
.activity-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1.5rem;
}
.activity-card {
    background: #1a1d27;
    border: 1px solid #2a2d3a;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    transition: border-color 0.2s;
}
.activity-card:hover { border-color: #f97316; }
.activity-card .name { font-weight: 600; font-size: 1rem; }
.activity-card .date { color: #888; font-size: 0.85rem; margin-top: 0.2rem; }
.activity-card .stats {
    display: flex;
    gap: 1.2rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}
.activity-card .stats .stat { display: flex; flex-direction: column; }
.activity-card .stats .label { color: #888; font-size: 0.7rem; text-transform: uppercase; }
.activity-card .stats .value { font-weight: 600; color: #fff; }
.activity-card .arrow {
    display: flex;
    align-items: center;
    color: #555;
    font-size: 1.5rem;
}

/* Activity Detail */
.back-link { display: inline-block; margin-bottom: 1rem; font-size: 0.9rem; }
.detail-header {
    background: #1a1d27;
    border: 1px solid #2a2d3a;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.detail-header h2 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.detail-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 0.75rem;
}
.detail-stats .stat { display: flex; flex-direction: column; }
.detail-stats .label { color: #888; font-size: 0.7rem; text-transform: uppercase; }
.detail-stats .value { font-weight: 700; font-size: 1.1rem; color: #fff; }
.detail-stats .value.vmax { color: #f97316; }
.detail-stats .value.hr { color: #ef4444; }

/* Map */
#map {
    width: 100%;
    height: 500px;
    border-radius: 8px;
    border: 1px solid #2a2d3a;
    margin-bottom: 1rem;
}

/* Color mode toggle */
.map-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.map-controls button {
    background: #1a1d27;
    border: 1px solid #2a2d3a;
    color: #e0e0e0;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
}
.map-controls button.active {
    background: #f97316;
    border-color: #f97316;
    color: #fff;
}

/* Charts */
.charts {
    background: #1a1d27;
    border: 1px solid #2a2d3a;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}
.chart-container { position: relative; height: 150px; margin-bottom: 0.5rem; }
.chart-container canvas { width: 100% !important; }
.chart-label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

/* Legend */
.legend {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.75rem;
}
.legend-bar {
    width: 120px;
    height: 10px;
    border-radius: 3px;
    background: linear-gradient(to right, #22c55e, #eab308, #ef4444);
}

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: #666;
}
.empty-state h2 { color: #888; margin-bottom: 0.5rem; }

/* Mobile */
@media (max-width: 640px) {
    .detail-stats { gap: 1rem; }
    #map { height: 350px; }
    .activity-card .stats { flex-wrap: wrap; gap: 0.8rem; }
}
