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

.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
}

.screen:not(.hidden) {
    display: flex;
}

.container {
    max-width: 800px;
    width: 100%;
    margin: 20px auto;
    padding: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 2.5em;
}

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

.app-version {
    text-align: center;
    margin-top: -15px;
    margin-bottom: 15px;
    color: #444;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.login-form {
    max-width: 400px;
    margin: 0 auto;
}

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

.login-form input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary, .btn-secondary, .btn-danger, .btn-success {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.3s;
    margin-bottom: 10px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-primary:disabled, .btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.divider {
    text-align: center;
    margin: 20px 0;
    color: #999;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: #ddd;
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.lobby-info {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.lobby-info p {
    margin: 10px 0;
    font-size: 1.1em;
    color: #555;
}

.player-name {
    font-size: 1.2em !important;
    color: #667eea !important;
}

.leader-badge {
    display: inline-block;
    padding: 10px 20px;
    background: #f39c12;
    color: white;
    border-radius: 20px;
    font-weight: bold;
    margin-top: 10px;
}

.players-waiting {
    margin: 30px 0;
}

.players-waiting h3 {
    color: #333;
    margin-bottom: 15px;
}

.players-list {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    min-height: 100px;
}

.player-item {
    padding: 10px;
    margin: 5px 0;
    background: white;
    border-radius: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-item.leader {
    border-left: 4px solid #f39c12;
}

.lobby-actions {
    margin-top: 30px;
}

.hidden {
    display: none !important;
}

#gameScreen {
    background: white;
    padding: 20px;
    overflow-y: auto;
}

.game-header {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    background: #667eea;
    color: white;
    border-radius: 10px;
    margin-bottom: 20px;
}

.scoreboard {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.scoreboard h3 {
    color: #333;
    margin-bottom: 15px;
}

.score-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    margin: 5px 0;
    background: white;
    border-radius: 5px;
}

.score-item.current-player {
    border-left: 4px solid #667eea;
    font-weight: bold;
}

.game-phase {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.game-phase h2 {
    color: #667eea;
    text-align: center;
    margin-bottom: 20px;
}

.phrase-box {
    background: #f39c12;
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
}

.phrase-box h3 {
    font-size: 1.8em;
    margin-top: 10px;
}

.video-recording, .video-player {
    text-align: center;
}

.video-recording video, .video-player video {
    width: 100%;
    max-width: 640px;
    height: 480px;
    background: #000;
    border-radius: 10px;
    margin-bottom: 20px;
}

.recording-controls, .video-counter {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}

.video-counter p {
    font-size: 1.2em;
    color: #333;
    margin-bottom: 10px;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 30px auto;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.guess-input {
    max-width: 600px;
    margin: 30px auto;
}

.guess-input input {
    width: 100%;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 15px;
}

.hint {
    text-align: center;
    color: #999;
    font-style: italic;
    margin-top: 15px;
}

.correct-phrase {
    background: #27ae60;
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
}

.correct-phrase h3 {
    font-size: 1.8em;
    margin-top: 10px;
}

.round-results {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.result-item {
    padding: 15px;
    margin: 10px 0;
    background: white;
    border-radius: 5px;
    border-left: 4px solid #ddd;
}

.result-item.correct {
    border-left-color: #27ae60;
}

.result-item strong {
    color: #667eea;
}

.result-item .accuracy {
    color: #27ae60;
    font-weight: bold;
    font-size: 1.1em;
}

.winner-announcement {
    text-align: center;
    padding: 40px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border-radius: 15px;
    margin-bottom: 30px;
}

.winner-announcement h3 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.final-scoreboard {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }

    h1 {
        font-size: 2em;
    }

    .video-recording video, .video-player video {
        height: auto;
        aspect-ratio: 4/3;
    }

    .game-header {
        flex-direction: column;
        gap: 10px;
    }
}
