* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: #fff;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Screens */
.screen {
    display: none;
    animation: fadeIn 0.3s ease;
}

.screen.active {
    display: block;
}

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

/* Room Selection Screen */
.room-content {
    text-align: center;
    padding: 40px 20px;
}

.room-content h1 {
    font-size: 4em;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 1.3em;
    color: #a0a0a0;
    margin-bottom: 50px;
}

.room-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.action-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 40px;
    min-width: 300px;
    backdrop-filter: blur(10px);
}

.action-card h2 {
    font-size: 1.8em;
    margin-bottom: 25px;
    color: #fff;
}

.divider {
    font-size: 1.5em;
    color: #666;
    font-weight: bold;
}

.input-field {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1.1em;
    transition: all 0.3s;
}

.input-field:focus {
    outline: none;
    border-color: #667eea;
    background: rgba(255, 255, 255, 0.1);
}

.input-field::placeholder {
    color: #888;
}

.btn-primary {
    width: 100%;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.connection-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    font-size: 0.9em;
    color: #888;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #666;
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: #4caf50;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Lobby Screen */
.lobby-content {
    padding: 20px;
}

.lobby-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
}

.lobby-header h1 {
    font-size: 2em;
}

.btn-copy {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.2);
}

.teams-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.team-lobby {
    background: rgba(255, 255, 255, 0.05);
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    min-height: 300px;
}

.team-lobby h2 {
    font-size: 1.8em;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.team-color.blue {
    background: #2196f3;
}

.team-color.red {
    background: #f44336;
}

.player-list {
    min-height: 150px;
    margin-bottom: 20px;
}

.player-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-avatar-small {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.btn-join-team {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    color: white;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-join-team:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.lobby-actions {
    text-align: center;
}

.hint {
    margin-top: 15px;
    color: #888;
    font-size: 0.95em;
}

/* Game Screen */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.team-score-bar {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    border-radius: 12px;
    min-height: 70px;
}

.team1-bar {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
}

.team2-bar {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    flex-direction: row-reverse;
}

.team-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.team2-bar .team-info {
    flex-direction: row-reverse;
}

.team-indicator {
    font-size: 1.2em;
    font-weight: bold;
    white-space: nowrap;
}

.player-avatars {
    display: flex;
    gap: 5px;
}

.avatar-mini {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: bold;
}

.score-display {
    font-size: 2.5em;
    font-weight: bold;
}

.timer-display {
    font-size: 3.5em;
    font-weight: bold;
    padding: 15px 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    min-width: 120px;
    text-align: center;
}

.timer-display.warning {
    color: #ff6b6b;
    animation: timerPulse 1s infinite;
}

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

/* Game Phases */
.game-phase {
    display: none;
}

.game-phase.active {
    display: block;
}

.phase-content {
    text-align: center;
    padding: 60px 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.current-team-name {
    font-size: 2.5em;
    margin-bottom: 20px;
}

.describer-info {
    font-size: 1.8em;
    margin-bottom: 30px;
}

.describer-info span {
    color: #667eea;
    font-weight: bold;
}

.phase-instructions {
    font-size: 1.2em;
    color: #aaa;
    line-height: 1.8;
    margin-bottom: 40px;
}

.btn-start {
    padding: 18px 60px;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.4em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(76, 175, 80, 0.4);
}

/* Active Game */
.round-title {
    text-align: center;
    font-size: 1.8em;
    margin-bottom: 30px;
    letter-spacing: 3px;
    color: #ddd;
}

.word-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.word-card {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    border: none;
    border-radius: 12px;
    padding: 25px 15px;
    color: white;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.word-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(33, 150, 243, 0.4);
}

.word-card.difficulty-medium {
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
}

.word-card.difficulty-hard {
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%);
}

.word-card.rare {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

.word-card.very-rare {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.word-card.guessed {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
    opacity: 0.6;
    cursor: default;
}

.word-card.skipped {
    background: linear-gradient(135deg, #757575 0%, #616161 100%);
    opacity: 0.5;
    cursor: default;
}

.word-text {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 8px;
}

.word-points {
    font-size: 0.95em;
    opacity: 0.9;
}

.game-info-bar {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 25px;
}

.info-text {
    text-align: center;
    color: #ccc;
    font-size: 0.95em;
}

.difficulty-tag {
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: bold;
}

.difficulty-tag.blue {
    background: #2196f3;
    color: white;
}

.difficulty-tag.dark-blue {
    background: #0d47a1;
    color: white;
}

.difficulty-tag.orange {
    background: #ff9800;
    color: white;
}

.difficulty-tag.red {
    background: #f44336;
    color: white;
}

.contributions-panel {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 25px;
}

.contributions-panel h3 {
    font-size: 1.3em;
    margin-bottom: 20px;
}

.contributions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.contribution-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.player-info-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.player-avatar-med {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
}

.player-name-text {
    font-size: 1.1em;
    font-weight: 600;
}

.player-score {
    color: #ffd700;
    font-weight: bold;
    font-size: 1.2em;
}

.word-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.word-tag {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: 600;
}

.guess-section {
    background: rgba(255, 255, 255, 0.05);
    padding: 25px;
    border-radius: 15px;
}

.guess-input {
    width: 100%;
    padding: 20px;
    font-size: 1.4em;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.guess-input:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 20px rgba(33, 150, 243, 0.3);
}

.guess-input.correct {
    border-color: #4caf50;
    animation: correctFlash 0.5s;
}

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

.game-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.btn-skip,
.btn-end {
    padding: 15px 40px;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-skip {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    color: white;
}

.btn-skip:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 107, 107, 0.4);
}

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

.btn-end:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

/* Round Summary */
.round-summary {
    background: rgba(255, 255, 255, 0.05);
    padding: 40px;
    border-radius: 15px;
    margin: 30px 0;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    font-size: 1.3em;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: #aaa;
}

.stat-value {
    color: #667eea;
    font-weight: bold;
    font-size: 1.4em;
}

/* Game Over Screen */
.gameover-content {
    text-align: center;
    padding: 40px;
}

.gameover-content h1 {
    font-size: 3.5em;
    margin-bottom: 30px;
}

.winner-announcement {
    font-size: 2.2em;
    color: #ffd700;
    font-weight: bold;
    margin-bottom: 40px;
    padding: 30px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 15px;
}

.final-scores-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.final-score-card {
    padding: 40px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
}

.final-score-card.team1 {
    border: 3px solid #2196f3;
}

.final-score-card.team2 {
    border: 3px solid #f44336;
}

.final-score-card h3 {
    font-size: 1.8em;
    margin-bottom: 20px;
}

.final-score {
    font-size: 4em;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .room-actions {
        flex-direction: column;
    }
    
    .teams-container {
        grid-template-columns: 1fr;
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .team-score-bar {
        width: 100%;
    }
    
    .word-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
    
    .final-scores-grid {
        grid-template-columns: 1fr;
    }
}
