/* ========================================
   UI Styles - Bangladesh Route Master
   ======================================== */

/* Hide all scrollbars globally */
html, body, .game-container, .modal, .modal-content {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE 10+ */
}
html::-webkit-scrollbar, body::-webkit-scrollbar, .game-container::-webkit-scrollbar, .modal::-webkit-scrollbar, .modal-content::-webkit-scrollbar {
    display: none;
}

/* Tutorial Modal Styles */
#tutorial-modal .tutorial-content {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    padding: 2.5rem 2rem;
    max-width: 420px;
    margin: 2rem auto;
    color: #222;
    font-family: 'Poppins', sans-serif;
}
#tutorial-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}
#tutorial-modal h2 {
    font-size: 1.7rem;
    font-weight: 700;
    margin: 0;
}
#tutorial-modal .close-btn {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #888;
    transition: color 0.2s;
}
#tutorial-modal .close-btn:hover {
    color: #e53e3e;
}
#tutorial-modal .tutorial-body {
    margin-bottom: 1.5rem;
}
#tutorial-modal h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
}
#tutorial-modal .tutorial-list {
    list-style: disc inside;
    margin-bottom: 1.2rem;
    padding-left: 0.5rem;
}
#tutorial-modal .tutorial-list li {
    margin-bottom: 0.7rem;
    font-size: 1rem;
}
#tutorial-modal .tutorial-footer {
    text-align: center;
    font-size: 1.05rem;
    color: #059669;
    font-weight: 500;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #10b981, #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
    color: white;
}

.loader-map {
    font-size: 4rem;
    animation: float 2s ease-in-out infinite;
}

.loader-content h1 {
    font-size: 2rem;
    margin: var(--space-md) 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.loader-bar {
    width: 200px;
    height: 6px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin: 0 auto var(--space-md);
}

.loader-progress {
    height: 100%;
    background: white;
    border-radius: var(--radius-full);
    animation: load-progress 2s ease-in-out forwards;
}

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

@keyframes load-progress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Game Container */
.game-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header - Mobile First */
.game-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    gap: var(--space-xs);
    padding: var(--space-sm);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    grid-column: 1;
    grid-row: 1;
}

.header-center {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-self: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.logo-icon {
    font-size: 1.25rem;
}

.logo-text {
    font-size: 0.9rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: none;
}

.level-badge {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    border-radius: var(--radius-md);
    color: white;
    box-shadow: var(--shadow-sm);
}

.level-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.level-number {
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
}

/* Route Info in Header - Mobile First */
.route-info-header {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    background: var(--bg-secondary);
    padding: 6px 10px;
    border-radius: var(--radius-lg);
}

.route-label-header {
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    display: none;
    font-size: 0.75rem;
}

.route-points-header {
    display: flex;
    align-items: center;
    gap: 6px;
}

.point-badge {
    display: flex;
    align-items: center;
    gap: 3px;
    padding: 2px 6px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.7rem;
}

.point-badge.start-badge {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.point-badge.end-badge {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.point-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.point-dot.start-dot {
    background: var(--success);
}

.point-dot.end-dot {
    background: var(--error);
}

.point-name-header {
    font-weight: 600;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.route-arrow-header {
    color: var(--text-muted);
    font-size: 0.9rem;
}
}

.coins-display, .streak-display {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.8rem;
}

/* Hide streak on mobile to save space */
.streak-display {
    display: none;
}

/* Hide settings button on mobile */
#settings-btn {
    display: none;
}

.coin-icon {
    font-size: 0.9rem;
    animation: coin-shine 2s ease-in-out infinite;
}

.streak-icon {
    font-size: 0.9rem;
}

@keyframes coin-shine {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}

/* Main Game Area */
.game-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-sm);
    padding-bottom: 140px; /* Space for floating bottom bar on mobile */
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Centered map layout */
.game-main.centered {
    justify-content: center;
    align-items: center;
}

.map-panel-centered {
    max-width: 100%;
    width: 100%;
}

.map-panel-centered .map-container {
    background: transparent;
    border-radius: var(--radius-xl);
    padding: var(--space-md);
    overflow: hidden;
}

.map-panel-centered .map-legend {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin-top: var(--space-md);
    padding: var(--space-sm);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
}

/* Control Panel */
.control-panel {
    width: 400px;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

/* Route Card */
.route-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    box-shadow: var(--shadow-lg);
}

.route-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.route-header h2 {
    font-size: 1.1rem;
}

.difficulty-badge {
    display: none; /* Hide on mobile */
    padding: 3px 8px;
    border-radius: var(--radius-md);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--success);
    color: white;
}

.difficulty-badge.medium {
    background: var(--warning);
    color: #1e293b;
}

.difficulty-badge.hard {
    background: var(--error);
}

.route-points {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.route-point {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.point-marker {
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.start-marker {
    background: var(--map-start);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

.end-marker {
    background: var(--map-end);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
}

.point-info {
    display: flex;
    flex-direction: column;
}

.point-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.point-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.route-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
}

.connector-line {
    width: 2px;
    height: 20px;
    background: var(--border-dark);
}

.connector-icon {
    font-size: 1.25rem;
    color: var(--primary);
}

.route-stats {
    display: flex;
    gap: var(--space-md);
}

.stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-sm);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.stat-icon {
    font-size: 1.25rem;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.stat-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
}

/* Input Section */
.input-section {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    box-shadow: var(--shadow-lg);
}

.input-wrapper {
    display: flex;
    gap: var(--space-sm);
}

.district-input {
    flex: 1;
    padding: var(--space-md);
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.district-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.district-input::placeholder {
    color: var(--text-muted);
}

.submit-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-lg);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-weight: 600;
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.submit-btn:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

/* Autocomplete */
.autocomplete-container {
    position: relative;
    margin-top: var(--space-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: var(--bg-secondary);
}

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

.autocomplete-item.not-connected {
    opacity: 0.5;
    border-left: 3px solid var(--error);
}

.autocomplete-district {
    font-weight: 500;
}

.autocomplete-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: auto;
}

.input-hint {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Route Display */
.route-display {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    box-shadow: var(--shadow-lg);
}

.route-display-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.route-display-header h3 {
    font-size: 1rem;
}

.clear-btn {
    padding: var(--space-xs) var(--space-sm);
    font-size: 1rem;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.clear-btn:hover {
    background: var(--bg-secondary);
    transform: scale(1.1);
}

.route-path {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    min-height: 50px;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    align-items: center;
}

.empty-route {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

.route-step {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    animation: pop-in 0.3s ease;
}

.route-step.start {
    background: var(--map-start);
}

.route-step.end {
    background: var(--map-end);
}

.route-arrow {
    color: var(--text-muted);
    font-size: 0.9rem;
}

@keyframes pop-in {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: var(--space-sm);
}

.action-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.action-btn .btn-icon {
    font-size: 1.25rem;
}

.action-btn .btn-cost {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.hint-btn:hover:not(:disabled) {
    background: #fef3c7;
}

.undo-btn:hover:not(:disabled) {
    background: #f1f5f9;
}

/* Modals */
.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: var(--space-lg);
    max-width: 420px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modal-in 0.3s ease;
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--radius-full);
    font-size: 1.25rem;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.close-btn:hover {
    background: var(--error);
    color: white;
}

/* Success Modal */
.success-content {
    text-align: center;
    max-width: 420px;
    padding: var(--space-md);
}

.success-content h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
}

.success-animation {
    position: relative;
    margin-bottom: var(--space-sm);
}

.trophy {
    font-size: 3rem;
}

@keyframes trophy-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Route Comparison */
.route-comparison {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin: var(--space-xs) 0;
    text-align: left;
}

.route-section {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--space-sm);
}

.route-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.route-display {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    font-size: 0.7rem;
}

.route-display .route-step,
.route-display .route-chip {
    background: var(--primary);
    color: white;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.7rem;
}

.route-display .route-chip.optimal {
    background: linear-gradient(135deg, #10b981, #059669);
}

.route-display .route-step.optimal {
    background: linear-gradient(135deg, #10b981, #059669);
}

.route-display .route-arrow {
    color: var(--text-muted);
    font-size: 0.7rem;
    margin: 0 2px;
}

/* Master Navigator Section */
.master-navigator-section {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    text-align: center;
    animation: glow-pulse 2s ease-in-out infinite;
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 10px rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.5); }
}

.master-navigator-badge {
    font-size: 1.1rem;
    font-weight: 800;
    color: #b45309;
    margin-bottom: var(--space-xs);
    animation: trophy-bounce 1s ease-in-out infinite;
}

.master-navigator-text {
    font-size: 0.85rem;
    color: #92400e;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.master-route-display {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.master-route-display .route-step {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.7rem;
}

.master-route-display .route-arrow {
    color: #92400e;
    font-size: 0.7rem;
    margin: 0 2px;
}

.success-stats {
    display: flex;
    gap: var(--space-sm);
    margin: var(--space-md) 0;
}

.success-stat {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.success-stat.highlight {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
}

.success-stat .stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.success-stat .stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.bonus-section {
    margin-bottom: var(--space-sm);
}

.bonus-badge {
    padding: 4px var(--space-sm);
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    border-radius: var(--radius-full);
    animation: pulse 1s ease-in-out infinite;
}

/* Settings Modal */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
}

.toggle {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border-dark);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

.toggle input:checked + .toggle-slider {
    background: var(--primary);
}

.toggle input:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.settings-footer {
    margin-top: var(--space-lg);
    text-align: center;
}

/* Ad Modal */
.ad-content {
    text-align: center;
}

.ad-container {
    margin: var(--space-lg) 0;
}

.ad-slot {
    min-height: 250px;
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: var(--space-md) 0;
}

.ad-placeholder {
    text-align: center;
    color: var(--text-muted);
}

.ad-placeholder span {
    font-size: 3rem;
}

.reward-badge {
    margin-left: var(--space-sm);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
}

/* Responsive - Mobile First (min-width) */

/* Tablets and up */
@media (min-width: 600px) {
    .game-header {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto;
        padding: var(--space-sm) var(--space-lg);
        gap: var(--space-md);
    }

    .header-left {
        gap: var(--space-sm);
    }

    .header-center {
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
    }

    .header-right {
        gap: var(--space-sm);
    }

    .logo-text {
        display: block;
        font-size: 1rem;
    }

    .logo-icon {
        font-size: 1.5rem;
    }

    .level-badge {
        flex-direction: row;
        padding: var(--space-xs) var(--space-md);
    }

    .level-number {
        font-size: 1.3rem;
    }

    .route-info-header {
        gap: var(--space-sm);
        padding: var(--space-sm) var(--space-md);
    }

    .route-label-header {
        display: block;
    }

    .difficulty-badge {
        display: block;
    }

    .route-points-header {
        gap: var(--space-sm);
    }

    .point-badge {
        gap: 5px;
        padding: 4px 10px;
        font-size: 0.85rem;
    }

    .point-name-header {
        max-width: 120px;
    }

    .route-arrow-header {
        font-size: 1rem;
    }

    .coins-display, .streak-display {
        padding: 6px 12px;
        font-size: 0.9rem;
        gap: 4px;
    }

    .coin-icon, .streak-icon {
        font-size: 1rem;
    }

    .header-action-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    /* Show streak and settings on tablets */
    .streak-display {
        display: flex;
    }

    #settings-btn {
        display: block;
    }

    .game-main {
        padding: var(--space-md);
        padding-bottom: 120px;
    }

    .map-panel {
        min-height: 450px;
    }

    .map-container {
        padding: var(--space-md);
    }

    .floating-bottom-bar {
        bottom: 20px;
        width: 90%;
        padding: var(--space-md) var(--space-lg);
    }

    .bottom-bar-content {
        flex-direction: row;
        align-items: center;
        gap: var(--space-lg);
    }

    .route-display-inline {
        flex: 1;
        min-width: 200px;
        width: auto;
    }

    .input-section-inline {
        min-width: 250px;
        width: auto;
    }

    .route-path-inline .district-chip {
        padding: 4px 10px;
        font-size: 0.85rem;
    }
}

/* Desktop and up */
@media (min-width: 900px) {
    .game-header {
        padding: var(--space-md) var(--space-xl);
    }

    .logo-text {
        font-size: 1.15rem;
    }

    .logo-icon {
        font-size: 1.75rem;
    }

    .level-badge {
        padding: var(--space-xs) var(--space-lg);
    }

    .level-number {
        font-size: 1.5rem;
    }

    .point-badge {
        padding: 5px 14px;
        font-size: 0.95rem;
    }

    .point-name-header {
        max-width: none;
    }

    .game-main {
        gap: var(--space-lg);
        padding: var(--space-lg);
        padding-bottom: 100px;
    }

    .map-panel-centered {
        max-width: 900px;
    }

    .map-panel {
        min-height: 600px;
    }

    .header-action-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }

    .coins-display, .streak-display {
        padding: var(--space-sm) var(--space-md);
        font-size: 1rem;
    }

    .coin-icon, .streak-icon {
        font-size: 1.25rem;
    }
}

/* Header Action Buttons - Mobile First */
.header-actions {
    display: flex;
    gap: 4px;
}

.header-action-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--bg-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}

.header-action-btn:hover {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.header-action-btn:active {
    transform: translateY(0);
}

.header-action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Floating Bottom Bar - Mobile First */
.floating-bottom-bar {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 900px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    padding: var(--space-sm) var(--space-md);
    z-index: 100;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bottom-bar-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
}

/* Inline Route Display - Mobile First */
.route-display-inline {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: var(--bg-secondary);
    padding: var(--space-sm);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.route-label {
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    font-size: 0.8rem;
}

.route-path-inline {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    overflow-x: auto;
    padding: var(--space-xs) 0;
    scrollbar-width: thin;
}

.route-path-inline::-webkit-scrollbar {
    height: 4px;
}

.route-path-inline::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 2px;
}

.route-path-inline .district-chip {
    background: var(--primary);
    color: white;
    padding: 3px 8px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.route-path-inline .route-arrow {
    color: var(--text-muted);
    font-size: 0.7rem;
}

.empty-route {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.8rem;
}

.clear-btn-small {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    padding: var(--space-xs);
    opacity: 0.6;
    transition: all 0.2s;
}

.clear-btn-small:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Inline Input Section - Mobile First */
.input-section-inline {
    position: relative;
    width: 100%;
}

.input-wrapper-inline {
    display: flex;
    gap: var(--space-xs);
}

.district-input-inline {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--bg-primary);
    transition: all 0.2s;
    min-width: 0;
}

.district-input-inline:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.submit-btn-inline {
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.submit-btn-inline:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.submit-btn-inline:active {
    transform: translateY(0);
}

/* Autocomplete positioned above the input */
.input-section-inline .autocomplete-container {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 60px;
    margin-bottom: var(--space-xs);
    max-height: 200px;
    overflow-y: auto;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    z-index: 200;
}

/* ========================================
   Developer Profile Button & Modal
   ======================================== */

/* Developer Button in Header */
.developer-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    padding: 0;
    border: 2px solid var(--primary);
    background: var(--bg-card);
    cursor: pointer;
    overflow: hidden;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.developer-btn:hover {
    transform: scale(1.1);
    border-color: var(--secondary);
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
}

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

.developer-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* Developer Modal Content */
.developer-content {
    max-width: 450px;
    text-align: center;
}

.developer-profile {
    margin-bottom: var(--space-lg);
}

.developer-avatar-large {
    width: 100px;
    height: 100px;
    margin: 0 auto var(--space-md);
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--primary);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    animation: avatar-glow 2s ease-in-out infinite alternate;
}

@keyframes avatar-glow {
    0% {
        box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
    }
    100% {
        box-shadow: 0 4px 30px rgba(99, 102, 241, 0.5);
    }
}

.developer-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.developer-name {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-xs);
}

.developer-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.developer-bio {
    text-align: left;
    background: var(--bg-secondary);
    padding: var(--space-md);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
}

.developer-bio p {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.developer-bio p:last-child {
    margin-bottom: 0;
}

.developer-bio strong {
    color: var(--text-primary);
}

.developer-projects {
    margin-bottom: var(--space-md);
}

.developer-projects h4,
.developer-connect h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    text-align: left;
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.project-item {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.project-item:hover {
    background: var(--bg-card);
    border-color: var(--primary);
    transform: translateX(4px);
}

.project-icon {
    font-size: 1.25rem;
}

.project-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    text-align: left;
}

.project-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
}

.developer-connect {
    margin-bottom: var(--space-md);
}

.connect-links {
    display: flex;
    gap: var(--space-sm);
    justify-content: center;
    flex-wrap: wrap;
}

.connect-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    color: white;
}

.connect-btn.email {
    background: linear-gradient(135deg, #ea4335, #c5221f);
}

.connect-btn.linkedin {
    background: linear-gradient(135deg, #0077b5, #005885);
}

.connect-btn.website {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}

.connect-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.developer-footer {
    padding-top: var(--space-md);
    border-top: 1px solid var(--border);
}

.developer-footer p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}
