/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#app {
    width: 100%;
    max-width: 800px;
}

/* Screen Management */
.screen {
    display: none;
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.screen.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

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

/* Intro Screen */
#intro-screen {
    text-align: center;
}

#intro-screen h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5em;
}

#intro-screen p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.language-selector {
    margin-bottom: 20px;
}

.language-selector label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-size: 1.1em;
    font-weight: 500;
}

.language-selector select {
    width: 200px;
    padding: 10px;
    font-size: 1.1em;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
}

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

.round-selector {
    margin-bottom: 20px;
}

.round-selector label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-size: 1.1em;
    font-weight: 500;
}

.round-selector input {
    width: 150px;
    padding: 10px;
    font-size: 1.2em;
    border: 2px solid #ddd;
    border-radius: 8px;
    text-align: center;
}

.round-selector input:focus {
    outline: none;
    border-color: #667eea;
}

.timer-selector {
    margin-bottom: 30px;
}

.timer-selector label {
    display: block;
    margin-bottom: 10px;
    color: #333;
    font-size: 1.1em;
    font-weight: 500;
}

.timer-selector select {
    width: 200px;
    padding: 10px;
    font-size: 1.1em;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
}

.timer-selector select:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn {
    padding: 12px 30px;
    font-size: 1.1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #4CAF50;
    color: white;
}

.btn-secondary:hover {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.btn-skip {
    background: #ff9800;
    color: white;
}

.btn-skip:hover {
    background: #f57c00;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.4);
}

.btn-hint {
    background: #2196F3;
    color: white;
    font-size: 0.9em;
    padding: 8px 16px;
}

.btn-hint:hover {
    background: #1976D2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.4);
}

.btn-hint:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.button-group {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Game Screen */
#game-screen {
    position: relative;
}

.score-counter {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #667eea;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.2em;
    font-weight: bold;
}

.timer-display {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #ff9800;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 1.2em;
    font-weight: bold;
}

.timer-display.warning {
    background: #f44336;
    animation: pulse 1s infinite;
}

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

.game-content {
    padding-top: 20px;
}

#country-display {
    text-align: center;
    margin-bottom: 30px;
}

.country-flag {
    margin-bottom: 20px;
}

.country-flag img {
    max-width: 320px;
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#country-name {
    color: #333;
    font-size: 2em;
    margin-bottom: 10px;
}

/* Answer Section */
.answer-section {
    text-align: center;
}

.answer-section label {
    display: block;
    margin-bottom: 15px;
    color: #555;
    font-size: 1.1em;
}

#capital-input {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    font-size: 1.1em;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
}

#capital-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Hints Section */
.hints-container {
    margin: 20px 0;
}

.hints-label {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 10px;
    font-weight: 500;
}

.hints-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.hint-display {
    background: #E3F2FD;
    border: 2px solid #2196F3;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    font-size: 1.3em;
    font-weight: bold;
    color: #1565C0;
    text-align: center;
}

.hint-display.hidden {
    display: none;
}

.multiple-choice-container {
    margin: 20px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.multiple-choice-container.hidden {
    display: none;
}

.choice-option {
    padding: 12px;
    background: #f5f5f5;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 1em;
}

.choice-option:hover {
    background: #E3F2FD;
    border-color: #2196F3;
    transform: translateY(-2px);
}

.choice-option.selected {
    background: #2196F3;
    color: white;
    border-color: #1976D2;
}

/* Feedback Section */
.feedback-section {
    text-align: center;
}

.feedback-section.hidden {
    display: none;
}

#feedback-message {
    font-size: 1.2em;
    margin-bottom: 25px;
    padding: 20px;
    border-radius: 8px;
    background: #f5f5f5;
}

.correct {
    color: #4CAF50;
    font-weight: bold;
    font-size: 1.2em;
}

.incorrect {
    color: #f44336;
    font-weight: bold;
    font-size: 1.2em;
}

/* Results Screen */
#results-screen h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
}

#final-score {
    text-align: center;
    font-size: 1.3em;
    color: #555;
    margin-bottom: 30px;
    padding: 20px;
    background: #f5f5f5;
    border-radius: 8px;
}

.results-table-container {
    overflow-x: auto;
    margin-bottom: 30px;
}

#results-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

#results-table th {
    background: #667eea;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

#results-table td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
}

#results-table tr:hover {
    background: #f5f5f5;
}

.correct-row {
    background: #e8f5e9;
}

.incorrect-row {
    background: #ffebee;
}

.skipped-row {
    background: #fff3e0;
}

.timeout-row {
    background: #e0e0e0;
}

#play-again-btn {
    display: block;
    margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 600px) {
    .screen {
        padding: 20px;
    }

    #intro-screen h1 {
        font-size: 2em;
    }

    #country-name {
        font-size: 1.5em;
    }

    .score-counter {
        position: static;
        margin-bottom: 20px;
        display: inline-block;
    }

    #results-table {
        font-size: 0.9em;
    }

    #results-table th,
    #results-table td {
        padding: 8px;
    }
}

/* Hidden utility class */
.hidden {
    display: none !important;
}
