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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    color: white;
    transition: all 0.5s ease;
    position: relative;
    padding-top: 2rem;
}

.container {
    text-align: center;
    padding: 2rem;
    max-width: 800px;
    width: 90%;
}

.welcome-screen {
    animation: fadeIn 1s ease;
}

.game-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.game-description {
    display: block;
    font-size: 1rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    line-height: 1.6;
    opacity: 0.9;
    text-align: center;
}

ol {
    display: inline-block;
}

ol li {
    margin-bottom: 0.5rem;
    text-align: left;
}

.start-button, .audio-button {
    background: linear-gradient(45deg, #ff6b6b, #ee5a52);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    color: white;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    margin: 0.5rem;
}

.start-button:hover, .audio-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.game-screen {
    display: none;
    animation: slideIn 0.5s ease;
}

.question {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.category-label {
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
    opacity: 0.7;
    font-style: italic;
    text-transform: capitalize;
}

.choices {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.choice {
    background: rgba(255,255,255,0.1);
    padding: 1rem;
    border-radius: 15px;
    font-size: 1rem;
    border: 2px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

.choice:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
}

.choice.selected {
    background: rgba(255,255,255,0.3);
    border-color: #FFD700;
    color: #FFD700;
}

.microphone {
    width: 100px;
    height: 100px;
    background: #4CAF50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem auto;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.microphone:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.microphone.listening {
    animation: pulse 1s infinite;
    background: #ff4444;
}

.mic-icon {
    width: 40px;
    height: 40px;
    fill: white;
}

.result-screen {
    display: none;
    animation: bounceIn 0.8s ease;
}

.result-icon {
    width: 150px;
    height: 150px;
    margin: 2rem auto;
}

.checkmark {
    color: #4CAF50;
    font-size: 150px;
}

.x-mark {
    color: #f44336;
    font-size: 150px;
    font-weight: bold;
}

.next-button {
    background: linear-gradient(45deg, #4CAF50, #45a049);
    border: none;
    padding: 1rem 2rem;
    font-size: 1.2rem;
    color: white;
    border-radius: 25px;
    cursor: pointer;
    margin-top: 2rem;
    transition: all 0.3s ease;
}

.next-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.correct-bg {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
}

.incorrect-bg {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.score {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 1.2rem;
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: none; /* Initially hidden */
}

.question-counter {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 1.2rem;
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: none; /* Initially hidden */
}

.status {
    margin: 1rem 0;
    font-size: 0.9rem;
    opacity: 0.8;
    min-height: 2rem;
}

.audio-controls {
    margin: 1rem 0;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.warning {
    background: rgba(255, 165, 0, 0.2);
    border: 2px solid orange;
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
    color: #FFD700;
}

.game-options {
    margin: 1.5rem 0;
}

.option-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    user-select: none;
    margin: 0.5rem 0;
}

.option-toggle input {
    margin-right: 0.5rem;
    transform: scale(1.2);
}

.toggle-label {
    font-size: 0.9rem;
}

.category-selection, .question-type-selection, .question-count-selection {
    margin-top: 1.5rem;
    text-align: left;
}

.category-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    text-align: left;
}

.category-options, .question-type-options, .question-count-options {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin: 0 auto;
    max-width: 300px;
}

.timer {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 1.2rem;
    background: rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    flex-direction: column;
}

.timer-icon {
    margin-right: 0.5rem;
}

.timer-bar {
    height: 10px;
    width: 100%;
    background: linear-gradient(90deg, #4CAF50, #FFEB3B, #f44336);
    border-radius: 5px;
    margin-top: 0.5rem;
    transition: width 1s linear;
}

/* Controls row for language and instructions */
.controls-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem auto;
    gap: 1rem;
}

/* Language selection styles */
.language-selector {
    margin: 0;
    display: flex;
    justify-content: center;
    z-index: 100;
}

.language-selector select {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    padding: 8px 10px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 30px;
    min-height: 44px; /* Larger touch target for mobile */
    width: auto;
    min-width: 180px;
    text-align: center;
    text-align-last: center;
}

.language-selector::after {
    content: "▼";
    font-size: 0.7rem;
    color: white;
    position: absolute;
    margin-left: 160px;
    margin-top: 15px;
    pointer-events: none;
}

.language-selector select:focus {
    outline: none;
    border-color: #FFD700;
}

.language-selector select option {
    background-color: #764ba2;
    color: white;
    padding: 10px;
}

.language-flag {
    font-size: 1.5rem;
    margin-right: 5px;
}

/* White icon style for emojis */
.white-icon {
    filter: brightness(0) invert(1);
    display: inline-block;
}

/* Instructions button styles */
.instructions-button {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 10px;
    padding: 10px 15px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.instructions-button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.info-icon {
    margin-right: 8px;
    font-size: 1.2rem;
}

/* Popup styles */
.popup {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
    animation: fadeIn 0.3s ease;
}

.popup-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 10% auto;
    padding: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 15px;
    width: 80%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
    animation: slideDown 0.4s ease;
}

.close-popup {
    color: white;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-popup:hover {
    color: #FFD700;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}