* {
    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;
    color: white;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Buttons */
button, .btn-primary, .btn-secondary {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    margin: 10px;
}

.btn-primary, button {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover, button:hover {
    background: #45a049;
    transform: scale(1.02);
}

.btn-secondary {
    background: #ff9800;
    color: white;
}

.btn-secondary:hover {
    background: #f57c00;
    transform: scale(1.02);
}

button:disabled {
    background: #888;
    cursor: not-allowed;
    transform: none;
}

/* Screen Management */
.screen {
    display: none;
}

.screen.active {
    display: block;
}

/* Lobby Header */
.lobby-header {
    text-align: center;
    padding: 20px;
}

/* Game Code */
.game-code {
    font-size: 4rem;
    font-weight: bold;
    background: rgba(255,255,255,0.2);
    padding: 20px 40px;
    border-radius: 15px;
    display: inline-block;
    margin: 20px 0;
    letter-spacing: 10px;
}

.join-url {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Lobby */
.lobby-content {
    display: flex;
    gap: 30px;
    margin-top: 30px;
}

.players-section {
    flex: 2;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 20px;
}

.players-section h2, .settings-section h2 {
    margin-bottom: 20px;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.player-card {
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    animation: fadeIn 0.5s ease;
    position: relative;
}

.kick-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(0,0,0,0.15);
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
}

.player-card:hover .kick-btn {
    display: inline-flex;
}

.kick-btn:hover {
    background: rgba(0,0,0,0.25);
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.player-card img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: white;
    margin-bottom: 10px;
    object-fit: cover;
}

.player-card .name {
    font-weight: bold;
    font-size: 1.1rem;
}

.settings-section {
    flex: 1;
    background: rgba(255,255,255,0.1);
    border-radius: 15px;
    padding: 20px;
}

select {
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: #333;
}

.pack-info {
    background: rgba(255,255,255,0.1);
    padding: 10px;
    border-radius: 8px;
    margin: 10px 0;
    font-size: 0.9rem;
}

.pack-info .question-types {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.pack-info .type-tag {
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
}

/* Question Screen */
.question-screen, .drawing-screen, .voting-screen {
    text-align: center;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.question-number {
    font-size: 1.5rem;
}

.question-type-badge {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1rem;
}

.question-type-badge.drawing {
    background: #9c27b0;
}

.timer {
    font-size: 3rem;
    font-weight: bold;
    background: rgba(255,255,255,0.2);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer.warning {
    background: #ff9800;
    animation: pulse 0.5s infinite;
}

.timer.danger {
    background: #f44336;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.question-text {
    font-size: 2.5rem;
    margin: 40px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.question-image-wrap {
    max-width: 900px;
    margin: 0 auto 25px;
}

.question-image {
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255,255,255,0.1);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.option {
    padding: 30px;
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    transition: transform 0.2s;
}

.option.red { background: #e21b3c; }
.option.blue { background: #1368ce; }
.option.yellow { background: #d89e00; }
.option.green { background: #26890c; }

.option.correct {
    animation: correctAnswer 0.5s ease;
    box-shadow: 0 0 30px rgba(255,255,255,0.8);
}

@keyframes correctAnswer {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.option.incorrect {
    opacity: 0.5;
}

.answer-count, .drawing-status, .vote-status {
    margin: 30px 0;
    font-size: 1.5rem;
}

/* Drawing Screen */
.drawing-prompt h2 {
    font-size: 2.5rem;
    margin: 30px 0;
}

/* Voting Screen */
.voting-title {
    font-size: 2rem;
}

.voting-prompt h2 {
    font-size: 1.5rem;
    margin: 20px 0;
    opacity: 0.9;
}

.drawings-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.drawing-card {
    background: rgba(255,255,255,0.15);
    border-radius: 15px;
    padding: 15px;
    text-align: center;
}

.drawing-card img {
    width: 100%;
    max-width: 200px;
    height: 200px;
    object-fit: contain;
    background: white;
    border-radius: 10px;
}

.drawing-card .artist-name {
    margin-top: 10px;
    font-weight: bold;
}

/* Results Screen */
.results-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 20px;
}

.correct-answer {
    text-align: center;
    font-size: 1.3rem;
    background: rgba(76, 175, 80, 0.3);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.results-list {
    max-width: 600px;
    margin: 0 auto 30px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.15);
    padding: 15px 25px;
    margin: 10px 0;
    border-radius: 10px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.result-item.correct {
    border-left: 5px solid #4CAF50;
}

.result-item.incorrect {
    border-left: 5px solid #f44336;
}

.result-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.result-info img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    object-fit: cover;
}

.points-earned {
    font-size: 1.2rem;
    font-weight: bold;
}

.points-earned.positive {
    color: #4CAF50;
}

/* Drawing Results */
.drawing-results {
    max-width: 900px;
    margin: 0 auto 30px;
}

.drawing-result-item {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255,255,255,0.15);
    padding: 20px;
    margin: 15px 0;
    border-radius: 15px;
    animation: slideIn 0.3s ease;
}

.drawing-result-item.winner {
    background: linear-gradient(135deg, rgba(255,215,0,0.3), rgba(255,179,71,0.3));
    border: 2px solid gold;
}

.drawing-result-item .rank {
    font-size: 2rem;
    font-weight: bold;
    min-width: 60px;
}

.drawing-result-item .drawing-preview {
    width: 100px;
    height: 100px;
    background: white;
    border-radius: 10px;
    object-fit: contain;
}

.drawing-result-item .player-details {
    flex: 1;
}

.drawing-result-item .votes {
    font-size: 1.5rem;
}

/* Leaderboard */
.leaderboard {
    max-width: 700px;
    margin: 30px auto;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.15);
    padding: 20px 30px;
    margin: 15px 0;
    border-radius: 15px;
    animation: slideIn 0.3s ease;
}

.leaderboard-item.first {
    background: linear-gradient(135deg, #ffd700, #ffb347);
    color: #333;
    font-size: 1.3rem;
}

.leaderboard-item.second {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: #333;
}

.leaderboard-item.third {
    background: linear-gradient(135deg, #cd7f32, #b87333);
}

.rank {
    font-size: 2rem;
    font-weight: bold;
    min-width: 60px;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.player-info img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: white;
    object-fit: cover;
}

.score {
    font-size: 1.5rem;
    font-weight: bold;
}

/* Game Over */
.game-over {
    text-align: center;
}

.game-over-header h2 {
    font-size: 3rem;
    margin-bottom: 10px;
}

.winner-announcement {
    font-size: 2rem;
    margin: 20px 0;
}

.confetti {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 100;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
    0% { transform: translateY(-100px) rotate(0deg); }
    100% { transform: translateY(100vh) rotate(720deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .lobby-content {
        flex-direction: column;
    }
    
    .game-code {
        font-size: 2.5rem;
        letter-spacing: 5px;
        padding: 15px 25px;
    }
    
    .question-text {
        font-size: 1.8rem;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
}
