/* ==========================================================================
   Layout Styles
   Page-specific layout styles for dashboard, profile, and feature sections
   ========================================================================== */

/* ==========================================================================
   Sidebar Navigation
   ========================================================================== */

.sidebar {
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.3s ease, width 0.3s ease;
}

/* Desktop: Always visible */
@media (min-width: 768px) {
    .sidebar {
        transform: translateX(0);
    }

    /* Collapsed state (desktop only) */
    .sidebar.sidebar-collapsed {
        width: 72px;
    }

    .sidebar.sidebar-collapsed .sidebar-logo-text,
    .sidebar.sidebar-collapsed .sidebar-nav-label {
        opacity: 0;
        width: 0;
        overflow: hidden;
        white-space: nowrap;
    }

    .sidebar.sidebar-collapsed .sidebar-header {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    .sidebar.sidebar-collapsed .sidebar-logo {
        justify-content: center;
    }

    .sidebar.sidebar-collapsed .sidebar-nav-item {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    .sidebar.sidebar-collapsed .sidebar-collapse-btn {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    /* Collapsed state for status row in footer */
    .sidebar.sidebar-collapsed .sidebar-status-row {
        flex-direction: column;
        gap: 0.5rem;
        padding-left: 0;
        padding-right: 0;
    }

    .sidebar.sidebar-collapsed .sidebar-status-dot-wrapper {
        justify-content: center;
        flex: none;
    }

    /* Collapsed state for footer elements */
    .sidebar.sidebar-collapsed .sidebar-footer {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .sidebar.sidebar-collapsed .sidebar-profile-link {
        justify-content: center;
        padding-left: 0;
        padding-right: 0;
    }

    .sidebar.sidebar-collapsed .sidebar-profile-link .sidebar-nav-label {
        display: none;
    }

    .sidebar.sidebar-collapsed .sidebar-profile-link svg {
        display: none;
    }
}

/* Mobile: Slide in when open */
.sidebar.sidebar-open {
    transform: translateX(0);
}

/* Sidebar nav item active state */
.sidebar-nav-item.active {
    background: var(--purple-muted);
    color: var(--purple);
    font-weight: 600;
}

.sidebar-nav-item.active .sidebar-nav-icon {
    color: var(--purple);
}

/* Profile link active state */
.sidebar-profile-link.active {
    background: var(--purple-muted);
}

.sidebar-profile-link.active .sidebar-profile-img {
    border-color: var(--purple-dark);
}

/* Content offset for sidebar (only when sidebar is visible/authenticated) */
.has-sidebar {
    transition: margin-left 0.3s ease;
}

@media (min-width: 768px) {
    /* Only apply margin when sidebar actually exists in DOM */
    body:has(.sidebar) .has-sidebar {
        margin-left: 240px;
    }

    body:has(.sidebar.sidebar-collapsed) .has-sidebar {
        margin-left: 72px;
    }
}

/* Header hamburger button (mobile only) */
.header-hamburger {
    display: flex;
}

@media (min-width: 768px) {
    .header-hamburger {
        display: none;
    }
}

/* ==========================================================================
   Mobile Bottom Navigation (deprecated, kept for reference)
   ========================================================================== */

.mobile-nav {
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

/* ==========================================================================
   Hero Stats Section
   ========================================================================== */

/* Hero Wrapper — clips both purple hero and amber band into one card */
.hero-wrapper {
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 32px;
}

.hero-stats {
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
    padding: 24px 28px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    position: relative;
}

/* Recent activity band — warm amber footer below hero */
.hero-recent {
    background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-dark) 100%);
    color: var(--purple-dark);
    padding: 10px 28px;
    display: flex;
    align-items: center;
}

.hero-recent-period {
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: 6px;
    min-width: 0;
}

.hero-recent-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.75;
    flex-shrink: 0;
}

.hero-recent-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.hero-recent-unit {
    font-size: 0.75rem;
    opacity: 0.85;
    flex-shrink: 0;
}

.hero-recent-detail {
    font-size: 0.75rem;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-recent-divider {
    width: 1px;
    align-self: stretch;
    background: rgba(91, 33, 182, 0.2);
    margin: 0 20px;
    flex-shrink: 0;
}

/* Skeleton shimmer for recent band (reuses .hero-recent layout) */
.hero-recent .skeleton-light {
    opacity: 0.3;
}

.hero-main {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hero-ring {
    width: 80px;
    height: 80px;
    position: relative;
    flex-shrink: 0;
}

.hero-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.hero-ring-bg {
    fill: none;
    stroke: rgba(255,255,255,0.2);
    stroke-width: 8;
}

.hero-ring-progress {
    fill: none;
    stroke: var(--yellow);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
    filter: drop-shadow(0 0 6px rgba(252, 211, 77, 0.5));
}

.hero-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
}

.hero-info h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 2px;
}

.hero-info p {
    font-size: 0.875rem;
    opacity: 0.9;
}

.hero-supporting {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-stat {
    text-align: center;
    min-width: 60px;
}

.hero-stat-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.hero-stat-label {
    font-size: 0.75rem;
    opacity: 0.8;
}

.hero-stat-icon {
    width: 20px;
    height: 20px;
    margin: 0 auto 4px;
    opacity: 0.7;
}

/* Clickable hero stats */
.hero-stat-link {
    text-decoration: none;
    color: inherit;
    border-radius: 8px;
    padding: 8px 12px;
    margin: -8px -12px;
    transition: background 0.2s ease, transform 0.2s ease;
}

.hero-stat-link:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .hero-stats {
        flex-direction: column;
        text-align: center;
        padding: 16px;
    }
    .hero-main {
        flex-direction: column;
    }
    .hero-supporting {
        width: 100%;
        justify-content: center;
        gap: 8px;
    }
    .hero-stat-value {
        font-size: 1.25rem;
    }
    .hero-stat-label {
        font-size: 0.625rem;
    }
    .hero-stat-link {
        padding: 6px 8px;
        margin: -6px -8px;
    }
    .hero-stat-icon {
        width: 16px;
        height: 16px;
        margin-bottom: 2px;
    }
    .hero-recent {
        padding: 10px 16px;
    }
    .hero-recent-divider {
        margin: 0 12px;
    }
}

@media (max-width: 640px) {
    .hero-recent {
        flex-direction: column;
        padding: 8px 16px;
    }
    .hero-recent-period {
        padding: 6px 0;
    }
    .hero-recent-divider {
        width: 100%;
        height: 1px;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .hero-supporting {
        gap: 4px;
    }
    .hero-stat {
        min-width: 50px;
    }
    .hero-stat-value {
        font-size: 1rem;
    }
    .hero-stat-link {
        padding: 4px 6px;
        margin: -4px -6px;
    }
}

/* ==========================================================================
   Country Cards
   ========================================================================== */

.country-grid {
    display: flex;
    gap: 16px;
    transition: all 0.4s ease;
}

.country-card {
    flex: 1;
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.4s ease;
    cursor: pointer;
}

/* Country card map link */
.country-map-link {
    display: block;
    padding: 8px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--purple);
    text-decoration: none;
    border-top: 1px solid var(--border-light);
    transition: background 0.2s ease;
}

.country-map-link:hover {
    background: var(--purple-muted);
}

.country-card:hover {
    box-shadow: var(--shadow-md);
}

.country-card.expanded {
    flex: 3;
}

.country-card.minimized {
    flex: 0.5;
}

.country-card.nl {
    border-left: 4px solid var(--nl-orange);
}

.country-card.be {
    border-left: 4px solid var(--be-yellow);
}

.country-card.lu {
    border-left: 4px solid var(--lu-blue);
}

.country-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: all 0.3s ease;
}

.country-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.country-flag {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.country-name {
    font-weight: 600;
    color: var(--text);
}

.country-percent {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.country-card.nl .country-percent {
    color: var(--nl-orange);
}

.country-card.be .country-percent {
    color: var(--be-yellow);
}

.country-card.lu .country-percent {
    color: var(--lu-blue);
}

.country-progress {
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    margin: 0 20px 12px;
    overflow: hidden;
}

.country-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.country-card.nl .country-progress-fill {
    background: linear-gradient(90deg, var(--nl-orange), #FB923C);
}

.country-card.be .country-progress-fill {
    background: linear-gradient(90deg, var(--be-yellow), #FDE047);
}

.country-card.lu .country-progress-fill {
    background: linear-gradient(90deg, var(--lu-blue), #93C5FD);
}

.country-count {
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding: 0 20px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.country-expand-hint {
    font-size: 0.75rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 4px;
}

.province-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    background: var(--border-light);
}

.country-card.expanded .province-content {
    max-height: 500px;
    padding: 16px 20px;
    overflow-y: auto;
}

.province-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
}

.province-item {
    background: var(--bg-card);
    padding: 10px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.province-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-sm);
}

.province-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.province-name {
    font-size: 0.875rem;
    font-weight: 500;
}

.province-count {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.province-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.province-bar-fill {
    height: 100%;
    border-radius: 2px;
}

.country-card.nl .province-bar-fill {
    background: var(--nl-orange);
}

.country-card.be .province-bar-fill {
    background: var(--be-yellow);
}

.country-card.lu .province-bar-fill {
    background: var(--lu-blue);
}

/* Minimized state */
.country-card.minimized .country-name,
.country-card.minimized .country-percent,
.country-card.minimized .country-progress,
.country-card.minimized .country-count {
    display: none;
}

.country-card.minimized .country-header {
    justify-content: center;
    padding: 24px 12px;
}

.country-card.minimized .country-flag {
    font-size: 2rem;
}

@media (max-width: 768px) {
    .country-grid {
        flex-direction: column;
    }
    .country-card.minimized {
        flex: 1;
    }
    .country-card.minimized .country-name,
    .country-card.minimized .country-percent,
    .country-card.minimized .country-progress,
    .country-card.minimized .country-count {
        display: block;
    }
    .country-card.minimized .country-header {
        justify-content: space-between;
        padding: 16px 20px;
    }
    .country-card.minimized .country-flag {
        font-size: 1.75rem;
    }
    .province-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Map Section
   ========================================================================== */

.map-section {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.map-header {
    padding: 16px 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
}

.map-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text);
}

.map-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.map-pill {
    height: 36px;
    padding: 0 14px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: var(--border-light);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
}

.map-pill:hover {
    background: var(--border);
}

.map-pill.active {
    background: var(--purple);
    color: white;
}

.map-pill.nl.active {
    background: var(--nl-orange);
}

.map-pill.be.active {
    background: var(--be-yellow);
    color: var(--text);
}

.map-pill.lu.active {
    background: var(--lu-blue);
}

.map-pill.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.map-pill.disabled:hover {
    background: var(--border-light);
}

/* Geo Mode Toggle */
.geo-mode-toggle {
    height: 36px;
    display: flex;
    align-items: center;
    background: var(--border-light);
    border-radius: 20px;
    padding: 2px;
}

.geo-mode-btn {
    padding: 6px 12px;
    border-radius: 18px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    color: var(--text-muted);
}

.geo-mode-btn:hover {
    color: var(--text);
}

.geo-mode-btn.active {
    background: var(--purple);
    color: white;
}

.country-pills {
    display: flex;
    gap: 4px;
}

.year-selector {
    position: relative;
}

.year-selector-btn {
    height: 36px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 12px;
    background: var(--border-light);
    border: none;
    border-radius: 10px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.year-selector-btn:hover {
    background: var(--border);
}

.year-selector-btn.active {
    background: var(--purple-muted);
    color: var(--purple);
}

.year-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 30;
    overflow: hidden;
}

.year-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.year-option:hover {
    background: var(--border-light);
}

.year-option.active {
    background: var(--purple-muted);
    color: var(--purple);
    font-weight: 600;
}

.year-option-count {
    font-size: 0.75rem;
    color: var(--text-light);
    background: var(--border-light);
    padding: 2px 8px;
    border-radius: 10px;
}

.year-option.active .year-option-count {
    background: var(--purple);
    color: white;
}

.map-year-badge {
    position: absolute;
    top: 12px;
    left: 52px; /* Offset to avoid Leaflet zoom controls (34px + margin) */
    background: var(--purple);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 20;
    box-shadow: var(--shadow-md);
}

.map-year-badge button {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.map-year-badge button:hover {
    background: rgba(255,255,255,0.3);
}

.map-icon-btn {
    height: 36px;
    padding: 0 10px;
    gap: 6px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: var(--border-light);
    color: var(--text-muted);
}

.map-icon-btn:hover {
    background: var(--border);
    color: var(--text);
}

.map-icon-btn.active {
    background: var(--purple);
    color: white;
}

.map-icon-btn.active:hover {
    background: var(--purple-dark);
}

@media (max-width: 768px) {
    .map-header {
        flex-direction: column;
        align-items: stretch;
    }
    .map-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 640px) {
    .map-controls {
        gap: 4px;
    }
    .geo-mode-toggle {
        order: -1;
        width: 100%;
        justify-content: center;
        margin-bottom: 4px;
        height: 32px;
    }
    .geo-mode-btn {
        font-size: 0.75rem;
        padding: 0 10px;
    }
    .country-pills {
        width: 100%;
        justify-content: center;
    }
    .map-pill {
        height: 32px;
        padding: 0 10px;
        font-size: 0.75rem;
    }
    .year-selector-btn {
        height: 32px;
        padding: 0 10px;
        font-size: 0.75rem;
    }
    .map-icon-btn {
        height: 32px;
        padding: 0 8px;
    }
    .map-fullscreen-btn {
        width: 32px;
        height: 32px;
    }
}

/* Map Body */
.map-body {
    position: relative;
    height: 560px;
}

.map-container {
    width: 100%;
    height: 100%;
    position: relative;
}

@media (max-width: 768px) {
    .map-body {
        height: 450px;
    }
}

/* Map Fullscreen Mode */
.map-section.fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9998;
    border-radius: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.map-section.fullscreen .map-body {
    flex: 1;
    height: auto;
}

.map-section.fullscreen .rides-panel {
    display: none;
}

/* Fullscreen toggle button */
.map-fullscreen-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--border-light);
    color: var(--text-muted);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.map-fullscreen-btn:hover {
    background: var(--border);
    color: var(--text);
}

.map-fullscreen-btn.active {
    background: var(--purple);
    color: white;
}

/* ==========================================================================
   Rides Panel
   ========================================================================== */

.rides-panel {
    background: var(--bg-muted);
    border-top: 1px solid var(--border-light);
}

.rides-panel-header {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    background: var(--bg-card);
    transition: background 0.15s ease;
}

.rides-panel-header:hover {
    background: var(--bg-muted);
}

.rides-panel-header h4 {
    font-family: 'Outfit', sans-serif;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.rides-panel-header h4 .rides-count {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-muted);
    padding: 2px 8px;
    border-radius: 10px;
}

.rides-panel-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    color: var(--text-muted);
    transition: all 0.15s ease;
}

.rides-panel-toggle:hover {
    background: var(--border-light);
    color: var(--text);
}

.rides-panel-toggle svg {
    transition: transform 0.3s ease;
}

.rides-panel.collapsed .rides-panel-toggle svg {
    transform: rotate(180deg);
}

.rides-panel-body {
    max-height: 300px;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.rides-panel.collapsed .rides-panel-body {
    max-height: 0;
}

.rides-panel-content {
    padding: 8px 16px;
    max-height: 220px;
    overflow-y: auto;
}

.rides-panel-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
}

.ride-item {
    padding: 12px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 6px;
    background: var(--bg-card);
}

.ride-item:hover {
    background: var(--bg-muted);
}

.ride-item.selected {
    background: var(--purple-muted);
    ring: 2px solid var(--purple);
}

.ride-item-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ride-item-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ride-item-stats {
    text-align: right;
}

.ride-item-distance {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--purple);
}

.ride-item-duration {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.rides-pagination-btn {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rides-pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.rides-pagination-btn.enabled {
    background: var(--border-light);
    color: var(--text-muted);
}

.rides-pagination-btn.enabled:hover {
    background: var(--border);
    color: var(--text);
}

/* ==========================================================================
   Map Panel Tabs (replaces separate rides + province panels)
   ========================================================================== */

.map-panel-tabs {
    border-top: 1px solid var(--border-light);
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    max-height: 380px;
    overflow: hidden;
}

.map-panel-tab-bar {
    display: flex;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-card);
    flex-shrink: 0;
}

.map-panel-tab {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.map-panel-tab:hover {
    color: var(--text);
    background: var(--bg-muted);
}

.map-panel-tab.active {
    color: var(--purple);
    border-bottom-color: var(--purple);
    font-weight: 600;
}

.map-panel-tab .tab-count {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-muted);
    padding: 2px 8px;
    border-radius: 10px;
}

.map-panel-tab.active .tab-count {
    background: var(--purple-muted);
    color: var(--purple);
}

.map-panel-body {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* Province grid within tab panel */
.map-panel-body .province-grid {
    padding: 16px 20px;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.map-panel-body .province-item {
    background: var(--bg-muted);
}

.map-panel-body .province-item.complete {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.02));
}

/* Municipality drilldown (full panel, replaces nested scroll) */
.municipality-drilldown {
    padding: 16px 20px;
}

.municipality-drilldown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.municipality-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--purple);
    background: var(--purple-muted);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.municipality-back-btn:hover {
    background: var(--purple);
    color: white;
}

.municipality-drilldown-title {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text);
}

.municipality-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 4px 16px;
}

.municipality-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background 0.15s ease;
    color: var(--text-muted);
}

.municipality-item:hover {
    background: var(--border-light);
}

.municipality-item.visited {
    color: var(--success);
    font-weight: 500;
}

.municipality-item.visited svg {
    color: var(--success);
}

.municipality-item:not(.visited) svg {
    color: var(--text-light);
}

/* Rides content within tab panel */
.map-panel-body .rides-panel-content {
    padding: 8px 16px;
}

@media (max-width: 768px) {
    .map-panel-tabs {
        max-height: 320px;
    }
}

@media (max-width: 640px) {
    .municipality-grid {
        grid-template-columns: 1fr;
    }
    .map-panel-body .province-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Analytics Section
   ========================================================================== */

.analytics-section {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.analytics-header {
    padding: 16px 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--border-light);
}

.analytics-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

/* Summary Cards */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    padding: 20px 24px;
}

.summary-card {
    background: var(--border-light);
    border-radius: 16px;
    padding: 16px;
    cursor: default;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.summary-card:hover {
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.summary-card.active {
    background: var(--purple-muted);
    border: 2px solid var(--purple);
}

.summary-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

.summary-card-icon svg {
    width: 20px;
    height: 20px;
}

.summary-card-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    margin-bottom: 4px;
}

.summary-card-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.summary-card-trend {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 2px;
}

.summary-card-trend.up {
    color: #10B981;
}

.summary-card-trend.down {
    color: #EF4444;
}

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

@media (max-width: 480px) {
    .summary-cards {
        gap: 10px;
        padding: 16px;
    }
    .summary-card {
        padding: 12px;
    }
    .summary-card-value {
        font-size: 1.5rem;
    }
    .summary-card-icon {
        width: 28px;
        height: 28px;
        margin-bottom: 8px;
    }
    .summary-card-icon svg {
        width: 16px;
        height: 16px;
    }
    .summary-card-label {
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   Activity Heatmap (GitHub-style contribution calendar)
   Uses CSS Grid with grid-auto-flow: column for correct day alignment.
   ========================================================================== */

/* CSS custom properties for heatmap sizing */
.heatmap-container {
    --heatmap-square-size: 12px;
    --heatmap-gap: 3px;
    --heatmap-week-width: calc(var(--heatmap-square-size) + var(--heatmap-gap));
    --heatmap-day-label-width: 28px;

    padding: 20px 24px;
    border-top: 1px solid var(--border-light);
    overflow-x: auto;
}

.heatmap-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

/* Main graph container with grid-template-areas */
.heatmap-graph {
    display: inline-grid;
    grid-template-areas:
        "empty months"
        "days squares";
    grid-template-columns: var(--heatmap-day-label-width) 1fr;
    gap: var(--heatmap-gap);
}

/* Empty corner cell for grid alignment */
.heatmap-empty {
    grid-area: empty;
}

/* Month labels row - positioned above squares using absolute positioning */
.heatmap-months {
    grid-area: months;
    position: relative;
    height: 16px;
    font-size: 0.6875rem;
    color: var(--text-light);
}

.heatmap-month {
    position: absolute;
    bottom: 0;
    white-space: nowrap;
}

/* Day labels (Sun-Sat) - 7 rows matching square grid */
.heatmap-days {
    grid-area: days;
    display: grid;
    grid-template-rows: repeat(7, var(--heatmap-square-size));
    gap: var(--heatmap-gap);
    font-size: 0.6875rem;
    color: var(--text-light);
}

.heatmap-day-label {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 4px;
    line-height: 1;
}

/* Day squares grid - flows top-to-bottom then left-to-right */
.heatmap-squares {
    grid-area: squares;
    display: grid;
    grid-template-rows: repeat(7, var(--heatmap-square-size));
    grid-auto-flow: column;
    grid-auto-columns: var(--heatmap-square-size);
    gap: var(--heatmap-gap);
}

/* Individual day cell */
.heatmap-day {
    width: var(--heatmap-square-size);
    height: var(--heatmap-square-size);
    border-radius: 2px;
    background: var(--border-light);
    transition: transform 0.15s ease;
    cursor: pointer;
    position: relative;
}

.heatmap-day:hover {
    transform: scale(1.3);
    z-index: 10;
}

/* Activity level colors */
.heatmap-day.level-1 { background: #C4B5FD; }
.heatmap-day.level-2 { background: #A78BFA; }
.heatmap-day.level-3 { background: #8B5CF6; }
.heatmap-day.level-4 { background: #7C3AED; }
.heatmap-day.level-5 { background: #6D28D9; }
.heatmap-day.empty { background: transparent; pointer-events: none; }

/* Heatmap External Tooltip (appended to body, matches Eddington style) */
#heatmap-tooltip {
    position: absolute;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 99999;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.15s ease;
}

#heatmap-tooltip.visible {
    opacity: 1;
}

.heatmap-tooltip-distance {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--purple);
}

.heatmap-tooltip-noactivity {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.heatmap-tooltip-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Footer with legend */
.heatmap-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 8px;
    padding-left: var(--heatmap-day-label-width);
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.6875rem;
    color: var(--text-light);
}

.heatmap-legend-box {
    width: 12px;
    height: 12px;
    border-radius: 2px;
}

/* Responsive: smaller squares on narrow screens */
@media (max-width: 640px) {
    .heatmap-container {
        --heatmap-square-size: 10px;
        --heatmap-day-label-width: 24px;
    }

    .heatmap-months,
    .heatmap-days {
        font-size: 0.625rem;
    }
}

/* ==========================================================================
   Personal Records
   ========================================================================== */

.records-container {
    padding: 20px 24px;
    border-top: 1px solid var(--border-light);
}

.records-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.records-title svg {
    color: var(--yellow);
}

.records-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.record-card {
    background: linear-gradient(135deg, var(--yellow) 0%, var(--yellow-light) 100%);
    border-radius: 14px;
    padding: 16px;
    position: relative;
    overflow: hidden;
}

.record-card::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
}

.record-label {
    font-size: 0.75rem;
    color: rgba(0,0,0,0.6);
    margin-bottom: 6px;
}

.record-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.record-detail {
    font-size: 0.6875rem;
    color: rgba(0,0,0,0.5);
    margin-top: 4px;
}

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

/* ==========================================================================
   Eddington Section
   ========================================================================== */

.eddington-section {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.eddington-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    border-bottom: 1px solid var(--border-light);
}

.eddington-title-group h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.eddington-title-group p {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-top: 4px;
}

.eddington-display {
    text-align: right;
}

.eddington-number {
    font-family: 'Outfit', sans-serif;
    font-size: 4rem;
    font-weight: 800;
    line-height: 1;
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.eddington-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.eddington-progress {
    padding: 20px 24px;
    background: var(--border-light);
}

.eddington-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.eddington-progress-title {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9375rem;
}

.eddington-progress-count {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.eddington-progress-bar {
    height: 10px;
    background: rgba(255,255,255,0.8);
    border-radius: 5px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.eddington-progress-fill {
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, var(--purple) 0%, var(--yellow) 100%);
    transition: width 0.5s ease;
}

.eddington-progress-hint {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 10px;
}

.eddington-progress-hint strong {
    color: var(--purple);
}

.eddington-chart {
    padding: 24px;
}

.eddington-rides {
    margin-top: 20px;
    background: var(--border-light);
    border-radius: 16px;
    padding: 16px;
}

.eddington-rides-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.eddington-rides-title {
    font-weight: 600;
    color: var(--text);
}

.eddington-rides-list {
    max-height: 280px;
    overflow-y: auto;
}

.eddington-ride-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease;
}

.eddington-ride-item:hover {
    transform: translateX(4px);
}

/* Eddington Development Table */
.eddington-development {
    padding: 20px 24px;
}

.eddington-development-wrapper {
    overflow-x: auto;
}

.eddington-development-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.eddington-development-table th,
.eddington-development-table td {
    padding: 8px 10px;
    text-align: right;
    white-space: nowrap;
}

.eddington-development-table th {
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-light);
}

.eddington-development-table th.text-left,
.eddington-development-table td.text-left {
    text-align: left;
}

.eddington-development-table td {
    border-bottom: 1px solid var(--border-light);
}

.eddington-development-table .year-cell {
    font-weight: 600;
    color: var(--purple);
}

.eddington-development-table .e-number {
    font-weight: 700;
    color: var(--purple);
}

.eddington-development-table .section-header {
    display: table-cell;
    background: var(--bg-muted);
    font-weight: 600;
    text-align: center;
    color: var(--text);
    border-bottom: 1px solid var(--border-light);
}

.eddington-development-table .section-header.year-section {
    background: rgba(124, 58, 237, 0.15);
    border-left: 2px solid rgba(124, 58, 237, 0.3);
}

.eddington-development-table .section-header.alltime-section {
    background: rgba(252, 211, 77, 0.25);
    border-left: 2px solid rgba(252, 211, 77, 0.5);
}


/* Sub-header row (E, Ritten, etc.) */
.eddington-development-table thead tr:last-child th {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.eddington-development-table .year-section {
    background: rgba(124, 58, 237, 0.05);
}

.eddington-development-table .alltime-section {
    background: rgba(252, 211, 77, 0.1);
}

/* Left border for first column of each section */
.eddington-development-table thead tr:last-child th:nth-child(2),
.eddington-development-table tbody td:nth-child(2) {
    border-left: 2px solid rgba(124, 58, 237, 0.3);
}

.eddington-development-table thead tr:last-child th:nth-child(7),
.eddington-development-table tbody td:nth-child(7) {
    border-left: 2px solid rgba(252, 211, 77, 0.5);
}

@media (max-width: 768px) {
    .eddington-header {
        flex-direction: column;
        text-align: center;
    }
    .eddington-display {
        text-align: center;
    }
    .eddington-number {
        font-size: 3rem;
    }
    .eddington-development-table {
        font-size: 0.7rem;
    }
    .eddington-development-table th,
    .eddington-development-table td {
        padding: 6px 4px;
    }
}

@media (max-width: 480px) {
    .eddington-number {
        font-size: 2.5rem;
    }
    .eddington-development-table {
        font-size: 0.6rem;
    }
    .eddington-development-table th,
    .eddington-development-table td {
        padding: 4px 2px;
    }
    .eddington-title-group h3 {
        font-size: 1rem;
    }
    .eddington-title-group p {
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   Achievement Badges — "Trophy shelf" design
   ========================================================================== */

.achv-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.achv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.achv-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
}

.achv-counter {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-light);
    background: var(--border-light);
    padding: 2px 10px;
    border-radius: var(--radius-full);
}

/* Grid: 3 country columns */
.achv-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Country column */
.achv-country {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.achv-country-head {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-light);
}

.achv-flag {
    font-size: 1.5rem;
    line-height: 1;
}

.achv-progress {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Tiers row */
.achv-tiers {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

/* Individual badge card */
.achv-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 60px;
    position: relative;
    transition: transform 0.2s ease;
    cursor: default;
}

.achv-badge:hover {
    transform: translateY(-3px);
}

/* Medal container */
.achv-medal {
    position: relative;
    width: 52px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.achv-medal-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.08));
    transition: filter 0.3s ease;
}

/* Unlocked medal gets richer shadow */
.achv-badge.is-unlocked .achv-medal-svg {
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12))
            drop-shadow(0 1px 2px rgba(0, 0, 0, 0.06));
}

/* Hexagon path transitions */
.achv-hex-path {
    transition: fill 0.4s ease, opacity 0.4s ease;
}

.achv-hex-sheen {
    transition: opacity 0.4s ease;
    pointer-events: none;
}

/* Medal text */
.achv-medal-text {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 700;
    pointer-events: none;
    letter-spacing: -0.02em;
}

/* Glow ring behind unlocked medals */
.achv-glow {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--badge-color) 0%, transparent 70%);
    opacity: 0.2;
    pointer-events: none;
    animation: achv-glow-pulse 3s ease-in-out infinite;
}

@keyframes achv-glow-pulse {
    0%, 100% { opacity: 0.15; transform: scale(1); }
    50% { opacity: 0.28; transform: scale(1.08); }
}

/* Tier label */
.achv-label {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--text-light);
    text-transform: capitalize;
    line-height: 1;
    letter-spacing: 0.02em;
}

.achv-label.is-unlocked {
    color: var(--text);
    font-weight: 600;
}

/* Progress bar below badge */
.achv-bar {
    width: 100%;
    height: 4px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: 2px;
}

.achv-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Full bar gets a subtle shine */
.achv-bar-full {
    background-image: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.35) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: achv-bar-shine 3s ease-in-out infinite;
}

@keyframes achv-bar-shine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* "Next" tier — the one you're working toward */
.achv-badge.is-next .achv-medal-svg {
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.1));
}

.achv-badge.is-next .achv-bar-fill {
    animation: achv-next-pulse 2s ease-in-out infinite;
}

@keyframes achv-next-pulse {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* ==========================================================================
   Champion tier — extra special
   ========================================================================== */

.achv-badge.is-champion .achv-medal-svg {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15))
            drop-shadow(0 0 12px var(--badge-color, #FFD700));
    animation: achv-champion-float 3s ease-in-out infinite;
}

@keyframes achv-champion-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.achv-badge.is-champion .achv-glow {
    opacity: 0.3;
    animation: achv-champion-glow 2s ease-in-out infinite;
}

@keyframes achv-champion-glow {
    0%, 100% { opacity: 0.25; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(1.15); }
}

/* Orbiting particles for champion */
.achv-particles {
    position: absolute;
    inset: -8px;
    pointer-events: none;
}

.achv-particles span {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--badge-color, var(--yellow));
}

.achv-particles span:nth-child(1) {
    top: 0; left: 50%;
    animation: achv-particle 2.4s ease-in-out infinite 0s;
}
.achv-particles span:nth-child(2) {
    top: 15%; right: 0;
    animation: achv-particle 2.4s ease-in-out infinite 0.4s;
}
.achv-particles span:nth-child(3) {
    bottom: 15%; right: 2px;
    animation: achv-particle 2.4s ease-in-out infinite 0.8s;
}
.achv-particles span:nth-child(4) {
    bottom: 0; left: 50%;
    animation: achv-particle 2.4s ease-in-out infinite 1.2s;
}
.achv-particles span:nth-child(5) {
    bottom: 15%; left: 2px;
    animation: achv-particle 2.4s ease-in-out infinite 1.6s;
}
.achv-particles span:nth-child(6) {
    top: 15%; left: 0;
    animation: achv-particle 2.4s ease-in-out infinite 2.0s;
}

@keyframes achv-particle {
    0%, 100% { opacity: 0; transform: scale(0); }
    20% { opacity: 1; transform: scale(1); }
    80% { opacity: 1; transform: scale(1); }
    95% { opacity: 0; transform: scale(0.5); }
}

/* Skeleton */
.achv-badge-skeleton {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
}

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

@media (max-width: 640px) {
    .achv-section {
        padding: 24px 16px;
    }

    .achv-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .achv-country {
        padding-bottom: 20px;
        border-bottom: 1px solid var(--border-light);
    }

    .achv-country:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .achv-tiers {
        gap: 10px;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .achv-grid {
        gap: 12px;
    }

    .achv-medal {
        width: 46px;
        height: 52px;
    }

    .achv-medal-text {
        font-size: 12px;
    }

    .achv-badge {
        width: 52px;
    }

    .achv-label {
        font-size: 0.5625rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .achv-glow,
    .achv-badge.is-champion .achv-glow,
    .achv-badge.is-champion .achv-medal-svg,
    .achv-badge.is-next .achv-bar-fill,
    .achv-bar-full,
    .achv-particles span {
        animation: none;
    }
}
