* {
    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;
}

.container {
    width: 100%;
    max-width: 1200px;
}

.screen {
    display: none;
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.5s ease-in;
}

.screen.active {
    display: block;
}

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

.game-title {
    font-size: 3em;
    color: #667eea;
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
    text-align: center;
    font-size: 1.3em;
    color: #666;
    margin-bottom: 40px;
}

/* Player Setup */
.player-setup {
    margin-bottom: 30px;
}

.player-setup h2 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

#player-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.player-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.player-name-input {
    flex: 1;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #ddd;
    border-radius: 10px;
    transition: border-color 0.3s;
}

.player-name-input:focus {
    outline: none;
    border-color: #667eea;
}

.remove-player-btn {
    padding: 10px 15px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: background 0.3s;
}

.remove-player-btn:hover {
    background: #ff5252;
}

.player-count {
    text-align: center;
    font-size: 1.1em;
    color: #666;
    margin-top: 10px;
}

/* Buttons */
.btn {
    padding: 15px 40px;
    font-size: 1.2em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.button-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

/* Settings */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.setting-group {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e9ecef;
}

.setting-group h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.select-input,
.number-input {
    width: 100%;
    padding: 12px;
    font-size: 1em;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.select-input:focus,
.number-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Game Screen */
#game-screen {
    padding: 20px;
    max-width: 100%;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.game-info h2 {
    color: #667eea;
    font-size: 1.8em;
    margin-bottom: 5px;
}

#city-to-find {
    font-size: 1.3em;
    color: #333;
    margin: 5px 0;
}

.city-name {
    font-weight: bold;
    color: #764ba2;
}

#round-info {
    color: #666;
    font-size: 1.1em;
}

#map-container {
    position: relative;
    margin-bottom: 20px;
}

#map {
    height: 600px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: crosshair;
}

/* Guess Result */
.guess-result {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    z-index: 1000;
    animation: popIn 0.5s ease-out;
}

.guess-result.hidden {
    display: none;
}

@keyframes popIn {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.guess-result h3 {
    color: #667eea;
    font-size: 1.8em;
    margin-bottom: 15px;
}

.distance-text {
    font-size: 1.3em;
    color: #333;
    margin-bottom: 20px;
}

#distance-value {
    font-weight: bold;
    color: #764ba2;
    font-size: 1.4em;
}

/* Scoreboard */
.scoreboard {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    border: 2px solid #e9ecef;
}

.scoreboard.hidden {
    display: none;
}

.scoreboard h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5em;
    text-align: center;
}

#score-table,
#final-score-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
}

#score-table th,
#score-table td,
#final-score-table th,
#final-score-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

#score-table th,
#final-score-table th {
    background: #667eea;
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#score-table tbody tr:hover,
#final-score-table tbody tr:hover {
    background: #f8f9fa;
}

/* Winner Screen */
.winner-container {
    text-align: center;
}

.winner-title {
    font-size: 3.5em;
    color: #667eea;
    margin-bottom: 30px;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

#confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 999;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #f0f;
    animation: confettiFall 3s linear infinite;
}

@keyframes confettiFall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

#winner-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    margin: 40px 0;
    min-height: 250px;
}

.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideUp 0.8s ease-out;
}

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

.podium-stand {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    text-align: center;
    min-width: 150px;
}

.podium-stand.first {
    height: 200px;
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
}

.podium-stand.second {
    height: 150px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
}

.podium-stand.third {
    height: 120px;
    background: linear-gradient(135deg, #d299c2 0%, #fef9d7 100%);
}

.podium-rank {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 10px;
}

.podium-player {
    font-size: 1.3em;
    font-weight: 600;
    margin-bottom: 5px;
}

.podium-score {
    font-size: 1em;
    opacity: 0.9;
}

.final-scores {
    margin: 40px 0;
}

.final-scores h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

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

    .game-title {
        font-size: 2em;
    }

    .subtitle {
        font-size: 1em;
    }

    #map {
        height: 400px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .game-header {
        flex-direction: column;
        align-items: flex-start;
    }

    #winner-podium {
        flex-direction: column-reverse;
        align-items: center;
    }

    .podium-stand.first,
    .podium-stand.second,
    .podium-stand.third {
        height: auto;
        min-height: 100px;
        width: 100%;
        max-width: 250px;
    }
}

/* Country labels for medium difficulty - red for better visibility */
.country-label-red {
    background: transparent;
    border: none;
    text-align: center;
}

.country-label-red span {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #ff3333;
    text-shadow: 
        -1px -1px 0 #fff,  
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        1px 1px 0 #fff,
        -2px -2px 0 #000,
        2px -2px 0 #000,
        -2px 2px 0 #000,
        2px 2px 0 #000,
        0 0 3px #fff,
        0 0 5px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    pointer-events: none;
}

/* Map markers */
.guess-marker,
.city-marker {
    animation: markerPop 0.3s ease-out;
}

@keyframes markerPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
