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

body {
    font-family: 'Segoe UI', sans-serif;
    background: #12131a;
    color: #c0c2cc;
    min-height: 100vh;
}

nav {
    background: #1a1b26;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #2ecc71;
}

.logo { font-size: 1.4rem; font-weight: bold; color: #2ecc71; text-decoration: none; }
.nav-links { display: flex; gap: 1rem; align-items: center; }
.nav-links a { color: #7c7f93; text-decoration: none; }
.nav-links a:hover { color: #2ecc71; }
.nav-links span { color: #2ecc71; font-weight: bold; }

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

.flash { padding: 0.8rem 1rem; margin-bottom: 1rem; border-radius: 6px; }
.flash.success { background: #1a3a2a; border-left: 4px solid #2ecc71; color: #2ecc71; }
.flash.error { background: #3a1a1a; border-left: 4px solid #e74c3c; color: #e74c3c; }

.auth-box {
    max-width: 400px;
    margin: 3rem auto;
    background: #1e2030;
    padding: 2rem;
    border-radius: 10px;
    border: 1px solid #2a2d3e;
}

.auth-box h2 { margin-bottom: 1rem; color: #2ecc71; }
.auth-box .notice { font-size: 0.85rem; color: #7c7f93; margin-bottom: 1.5rem; background: #252738; padding: 0.8rem; border-radius: 6px; line-height: 1.6; }
.auth-box form { display: flex; flex-direction: column; gap: 0.8rem; }
.auth-box input { padding: 0.7rem; background: #252738; border: 1px solid #3b3f5c; border-radius: 6px; color: #c0c2cc; font-size: 1rem; }
.auth-box input:focus { outline: none; border-color: #2ecc71; }
.auth-box button { padding: 0.8rem; background: #2ecc71; color: #000; border: none; border-radius: 6px; font-size: 1rem; font-weight: bold; cursor: pointer; }
.auth-box button:hover { background: #27ae60; }
.auth-box p { margin-top: 1rem; font-size: 0.9rem; color: #7c7f93; }
.auth-box a { color: #2ecc71; }
.auth-box label { color: #7c7f93; font-size: 0.9rem; }

.auth-box select, .auth-box textarea {
    padding: 0.7rem;
    background: #252738;
    border: 1px solid #3b3f5c;
    border-radius: 6px;
    color: #c0c2cc;
    font-size: 1rem;
    width: 100%;
}
.auth-box select:focus, .auth-box textarea:focus { outline: none; border-color: #2ecc71; }

/* Activity cards */
.activity-card {
    background: #1e2030;
    border: 1px solid #2a2d3e;
    border-radius: 10px;
    padding: 1.2rem;
    margin-bottom: 1rem;
}
.activity-card.favorite { border-left: 4px solid #f1c40f; }
.activity-card.pinned { border-left: 4px solid #9b59b6; }
.activity-header { display: flex; gap: 1rem; align-items: center; margin-bottom: 0.5rem; font-size: 0.85rem; color: #7c7f93; flex-wrap: wrap; }
.activity-user { color: #2ecc71; font-weight: bold; }
.activity-user a { color: #2ecc71; text-decoration: none; }
.activity-user a:hover { text-decoration: underline; }
.activity-type { background: #252738; color: #7c7f93; padding: 0.2rem 0.6rem; border-radius: 20px; text-transform: capitalize; }
.activity-date { margin-left: auto; color: #565869; }
.activity-card h3 { color: #c0c2cc; margin-bottom: 0.3rem; }
.activity-card p { color: #7c7f93; font-size: 0.9rem; }
.activity-link { text-decoration: none; color: inherit; display: block; }
.activity-link:hover .activity-card { border-color: #2ecc71; }
.podium { font-size: 1rem; }
.comment-count { color: #565869; font-size: 0.85rem; white-space: nowrap; }
.comment-count-active { color: #2ecc71; }

/* Pin buttons */
.btn-pin, .btn-unpin {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: bold;
}
.btn-pin { background: #2a1a3a; color: #9b59b6; border: 1px solid #9b59b6; }
.btn-pin:hover { background: #3a2a4a; }
.btn-unpin { background: #252738; color: #7c7f93; border: 1px solid #3b3f5c; }
.btn-unpin:hover { background: #2a2d3e; color: #c0c2cc; }

/* Segment badge */
.segment-badge {
    display: inline-block;
    background: #1a2a1a;
    border: 1px solid #2ecc71;
    border-radius: 6px;
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
    color: #2ecc71;
    margin-bottom: 0.8rem;
}

/* Activity stats grid */
.activity-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin: 1rem 0;
    padding: 1rem;
    background: #161722;
    border-radius: 8px;
    border: 1px solid #2a2d3e;
}
.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    padding: 0.5rem 0.8rem;
    background: #1e2030;
    border-radius: 6px;
    border: 1px solid #2a2d3e;
}
.stat-box-value { font-size: 1.1rem; font-weight: bold; color: #2ecc71; }
.stat-box-label { font-size: 0.75rem; color: #565869; margin-top: 0.2rem; }

.devices {
    font-size: 0.8rem;
    color: #565869;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #2a2d3e;
}

/* Comments */
.comments-section { margin-top: 1rem; }
.comments-section h3 { margin-bottom: 1rem; color: #2ecc71; }
.comment {
    background: #1e2030;
    border: 1px solid #2a2d3e;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    margin-bottom: 0.8rem;
}
.comment-user { color: #2ecc71; font-weight: bold; margin-right: 0.5rem; }
.comment-date { color: #565869; font-size: 0.8rem; }
.comment p { margin-top: 0.4rem; color: #c0c2cc; }
.no-comments { color: #565869; margin-bottom: 1rem; }
.comment-form { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.8rem; }
.comment-form textarea {
    padding: 0.7rem;
    background: #252738;
    border: 1px solid #3b3f5c;
    border-radius: 6px;
    color: #c0c2cc;
    font-size: 1rem;
    resize: vertical;
}
.comment-form textarea:focus { outline: none; border-color: #2ecc71; }
.comment-form button {
    align-self: flex-start;
    padding: 0.6rem 1.5rem;
    background: #2ecc71;
    color: #000;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}
.comment-form button:hover { background: #27ae60; }

/* Profile */
.profile-box {
    background: #1e2030;
    border: 1px solid #2a2d3e;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}
.profile-header { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.profile-header h2 { color: #2ecc71; margin-bottom: 0.2rem; }
.joined { color: #565869; font-size: 0.85rem; }
.avatar { width: 64px; height: 64px; border-radius: 50%; border: 2px solid #2ecc71; object-fit: cover; }
.avatar-placeholder { width: 64px; height: 64px; border-radius: 50%; background: #252738; border: 2px solid #3b3f5c; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; flex-shrink: 0; }

.profile-stats {
    display: flex;
    gap: 2rem;
    padding: 1rem 0;
    border-top: 1px solid #2a2d3e;
    border-bottom: 1px solid #2a2d3e;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.stat-item { text-align: center; }
.stat-number { display: block; font-size: 1.4rem; font-weight: bold; color: #2ecc71; }
.stat-label { font-size: 0.8rem; color: #565869; }

.profile-actions { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.btn-sync {
    padding: 0.6rem 1.2rem;
    background: #2ecc71;
    color: #000;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
}
.btn-sync:hover { background: #27ae60; }
.btn-sync:disabled { background: #2a2d3e; color: #565869; cursor: not-allowed; }
.btn-settings {
    padding: 0.6rem 1.2rem;
    background: #252738;
    color: #7c7f93;
    border: 1px solid #3b3f5c;
    border-radius: 6px;
    font-size: 0.9rem;
    text-decoration: none;
}
.btn-settings:hover { background: #2a2d3e; color: #c0c2cc; }
.sync-status { font-size: 0.9rem; }

.btn-favorite, .btn-unfavorite {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
}
.btn-favorite { background: #f1c40f; color: #000; }
.btn-favorite:hover { background: #d4ac0d; }
.btn-unfavorite { background: #252738; color: #f1c40f; border: 1px solid #f1c40f; }
.btn-unfavorite:hover { background: #2a2d3e; }

/* Notifications */
.notif-bell { position: relative; text-decoration: none; color: #7c7f93; font-size: 1.1rem; }
.notif-bell:hover { color: #2ecc71; }
.notif-badge {
    position: absolute;
    top: -8px; right: -10px;
    background: #e74c3c;
    color: white;
    border-radius: 50%;
    padding: 1px 5px;
    font-size: 0.7rem;
    font-weight: bold;
}
.notif-card {
    display: block;
    background: #1e2030;
    border: 1px solid #2a2d3e;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 0.6rem;
    text-decoration: none;
    color: #c0c2cc;
}
.notif-card:hover { border-color: #2ecc71; }
.notif-card.unread { border-left: 4px solid #2ecc71; color: #c0c2cc; }
.notif-message { display: block; margin-bottom: 0.3rem; }
.notif-date { font-size: 0.8rem; color: #565869; }
.btn-clear {
    padding: 0.5rem 1rem;
    background: #252738;
    color: #7c7f93;
    border: 1px solid #3b3f5c;
    border-radius: 6px;
    cursor: pointer;
}
.btn-clear:hover { background: #2a2d3e; color: #c0c2cc; }

/* Login info */
.terrarium-info {
    max-width: 600px;
    margin: 2rem auto 0;
    padding: 1.5rem;
    background: #1e2030;
    border: 1px solid #2a2d3e;
    border-radius: 10px;
}
.terrarium-info h3 { color: #2ecc71; margin-bottom: 1rem; }
.terrarium-info p { color: #7c7f93; margin-bottom: 1rem; line-height: 1.6; }
.info-block { background: #252738; border-radius: 8px; padding: 1rem; margin-bottom: 0.8rem; }
.info-block h4 { color: #c0c2cc; margin-bottom: 0.5rem; }
.info-block p { margin: 0; color: #7c7f93; line-height: 1.6; }

/* Members */
.members-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}
.member-card {
    background: #1e2030;
    border: 1px solid #2a2d3e;
    border-radius: 10px;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s;
}
.member-card:hover { border-color: #2ecc71; }
.member-avatar {
    width: 48px; height: 48px;
    border-radius: 50%;
    background: #252738;
    border: 2px solid #3b3f5c;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    overflow: hidden;
}
.member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.member-info { display: flex; flex-direction: column; gap: 0.2rem; }
.member-name { color: #2ecc71; font-weight: bold; }
.member-stats { color: #7c7f93; font-size: 0.85rem; }
.member-joined { color: #565869; font-size: 0.75rem; }
.member-last-active { color: #2ecc71; font-size: 0.75rem; }

/* Leaderboard */
.leaderboard-list { display: flex; flex-direction: column; gap: 0.6rem; }
.leaderboard-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #1e2030;
    border: 1px solid #2a2d3e;
    border-radius: 8px;
    padding: 0.8rem 1.2rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s;
}
.leaderboard-row:hover { border-color: #2ecc71; }
.lb-rank { font-size: 1.2rem; width: 2rem; text-align: center; flex-shrink: 0; color: #565869; font-weight: bold; }
.lb-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #252738;
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0; overflow: hidden;
}
.lb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.lb-name { color: #2ecc71; font-weight: bold; flex: 1; }
.lb-count { color: #7c7f93; font-size: 0.9rem; }
.lb-distance { color: #565869; font-size: 0.85rem; min-width: 70px; text-align: right; }

.period-btn {
    padding: 0.4rem 0.9rem;
    background: #252738;
    color: #7c7f93;
    border: 1px solid #3b3f5c;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
}
.period-btn:hover { background: #2a2d3e; color: #c0c2cc; }
.period-btn.active { background: #2ecc71; color: #000; border-color: #2ecc71; font-weight: bold; }

/* Popular routes */
.routes-list { display: flex; flex-direction: column; gap: 0.8rem; }
.route-card {
    background: #1e2030;
    border: 1px solid #2a2d3e;
    border-radius: 10px;
    padding: 1.2rem;
}
.route-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.4rem; flex-wrap: wrap; gap: 0.5rem; }
.route-name { color: #c0c2cc; font-weight: bold; font-size: 1rem; }
.my-rides { color: #2ecc71; font-size: 0.8rem; background: #1a2a1a; padding: 0.2rem 0.6rem; border-radius: 20px; border: 1px solid #2ecc71; }
.route-location { color: #565869; font-size: 0.85rem; display: block; margin-bottom: 0.6rem; }
.route-stats { display: flex; gap: 1.5rem; font-size: 0.85rem; color: #7c7f93; flex-wrap: wrap; }

/* Profile two-box layout */
.profile-top {
    display: grid;
    grid-template-columns: 1fr 0.6fr;
    gap: 1rem;
    margin-bottom: 1rem;
    align-items: stretch;
}
.profile-box-main { margin-bottom: 0; }
.profile-box-bio {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}
.bio-title { color: #2ecc71; font-size: 0.95rem; margin-bottom: 0.8rem; }
.bio-form { display: flex; flex-direction: column; flex: 1; gap: 0.5rem; }
.bio-form textarea {
    flex: 1;
    min-height: 120px;
    padding: 0.7rem;
    background: #252738;
    border: 1px solid #3b3f5c;
    border-radius: 6px;
    color: #c0c2cc;
    font-size: 0.9rem;
    resize: vertical;
    line-height: 1.5;
    font-family: 'Segoe UI', sans-serif;
}
.bio-form textarea:focus { outline: none; border-color: #2ecc71; }
.bio-footer { display: flex; justify-content: space-between; align-items: center; }
.bio-hint { font-size: 0.75rem; color: #565869; }
.bio-footer button {
    padding: 0.5rem 1.2rem;
    background: #2ecc71;
    color: #000;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9rem;
}
.bio-footer button:hover { background: #27ae60; }
.bio-text { color: #c0c2cc; font-size: 0.9rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.bio-empty { color: #565869; font-size: 0.85rem; font-style: italic; }

@media (max-width: 650px) {
    .profile-top { grid-template-columns: 1fr; }
}

/* Heatmap */
.heatmap-grid { display:grid; grid-template-rows:repeat(7,11px); grid-auto-flow:column; gap:2px; overflow-x:auto; padding-bottom:0.5rem; }
.heatmap-cell { width:11px; height:11px; border-radius:2px; display:inline-block; cursor:default; }
.heatmap-empty { background:transparent; }
.heatmap-0 { background:#1e2030; border:1px solid #2a2d3e; }
.heatmap-1 { background:#1a4a2a; }
.heatmap-2 { background:#1e7a3a; }
.heatmap-3 { background:#25a84e; }
.heatmap-4 { background:#2ecc71; }
.heatmap-legend { display:flex; align-items:center; gap:3px; }
.legend-0 { background:#1e2030; border:1px solid #2a2d3e; }
.legend-1 { background:#1a4a2a; }
.legend-2 { background:#1e7a3a; }
.legend-3 { background:#25a84e; }
.legend-4 { background:#2ecc71; }
.heatmap-months { display:grid; gap:2px; margin-top:4px; }
.heatmap-month-label { font-size:0.7rem; color:#565869; }

/* Country explorer */
.country-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:1rem; }
.country-card { background:#1e2030; border:1px solid #2a2d3e; border-radius:10px; padding:1rem; display:flex; gap:1rem; align-items:flex-start; }
.country-flag { font-size:2rem; line-height:1; flex-shrink:0; }
.country-info { display:flex; flex-direction:column; gap:0.2rem; min-width:0; }
.country-name { color:#c0c2cc; font-weight:bold; font-size:0.95rem; }
.country-rides { color:#2ecc71; font-size:0.85rem; }
.country-routes { display:flex; flex-wrap:wrap; gap:0.3rem; margin-top:0.3rem; }
.country-route-tag { background:#252738; color:#7c7f93; font-size:0.7rem; padding:0.15rem 0.4rem; border-radius:4px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:150px; }
.country-route-more { color:#565869; font-size:0.75rem; align-self:center; }

/* Also rode this */
.also-rode-section { background:#1e2030; border:1px solid #2a2d3e; border-radius:10px; padding:1.2rem; margin-bottom:1.5rem; }
.also-rode-section h3 { color:#2ecc71; margin-bottom:1rem; font-size:1rem; }
.also-rode-section h3 em { color:#7c7f93; font-style:normal; }
.also-rode-list { display:flex; flex-wrap:wrap; gap:0.8rem; }
.also-rode-card { display:flex; align-items:center; gap:0.6rem; background:#252738; border:1px solid #3b3f5c; border-radius:8px; padding:0.6rem 0.8rem; text-decoration:none; color:inherit; transition:border-color 0.2s; }
.also-rode-card:hover { border-color:#2ecc71; }
.also-rode-avatar { width:32px; height:32px; border-radius:50%; background:#2a2d3e; display:flex; align-items:center; justify-content:center; font-size:0.9rem; overflow:hidden; flex-shrink:0; }
.also-rode-avatar img { width:100%; height:100%; object-fit:cover; }
.also-rode-info { display:flex; flex-direction:column; gap:0.1rem; }
.also-rode-name { color:#2ecc71; font-weight:bold; font-size:0.85rem; }
.also-rode-count { color:#7c7f93; font-size:0.75rem; }
.also-rode-date { color:#565869; font-size:0.7rem; }

/* Profile extra links */
.profile-extra-links { display:flex; gap:0.6rem; flex-wrap:wrap; margin:0.8rem 0; }
.profile-extra-btn { padding:0.4rem 0.9rem; background:#252738; color:#7c7f93; border:1px solid #3b3f5c; border-radius:6px; text-decoration:none; font-size:0.85rem; }
.profile-extra-btn:hover { background:#2a2d3e; color:#2ecc71; border-color:#2ecc71; }

/* Real name + bt link */
.bt-real-name { display:block; color:#7c7f93; font-size:0.85rem; margin-bottom:0.1rem; }
.bt-profile-link { display:inline-block; margin-top:0.3rem; font-size:0.8rem; color:#565869; text-decoration:none; }
.bt-profile-link:hover { color:#2ecc71; }

/* Empty feed */
.empty-feed { background:#1e2030; border:1px solid #2a2d3e; border-radius:10px; padding:2rem; text-align:center; color:#7c7f93; line-height:2; }
.empty-feed a { color:#2ecc71; }
.empty-feed strong { color:#c0c2cc; }
