* {
    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 {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 100%;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
}

.logo-section {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.logo {
    max-width: 80px;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.3));
    animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

h1 {
    color: #333;
    font-size: 2.2em;
    margin-bottom: 5px;
}

.subtitle {
    color: #667eea;
    font-size: 0.95em;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Player Name Section */
.player-info {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 25px;
    border-left: 5px solid #667eea;
}

.player-name-input {
    width: 100%;
    padding: 12px;
    font-size: 1em;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
    outline: none;
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
}

.player-name-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.2);
}

.btn-set-name {
    width: 100%;
    padding: 10px;
    font-size: 0.95em;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.btn-set-name:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.current-player {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    margin: 0;
}

.current-player strong {
    color: #667eea;
    font-size: 1.1em;
}

.game-info {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.info-box {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    border-left: 4px solid #667eea;
    transition: all 0.3s;
}

.info-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.info-box .label {
    display: block;
    font-size: 0.8em;
    color: #666;
    margin-bottom: 5px;
    font-weight: 600;
}

.info-box span:not(.label) {
    font-size: 1.8em;
    font-weight: bold;
    color: #667eea;
}

.game-area {
    background: #f9f9f9;
    border: 2px solid #ddd;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 25px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.word-display {
    font-size: 3em;
    font-weight: bold;
    color: #333;
    margin-bottom: 30px;
    letter-spacing: 5px;
    font-family: 'Courier New', monospace;
    text-align: center;
    min-height: 60px;
}

.input-field {
    width: 100%;
    padding: 15px;
    font-size: 1.2em;
    border: 2px solid #ddd;
    border-radius: 10px;
    outline: none;
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
    text-align: center;
}

.input-field:focus {
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.3);
}

.input-field:disabled {
    background: #f0f0f0;
    cursor: not-allowed;
}

.input-field.correct {
    border-color: #4caf50;
    background: #f1f8f4;
}

.input-field.wrong {
    border-color: #f44336;
    background: #ffebee;
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 30px;
}

.btn {
    padding: 15px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Leaderboard */
.leaderboard-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.leaderboard-section h2 {
    color: #333;
    margin-bottom: 15px;
    text-align: center;
    font-size: 1.8em;
}

.leaderboard-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: center;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85em;
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-small:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.leaderboard-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.leaderboard-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.leaderboard-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    font-size: 0.95em;
}

.leaderboard-row:hover {
    background-color: #f9f9f9;
    transition: all 0.3s;
}

.leaderboard-row:nth-child(odd) {
    background-color: #fafafa;
}

.leaderboard-table strong {
    color: #667eea;
    font-size: 1.1em;
}

.medal {
    font-size: 1.3em;
    margin-right: 5px;
}

.no-scores {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
}

/* Game Over Modal */
.game-over {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    text-align: center;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
    width: 90%;
}

.game-over h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 2em;
}

.game-over p {
    font-size: 1.1em;
    color: #666;
    margin: 10px 0;
    font-weight: 500;
}

.game-over span {
    color: #667eea;
    font-weight: bold;
}

#gameOverPlayer {
    font-size: 1.3em;
    display: block;
    margin-bottom: 15px;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
    color: #666;
    font-size: 0.9em;
}

/* Responsive */
@media (max-width: 600px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 1.8em;
    }

    .game-info {
        grid-template-columns: repeat(2, 1fr);
    }

    .word-display {
        font-size: 2em;
    }

    .button-group {
        grid-template-columns: 1fr;
    }

    .leaderboard-table {
        font-size: 0.85em;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 8px;
    }

    .game-over {
        padding: 30px 20px;
    }
}