@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

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

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 100%);
    min-height: 100vh;
    color: #333333;
    transition: all 0.3s ease;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    transition: all 0.3s ease;
}

header {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

header h1 {
    font-size: 3em;
    color: #007BFF;
    margin-bottom: 10px;
    font-weight: 700;
    background: linear-gradient(135deg, #007BFF, #6C63FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 20px;
}

.score-display {
    display: flex;
    justify-content: center;
    gap: 30px;
    font-weight: bold;
    font-size: 1.1em;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    padding: 20px;
    border-radius: 16px;
    margin: 15px 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid #e0e6ed;
}

.score-display span {
    background: linear-gradient(135deg, #007BFF, #0056b3);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}

/* Menú Principal */
.menu-screen {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.menu-screen h2 {
    font-size: 2.2em;
    color: #333333;
    margin-bottom: 30px;
    font-weight: 600;
}

.menu-screen h3 {
    font-size: 1.6em;
    color: #333333;
    margin-bottom: 20px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Selección de Temas */
.topic-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.topic-btn {
    background: linear-gradient(135deg, #007BFF, #0056b3);
    color: white;
    border: none;
    padding: 30px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.25), 0 4px 12px rgba(0, 123, 255, 0.15);
    text-align: left;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
}

.topic-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 123, 255, 0.35), 0 6px 18px rgba(0, 123, 255, 0.2);
    background: linear-gradient(135deg, #0056b3, #007BFF);
}

.multiplayer-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid #5a67d8;
}

.multiplayer-btn:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.35), 0 6px 18px rgba(102, 126, 234, 0.2);
}

/* Estilos para diálogos de sala */
.create-room-dialog,
.join-room-dialog {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    margin: 0 auto;
}

.create-room-dialog h3,
.join-room-dialog h3 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.2);
}

.form-group small {
    color: #666;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.dialog-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 25px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 0 5px;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.btn-copy {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
}

.btn-copy:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.3);
}

/* Estilos para la pantalla de sala */
.room-screen {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.room-info {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
}

.info-item {
    text-align: center;
}

.info-item span:first-child {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
}

.player-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #dee2e6;
}

.player-item.host {
    border-left-color: #ffc107;
    background: #fff3cd;
}

.host-badge {
    background: #ffc107;
    color: #856404;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.room-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.room-chat {
    border-top: 2px solid #eee;
    padding-top: 20px;
}

.topic-btn h3 {
    font-size: 1.4em;
    margin-bottom: 8px;
    color: white;
}

.topic-btn p {
    font-size: 1em;
    margin-bottom: 10px;
    opacity: 0.9;
    font-weight: bold;
}

.description {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: normal;
    display: block;
    margin-top: 10px;
}

/* Header de tema seleccionado */
.topic-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.topic-header h2 {
    margin: 0;
    font-size: 1.6em;
}

.game-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.game-btn {
    background: linear-gradient(135deg, #007BFF, #0056b3);
    color: white;
    border: none;
    padding: 30px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.25), 0 4px 12px rgba(0, 123, 255, 0.15);
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
}

.game-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 123, 255, 0.35), 0 6px 18px rgba(0, 123, 255, 0.2);
    background: linear-gradient(135deg, #0056b3, #007BFF);
}

.game-btn h3 {
    font-size: 1.5em;
    margin-bottom: 10px;
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.game-btn p {
    font-size: 1em;
    margin-bottom: 10px;
    opacity: 0.9;
}

.points {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
}

.reset-btn {
    background: linear-gradient(135deg, #E53935, #d32f2f);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 500;
    margin: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 6px 18px rgba(229, 57, 53, 0.25);
}

.reset-btn:hover {
    background: linear-gradient(135deg, #d32f2f, #E53935);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(229, 57, 53, 0.35);
}

/* Pantallas de Juego */
.game-screen {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-height: 500px;
}

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

.game-header h2 {
    color: #4a5568;
    font-size: 1.8em;
}

.game-info {
    display: flex;
    gap: 20px;
    font-weight: bold;
}

.game-info span {
    background: #4299e1;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
}

/* Quiz Game */
.question-container {
    text-align: center;
    margin-bottom: 30px;
}

#questionText {
    font-size: 1.4em;
    margin-bottom: 30px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 10px;
    border-left: 5px solid #4299e1;
}

.options {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.option-btn {
    background: #ffffff;
    color: #333333;
    border: 2px solid #e0e6ed;
    padding: 16px 28px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 80px;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.option-btn:hover {
    background: #f8f9fa;
    border-color: #007BFF;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.15);
    color: #007BFF;
}

.option-btn.correct {
    background: linear-gradient(135deg, #28A745, #20c997);
    color: white;
    border-color: #28A745;
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
    animation: correctPulse 0.6s ease;
}

.option-btn.incorrect {
    background: linear-gradient(135deg, #E53935, #d32f2f);
    color: white;
    border-color: #E53935;
    box-shadow: 0 8px 20px rgba(229, 57, 53, 0.3);
    animation: incorrectShake 0.6s ease;
}

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

@keyframes incorrectShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Memory Game */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 650px;
    margin: 30px auto;
}

.memory-card {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #007BFF, #0056b3);
    border: none;
    border-radius: 16px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    color: white;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px;
    min-height: 90px;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 6px 18px rgba(0, 123, 255, 0.2);
}

.memory-card:hover {
    background: linear-gradient(135deg, #0056b3, #007BFF);
    transform: scale(1.05) rotateY(5deg);
    box-shadow: 0 8px 25px rgba(0, 123, 255, 0.3);
}

.memory-card.flipped {
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    color: #333333;
    border: 2px solid #e0e6ed;
    transform: scale(1.02);
}

.memory-card.matched {
    background: linear-gradient(135deg, #28A745, #20c997);
    color: white;
    animation: matchedPulse 0.8s ease;
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

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

/* Fill in the Blanks */
.fill-container {
    text-align: center;
    margin-bottom: 30px;
}

#fillQuestion {
    font-size: 1.4em;
    margin-bottom: 30px;
    padding: 20px;
    background: #f7fafc;
    border-radius: 10px;
    border-left: 5px solid #4299e1;
}

#answerInput {
    padding: 18px;
    font-size: 1.3em;
    font-weight: 500;
    border: 2px solid #e0e6ed;
    border-radius: 16px;
    margin-right: 20px;
    text-align: center;
    width: 220px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    color: #333333;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#answerInput:focus {
    outline: none;
    border-color: #007BFF;
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.2), 0 8px 25px rgba(0, 123, 255, 0.1);
    transform: translateY(-2px);
}

.fill-container button {
    background: #4299e1;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
}

.fill-container button:hover {
    background: #3182ce;
}

/* Feedback */
.feedback {
    text-align: center;
    margin: 25px 0;
    padding: 20px;
    border-radius: 16px;
    font-size: 1.3em;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Poppins', sans-serif;
}

.feedback.correct {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    color: #28A745;
    border: 2px solid #28A745;
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.15);
    animation: fadeInScale 0.5s ease;
}

.feedback.incorrect {
    background: linear-gradient(135deg, #f8d7da, #f1b0b7);
    color: #E53935;
    border: 2px solid #E53935;
    box-shadow: 0 8px 20px rgba(229, 57, 53, 0.15);
    animation: fadeInScale 0.5s ease;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Botones de navegación */
.back-btn {
    background: linear-gradient(135deg, #6C63FF, #5a52d5);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: 500;
    margin: 12px 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 6px 18px rgba(108, 99, 255, 0.25);
}

.back-btn:hover {
    background: linear-gradient(135deg, #5a52d5, #6C63FF);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(108, 99, 255, 0.35);
}

/* Pantalla de Resultados */
.results {
    text-align: center;
    margin: 30px 0;
}

.results p {
    font-size: 1.3em;
    margin: 15px 0;
    padding: 15px;
    background: #f7fafc;
    border-radius: 10px;
}

.result-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.result-buttons button {
    background: #4299e1;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1em;
    font-weight: bold;
    transition: all 0.3s ease;
}

.result-buttons button:hover {
    background: #3182ce;
    transform: scale(1.05);
}

/* Estilos de Multijugador */
.multiplayer-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
    padding: 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 2s infinite;
}

.status-dot.online {
    background-color: #4CAF50;
}

.status-dot.offline {
    background-color: #f44336;
    animation: none;
}

.status-dot.connecting {
    background-color: #ff9800;
}

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

.multiplayer-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.room-interface {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.room-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.room-code {
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
    font-weight: bold;
    color: #FFD700;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.players-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.player-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    position: relative;
}

.player-card.ready {
    border: 2px solid #4CAF50;
    background: rgba(76, 175, 80, 0.2);
}

.player-card.host::before {
    content: '👑';
    position: absolute;
    top: -5px;
    right: -5px;
    font-size: 1.2em;
}

.player-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin: 0 auto 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    color: white;
}

.player-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.player-status {
    font-size: 0.9em;
    opacity: 0.8;
}

.ready-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 5px;
}

.ready-indicator.ready {
    background-color: #4CAF50;
}

.ready-indicator.not-ready {
    background-color: #f44336;
}

.game-settings {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    text-align: left;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-row:last-child {
    border-bottom: none;
}

.chat-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    height: 200px;
    display: flex;
    flex-direction: column;
    margin: 20px 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    font-size: 0.9em;
}

.chat-message {
    margin: 5px 0;
    padding: 5px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}

.chat-message.system {
    background: rgba(255, 193, 7, 0.2);
    font-style: italic;
}

.chat-input-container {
    display: flex;
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.chat-input {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    margin-right: 10px;
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.chat-send-btn {
    padding: 8px 15px;
    background: #007BFF;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.chat-send-btn:hover {
    background: #0056b3;
}

.room-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 20px 0;
}

.ready-btn {
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.ready-btn.not-ready {
    background: #4CAF50;
    color: white;
}

.ready-btn.ready {
    background: #f44336;
    color: white;
}

.ready-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.leave-room-btn {
    padding: 10px 20px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.leave-room-btn:hover {
    background: #545b62;
}

.invitation-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    text-align: center;
    min-width: 300px;
}

.invitation-popup h3 {
    margin-top: 0;
    color: #FFD700;
}

.invitation-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.accept-btn {
    background: #4CAF50;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.decline-btn {
    background: #f44336;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.leaderboard-container {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.leaderboard-table th {
    background: rgba(255, 255, 255, 0.1);
    font-weight: bold;
    color: #FFD700;
}

.leaderboard-rank {
    font-weight: bold;
    font-size: 1.2em;
}

.leaderboard-rank.first {
    color: #FFD700;
}

.leaderboard-rank.second {
    color: #C0C0C0;
}

.leaderboard-rank.third {
    color: #CD7F32;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .score-display {
        flex-direction: column;
        gap: 10px;
    }
    
    .game-buttons {
        grid-template-columns: 1fr;
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .game-info {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .options {
        flex-direction: column;
        align-items: center;
    }
    
    .memory-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .fill-container input {
        margin-bottom: 15px;
        margin-right: 0;
    }
    
    .result-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .multiplayer-options {
        grid-template-columns: 1fr;
    }
    
    .players-list {
        grid-template-columns: 1fr;
    }
    
    .room-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .invitation-popup {
        margin: 20px;
        min-width: auto;
        max-width: calc(100vw - 40px);
    }
    
    .invitation-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .memory-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    #questionText, #fillQuestion {
        font-size: 1.2em;
    }
}