/* Variables & Design System */
:root {
    --color-primary: #FC4C02; /* Strava Orange */
    --color-primary-hover: #E34000;
    --color-secondary: #4A5568;
    --color-bg-main: #FFFFFF;
    --color-bg-card: #FFFFFF;
    --color-bg-hover: #F8FAFC;
    --color-border: #E2E8F0;
    --color-text-main: #0F172A;
    --color-text-muted: #64748B;
    --color-success: #10B981;
    --color-warning: #F59E0B;
    --color-shadow: rgba(0, 0, 0, 0.04);
    --font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 18px;
    --transition-speed: 0.25s;
}

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

body {
    background-color: var(--color-bg-main);
    color: var(--color-text-main);
    font-family: var(--font-family);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 60px;
}

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* App Header */
.app-header {
    background-color: #FFFFFF;
    border-bottom: 1px solid var(--color-border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.01);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

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

.brand h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--color-text-main);
}

.brand .subtitle {
    font-size: 13px;
    color: var(--color-text-muted);
}

.header-actions {
    display: flex;
    gap: 12px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--border-radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #FFFFFF;
}

.btn-primary:hover {
    background-color: var(--color-primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(252, 76, 2, 0.15);
}

.btn-secondary {
    background-color: #FFFFFF;
    color: var(--color-text-main);
    border-color: var(--color-border);
}

.btn-secondary:hover {
    background-color: var(--color-bg-hover);
    border-color: #CBD5E1;
    transform: translateY(-1px);
}

.icon {
    flex-shrink: 0;
}

.id-spinner.syncing {
    animation: spin 1s linear infinite;
}

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

/* Rules Banner */
.rules-banner {
    background-color: #FFFFFF;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: 24px;
    margin: 28px 0;
    box-shadow: 0 4px 18px var(--color-shadow);
    position: relative;
}

.rules-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #FC4C02 0%, #f09433 33%, #bc1888 66%, #4f46e5 100%);
    border-top-left-radius: var(--border-radius-lg);
    border-top-right-radius: var(--border-radius-lg);
}

.rules-header h2 {
    font-size: 18px;
    font-weight: 800;
    background: linear-gradient(135deg, #FC4C02 0%, #bc1888 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    letter-spacing: -0.2px;
}

.rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.rule-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.rule-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}

.rule-icon.target {
    background-color: rgba(252, 76, 2, 0.08);
    color: var(--color-primary);
}

.rule-icon.streak {
    background-color: rgba(245, 158, 11, 0.08);
    color: var(--color-warning);
}

.rule-icon.distance {
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--color-success);
}

.rule-icon.prize {
    background-color: rgba(217, 119, 6, 0.08);
    color: #D97706;
}

.rule-icon.medal-special {
    background-color: rgba(5, 150, 105, 0.08);
    color: #059669;
}

.rule-details h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-main);
    margin-bottom: 4px;
}

.rule-details p {
    font-size: 13px;
    color: var(--color-text-muted);
}

.rules-note {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed var(--color-border);
    font-size: 12px;
    color: var(--color-text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.present-badge {
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Dashboard Layout */
.dashboard-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 28px;
    align-items: start;
}

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

.card-wrapper {
    background-color: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 4px 18px var(--color-shadow);
    overflow: hidden;
}

/* Leaderboard Section */
.section-header {
    padding: 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.table-hint {
    padding: 0 24px 16px;
    margin-top: -8px;
    font-size: 12.5px;
    color: var(--color-text-muted);
}

.search-bar {
    position: relative;
    width: 260px;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    pointer-events: none;
}

.search-bar input {
    width: 100%;
    padding: 10px 14px 10px 42px;
    font-family: var(--font-family);
    font-size: 13px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    outline: none;
    transition: all var(--transition-speed) ease;
}

.search-bar input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(252, 76, 2, 0.08);
}

/* Leaderboard Table */
.table-container {
    overflow-x: auto;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.leaderboard-table th {
    background-color: var(--color-bg-hover);
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-text-muted);
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--color-border);
}

.leaderboard-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border);
    font-size: 12.5px;
    vertical-align: middle;
    transition: background-color var(--transition-speed) ease;
}

.leaderboard-table tbody tr {
    cursor: pointer;
}

.leaderboard-table tbody tr:hover td {
    background-color: var(--color-bg-hover);
}

/* Marks the cutoff between medal-winning ranks (1-10) and the rest */
.leaderboard-table tbody tr.rank-cutoff-row td {
    border-bottom: 2px solid #EF4444;
}

.text-center {
    text-align: center;
}

/* Rank Badges */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 13px;
}

.rank-badge.rank-1 {
    background-color: #FEF3C7;
    color: #D97706;
    border: 1px solid #FCD34D;
}

.rank-badge.rank-2 {
    background-color: #E2E8F0;
    color: #475569;
    border: 1px solid #CBD5E1;
}

.rank-badge.rank-3 {
    background-color: #FFEDD5;
    color: #C2410C;
    border: 1px solid #FED7AA;
}

.rank-badge.rank-medal {
    background-color: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
}

.rank-badge.rank-other {
    color: var(--color-text-muted);
}

/* Athlete Profile Cell */
.athlete-profile-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.athlete-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: crop;
    border: 1.5px solid var(--color-border);
}

.athlete-name-container {
    display: flex;
    flex-direction: column;
}

.athlete-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--color-text-main);
    white-space: nowrap;
}

.athlete-sub {
    font-size: 10px;
    color: var(--color-text-muted);
}

/* Progress indicator in table score */
.score-badge-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.score-value {
    font-weight: 700;
    font-size: 15px;
    color: var(--color-primary);
}

.score-max {
    font-size: 11px;
    color: var(--color-text-muted);
}

.progress-bar-bg {
    width: 80px;
    height: 4px;
    background-color: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--color-primary);
    border-radius: 2px;
    transition: width 0.4s ease;
}

.table-loader {
    padding: 48px !important;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--color-border);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 12px;
}

/* Sidebar & Tab Navigation */
.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-tabs {
    display: flex;
    background-color: #F1F5F9;
    padding: 4px;
    border-radius: var(--border-radius-sm);
}

.tab-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    font-family: var(--font-family);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.tab-btn.active {
    background-color: #FFFFFF;
    color: var(--color-text-main);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.scrollable-feed {
    max-height: 520px;
    overflow-y: auto;
    padding: 20px;
}

.feed-placeholder {
    padding: 40px 10px;
    color: var(--color-text-muted);
    font-size: 13px;
}

/* Activity Feed Items */
.activity-item {
    display: flex;
    gap: 12px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
    align-items: flex-start;
}

.activity-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.activity-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-main);
}

.activity-desc {
    font-size: 12px;
    color: var(--color-text-muted);
    margin: 2px 0 6px;
}

.activity-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--color-text-muted);
}

.activity-type-badge {
    background-color: var(--color-border);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}

.activity-type-badge.run {
    background-color: rgba(252, 76, 2, 0.08);
    color: var(--color-primary);
}

.activity-type-badge.walk {
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--color-success);
}

.activity-type-badge.trailrun {
    background-color: rgba(245, 158, 11, 0.08);
    color: var(--color-warning);
}

/* Sync Log Items */
.log-item {
    padding: 12px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    margin-bottom: 12px;
    font-size: 12px;
}

.log-item:last-child {
    margin-bottom: 0;
}

.log-item.success {
    border-left: 3px solid var(--color-success);
}

.log-item.failed {
    border-left: 3px solid #EF4444;
}

.log-header {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    margin-bottom: 4px;
}

.log-time {
    color: var(--color-text-muted);
}

.log-status.success {
    color: var(--color-success);
}

.log-status.failed {
    color: #EF4444;
}

.log-body {
    color: var(--color-text-muted);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity var(--transition-speed) ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-card {
    background-color: #FFFFFF;
    width: 100%;
    max-width: 640px;
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--color-border);
    position: relative;
    padding: 32px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(1);
    transition: transform var(--transition-speed) cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.hidden .modal-card {
    transform: scale(0.95);
}

.modal-close-btn {
    position: absolute;
    top: 24px;
    right: 24px;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all var(--transition-speed) ease;
}

.modal-close-btn:hover {
    background-color: var(--color-bg-hover);
    color: var(--color-text-main);
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.modal-profile {
    display: flex;
    align-items: center;
    gap: 16px;
}

.modal-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
}

.modal-profile h2 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 2px;
}

.badge-rank {
    display: inline-block;
    padding: 2px 10px;
    background-color: var(--color-bg-hover);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
}

/* Trigger button below the athlete name (index.html) that opens the
   shareable achievement card */
.achievement-trigger-btn {
    display: block;
    margin-top: 10px;
    padding: 7px 14px;
    font-family: var(--font-family);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary);
    background: rgba(252, 76, 2, 0.08);
    border: 1px solid rgba(252, 76, 2, 0.25);
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.achievement-trigger-btn:hover {
    background: rgba(252, 76, 2, 0.15);
    border-color: rgba(252, 76, 2, 0.4);
}

.modal-score-badge {
    background-color: rgba(252, 76, 2, 0.05);
    border: 1px solid rgba(252, 76, 2, 0.1);
    padding: 12px 20px;
    border-radius: var(--border-radius-md);
    text-align: center;
}

.modal-score-badge .label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.modal-score-badge .score {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-primary);
    line-height: 1.1;
}

.modal-score-badge .max-label {
    font-size: 10px;
    color: var(--color-text-muted);
}

/* Score Breakdown Grid */
.modal-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.score-breakdown-card {
    border: 1px solid var(--color-border);
    background-color: var(--color-bg-hover);
    padding: 14px 16px;
    border-radius: var(--border-radius-md);
    display: flex;
    gap: 12px;
    align-items: center;
}

.score-breakdown-card .card-icon {
    font-size: 20px;
}

.score-breakdown-card .card-info .label {
    display: block;
    font-size: 10px;
    color: var(--color-text-muted);
}

.score-breakdown-card .card-info .value {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-main);
}

/* Modal Stats Bar */
.modal-stats-bar {
    display: flex;
    justify-content: space-between;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-md);
    padding: 16px 20px;
    margin-bottom: 28px;
    background-color: #FFFFFF;
}

.modal-stats-bar .stat-item {
    text-align: center;
    flex: 1;
    border-right: 1px solid var(--color-border);
}

.modal-stats-bar .stat-item:last-child {
    border-right: none;
}

.modal-stats-bar .stat-item .label {
    display: block;
    font-size: 11px;
    color: var(--color-text-muted);
    margin-bottom: 4px;
}

.modal-stats-bar .stat-item .value {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text-main);
}

/* Contribution Calendar */
.calendar-section h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.calendar-legend {
    display: flex;
    gap: 16px;
    font-size: 11px;
    color: var(--color-text-muted);
    margin-bottom: 14px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    display: inline-block;
}

.c-none { background-color: #E2E8F0; }
.c-low { background-color: rgba(252, 76, 2, 0.2); }
.c-done { background-color: var(--color-primary); }

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day-box {
    aspect-ratio: 1;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 500;
    position: relative;
    cursor: default;
    transition: transform 0.15s ease;
}

.calendar-day-box:hover {
    transform: scale(1.06);
    z-index: 10;
}

.calendar-day-box .day-num {
    font-size: 11px;
    font-weight: 600;
}

.calendar-day-box .day-dist {
    font-size: 8px;
    opacity: 0.85;
}

.calendar-day-box.d-none {
    background-color: #E2E8F0;
    color: #64748B;
}

.calendar-day-box.d-low {
    background-color: rgba(252, 76, 2, 0.2);
    color: #9A2E00;
}

.calendar-day-box.d-done {
    background-color: var(--color-primary);
    color: #FFFFFF;
}

/* Tooltip for Calendar Day */
.calendar-day-box[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(15, 23, 42, 0.95);
    color: #FFFFFF;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Utility Hidden */
.hidden {
    display: none !important;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: #0F172A;
    color: #FFFFFF;
    padding: 12px 24px;
    border-radius: var(--border-radius-sm);
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateY(0);
    opacity: 1;
    transition: all var(--transition-speed) ease;
}

.toast.hidden {
    transform: translateY(20px);
    opacity: 0;
    pointer-events: none;
}

/* App Footer */
.app-footer {
    border-top: 1px solid var(--color-border);
    background-color: #FAFBFD;
    padding: 40px 0;
    margin-top: 80px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

@media(min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        gap: 0;
    }
}

.footer-copyright {
    color: var(--color-text-muted);
    font-size: 13px;
    font-weight: 400;
}

.footer-divider {
    width: 40px;
    height: 1px;
    background-color: var(--color-border);
}

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

.footer-support {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}

.primago-highlight {
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
    letter-spacing: 0.5px;
    position: relative;
    display: inline-block;
    padding: 0 2px;
}

.primago-highlight::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(135deg, #4f46e5 0%, #06b6d4 100%);
    border-radius: 1px;
    opacity: 0.8;
}

/* Body Lock for Password Verification */
body.locked {
    overflow: hidden;
}

/* Password Verification Screen */
.password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.password-card {
    background: var(--color-bg-card);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    padding: 40px 30px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.password-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(252, 76, 2, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.password-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--color-text-main);
}

.password-card p {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 28px;
    line-height: 1.5;
}

.password-card form {
    width: 100%;
}

.password-card .input-wrapper {
    width: 100%;
    margin-bottom: 16px;
}

.password-card input[type="password"] {
    width: 100%;
    padding: 12px 18px;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--color-border);
    font-family: var(--font-family);
    font-size: 14px;
    text-align: center;
    background-color: var(--color-bg-hover);
    transition: all 0.2s;
}

.password-card input[type="password"]:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(252, 76, 2, 0.15);
    background-color: #FFFFFF;
}

.btn-block {
    width: 100%;
    justify-content: center;
    padding: 12px;
    font-size: 15px;
}

.password-error {
    color: #EF4444;
    font-size: 12px;
    font-weight: 500;
    margin-top: 12px;
}

.back-link {
    margin-top: 24px;
    font-size: 13px;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

/* Admin Title & Badges */
.admin-title-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-badge {
    background: rgba(252, 76, 2, 0.1);
    color: var(--color-primary);
    border: 1px solid rgba(252, 76, 2, 0.25);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.btn-danger {
    background-color: #EF4444;
    color: #FFFFFF;
}

.btn-danger:hover {
    background-color: #DC2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
    transform: translateY(-1px);
}

/* Leaderboard Clickable Rows */
.clickable-rows tbody tr {
    cursor: pointer;
}

.clickable-rows tbody tr:hover {
    background-color: var(--color-bg-hover);
}

/* Social Media Toggle Button in Calendar Day Box */
.social-toggle-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--color-border);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    z-index: 5;
}

.social-toggle-btn:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.social-toggle-btn.active {
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
    border-color: transparent;
    color: white;
}

/* For non-admin page, social badge inside calendar boxes (view-only) */
.social-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 10px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

/* Modal Activities Log */
.modal-activities-section {
    margin-top: 24px;
    border-top: 1px solid var(--color-border);
    padding-top: 20px;
}

.modal-activities-section h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-main);
    margin-bottom: 12px;
}

.modal-activities-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    background-color: var(--color-bg-hover);
}

.modal-activity-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-bottom: 1px solid var(--color-border);
    font-size: 12px;
}

.modal-activity-row:last-child {
    border-bottom: none;
}

.modal-activity-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.modal-activity-date {
    color: var(--color-text-muted);
    font-size: 10px;
}

.modal-activity-name {
    font-weight: 600;
    color: var(--color-text-main);
}

.modal-activity-stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-activity-badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
}

.modal-activity-badge.run {
    background-color: rgba(252, 76, 2, 0.08);
    color: var(--color-primary);
}

.modal-activity-badge.walk {
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--color-success);
}

.modal-activity-badge.trailrun {
    background-color: rgba(245, 158, 11, 0.08);
    color: var(--color-warning);
}

.modal-activity-dist {
    font-weight: 700;
    color: var(--color-text-main);
}

.modal-activity-dist-input {
    width: 56px;
    padding: 2px 4px;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    background-color: var(--color-bg-hover);
    color: var(--color-text-main);
}

.modal-activity-duration {
    color: var(--color-text-muted);
}

.modal-activity-delete-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    background: transparent;
    color: var(--color-danger, #EF4444);
    cursor: pointer;
    transition: background-color var(--transition-speed) ease;
}

.modal-activity-delete-btn:hover {
    background-color: rgba(239, 68, 68, 0.1);
}



/* Lock Screen (public page: leaderboard hidden until challenge ends).
   Kept bright and playful on purpose - this is a fun run challenge, not a
   countdown to something ominous, so no dark/horror styling here. */
#public-main-content.content-locked {
    display: none;
}

.lock-overlay {
    z-index: 2000;
    background: linear-gradient(160deg, rgba(255, 237, 213, 0.97), rgba(255, 246, 237, 0.97) 45%, rgba(255, 228, 196, 0.97));
    backdrop-filter: blur(4px);
    overflow: hidden;
}

/* Confetti pieces drifting down behind the card - celebratory, not spooky */
.lock-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.lock-confetti span {
    position: absolute;
    top: -8%;
    width: 9px;
    height: 14px;
    opacity: 0;
    border-radius: 2px;
    animation: lock-confetti-fall 6s linear infinite;
}

.lock-confetti span:nth-child(1) { left: 5%;  background: var(--color-primary); animation-delay: 0s;   animation-duration: 6.5s; }
.lock-confetti span:nth-child(2) { left: 18%; background: #FFC107; animation-delay: 0.8s; animation-duration: 5.5s; }
.lock-confetti span:nth-child(3) { left: 33%; background: #10B981; animation-delay: 1.6s; animation-duration: 7s; }
.lock-confetti span:nth-child(4) { left: 50%; background: #3B82F6; animation-delay: 0.3s; animation-duration: 6s; }
.lock-confetti span:nth-child(5) { left: 65%; background: var(--color-primary); animation-delay: 2.2s; animation-duration: 6.8s; }
.lock-confetti span:nth-child(6) { left: 78%; background: #FFC107; animation-delay: 1.1s; animation-duration: 5.8s; }
.lock-confetti span:nth-child(7) { left: 90%; background: #EC4899; animation-delay: 1.9s; animation-duration: 6.3s; }
.lock-confetti span:nth-child(8) { left: 96%; background: #10B981; animation-delay: 0.6s; animation-duration: 7.2s; }

@keyframes lock-confetti-fall {
    0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 0.9; }
    100% { transform: translateY(105vh) rotate(360deg); opacity: 0; }
}

.lock-card {
    max-width: 460px;
    text-align: center;
    position: relative;
    background: #FFFFFF;
    border: 1px solid rgba(252, 76, 2, 0.15);
    box-shadow: 0 25px 60px rgba(252, 76, 2, 0.15), 0 8px 24px rgba(0, 0, 0, 0.06);
    animation: lock-card-in 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes lock-card-in {
    0%   { opacity: 0; transform: scale(0.85) translateY(20px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.lock-icon-wrap {
    position: relative;
    width: 84px;
    height: 84px;
    margin: 0 auto 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lock-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1.5px solid rgba(252, 76, 2, 0.4);
    animation: lock-pulse 2.4s ease-out infinite;
}

.lock-ring-2 {
    animation-delay: 1.2s;
}

@keyframes lock-pulse {
    0%   { transform: scale(0.6); opacity: 0.9; }
    100% { transform: scale(1.7); opacity: 0; }
}

.lock-icon {
    position: relative;
    z-index: 1;
    font-size: 34px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(252, 76, 2, 0.16), rgba(252, 76, 2, 0.02) 70%);
    animation: lock-bounce 2s ease-in-out infinite;
}

@keyframes lock-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}

.lock-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-primary);
    background: rgba(252, 76, 2, 0.1);
    border: 1px solid rgba(252, 76, 2, 0.25);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.lock-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 14px;
    letter-spacing: -0.3px;
    background: linear-gradient(90deg, var(--color-text-main), var(--color-primary), var(--color-text-main));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: lock-shimmer 4s linear infinite;
}

@keyframes lock-shimmer {
    0%   { background-position: 200% center; }
    100% { background-position: -200% center; }
}

.lock-desc {
    color: var(--color-text-muted);
    font-size: 13px;
    line-height: 1.7;
    margin-bottom: 10px;
}

.lock-desc strong {
    color: var(--color-primary);
    font-weight: 600;
}

.lock-desc-sub {
    color: var(--color-text-muted);
    opacity: 0.8;
    font-size: 12.5px;
}

.lock-noreg-form {
    display: flex;
    gap: 8px;
    margin-top: 22px;
}

.lock-noreg-form input {
    flex: 1;
    padding: 11px 14px;
    font-family: var(--font-family);
    font-size: 13px;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    outline: none;
    background: var(--color-bg-hover);
    color: var(--color-text-main);
    transition: all var(--transition-speed) ease;
}

.lock-noreg-form input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(252, 76, 2, 0.12);
    background: #FFFFFF;
}

.lock-noreg-form .btn-primary {
    box-shadow: 0 4px 14px rgba(252, 76, 2, 0.3);
}

.lock-noreg-error {
    color: #EF4444;
    font-size: 12px;
    margin-top: 12px;
    animation: lock-error-in 0.3s ease;
}

@keyframes lock-error-in {
    0%   { opacity: 0; transform: translateY(-4px); }
    100% { opacity: 1; transform: translateY(0); }
}

@media (max-width: 520px) {
    .lock-card {
        padding: 24px 20px;
        max-width: calc(100% - 24px);
    }

    .lock-noreg-form {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lock-confetti,
    .lock-ring,
    .lock-icon,
    .lock-title {
        animation: none !important;
    }
}

/* Final Results Page (static/index_real.html, shown after the challenge
   ends): celebratory hero + podium replacing the rules banner. */
.final-hero {
    position: relative;
    overflow: hidden;
    padding: 32px;
    margin-bottom: 24px;
    text-align: center;
    background: linear-gradient(160deg, #FFF7ED 0%, #FFFFFF 55%, #FFF1E6 100%);
}

.final-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.final-confetti span {
    position: absolute;
    top: -8%;
    width: 8px;
    height: 12px;
    opacity: 0;
    border-radius: 2px;
    animation: final-confetti-fall 7s linear infinite;
}

.final-confetti span:nth-child(1)  { left: 3%;  background: var(--color-primary); animation-delay: 0s;   animation-duration: 7.5s; }
.final-confetti span:nth-child(2)  { left: 13%; background: #FFC107; animation-delay: 0.9s; animation-duration: 6.5s; }
.final-confetti span:nth-child(3)  { left: 24%; background: #10B981; animation-delay: 1.8s; animation-duration: 8s; }
.final-confetti span:nth-child(4)  { left: 36%; background: #3B82F6; animation-delay: 0.4s; animation-duration: 7s; }
.final-confetti span:nth-child(5)  { left: 48%; background: #EC4899; animation-delay: 2.4s; animation-duration: 7.8s; }
.final-confetti span:nth-child(6)  { left: 60%; background: var(--color-primary); animation-delay: 1.2s; animation-duration: 6.8s; }
.final-confetti span:nth-child(7)  { left: 71%; background: #FFC107; animation-delay: 2s;   animation-duration: 7.2s; }
.final-confetti span:nth-child(8)  { left: 82%; background: #10B981; animation-delay: 0.7s; animation-duration: 8.2s; }
.final-confetti span:nth-child(9)  { left: 91%; background: #3B82F6; animation-delay: 1.5s; animation-duration: 6.3s; }
.final-confetti span:nth-child(10) { left: 97%; background: #EC4899; animation-delay: 2.7s; animation-duration: 7.6s; }

@keyframes final-confetti-fall {
    0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 0.9; }
    100% { transform: translateY(340px) rotate(360deg); opacity: 0; }
}

.final-hero-heading {
    position: relative;
    z-index: 1;
    margin-bottom: 28px;
}

.final-eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--color-primary);
    background: rgba(252, 76, 2, 0.1);
    border: 1px solid rgba(252, 76, 2, 0.25);
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.final-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, var(--color-text-main), var(--color-primary), var(--color-text-main));
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: final-shimmer 5s linear infinite;
}

@keyframes final-shimmer {
    0%   { background-position: 200% center; }
    100% { background-position: -200% center; }
}

.final-subtitle {
    color: var(--color-text-muted);
    font-size: 14px;
    max-width: 560px;
    margin: 0 auto;
}

/* Podium */
.podium {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    max-width: 700px;
    margin: 0 auto;
}

.podium-loader {
    padding: 30px;
    color: var(--color-text-muted);
}

.podium-item {
    flex: 1;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    animation: podium-in 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes podium-in {
    0%   { opacity: 0; transform: translateY(30px) scale(0.9); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.podium-medal {
    font-size: 32px;
    margin-bottom: 6px;
    animation: podium-medal-bounce 2.4s ease-in-out infinite;
}

.podium-rank-2 .podium-medal { animation-delay: 0.2s; }
.podium-rank-3 .podium-medal { animation-delay: 0.4s; }

@keyframes podium-medal-bounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-6px) rotate(-4deg); }
}

.podium-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: #FFFFFF;
    background: linear-gradient(135deg, var(--color-primary), #FF8A50);
    box-shadow: 0 6px 16px rgba(252, 76, 2, 0.35);
    margin-bottom: 10px;
    border: 3px solid #FFFFFF;
}

.podium-rank-1 .podium-avatar {
    width: 72px;
    height: 72px;
    font-size: 28px;
    background: linear-gradient(135deg, #FFC107, #FF8A00);
    box-shadow: 0 8px 22px rgba(255, 193, 7, 0.45);
}

.podium-name {
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    margin-bottom: 4px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.podium-rank-1 .podium-name {
    font-size: 16px;
    font-weight: 700;
}

.podium-score {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 12px;
}

.podium-score span {
    font-weight: 500;
    color: var(--color-text-muted);
    font-size: 11px;
}

.podium-bar {
    width: 100%;
    border-radius: 10px 10px 0 0;
    background: linear-gradient(180deg, #FFE4C4, #FFD9B3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    padding-top: 10px;
    height: 70px;
}

.podium-rank-1 .podium-bar {
    height: 110px;
    background: linear-gradient(180deg, #FFECB3, #FFD54F);
    box-shadow: 0 -4px 20px rgba(255, 193, 7, 0.3);
}

.podium-rank-2 .podium-bar {
    height: 84px;
}

.podium-rank-3 .podium-bar {
    height: 60px;
}

.podium-bar-rank {
    font-size: 22px;
    font-weight: 800;
    color: rgba(0, 0, 0, 0.75);
}

.podium-bar-distance {
    font-size: 11px;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.6);
}

@media (max-width: 640px) {
    .final-title {
        font-size: 22px;
    }

    .podium {
        gap: 10px;
    }

    .podium-item {
        max-width: 110px;
    }

    .podium-name {
        font-size: 12px;
    }

    .podium-rank-1 .podium-name {
        font-size: 13px;
    }

    .podium-avatar {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .podium-rank-1 .podium-avatar {
        width: 56px;
        height: 56px;
        font-size: 22px;
    }

    .podium-bar {
        height: 54px;
        padding-top: 6px;
        gap: 1px;
    }

    .podium-rank-1 .podium-bar {
        height: 80px;
    }

    .podium-rank-2 .podium-bar {
        height: 64px;
    }

    .podium-rank-3 .podium-bar {
        height: 50px;
    }

    .podium-bar-rank {
        font-size: 17px;
    }

    .podium-bar-distance {
        font-size: 9.5px;
    }
}

.final-dashboard-layout {
    grid-template-columns: 1fr;
}

@media (prefers-reduced-motion: reduce) {
    .final-confetti,
    .final-title,
    .podium-medal {
        animation: none !important;
    }
}

/* Achievement / Share Card (final results page: click a row in Klasemen
   Lengkap to open a full-page screenshot-friendly summary card) */
.achievement-overlay {
    z-index: 2100;
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
}

.achievement-close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2;
    background: rgba(255, 255, 255, 0.16);
    color: #FFFFFF;
}

.achievement-close-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    color: #FFFFFF;
}

.achievement-card {
    position: relative;
    overflow-y: auto;
    width: 100%;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 24px 40px;
    text-align: center;
    background: linear-gradient(160deg, #FF7A3D 0%, var(--color-primary) 55%, #E34000 100%);
    color: #FFFFFF;
    animation: achievement-in 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes achievement-in {
    0%   { opacity: 0; transform: scale(0.97); }
    100% { opacity: 1; transform: scale(1); }
}

.achievement-anniversary {
    position: relative;
    z-index: 1;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: #FFE9DA;
    margin-bottom: 14px;
    text-transform: uppercase;
}

.achievement-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.achievement-confetti span {
    position: absolute;
    top: -8%;
    width: 7px;
    height: 11px;
    border-radius: 2px;
    opacity: 0;
    background: #FFFFFF;
    animation: achievement-confetti-fall 5s linear infinite;
}

.achievement-confetti span:nth-child(1) { left: 8%;  animation-delay: 0s;   opacity: 0.9; }
.achievement-confetti span:nth-child(2) { left: 24%; animation-delay: 0.7s; background: #FFE066; }
.achievement-confetti span:nth-child(3) { left: 42%; animation-delay: 1.4s; }
.achievement-confetti span:nth-child(4) { left: 60%; animation-delay: 0.4s; background: #FFE066; }
.achievement-confetti span:nth-child(5) { left: 78%; animation-delay: 1.8s; }
.achievement-confetti span:nth-child(6) { left: 92%; animation-delay: 1s;   background: #FFE066; }

@keyframes achievement-confetti-fall {
    0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 0.7; }
    100% { transform: translateY(420px) rotate(280deg); opacity: 0; }
}

.achievement-brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 8px 18px;
    border-radius: 24px;
    margin-bottom: 22px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.achievement-brand svg {
    width: 22px;
    height: 22px;
    opacity: 0.9;
}

.achievement-medal {
    position: relative;
    z-index: 1;
    font-size: 72px;
    margin-bottom: 12px;
    animation: achievement-medal-bounce 2s ease-in-out infinite;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.2));
}

@keyframes achievement-medal-bounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50%      { transform: translateY(-6px) rotate(-3deg); }
}

.achievement-name {
    position: relative;
    z-index: 1;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 28px;
    word-break: break-word;
    max-width: 90vw;
}

/* Headline stat: total distance, shown big and first */
.achievement-hero-stat {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 20px;
}

.achievement-hero-value {
    font-size: 56px;
    font-weight: 800;
    letter-spacing: -1px;
    line-height: 1;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.achievement-hero-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    opacity: 0.9;
}

.achievement-progress {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 320px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--border-radius-md);
    padding: 18px 20px;
    margin-bottom: 20px;
}

.achievement-progress-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 14px;
}

.achievement-stat-value {
    font-size: 26px;
    font-weight: 800;
}

.achievement-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.85;
}

.achievement-progress-bar-bg {
    width: 100%;
    height: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.25);
    overflow: hidden;
}

.achievement-progress-bar-fill {
    height: 100%;
    width: 0%;
    border-radius: 10px;
    background: #FFFFFF;
    transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.achievement-footer {
    position: relative;
    z-index: 1;
    font-size: 10.5px;
    opacity: 0.8;
    letter-spacing: 0.2px;
}

.achievement-hint {
    position: relative;
    z-index: 1;
    text-align: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 12.5px;
    margin-top: 24px;
}

@media (max-width: 480px) {
    .achievement-card {
        padding: 56px 20px 32px;
    }

    .achievement-medal {
        font-size: 56px;
    }

    .achievement-name {
        font-size: 22px;
    }

    .achievement-hero-value {
        font-size: 42px;
    }

    .achievement-stat-value {
        font-size: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .achievement-confetti,
    .achievement-medal {
        animation: none !important;
    }
}
