:root {
    --mta-blue: #0039A6;
    --mta-orange: #FF6319;
    --mta-red: #EE352E;
    --mta-green: #00933C;
    --mta-purple: #B933AD;
    --mta-yellow: #FCCC0A;
    --mta-lime: #6CBE45;
    --mta-brown: #996633;
    --mta-gray: #A7A9AC;
    --mta-shuttle: #808183;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    padding-bottom: 100px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--mta-blue) 0%, #002d7a 100%);
    color: white;
    padding: 16px 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header-top {
    text-align: center;
    padding: 12px 0;
}

.header-image {
    max-width: 280px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Responsive: make header image smaller on very small screens */
@media (max-width: 360px) {
    .header-image {
        max-width: 240px;
    }
}

/* Navigation */
.nav-bar {
    display: flex;
    gap: 0;
    margin: 0 -16px;
}

.nav-link {
    flex: 1;
    text-align: center;
    padding: 12px 16px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 3px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

.nav-link:hover {
    color: rgba(255,255,255,0.9);
}

.nav-link.active {
    color: white;
    border-bottom-color: var(--mta-orange);
}

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

/* Card */
.card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

/* Line Selector Grid */
.line-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.line-btn {
    width: 100%;
    aspect-ratio: 1;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.line-btn:active {
    transform: scale(0.95);
}

.line-btn.selected {
    box-shadow: 0 0 0 4px var(--mta-orange);
    transform: scale(1.1);
}

.line-btn[data-line="A"],
.line-btn[data-line="C"],
.line-btn[data-line="E"] { background-color: var(--mta-blue); }

.line-btn[data-line="B"],
.line-btn[data-line="D"],
.line-btn[data-line="F"],
.line-btn[data-line="M"] { background-color: var(--mta-orange); }

.line-btn[data-line="G"] { background-color: var(--mta-lime); }

.line-btn[data-line="J"],
.line-btn[data-line="Z"] { background-color: var(--mta-brown); }

.line-btn[data-line="L"] { background-color: var(--mta-gray); }

.line-btn[data-line="N"],
.line-btn[data-line="Q"],
.line-btn[data-line="R"],
.line-btn[data-line="W"] { background-color: var(--mta-yellow); color: #1a1a1a; }

.line-btn[data-line="1"],
.line-btn[data-line="2"],
.line-btn[data-line="3"] { background-color: var(--mta-red); }

.line-btn[data-line="4"],
.line-btn[data-line="5"],
.line-btn[data-line="6"] { background-color: var(--mta-green); }

.line-btn[data-line="7"] { background-color: var(--mta-purple); }

.line-btn[data-line="S"] { background-color: var(--mta-shuttle); }

/* Car Number Input */
.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.car-input {
    width: 100%;
    padding: 16px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s;
    letter-spacing: 8px;
}

.car-input:focus {
    border-color: var(--mta-blue);
}

.car-input::placeholder {
    letter-spacing: normal;
    color: #ccc;
}

/* Car Info Display */
.car-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    display: none;
}

.car-info.visible {
    display: block;
    animation: fadeIn 0.3s ease;
}

.car-info h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--mta-blue);
    margin-bottom: 4px;
}

.car-info p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.car-info .car-years {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border-color);
}

/* Log Button */
.log-btn {
    width: 100%;
    padding: 18px;
    font-size: 18px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, var(--mta-orange) 0%, #e55a15 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.log-btn:active {
    transform: scale(0.98);
}

.log-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stat-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--mta-blue);
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.stat-sublabel {
    font-size: 11px;
    color: var(--mta-orange);
    font-weight: 600;
    margin-top: 2px;
}

/* Today's Rides */
.today-rides {
    background: linear-gradient(135deg, var(--mta-blue) 0%, #002d7a 100%);
    color: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
}

.today-rides .card-title {
    color: rgba(255,255,255,0.8);
}

.today-count {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
}

.today-label {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 4px;
}

.today-list {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.today-ride {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
}

.today-ride .line-bullet {
    width: 20px;
    height: 20px;
    font-size: 12px;
}

/* Car Type Breakdown */
.car-type-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.car-type-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.car-type-name {
    font-weight: 600;
    min-width: 60px;
}

.car-type-bar-container {
    flex: 1;
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
}

.car-type-bar {
    height: 100%;
    background: linear-gradient(135deg, var(--mta-blue) 0%, var(--mta-orange) 100%);
    border-radius: 12px;
    transition: width 0.5s ease;
    min-width: 2px;
}

.car-type-count {
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

/* Day of Week Chart */
.dow-chart {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 120px;
    padding-top: 20px;
}

.dow-bar-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.dow-bar-wrapper {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 4px;
}

.dow-bar {
    width: 100%;
    max-width: 30px;
    background: linear-gradient(180deg, var(--mta-blue) 0%, var(--mta-orange) 100%);
    border-radius: 4px 4px 0 0;
    transition: height 0.5s ease;
    min-height: 4px;
}

.dow-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-top: 8px;
}

.dow-count {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Recent Rides */
.recent-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ride-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 12px;
}

/* Line Bullet */
.line-bullet {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: white;
    flex-shrink: 0;
}

.ride-details {
    flex: 1;
}

.ride-car {
    font-weight: 700;
    font-size: 16px;
}

.ride-type {
    font-size: 12px;
    color: var(--text-secondary);
}

.ride-time {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: right;
}

.ride-date {
    font-weight: 500;
}

.delete-btn {
    background: none;
    border: none;
    color: var(--mta-red);
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.delete-btn:hover {
    background: rgba(238, 53, 46, 0.1);
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.action-btn {
    flex: 1;
    padding: 14px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s;
    min-width: 0;
}

.action-btn:active {
    transform: scale(0.98);
}

.export-btn {
    background: var(--mta-blue);
    color: white;
}

.import-btn {
    background: var(--mta-green);
    color: white;
}

.clear-btn {
    background: #f8f9fa;
    color: var(--mta-red);
    border: 2px solid var(--mta-red);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1a1a1a;
    color: white;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 500;
    opacity: 0;
    transition: transform 0.3s, opacity 0.3s;
    z-index: 1000;
    max-width: 90%;
    text-align: center;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    border-radius: 16px;
    padding: 24px;
    max-width: 340px;
    width: 90%;
    text-align: center;
}

.modal h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.modal p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.modal-buttons {
    display: flex;
    gap: 12px;
}

.modal-buttons.vertical {
    flex-direction: column;
}

.modal-btn {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.modal-btn.cancel {
    background: #f8f9fa;
    color: var(--text-primary);
}

.modal-btn.confirm {
    background: var(--mta-red);
    color: white;
}

.modal-btn.primary {
    background: var(--mta-blue);
    color: white;
}

.modal-btn.secondary {
    background: var(--mta-orange);
    color: white;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Line bullet colors */
.line-bullet[data-line="A"],
.line-bullet[data-line="C"],
.line-bullet[data-line="E"] { background-color: var(--mta-blue); }

.line-bullet[data-line="B"],
.line-bullet[data-line="D"],
.line-bullet[data-line="F"],
.line-bullet[data-line="M"] { background-color: var(--mta-orange); }

.line-bullet[data-line="G"] { background-color: var(--mta-lime); }

.line-bullet[data-line="J"],
.line-bullet[data-line="Z"] { background-color: var(--mta-brown); }

.line-bullet[data-line="L"] { background-color: var(--mta-gray); }

.line-bullet[data-line="N"],
.line-bullet[data-line="Q"],
.line-bullet[data-line="R"],
.line-bullet[data-line="W"] { background-color: var(--mta-yellow); color: #1a1a1a; }

.line-bullet[data-line="1"],
.line-bullet[data-line="2"],
.line-bullet[data-line="3"] { background-color: var(--mta-red); }

.line-bullet[data-line="4"],
.line-bullet[data-line="5"],
.line-bullet[data-line="6"] { background-color: var(--mta-green); }

.line-bullet[data-line="7"] { background-color: var(--mta-purple); }

.line-bullet[data-line="S"] { background-color: var(--mta-shuttle); }

/* Install prompt */
.install-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 16px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: none;
    z-index: 100;
}

.install-prompt.visible {
    display: block;
}

.install-prompt-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

.install-prompt-text {
    flex: 1;
}

.install-prompt-text h4 {
    font-size: 14px;
    margin-bottom: 4px;
}

.install-prompt-text p {
    font-size: 12px;
    color: var(--text-secondary);
}

.install-btn {
    padding: 10px 20px;
    background: var(--mta-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.dismiss-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-secondary);
}

/* ================================================
   Explorer Page Styles
   ================================================ */

/* Search Bar */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.search-input {
    flex: 1;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--mta-blue);
}

/* Filter Controls */
.filter-row {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: white;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.filter-select:focus {
    border-color: var(--mta-blue);
}

.results-count {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

/* Fleet Card */
.fleet-card {
    background: var(--card-bg);
    border-radius: 16px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.fleet-card.ridden {
    border-left: 4px solid var(--mta-orange);
}

.fleet-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    cursor: pointer;
    user-select: none;
}

.fleet-card-header:active {
    background: #f8f9fa;
}

.fleet-model {
    font-size: 24px;
    font-weight: 700;
    color: var(--mta-blue);
    min-width: 70px;
}

.fleet-summary {
    flex: 1;
    min-width: 0;
}

.fleet-range {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.fleet-division {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.fleet-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.ridden-badge {
    background: var(--mta-orange);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.ride-count-badge {
    font-size: 11px;
    color: var(--mta-blue);
    font-weight: 600;
}

.expand-arrow {
    color: var(--text-secondary);
    font-size: 12px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.fleet-card.expanded .expand-arrow {
    transform: rotate(180deg);
}

/* Fleet Card Details */
.fleet-details {
    display: none;
    padding: 0 20px 20px;
    border-top: 1px solid var(--border-color);
}

.fleet-card.expanded .fleet-details {
    display: block;
    animation: fadeIn 0.25s ease;
}

.fleet-detail-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.fleet-detail-row:last-child {
    border-bottom: none;
}

.fleet-detail-label {
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 100px;
}

.fleet-detail-value {
    flex: 1;
    color: var(--text-primary);
    line-height: 1.5;
}

.fleet-lines {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.fleet-lines .line-bullet {
    width: 26px;
    height: 26px;
    font-size: 14px;
}

.fleet-user-stats {
    background: linear-gradient(135deg, #fff8f0 0%, #fff0e0 100%);
    border-radius: 10px;
    padding: 14px;
    margin-top: 12px;
}

.fleet-user-stats h4 {
    font-size: 13px;
    font-weight: 700;
    color: var(--mta-orange);
    margin-bottom: 8px;
}

.fleet-user-cars {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.fleet-user-car {
    background: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

/* Collection Progress */
.collection-progress {
    background: linear-gradient(135deg, var(--mta-blue) 0%, #002d7a 100%);
    color: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
}

.collection-progress .card-title {
    color: rgba(255,255,255,0.8);
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px 16px;
    margin-bottom: 16px;
}

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

.progress-stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
}

.progress-stat-value .of-total {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.7;
}

.progress-stat-label {
    font-size: 11px;
    opacity: 0.8;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Dual Progress Bars */
.progress-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

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

.progress-bar-label {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.9;
    min-width: 42px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.progress-bar-container {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-bar.types {
    background: var(--mta-orange);
}

.progress-bar.fleet {
    background: rgba(255,255,255,0.9);
}

/* ================================================
   Highscores Page Styles
   ================================================ */

/* Your Stats Card (blue gradient like today-rides) */
.your-stats {
    background: linear-gradient(135deg, var(--mta-blue) 0%, #002d7a 100%);
    color: white;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
}

.your-stats .card-title {
    color: rgba(255,255,255,0.8);
}

.your-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.your-stat-item {
    text-align: center;
    padding: 12px;
    background: rgba(255,255,255,0.1);
    border-radius: 12px;
}

.your-stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.1;
}

.your-stat-value.large {
    font-size: 36px;
}

.your-stat-label {
    font-size: 11px;
    opacity: 0.8;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.your-stat-sublabel {
    font-size: 12px;
    opacity: 0.7;
    margin-top: 2px;
}

/* Leaderboard Table */
.leaderboard-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.4;
}

.leaderboard-table-wrapper {
    overflow-x: auto;
    margin: 0 -20px;
    padding: 0 20px;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 400px;
}

.leaderboard-table th {
    text-align: left;
    padding: 10px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
}

.leaderboard-table th:first-child {
    width: 50px;
    text-align: center;
}

.leaderboard-table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.leaderboard-table tr:last-child td {
    border-bottom: none;
}

.leaderboard-table tr.current-user {
    background: linear-gradient(135deg, #fff8f0 0%, #fff0e0 100%);
}

.leaderboard-table tr.current-user td {
    font-weight: 600;
}

.rank-cell {
    text-align: center;
    font-weight: 700;
    color: var(--text-secondary);
}

.rank-cell.gold {
    color: #FFD700;
}

.rank-cell.silver {
    color: #C0C0C0;
}

.rank-cell.bronze {
    color: #CD7F32;
}

.username-cell {
    font-weight: 600;
    color: var(--text-primary);
}

.cars-cell {
    font-weight: 600;
    color: var(--mta-blue);
}

.pct-cell {
    color: var(--mta-orange);
    font-weight: 600;
}

.rides-cell {
    color: var(--text-secondary);
}

/* CTA Banner */
.cta-banner {
    background: #f8f9fa;
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    margin-top: 16px;
}

.cta-banner-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.cta-banner-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Achievements Grid */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 400px) {
    .achievements-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.achievement-badge {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    position: relative;
    border: 2px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.achievement-badge.locked {
    opacity: 0.6;
}

.achievement-badge.unlocked {
    border-color: var(--mta-orange);
    background: linear-gradient(135deg, #fff8f0 0%, #fff0e0 100%);
}

.achievement-badge.unlocked .achievement-icon {
    filter: none;
}

.achievement-icon {
    font-size: 32px;
    margin-bottom: 8px;
    filter: grayscale(100%);
}

.achievement-badge.unlocked .achievement-icon {
    filter: none;
}

.achievement-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.2;
}

.achievement-req {
    font-size: 10px;
    color: var(--text-secondary);
    line-height: 1.3;
}

.achievement-lock {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 12px;
    opacity: 0.5;
}

.achievement-badge.unlocked .achievement-lock {
    display: none;
}

/* Position indicator for leaderboard */
.position-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.15);
    padding: 8px 16px;
    border-radius: 20px;
    margin-top: 12px;
}

.position-indicator-label {
    font-size: 12px;
    opacity: 0.8;
    margin-right: 8px;
}

.position-indicator-value {
    font-size: 18px;
    font-weight: 700;
}

/* ================================================
   Authentication Styles
   ================================================ */

/* Auth Bar */
.auth-bar {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    padding: 12px 16px;
    display: flex;
    justify-content: center;
}

.auth-logged-out,
.auth-logged-in {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 600px;
    width: 100%;
}

.auth-message {
    flex: 1;
    color: rgba(255,255,255,0.8);
    font-size: 13px;
}

.auth-user {
    flex: 1;
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.auth-user-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: var(--mta-orange);
    border-radius: 50%;
    margin-right: 8px;
    font-size: 14px;
}

.auth-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: var(--mta-orange);
    color: white;
    transition: transform 0.15s;
    white-space: nowrap;
}

.auth-btn:active {
    transform: scale(0.98);
}

.auth-btn.secondary {
    background: rgba(255,255,255,0.2);
}

/* Auth Modal */
.auth-modal {
    max-width: 360px;
    padding: 0;
    overflow: hidden;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    z-index: 1;
    line-height: 1;
    padding: 4px;
}

.modal-close:hover {
    color: var(--text-primary);
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    padding: 16px;
    font-size: 14px;
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s, border-color 0.2s;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}

.auth-tab:hover {
    color: var(--text-primary);
}

.auth-tab.active {
    color: var(--mta-blue);
    border-bottom-color: var(--mta-blue);
}

.auth-form {
    padding: 24px;
}

.auth-input-group {
    margin-bottom: 16px;
}

.auth-input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.auth-input-group input {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.auth-input-group input:focus {
    border-color: var(--mta-blue);
}

.auth-submit-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--mta-blue) 0%, #002d7a 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.15s;
}

.auth-submit-btn:active {
    transform: scale(0.98);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-error {
    margin-top: 12px;
    padding: 10px;
    background: #ffebeb;
    border-radius: 6px;
    color: var(--mta-red);
    font-size: 13px;
    display: none;
}

.auth-error.visible {
    display: block;
}

.auth-success {
    margin-top: 12px;
    padding: 10px;
    background: #e8f5e9;
    border-radius: 6px;
    color: var(--mta-green);
    font-size: 13px;
    display: none;
}

.auth-success.visible {
    display: block;
}

/* Import Prompt */
.auth-import {
    padding: 24px;
    text-align: center;
}

.auth-import h3 {
    margin-bottom: 8px;
    font-size: 18px;
}

.auth-import p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.auth-import-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Sync Status Indicator */
.sync-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
}

.sync-status.syncing {
    color: var(--mta-orange);
}

.sync-status.synced {
    color: var(--mta-green);
}

.sync-status.error {
    color: var(--mta-red);
}

.sync-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.sync-dot.syncing {
    animation: pulse 1s infinite;
}

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

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner.dark {
    border-color: rgba(0,0,0,0.1);
    border-top-color: var(--mta-blue);
}

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

/* ================================================
   About & Privacy Page Styles
   ================================================ */

.page-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--mta-blue);
    margin-bottom: 8px;
}

.last-updated {
    font-size: 13px;
    color: var(--text-secondary);
}

.about-content {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
}

.about-content p {
    margin-bottom: 12px;
}

.about-content p:last-child {
    margin-bottom: 0;
}

.about-list {
    margin: 12px 0;
    padding-left: 24px;
}

.about-list li {
    margin-bottom: 10px;
    line-height: 1.5;
}

.about-list li:last-child {
    margin-bottom: 0;
}

.about-link {
    color: var(--mta-blue);
    text-decoration: none;
    font-weight: 500;
}

.about-link:hover {
    text-decoration: underline;
}

.about-footer-link {
    text-align: center;
    padding: 20px 0 40px;
}

/* ================================================
   Site Footer
   ================================================ */

.site-footer {
    text-align: center;
    padding: 24px 16px 40px;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.footer-link:hover {
    color: var(--mta-blue);
    text-decoration: underline;
}
