/* Base styles */
:root {
    --color-primary: #ff4d4d;
    --color-primary-hover: #ff3333;
    --color-secondary: #4d79ff;
    --color-secondary-hover: #3366ff;
    --color-background: #121212;
    --color-background-paper: #1e1e1e;
    --color-text-primary: #f5f5f5;
    --color-text-secondary: #b3b3b3;
    --color-border: #333333;
    --color-success-bg: rgba(0, 128, 0, 0.2);
    --color-success-text: #4ade80;
    --color-error-bg: rgba(220, 38, 38, 0.2);
    --color-error-text: #f87171;
}

body.light-mode {
    --color-background: #ffffff;
    --color-background-paper: #f5f5f5;
    --color-text-primary: #121212;
    --color-text-secondary: #333333;
    --color-border: #dddddd;
}

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

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--color-background);
    color: var(--color-text-primary);
    line-height: 1.5;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

@media (min-width: 640px) {
    .container {
        padding: 1rem;
    }
}

/* Header styles */
header {
    width: 100%;
    max-width: 64rem;
    text-align: center;
    margin-bottom: 1rem;
    padding: 0 0.5rem;
    position: relative;
}

.theme-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 3rem;
    height: 1.5rem;
    background-color: var(--color-border);
    border-radius: 9999px;
    display: flex;
    align-items: center;
    padding: 0.125rem;
    cursor: pointer;
}

.toggle-thumb {
    width: 1.25rem;
    height: 1.25rem;
    background-color: var(--color-primary);
    border-radius: 50%;
    transition: transform 0.3s, background-color 0.3s, mask-image 0.3s;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E");
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

body.light-mode .toggle-thumb {
    transform: translateX(1.5rem);
    background-color: var(--color-primary);
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Cpath d='M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='5'/%3E%3Cpath d='M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42'/%3E%3C/svg%3E");
}

@media (min-width: 640px) {
    header {
        margin-bottom: 1.5rem;
    }
}

@media (min-width: 768px) {
    header {
        margin-bottom: 2rem;
    }
}

header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
}

@media (min-width: 640px) {
    header h1 {
        font-size: 2.25rem;
        margin-bottom: 0.5rem;
    }
}

@media (min-width: 768px) {
    header h1 {
        font-size: 3.75rem;
    }
}

header p {
    font-size: 1rem;
    color: var(--color-text-secondary);
}

@media (min-width: 640px) {
    header p {
        font-size: 1.125rem;
    }
}

@media (min-width: 768px) {
    header p {
        font-size: 1.25rem;
    }
}

/* Main container styles */
main {
    width: 100%;
    max-width: 64rem;
    background-color: var(--color-background-paper);
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 1rem;
    position: relative;
}

@media (min-width: 640px) {
    main {
        padding: 1.5rem;
    }
}

@media (min-width: 768px) {
    main {
        padding: 2rem;
    }
}


@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading screen styles */
#loading-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 0.25rem solid var(--color-border);
    border-top: 0.25rem solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

#loading-screen p {
    font-size: 1.125rem;
    color: var(--color-text-secondary);
}

/* Game screen styles */
.progress {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .progress {
        flex-direction: row;
        align-items: center;
        margin-bottom: 1.5rem;
    }
}

.question-counter {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
    .question-counter {
        font-size: 1rem;
        margin-bottom: 0;
    }
}

.score-container {
    display: flex;
    gap: 1rem;
}

.score, .streak {
    color: var(--color-text-primary);
    font-size: 0.875rem;
}

@media (min-width: 640px) {
    .score, .streak {
        font-size: 1rem;
    }
}

.score span, .streak span {
    font-weight: 700;
}

/* Quote card styles */
.quote-card {
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    position: relative;
}

@media (min-width: 640px) {
    .quote-card {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
}

.quote-icon {
    position: absolute;
    top: -1rem;
    left: -0.5rem;
    width: 2rem;
    height: 2rem;
    background-color: var(--color-primary);
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z'%3E%3C/path%3E%3Cpath d='M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z'%3E%3C/path%3E%3C/svg%3E");
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1z'%3E%3C/path%3E%3Cpath d='M15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z'%3E%3C/path%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

@media (min-width: 640px) {
    .quote-icon {
        width: 2.5rem;
        height: 2.5rem;
        top: -1.25rem;
    }
}

blockquote {
    font-family: 'Merriweather', serif;
    font-style: italic;
    font-size: 1.125rem;
    color: var(--color-text-primary);
    margin-bottom: 0.75rem;
    padding-left: 1rem;
}

@media (min-width: 640px) {
    blockquote {
        font-size: 1.25rem;
        margin-bottom: 1rem;
        padding-left: 1.5rem;
    }
}

@media (min-width: 768px) {
    blockquote {
        font-size: 1.5rem;
    }
}

#answer-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

@media (min-width: 640px) {
    #answer-info {
        margin-top: 1.5rem;
        padding-top: 1.5rem;
    }
}

#answer-info p {
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

@media (min-width: 640px) {
    #answer-info p {
        font-size: 1rem;
    }
}

#answer-info p:first-child {
    color: var(--color-text-primary);
    font-size: 1rem;
}

@media (min-width: 640px) {
    #answer-info p:first-child {
        font-size: 1.125rem;
    }
}

.bold {
    font-weight: 700;
}

/* Button styles */
#guess-buttons {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    #guess-buttons {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }
}

.trump-button, .dictator-button {
    padding: 1.25rem 1.5rem;
    font-size: 1.125rem;
    font-weight: 700;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

@media (min-width: 640px) {
    .trump-button, .dictator-button {
        padding: 1rem 1.5rem;
    }
}

.trump-button {
    background-color: var(--color-primary);
    color: white;
}

.trump-button:hover {
    background-color: var(--color-primary-hover);
}

.dictator-button {
    background-color: var(--color-secondary);
    color: white;
}

.dictator-button:hover {
    background-color: var(--color-secondary-hover);
}

#result-message {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    width: 100%;
}

@media (min-width: 640px) {
    #result-message {
        margin-bottom: 1.5rem;
        padding: 1rem;
    }
}

#result-message.correct {
    background-color: var(--color-success-bg);
    color: var(--color-success-text);
}

#result-message.wrong {
    background-color: var(--color-error-bg);
    color: var(--color-error-text);
}

#result-icon {
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
}

@media (min-width: 640px) {
    #result-icon {
        width: 1.5rem;
        height: 1.5rem;
    }
}

#result-text {
    font-size: 1rem;
    font-weight: 700;
}

@media (min-width: 640px) {
    #result-text {
        font-size: 1.125rem;
    }
}

.next-button, .play-again-button {
    width: 100%;
    padding: 1.25rem 1.5rem;
    background-color: var(--color-primary);
    color: white;
    font-size: 1.125rem;
    font-weight: 700;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 640px) {
    .next-button, .play-again-button {
        width: auto;
        padding: 0.75rem 1.5rem;
    }
}

.next-button:hover, .play-again-button:hover {
    background-color: var(--color-primary-hover);
}

.refresh-icon {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
    background-color: white;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 4v6h-6'%3E%3C/path%3E%3Cpath d='M1 20v-6h6'%3E%3C/path%3E%3Cpath d='M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15'%3E%3C/path%3E%3C/svg%3E");
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 4v6h-6'%3E%3C/path%3E%3Cpath d='M1 20v-6h6'%3E%3C/path%3E%3Cpath d='M3.51 9a9 9 0 0 1 14.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0 0 20.49 15'%3E%3C/path%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

/* Game over screen styles */
#game-over-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0;
}

@media (min-width: 640px) {
    #game-over-screen {
        padding: 2rem 0;
    }
}

.trophy-icon {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1rem;
    background-color: var(--color-primary);
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9H4.5a2.5 2.5 0 0 1 0-5H6'%3E%3C/path%3E%3Cpath d='M18 9h1.5a2.5 2.5 0 0 0 0-5H18'%3E%3C/path%3E%3Cpath d='M4 22h16'%3E%3C/path%3E%3Cpath d='M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22'%3E%3C/path%3E%3Cpath d='M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22'%3E%3C/path%3E%3Cpath d='M18 2H6v7a6 6 0 0 0 12 0V2Z'%3E%3C/path%3E%3C/svg%3E");
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9H4.5a2.5 2.5 0 0 1 0-5H6'%3E%3C/path%3E%3Cpath d='M18 9h1.5a2.5 2.5 0 0 0 0-5H18'%3E%3C/path%3E%3Cpath d='M4 22h16'%3E%3C/path%3E%3Cpath d='M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22'%3E%3C/path%3E%3Cpath d='M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22'%3E%3C/path%3E%3Cpath d='M18 2H6v7a6 6 0 0 0 12 0V2Z'%3E%3C/path%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

@media (min-width: 640px) {
    .trophy-icon {
        width: 4rem;
        height: 4rem;
        margin-bottom: 1.5rem;
    }
}

#game-over-screen h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 0.75rem;
}

@media (min-width: 640px) {
    #game-over-screen h2 {
        font-size: 1.875rem;
        margin-bottom: 1rem;
    }
}

#game-over-screen p {
    font-size: 1.125rem;
    color: var(--color-text-primary);
    margin-bottom: 0.25rem;
    text-align: center;
}

@media (min-width: 640px) {
    #game-over-screen p {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
}

#game-over-screen p:last-of-type {
    font-size: 1rem;
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    #game-over-screen p:last-of-type {
        font-size: 1.125rem;
        margin-bottom: 1.5rem;
    }
}

/* Footer styles */
footer {
    width: 100%;
    max-width: 64rem;
    text-align: center;
    margin-top: 1rem;
    padding: 0 0.5rem 1rem;
    color: var(--color-text-secondary);
    font-size: 0.75rem;
}

@media (min-width: 640px) {
    footer {
        margin-top: 1.5rem;
        font-size: 0.875rem;
    }
}

@media (min-width: 768px) {
    footer {
        margin-top: 2rem;
    }
}

footer p {
    margin-bottom: 0.25rem;
}

@media (min-width: 640px) {
    footer p {
        margin-bottom: 0.5rem;
    }
}

/* Support message and Ko-fi button styles */
.support-message {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.support-message p {
    font-size: 0.875rem;
    color: var(--color-text-primary);
    margin-bottom: 0.5rem;
}

.kofi-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    background-color: var(--color-primary);
    color: white;
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 0.25rem;
}

.kofi-button:hover {
    background-color: var(--color-primary-hover);
}

.kofi-icon {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
    background-color: white;
    mask-image: url("heart.svg");
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-image: url("heart.svg");
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

@media (min-width: 640px) {
    .support-message {
        margin-top: 1.5rem;
    }

    .support-message p {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .kofi-button {
        font-size: 1rem;
        padding: 0.5rem 1.5rem;
    }
}

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