/* Modern Reset and Variables */
:root {
    --primary-color: #000000;
    --secondary-color: #f8f8f8;
    --border-color: #e5e5e5;
    --accent-color: #4a4a4a;
    --correct-color: #66aa66;
    --incorrect-color: #aa6666;
    --border-radius: 8px;
    --spacing: 24px;
    --transition: all 0.1s ease;
    --font-main: 'Franklin Gothic Medium', 'Franklin Gothic', 'ITC Franklin Gothic', Arial, sans-serif;
    --font-title: 'Franklin Gothic Heavy', 'Franklin Gothic Bold', 'ITC Franklin Gothic Bold', Arial Black, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', sans-serif;
}

body {
    background-color: white;
    min-height: 100vh;
    font-size: 16px;
    color: var(--primary-color);
    padding: 0;
    display: block;
    line-height: 1.5;
    position: relative;
    overflow-y: auto;
    font-family: var(--font-main);
}

.container {
    width: 95%;
    max-width: 900px;  /* Increased from 700px to accommodate two columns */
    margin: 0 auto;
    padding: 24px 16px;
    background-color: white;
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

/* Add new class for archive container */
.container:has(.quiz-options) {
    max-width: 1000px;  /* Wider container only for archive page */
}

/* Typography */
h1 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: calc(var(--spacing) * 0.5);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

p {
    font-size: 18px;
    color: var(--accent-color);
    margin-bottom: var(--spacing);
    line-height: 1.6;
}

/* Quiz Options/Buttons */
.quiz-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    width: 100%;
    margin-top: var(--spacing);
}

.quiz-button {
    font-size: 16px;
    padding: 16px 20px;
    text-decoration: none;
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border-radius: var(--border-radius);
    display: flex-inline;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    border: 1px solid #e5e5e5;
    font-weight: 600;
}

.quiz-button:hover {
    background-color: #eeeeee;
    transform: translateY(-1px);
}

/* Quiz Interface */
#guess-input {
    font-size: 1.05rem;
    padding: 16px;
    width: 100%;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--secondary-color);
    letter-spacing: 0.5px;
    font-family: var(--font-main);
    font-weight: 500;
    padding-right: 48px;
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--primary-color);
}

#guess-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: white;
}

#guess-input.correct {
    color: var(--correct-color);
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

#guess-input.incorrect {
    color: var(--incorrect-color);
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Smooth transition back to normal */
#guess-input:not(.correct):not(.incorrect) {
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--primary-color);
}

/* Slots and Guesses */
.country-list {
    margin-top: 8px;
}

.country-slot {
    padding: 12px;
    margin: 6px 0;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--secondary-color);
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    letter-spacing: 0.5px;
    font-family: var(--font-main);
    font-size: 1.125rem;
}

.country-slot.correct {
    background-color: #f0f7f0;
    border-color: var(--correct-color);
    color: var(--correct-color);
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.country-slot.incorrect {
    background-color: #f7f0f0;
    border-color: var(--incorrect-color);
    color: var(--incorrect-color);
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Strikes Display */
#strikes-container {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--secondary-color);
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 600;
    margin: calc(var(--spacing) * 0.5) 0;
}

#strikes {
    color: var(--incorrect-color);
}

/* Incorrect Guesses Section */
#incorrect-guess-container {
    margin-top: 16px;
    overflow-y: visible;
    max-height: none;
}

#incorrect-guess-container h3 {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-color);
    margin-bottom: 12px;
}

#incorrect-guesses {
    margin-top: 8px;
    overflow-y: visible;
}

/* Scrollbar Styling */
#incorrect-guesses::-webkit-scrollbar {
    width: 6px;
}

#incorrect-guesses::-webkit-scrollbar-track {
    background: var(--secondary-color);
}

#incorrect-guesses::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: var(--border-radius);
}

/* Finish Message */
#finish-message {
    margin-top: var(--spacing);
    padding: var(--spacing);
    background-color: var(--secondary-color);
    border-radius: var(--border-radius);
    text-align: center;
}

#finish-message h2 {
    font-size: 24px;
    margin-bottom: 16px;
}

.guesses-remaining {
    border: 2px solid var(--border-color);
    font-family: var(--font-main);
    font-size: 1em;
    color: var(--primary-color);
    font-weight: 500;
    padding: 6px 12px;
    width: 40%;
    border-radius: var(--border-radius);
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

.guesses-remaining b {
    color: #6b46c1;
}

/* Autocomplete Styles */
.input-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 16px;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    z-index: 1000;
    display: none;
    letter-spacing: 0.5px;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 0.5px;
    font-family: var(--font-main);
    font-size: 1.125rem;
    font-weight: 500;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background-color: var(--secondary-color);
}

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

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 90%;
    width: 400px;
    text-align: center;
    z-index: 1000;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--accent-color);
}

.keep-playing-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.copied-message {
    display: none;
    color: var(--accent-color);
    margin-top: 12px;
}

.copied-message.visible {
    display: block;
}

/* Update layout styles */
.header {
    text-align: left;
    position: relative;
}

#quiz-container {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.quiz-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: auto;
    overflow-y: visible;
    padding-right: 0;
    margin-right: 0;
}

/* Update spacing */
#incorrect-guess-container {
    margin-top: 16px;
    overflow-y: visible;
    max-height: none;
}

.country-list {
    margin-bottom: 16px;
}

/* Update back link and spacing */
.back-link {
    font-size: 14px;
    text-decoration: none;
    color: var(--accent-color);
    display: inline-block;
    margin-bottom: 12px;
}

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

/* Add padding only to index page container */
body:has(.quiz-options) .container {
    padding-top: 32px;
}

.score {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin: 10px 0;
    color: var(--primary-color);
}

/* Update guess count display */
#guess-count-container {
    display: inline-block;
    padding: 4px 12px;
    background-color: var(--secondary-color);
    border-radius: var(--border-radius);
    font-size: 0.95em;
    font-weight: 600;
    width: 100%;
    margin: calc(var(--spacing) * 0.5) 0;
    text-align: center;
}

/* Update summary grid display */
.summary-line {
    font-family: monospace;
    white-space: pre;
    margin: 8px 0;
    text-align: left;
}

.score {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    margin: 10px 0;
    color: var(--primary-color);
}

.button-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 8px 0;
    width: 100%;
}

.game-button {
    width: 100%;
    padding: 12px 24px;
    font-size: 1em;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    text-transform: uppercase;
    transition: var(--transition);
}

.button-primary {
    background: #4361ee;
    color: white;
    border: none;
}

.button-primary:hover {
    background: #3046c4;
    transform: translateY(-1px);
}

.button-secondary {
    background: var(--secondary-color);
    color: #666;
    border: 2px solid var(--border-color);
}

.button-secondary:hover {
    background: #eeeeee;
    transform: translateY(-1px);
}

.button-purple {
    background: #6b46c1;
    color: white;
    border: none;
}

/* When we have three buttons */
.button-container.three-buttons {
    grid-template-columns: 1fr 1fr 1fr;
}

/* Update spacing for specific elements */
.country-list {
    margin-bottom: 16px;
}

.guess-indicator {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-60%);
    font-size: 1.75rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.1s ease;
    pointer-events: none;
    line-height: 1;
}

.guess-indicator.correct {
    opacity: 1;
    color: var(--correct-color);
}

.guess-indicator.incorrect {
    opacity: 1;
    color: var(--incorrect-color);
}

/* Add to existing styles */
.source-citation {
    font-size: 0.8em;
    color: #666;
    text-align: center;
    margin-top: 20px;
}

.source-citation a {
    color: #666;
    text-decoration: underline;
}

/* Update archive link styles */
.archive-link {
    position: absolute;
    right: 0;
    top: 0;          /* Align to very top */
    line-height: 1;  /* Remove any extra line height */
}

.archive-link a {
    font-size: 0.7em;
    font-weight: 400;
    display: block;
    line-height: 1.2;
    color: #4361ee;          /* Set default color */
    text-decoration: none;   /* Remove underline by default */
}

.archive-link a:visited {
    color: #4361ee;          /* Keep same color when visited */
}

.archive-link a:hover {
    text-decoration: underline;  /* Add underline only on hover */
}

.help-link {
    margin-right: 70px;
    position: absolute;
    right: 0;
    top: 0;          /* Align to very top */
    line-height: 1;  /* Remove any extra line height */
}

.help-link a {
    position: relative;
    display: block;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    border-radius: 50%;
    border: 2px solid #4361ee;
    color: #4361ee;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    user-select: none;
}

.help-link a::after {
    content: "?";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.feedback-link {
    margin-right: 100px;
    position: absolute;
    right: 0;
    top: 0;
    line-height: 1;
}

.feedback-link a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    text-decoration: none;
    font-size: 16px;
    user-select: none;
}

.feedback-link a:hover {
    opacity: 0.7;
}

@media (max-width: 768px) {
    .help-link a {
        width: 18px;
        height: 18px;
        min-width: 18px;
        min-height: 18px;
        font-size: 12px;
    }
    
    .feedback-link {
        margin-right: 65px;
    }
    
    .feedback-link a {
        width: 18px;
        height: 18px;
        min-width: 18px;
        min-height: 18px;
        font-size: 14px;
    }
}

.title-main {
    display: flex;
    font-size: 1.2em;
    align-items: baseline;
    flex-wrap: wrap;
    padding-bottom: 16px;
    border-bottom: 1px solid #ddd;
    margin-right: 80px;
    width: 100%;
    gap: 8px;
}

.title-primary {
    font-family: var(--font-title);
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.quiz-date {
    color: #666;
    white-space: nowrap;
    font-weight: 300;
}

/* Quiz title */
.quiz-title {
    font-weight: 200;
    display: flex;
    flex-direction: column;
    vertical-align: middle;
    gap: 16px;
    /*margin-bottom: 24px;*/
    font-family: "Franklin Gothic Medium", "Franklin Gothic", "ITC Franklin Gothic", Arial, sans-serif;
}

.quiz-number {
    font-family: inherit;
    font-weight: inherit;
    letter-spacing: inherit;
}

.quiz-subtitle {
    font-size: 1.4em;
    font-weight: 500;
    font-family: "Franklin Gothic Medium", "Franklin Gothic", "ITC Franklin Gothic", Arial, sans-serif;
    padding-top: 8px;
    justify-content: center;
    text-align: center;
}

/* Score display container */
.score-display {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 12px 0;
}

.score-box {
    flex: 1;
    font-size: 0.95em;
    font-weight: 600;
    padding: 12px 24px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: var(--font-main);
    text-align: center;
}

/* Different colors for each box */
.score-box:first-child {
    background-color: #e8eef4;
    border-color: #d5e0eb;
}

.score-box:last-child {
    background-color: #e8f0e5;
    border-color: #d5e2cf;
}

/* Country list */
.country-list {
    margin-top: 8px;
}

.country-slot {
    padding: 10px;
    margin: 6px 0;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--secondary-color);
    transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 400;
    letter-spacing: 0.3px;
    font-family: var(--font-main);
    font-size: 1.025rem;
}

/* Button container */
.button-group {
    display: flex;
    width: 100%;
    gap: 8px;
    margin: 8px 0;
}

/* .button-group .game-button {
    width: 200px;
} */

/* Incorrect guesses section */
.incorrect-container {
    margin-top: 16px;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--secondary-color);
}

.incorrect-title {
    margin: 0 0 8px 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #666;
    text-transform: uppercase;
    font-family: var(--font-main);
}

.incorrect-list {
    margin: 0;
    padding-left: 20px;
    color: #666;
}

.incorrect-list li {
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    font-family: var(--font-main);
    font-size: 1.125rem;
}

/* Archive page home link */
.home-link {
    color: #000;
    text-decoration: underline;
}

/* Style changes when title wraps */
@media (max-width: 900px) {
    .title-main {
        font-size: 1.2em;
        padding: 0 0 16px 0;
        margin-right: 0;
        flex-direction: column;
        align-items: flex-start;
        position: relative;
        display: flex;
    }

    .archive-link {
        position: absolute;
        right: 0;
        top: 0;          /* Align to very top */
        line-height: 1;  /* Remove any extra line height */
    }

    .archive-link a {
        font-size: 0.8em;
        display: block;  /* Ensure precise positioning */
        line-height: 1.2;
    }

    .help-link {
        position: absolute;
        margin-right: 60px;
        right: 0;
        top: 0;          /* Align to very top */
        line-height: 1;  /* Remove any extra line height */
    }

    .help-link a {
        font-size: 0.8em;
        display: block;  /* Ensure precise positioning */
        line-height: 1.2;
    }
    
    .feedback-link {
        position: absolute;
        margin-right: 85px;
        right: 0;
        top: 0;
        line-height: 1;
    }
    
    .feedback-link a {
        font-size: 0.8em;
        display: block;
        line-height: 1.2;
    }

    .quiz-date {
        margin-top: 4px;
        font-size: 0.8em;
        font-weight: 300;
        margin-left: 0;
        padding-left: 0;
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {

    .title-main {
        font-size: 0.9em;
        margin-right: 50px;
    }

    .archive-title {
        font-size: 1.2em;
    }

    .button-group {
        margin: 8px 0;
    }
    
    .button-group .game-button {
        font-size: 0.8em;
        padding: 12px 16px;
    }

    .modal {
        width: 90%;
        margin: 0 auto;
    }

    .game-button {
        font-size: 0.9em;
        padding: 12px 16px;
    }

    .archive-link a,
    .help-link a,
    .feedback-link a {
        font-size: 0.8em;
        padding: 4px 8px;
    }
}

/* Quiz card base styles */
.quiz-card {
    text-align: center;
    background: var(--secondary-color);
    border-radius: var(--border-radius);
    margin-bottom: 16px;
    padding: 16px;
    position: relative;
    text-decoration: none;
    color: var(--primary-color);
    display: flex;          /* Add flex display */
    flex-direction: column; /* Stack content vertically */
    justify-content: center;/* Center content vertically */
    min-height: 100px;      /* Ensure consistent height */
}

/* Archive-specific styles */
.archive-quiz-button {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: #eee7ff;
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
    min-height: 120px;  /* Ensure enough space */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    justify-content: space-between;  /* Distribute space between elements */
}

.archive-quiz-button:hover {
    background-color: #e5dcff;
    transform: translateY(-1px);
}

.archive-quiz-number {
    font-size: 0.9em;
    font-weight: 600;
    color: #666;
}

.archive-quiz-title {
    font-size: 1.1em;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    padding: 12px 0;  /* Add some padding above and below */
    flex: 1;          /* Take up available space */
    display: flex;    /* Enable flex layout */
    align-items: center; /* Center content vertically */
    justify-content: center; /* Center content horizontally */
}

.archive-quiz-date {
    font-size: 0.8em;
    color: #666;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .archive-quiz-button {
        padding: 12px;
        min-height: 80px;
    }

    .archive-quiz-title {
        font-size: 1em;
    }

    .archive-quiz-number {
        font-size: 0.8em;
    }

    .archive-quiz-date {
        font-size: 0.7em;
    }
}

.slot-number {
    color: #666;
    font-size: 0.9em;
    margin-right: 16px;
    min-width: 20px;
}

.slot-content {
    flex: 1;
    text-align: center;
}

/* Add to your existing styles */
.reveal-answers-modal {
    width: 100%;
    padding: 12px 24px;
    margin-top: 8px;
    background: #fff;
    color: #dc2626;
    border: 2px solid #dc2626;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    text-transform: uppercase;
    transition: var(--transition);
}

.reveal-answers-modal:hover {
    background: #dc2626;
    color: white;
}

@media (max-width: 768px) {
    .reveal-answers-modal {
        font-size: 0.8em;
        padding: 12px 16px;
    }
}

/* Add two-column layout for desktop */
@media (min-width: 769px) {
    .country-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(5, auto);
        gap: 8px;  /* Reduced from 16px */
        margin-top: 8px;
    }

    /* Place slots in specific grid positions */
    .country-slot:nth-child(1) { grid-area: 1 / 1; }
    .country-slot:nth-child(2) { grid-area: 2 / 1; }
    .country-slot:nth-child(3) { grid-area: 3 / 1; }
    .country-slot:nth-child(4) { grid-area: 4 / 1; }
    .country-slot:nth-child(5) { grid-area: 5 / 1; }
    .country-slot:nth-child(6) { grid-area: 1 / 2; }
    .country-slot:nth-child(7) { grid-area: 2 / 2; }
    .country-slot:nth-child(8) { grid-area: 3 / 2; }
    .country-slot:nth-child(9) { grid-area: 4 / 2; }
    .country-slot:nth-child(10) { grid-area: 5 / 2; }

    .country-slot {
        padding: 8px 12px;  /* Reduced vertical padding */
        margin: 0;
    }
}

/* Existing mobile styles remain unchanged */
@media (max-width: 768px) {
    .country-list {
        display: block;  /* Ensure single column on mobile */
    }

    .country-slot {
        margin: 6px 0;  /* Keep existing mobile spacing */
    }
}

#reveal-answers {
    background: white;
    color: #dc2626;  /* Red text */
    border: 2px solid #dc2626;  /* Red border */
    transition: var(--transition);
}

#reveal-answers:hover {
    background: #dc2626;  /* Red background on hover */
    color: white;
}

/* Keep the button disabled state visually distinct */
#reveal-answers:disabled {
    background: #f3f4f6;
    color: #9ca3af;
    border-color: #e5e7eb;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .quiz-date {
        display: none;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .quiz-options {
        grid-template-columns: 1fr;  /* Single column on mobile */
    }

    .quiz-button {
        font-size: 16px;
        padding: 8px 10px;
        text-decoration: none;
        background-color: var(--secondary-color);
        color: var(--primary-color);
        border-radius: var(--border-radius);
        display: flex;
        align-items: center;
        gap: 0px;
        transition: var(--transition);
        border: 1px solid #e5e5e5;
        justify-content: center;
        text-align: center;
        font-weight: 600;
    }

    .archive-description {
        font-size: 0.8em;
        margin-bottom: 0px;
    }

    .container {
        width: 95%;
        padding: 16px;
    }

    .header {
        margin: 0;
        padding: 0;
        margin-bottom: 0px;
        position: relative;
    }

    .title-main {
        font-size: 0.8em;
        margin-right: 60px;
        padding-bottom: 8px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        border-bottom: 1px solid #ddd;
    }

    .title-primary {
        letter-spacing: -0.03em;
        white-space: nowrap;
        font-weight: 600;
    }

    .quiz-number {
        font-size: inherit;
        letter-spacing: inherit;
    }

    .quiz-date {
        font-size: 0.8em;
        font-weight: 100;
        color: #666;
        margin-top: 4px;
        margin-left: 8px;
        white-space: nowrap;
    }

    .archive-link {
        position: absolute;
        right: 0px;
        bottom: 8px;
    }

    .archive-link a {
        font-size: 0.8em;
        padding: 4px 8px;
    }

    .help-link {
        position: absolute;
        margin-right: 50px;
        right: 0px;
        bottom: 8px;
    }

    .help-link a {
        font-size: 0.8em;
        padding: 4px 8px;
    }
    
    .feedback-link {
        position: absolute;
        margin-right: 72px;
        right: 0px;
        bottom: 8px;
    }
    
    .feedback-link a {
        font-size: 0.8em;
        padding: 4px 8px;
    }

    p {
        font-size: 0.9em;
        line-height: 1.4;
        margin-bottom: calc(var(--spacing) * 0.75);
        color: var(--accent-color);
    }

    .quiz-subtitle {
        font-size: 0.95em;
        font-weight: 600;
        padding-top: 4px;
        justify-content: center;
        text-align: center;
    }

    .quiz-content {
        padding: 0;
    }

    .country-list {
        margin: 16px 0;
    }

    .country-slot {
        margin: 6px 0;
    }

    .submit-guess {
        font-size: 0.3em;
        padding: 12px 16px;
    }

    .modal {
        width: 90%;
        margin: 0 auto;
    }

    /* Make selector more specific to override existing styles */
    .quiz-content .button-group .game-button,
    .quiz-content .button-group .button-primary,
    .quiz-content .button-group .button-secondary {
        font-size: 0.8em;
        padding: 12px 16px;
    }

    .guesses-remaining {
        border: 2px solid var(--border-color);
        font-family: var(--font-main);
        font-size: 0.8em;
        color: var(--primary-color);
        font-weight: 400;
        padding: 6px 12px;
        width: 60%;
        border-radius: var(--border-radius);
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }

    .game-button {
        font-size: 0.9em;
        padding: 12px 16px;
    }

    .quiz-card {
        padding: 8px;          /* Reduce padding */
        min-height: 20px;       /* Set minimum height */
        max-height: 40px;       /* Set maximum height */
        display: flex;          /* Enable flex layout */
        flex-direction: column; /* Stack content vertically */
        justify-content: center;/* Center content vertically */
    }

    .quiz-card .quiz-number {
        font-size: 0.9em;       /* Smaller quiz number */
        margin-bottom: 2px;     /* Less space below number */
    }

    .quiz-card .quiz-title {
        font-size: 1.1em;       /* Smaller title */
        line-height: 1.2;       /* Tighter line height */
        margin: 2px 0;          /* Less vertical spacing */
    }

    .quiz-card .quiz-date {
        font-size: 0.8em;       /* Smaller date */
        position: absolute;     /* Position date absolutely */
        right: 12px;           /* Align to right with padding */
        top: 50%;              /* Center vertically */
        transform: translateY(-50%); /* Perfect vertical centering */
    }

    .button-primary,
    .button-secondary {
        font-size: 0.9em;
        padding: 12px 16px;
    }
}

/* Even smaller for very small screens */
@media (max-width: 380px) {
    .title-main {
        font-size: 0.6em;
        margin-right: 40px;
    }

    .quiz-date {
        font-size: 0.75em;
    }

    p {
        font-size: 0.8em;
    }
    .submit-guess {
        font-size: 0.3em;
        padding: 12px 16px;
    }
}

/* Update help modal styles */
.help-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.help-modal {
    background: white;
    padding: 20px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 85vh; /* Reduced from 90vh to create more space */
    overflow-y: auto;
    position: relative;
    margin: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateY(10px); /* Move modal down slightly */
}

.help-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
    text-align: center;
    padding: 0 24px;  /* Add some padding for the close button */
}

.help-modal-header h2 {
    flex: 1;  /* Take up all available space */
    text-align: center;
    margin: 0;
    font-family: var(--font-title);
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -0.5px;
}

.close-help-modal,
.close-feedback-modal,
.close-announcement-modal {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    color: #666;
}

.close-help-modal:hover,
.close-feedback-modal:hover,
.close-announcement-modal:hover {
    color: #000;
}

.announcement-title {
    font-size: 18px !important;
}

.announcement-subheading {
    font-size: 16px;
    margin-top: 20px;
    margin-bottom: 10px;
}

/* Update mobile styles */
@media (max-width: 768px) {
    .help-modal-overlay {
        align-items: center; /* Keep centered vertically */
        justify-content: center; /* Keep centered horizontally */
        padding: 20px;
    }

    .help-modal {
        width: 90%;
        margin: 0 auto;
        padding: 20px;
        max-height: 80vh;
        overflow-y: auto;
        border-radius: 12px;
        transform: none; /* Remove transform on mobile */
    }
}

/* Very small screens */
@media (max-width: 480px) {
    .help-modal-overlay {
        padding: 15px;
    }
    
    .help-modal {
        width: 95%;
        padding: 15px;
        border-radius: 12px;
    }
}

/* Header links container */
.header-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: absolute;
    right: 0;
    top: 0;
}

.help-link a,
.feedback-link a,
.archive-link a {
    display: flex;
    align-items: center;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .header-links {
        transform: translateY(-3px) !important;
        gap: 14px;
    }

    .header-links .help-link,
    .header-links .feedback-link,
    .header-links .archive-link {
        position: relative !important;
        margin-right: 0 !important;
        right: auto !important;
        top: auto !important;
        display: flex;
        align-items: center;
        font-size: 1.2em;
    }

    /* Help modal mobile adjustments */
    .help-modal {
        width: 90% !important;
        max-width: 400px !important;
        margin: 20px auto !important;
        border-radius: 12px !important;
        height: auto !important;
        max-height: 90vh !important;
    }
}

/* Consolidate ALL media queries */
@media (max-width: 900px) {
    /* Remove any conflicting styles from 900px query */
    .title-main .help-link,
    .title-main .feedback-link,
    .title-main .archive-link {
        position: static;
        top: auto;
        right: auto;
    }
}

@media (max-width: 380px) {
    /* Keep the working styles from smallest breakpoint */
    .header-links {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        position: absolute;
        right: 0;
        top: 0;
    }
}

.help-modal-content {
    font-family: var(--font-main);
    font-size: 16px;
    line-height: 1.5;
    font-weight: 400;  /* Thinner weight */
    color: var(--accent-color);
}

.help-modal-content h3 {
    margin: 24px 0 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--primary-color);
    font-family: var(--font-main);
}

.help-modal-content p,
.help-modal-content li {
    margin: 6px 0;
    font-weight: 400;
    color: var(--accent-color);
}

.help-modal-content ul {
    margin: 12px 0;
    padding-left: 24px;
}

.help-modal-content .visualization {
    text-align: center;
    display: flex;
    justify-content: center;
    white-space: pre;
    font-family: monospace;
    background: var(--secondary-color);
    padding: 16px;
    border-radius: var(--border-radius);
    margin: 16px 0;
}
