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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f4f8;
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 10px;
}

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

.nav-icons {
    display: flex;
    gap: 5px;
    align-items: center;
}

.dark-mode-toggle {
    background: none;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
    color: #4a5568;
}

.dark-mode-toggle:hover {
    background: #f7fafc;
    transform: scale(1.05);
}

.nav-btn {
    padding: 10px 15px;
    border: 2px solid #3182ce;
    background: white;
    color: #3182ce;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    margin: 0 5px;
}

.nav-btn:hover {
    background: #3182ce;
    color: white;
    transform: translateY(-2px);
}

.icon-btn {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 20px;
    transition: all 0.2s;
    color: #4a5568;
}

.icon-btn:hover {
    background: #3182ce;
    color: white;
    border-color: #3182ce;
    transform: scale(1.05);
}

.mode-toggle {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.mode-btn {
    padding: 10px 20px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.mode-btn.active {
    background: #3182ce;
    color: white;
    border-color: #3182ce;
}

.mode-btn:hover:not(.active) {
    background: #f7fafc;
}

.title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
    letter-spacing: 1px;
}

.input-container {
    position: relative;
    margin-bottom: 15px;
}

#stateInput {
    width: 100%;
    padding: 12px 16px;
    padding-right: 90px;
    font-size: 0.9rem;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    outline: none;
    background: white;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

#stateInput:focus {
    border-color: #3182ce;
}

.enter-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    padding: 6px 16px;
    background: #3182ce;
    color: white;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.enter-btn:hover {
    background: #2c5aa0;
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 15px 15px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid #f7fafc;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.suggestion-item:hover {
    background: #f7fafc;
}

.map-container {
    background: white;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
}

#usaMap {
    width: 100%;
    max-width: 900px;
    height: auto;
    background: #f8fafc;
    border-radius: 10px;
    padding: 20px;
}

#usaMap svg {
    width: 100%;
    height: auto;
    display: block;
}

.state-path {
    fill: #e2e8f0;
    stroke: #cbd5e0;
    stroke-width: 1.5;
    transition: all 0.3s ease;
}

/* Added hover effect for state paths */
.state-path:hover {
    fill: #22c55e !important; /* Bright green hover */
    cursor: pointer;
}

.state-path.guessed {
    stroke-width: 2.5;
    stroke: #2d3748;
}

.state-label {
    font-size: 14px;
    font-weight: bold;
    fill: #1a202c;
    text-anchor: middle;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.control-btn {
    padding: 10px 20px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.control-btn.active {
    background: #3182ce;
    color: white;
    border-color: #3182ce;
}

.control-btn:hover:not(.active) {
    background: #f7fafc;
}

.guesses-container {
    background: white;
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.guesses-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.guess-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 500;
    position: relative;
    margin-bottom: 6px;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 2px solid transparent;
}

.guess-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.guess-flag {
    width: 40px;
    height: 28px;
    margin-right: 15px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
    background: #4299e1;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.guess-name {
    flex: 1;
    font-weight: 600;
    letter-spacing: 0.5px;
    color: #2d3748;
    font-size: 1.1rem;
}

.guess-distance {
    font-size: 1rem;
    font-weight: 600;
    margin-right: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
}

.guess-arrow {
    font-size: 1.4rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* Beautiful gradient colors from farthest (left) to closest (right) */
.distance-3 { 
    background: linear-gradient(135deg, #d8b4fe 0%, #9333ea 100%); 
    color: white; 
    border-color: #7e22ce;
}

.distance-2 { 
    background: linear-gradient(135deg, #fdba74 0%, #f97316 100%); 
    color: white; 
    border-color: #ea580c;
}

.distance-1 { 
    background: linear-gradient(135deg, #f87171 0%, #dc2626 100%); 
    color: white; 
    border-color: #991b1b;
}

.distance-0 { 
    background: linear-gradient(135deg, #86efac 0%, #22c55e 100%); 
    color: #14532d; 
    border-color: #16a34a;
    animation: correctPulse 2s ease-in-out;
}

@keyframes correctPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #2d3748;
}

.new-game-btn {
    padding: 12px 30px;
    background: #3182ce;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 20px;
    transition: background 0.2s;
}

.new-game-btn:hover {
    background: #2c5aa0;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin: 20px 0;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: #f7fafc;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #3182ce;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.8rem;
    color: #718096;
    font-weight: 500;
}

.encouragement {
    background: #f0f9ff;
    border: 2px solid #bae6fd;
    border-radius: 10px;
    padding: 15px;
    margin: 20px 0;
    text-align: center;
}

.encouragement p {
    margin: 5px 0;
    color: #0369a1;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-btn.primary {
    background: #3182ce;
    color: white;
}

.modal-btn.primary:hover {
    background: #2c5aa0;
}

.modal-btn.secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.modal-btn.secondary:hover {
    background: #cbd5e0;
}

.hidden {
    display: none;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .globe {
        width: 300px;
        height: 300px;
    }
    
    .usa-map {
        width: 220px;
        height: 150px;
    }
    
    .title {
        font-size: 1.5rem;
    }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 15px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #718096;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-btn:hover {
    background: #f7fafc;
    color: #2d3748;
}

.modal-body {
    text-align: left;
}

.modal-body ul {
    padding-left: 20px;
}

.modal-body li {
    margin-bottom: 8px;
}

.color-guide {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.color-item {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.setting-item {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    background: #f7fafc;
}

.setting-item label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
}

.setting-item input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
    padding: 15px;
    background: #f7fafc;
    border-radius: 10px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #3182ce;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: #718096;
    font-weight: 500;
}

.reset-stats-btn {
    width: 100%;
    padding: 10px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.reset-stats-btn:hover {
    background: #c53030;
}

.quiz-cards {
    display: flex;
    gap: 20px;
    margin: 20px 0 15px 0;
    justify-content: center;
}

.quiz-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #cbd5e0;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    text-align: center;
    flex: 1;
    min-width: 250px;
    max-width: 300px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.quiz-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.15);
}

.quiz-card h3 {
    margin-bottom: 10px;
    color: #2d3748;
    font-size: 1.2rem;
}

.quiz-card p {
    margin-bottom: 15px;
    color: #718096;
    font-size: 0.9rem;
}

.play-btn {
    padding: 10px 20px;
    background: #3182ce;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.play-btn:hover {
    background: #2c5aa0;
}

.footer {
    text-align: center;
    padding: 20px;
    background: #f7fafc;
    border-top: 2px solid #e2e8f0;
    margin-top: 20px;
    color: #718096;
    font-size: 0.9rem;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        max-width: 100%;
    }
    
    .header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .nav-icons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    .nav-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        margin: 2px;
    }
    
    .title {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }
    
    .quiz-cards {
        flex-direction: column;
        gap: 15px;
    }
    
    .quiz-card {
        min-width: auto;
        max-width: 100%;
        padding: 20px;
    }
    
    .mode-toggle {
        flex-direction: column;
        gap: 8px;
    }
    
    .mode-btn {
        padding: 12px 16px;
        font-size: 0.85rem;
    }
    
    .controls {
        flex-direction: column;
        gap: 8px;
    }
    
    .control-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .start-btn {
        padding: 12px 24px;
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .modal-content {
        margin: 20px;
        padding: 20px;
        max-width: 90%;
    }
    
    .modal-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-btn {
        padding: 10px 16px;
    }
    
    /* Input and suggestions */
    #stateInput {
        font-size: 0.85rem;
        padding: 10px 14px;
        padding-right: 80px;
    }
    
    .enter-btn {
        padding: 5px 12px;
        font-size: 0.8rem;
    }
    
    .suggestions {
        font-size: 0.85rem;
    }
    
    /* Map container */
    .map-container {
        padding: 10px;
        margin-bottom: 10px;
    }
    
    #usaMap {
        padding: 10px;
    }
    
    /* Guesses container */
    .guesses-container {
        padding: 10px;
        max-height: 150px;
    }
    
    .guess-item {
        padding: 8px 12px;
        margin-bottom: 4px;
    }
    
    .guess-flag {
        width: 32px;
        height: 22px;
        margin-right: 10px;
        font-size: 0.8rem;
    }
    
    .guess-name {
        font-size: 0.95rem;
    }
    
    .guess-distance {
        font-size: 0.85rem;
        margin-right: 8px;
        padding: 4px 8px;
    }
    
    .guess-arrow {
        font-size: 1.1rem;
    }
    
    /* Quiz specific styles */
    .question-container {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .question-text {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }
    
    .answers-grid {
        gap: 8px;
        margin-bottom: 15px;
    }
    
    .answer-btn {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .score {
        font-size: 1.3rem;
        margin: 15px 0;
    }
    
    .score-container {
        flex-direction: column;
        gap: 10px;
        margin: 15px 0;
    }
    
    #timer, #lives {
        font-size: 1rem;
    }
    
    /* Category selector for history quiz */
    .category-selector {
        grid-template-columns: 1fr;
        gap: 8px;
        margin: 15px 0;
    }
    
    .category-btn {
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .category-btn p {
        font-size: 0.8rem;
        margin: 3px 0;
    }
    
    /* Footer */
    .footer {
        padding: 15px;
        font-size: 0.8rem;
    }
}

/* Extra small devices (phones, 480px and down) */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .title {
        font-size: 1.2rem;
    }
    
    .nav-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }
    
    .dark-mode-toggle {
        padding: 6px 10px;
        font-size: 1rem;
    }
    
    .icon-btn {
        padding: 6px 10px;
        font-size: 1.2rem;
    }
    
    #stateInput {
        font-size: 0.8rem;
        padding: 8px 12px;
        padding-right: 70px;
    }
    
    .enter-btn {
        padding: 4px 10px;
        font-size: 0.75rem;
    }
    
    .question-text {
        font-size: 1rem;
    }
    
    .answer-btn {
        padding: 10px;
        font-size: 0.85rem;
    }
    
    .guess-item {
        padding: 6px 10px;
    }
    
    .guess-name {
        font-size: 0.9rem;
    }
    
    .guess-distance {
        font-size: 0.8rem;
    }
    
    .modal-content {
        margin: 15px;
        padding: 15px;
    }
    
    .modal-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

/* Tablet devices (768px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 90%;
        padding: 20px;
    }
    
    .quiz-cards {
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .category-selector {
        grid-template-columns: 1fr 1fr;
    }
}

/* Prevent zoom on input focus for mobile */
@media (max-width: 768px) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .nav-btn:hover, 
    .icon-btn:hover, 
    .mode-btn:hover:not(.active),
    .control-btn:hover:not(.active),
    .answer-btn:hover,
    .suggestion-item:hover,
    .guess-item:hover {
        transform: none;
    }
    
    .nav-btn:active, 
    .icon-btn:active, 
    .mode-btn:active,
    .control-btn:active,
    .answer-btn:active {
        transform: scale(0.95);
    }
}

/* Dark Mode Toggle Button */
.dark-mode-toggle-fixed {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #3182ce;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-toggle-fixed:hover {
    background: #2c5aa0;
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.dark-mode-toggle-fixed:active {
    transform: scale(0.95);
}

/* Hide the old dark mode button in nav */
.nav-icons .dark-mode-toggle {
    display: none;
}

/* Dark Mode Styles */
/* Dark Mode Styles */
body.dark-mode {
    background: #1a202c;
    color: #e2e8f0;
}

body.dark-mode .title {
    color: #e2e8f0;
    background: none;
    -webkit-text-fill-color: #e2e8f0;
}

body.dark-mode .header {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

body.dark-mode .nav-links a {
    background: rgba(66, 153, 225, 0.2);
    color: #e2e8f0;
}

body.dark-mode .nav-links a:hover {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

body.dark-mode .nav-btn {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .nav-btn:hover {
    background: #3182ce;
    color: white;
}

body.dark-mode .icon-btn {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .icon-btn:hover {
    background: #3182ce;
    color: white;
}

body.dark-mode .dark-mode-toggle {
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .dark-mode-toggle:hover {
    background: #4a5568;
}

body.dark-mode .question-container {
    background: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .question-text {
    color: #e2e8f0;
}

body.dark-mode .answer-btn {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .answer-btn:hover {
    background: #374151;
}

body.dark-mode .category-btn {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .category-btn:hover {
    background: #374151;
}

body.dark-mode .category-btn.active {
    background: #3182ce;
    color: white;
    border-color: #3182ce;
}

body.dark-mode .mode-btn {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .mode-btn:hover {
    background: #374151;
}

body.dark-mode .results-container {
    background: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .results-text {
    color: #cbd5e1;
}

body.dark-mode .quiz-container {
    color: #e2e8f0;
}

body.dark-mode .score-container {
    color: #e2e8f0;
}

body.dark-mode #modeIndicator {
    color: #cbd5e1 !important;
}

body.dark-mode .mode-btn {
    background: #2d3748;
    border-color: #e2e8f0;
    color: #e2e8f0;
}

body.dark-mode .mode-btn.active {
    background: #3182ce;
    color: white;
    border-color: #3182ce;
}

body.dark-mode .mode-btn:hover:not(.active) {
    background: #4a5568;
}

body.dark-mode #stateInput {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode #stateInput:focus {
    border-color: #3182ce;
}

body.dark-mode .suggestions {
    background: #2d3748;
    border-color: #4a5568;
}

body.dark-mode .suggestion-item {
    color: #e2e8f0;
    border-bottom-color: #4a5568;
}

body.dark-mode .suggestion-item:hover {
    background: #4a5568;
}

body.dark-mode .map-container {
    background: #2d3748;
}

body.dark-mode #usaMap {
    background: #2d3748;
}

body.dark-mode .state-path {
    fill: #4a5568;
    stroke: #718096;
}

body.dark-mode .state-path.guessed {
    stroke: #e2e8f0;
}

body.dark-mode .state-label {
    fill: #e2e8f0;
}

body.dark-mode .control-btn {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .control-btn.active {
    background: #3182ce;
    color: white;
    border-color: #3182ce;
}

body.dark-mode .control-btn:hover:not(.active) {
    background: #4a5568;
}

body.dark-mode .guesses-container {
    background: #2d3748;
}

body.dark-mode .guess-item {
    background: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .guess-name {
    color: #e2e8f0;
}

body.dark-mode .guess-distance {
    background: rgba(45, 55, 72, 0.5);
}

body.dark-mode .modal-content {
    background: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .modal-content h2 {
    color: #e2e8f0;
}

body.dark-mode .close-btn {
    color: #e2e8f0;
}

body.dark-mode .close-btn:hover {
    background: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .modal-body {
    color: #e2e8f0;
}

body.dark-mode .color-item {
    background: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .setting-item {
    background: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .stat-item {
    background: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .stat-number {
    color: #63b3ed;
}

body.dark-mode .encouragement {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .encouragement p {
    color: #90cdf4;
}

body.dark-mode .quiz-card {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .quiz-card h3 {
    color: #e2e8f0;
}

body.dark-mode .quiz-card p {
    color: #cbd5e0;
}

/* History Quiz Hub specific dark mode styles */
body.dark-mode .category-btn {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .category-btn:hover {
    background: #4a5568;
    border-color: #3182ce;
}

body.dark-mode .category-btn p {
    color: #cbd5e0;
}

body.dark-mode .question-container h2 {
    color: #e2e8f0;
}

body.dark-mode .question-container p {
    color: #cbd5e0;
}

body.dark-mode .mode-btn {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .mode-btn:hover {
    background: #4a5568;
    border-color: #3182ce;
}

/* Flag Quiz dark mode styles */
body.dark-mode .question-text {
    color: #e2e8f0;
}

body.dark-mode .flag-image {
    border-color: #4a5568;
}

body.dark-mode .answer-btn {
    background: #2d3748;
    color: #e2e8f0;
    border-color: #4a5568;
}

body.dark-mode .answer-btn:hover {
    background: #4a5568;
}

body.dark-mode .answer-btn.correct {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

body.dark-mode .answer-btn.incorrect {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

body.dark-mode .results-container {
    background: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .results-score {
    color: #63b3ed;
}

body.dark-mode .mode-btn p {
    color: #cbd5e0;
/* Blog Styles */
.blog-intro {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.blog-intro h2 {
    color: #2d3748;
    margin-bottom: 10px;
}

.blog-intro p {
    color: #666;
    font-size: 1.1rem;
}

.article-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.article-preview {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.article-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
}

.article-preview h3 {
    margin-bottom: 10px;
    color: #2d3748;
}

.article-preview h3 a {
    color: inherit;
    text-decoration: none;
}

.article-preview h3 a:hover {
    color: #3182ce;
}

.article-preview p {
    margin-bottom: 15px;
    color: #666;
    line-height: 1.5;
}

.read-more {
    color: #3182ce;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.read-more:hover {
    text-decoration: underline;
}

.blog-article {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    line-height: 1.6;
    max-width: 800px;
    margin: 0 auto;
}

.blog-article h2 {
    color: #2d3748;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.article-date {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 20px;
    font-style: italic;
}

.blog-article h3 {
    color: #2d3748;
    margin: 30px 0 15px 0;
    font-size: 1.3rem;
}

.blog-article ul {
    padding-left: 20px;
    margin-bottom: 20px;
}

.blog-article li {
    margin-bottom: 8px;
}

.article-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.nav-link {
    color: #3182ce;
    text-decoration: none;
    font-weight: 600;
    padding: 10px 15px;
    border-radius: 8px;
    transition: background 0.2s;
}

.nav-link:hover {
    background: #f7fafc;
    text-decoration: underline;
}

/* Dark mode for blog */
body.dark-mode .blog-intro {
    background: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .blog-intro h2 {
    color: #e2e8f0;
}

body.dark-mode .blog-intro p {
    color: #cbd5e0;
}

body.dark-mode .article-preview {
    background: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .article-preview h3 {
    color: #e2e8f0;
}

body.dark-mode .article-preview p {
    color: #cbd5e0;
}

body.dark-mode .blog-article {
    background: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .blog-article h2,
body.dark-mode .blog-article h3 {
    color: #e2e8f0;
}

body.dark-mode .article-date {
    color: #cbd5e0;
}

body.dark-mode .article-navigation {
    border-top-color: #4a5568;
}

body.dark-mode .nav-link:hover {
    background: #4a5568;
}

/* Mobile responsive for blog */
@media (max-width: 768px) {
    .blog-intro {
        padding: 15px;
        margin-bottom: 20px;
    }

    .article-preview {
        padding: 20px;
    }

    .blog-article {
        padding: 20px;
    }

    .blog-article h2 {
        font-size: 1.5rem;
    }

    .article-navigation {
        flex-direction: column;
        gap: 10px;
    }

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