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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Navbar */
.navbar {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 15px 0;
    margin-bottom: 30px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-links a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

/* Login/Register Box */
.login-box, .join-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 400px;
    margin: 100px auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.login-box h1, .join-box h1 {
    text-align: center;
    color: #667eea;
    margin-bottom: 30px;
    font-size: 2.5em;
}

.login-box input, .join-box input,
.editor input, .editor select {
    width: 100%;
    padding: 15px;
    margin: 10px 0;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
}

.login-box input:focus, .join-box input:focus,
.editor input:focus {
    outline: none;
    border-color: #667eea;
}

.login-box button, .join-box button {
    width: 100%;
    padding: 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

.login-box button:hover, .join-box button:hover {
    background: #5568d3;
}

.login-box p, .join-box p {
    text-align: center;
    margin-top: 20px;
}

.login-box a, .join-box a {
    color: #667eea;
    text-decoration: none;
}

.error {
    background: #fee;
    color: #c33;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #c33;
}

.success {
    background: #efe;
    color: #3c3;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 4px solid #3c3;
}

/* Dashboard */
.dashboard {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

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

.kahoots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.kahoot-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.kahoot-card h3 {
    margin-bottom: 10px;
    font-size: 1.4em;
}

.card-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary, .btn-play, .btn-edit, .btn-delete {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-play {
    background: #2ecc71;
    color: white;
}

.btn-edit {
    background: #f39c12;
    color: white;
}

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

.empty-state {
    text-align: center;
    padding: 60px;
    color: #999;
    font-size: 1.2em;
}

/* Editor */
.editor {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.editor h1 {
    margin-bottom: 30px;
    color: #667eea;
}

.question-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin-bottom: 20px;
    border: 2px solid #e0e0e0;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.btn-delete-small {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.answers-editor {
    margin: 20px 0;
}

.answer-input {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.answer-input input[type="radio"] {
    width: auto;
}

.answer-input input[type="text"] {
    flex: 1;
}

.time-selector {
    margin-top: 15px;
}

.time-selector select {
    padding: 8px;
    border-radius: 5px;
    border: 2px solid #e0e0e0;
}

/* Play Screen */
.play-screen {
    background: white;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.join-info {
    display: flex;
    justify-content: space-around;
    margin: 40px 0;
    flex-wrap: wrap;
    gap: 30px;
}

.pin-display {
    flex: 1;
    min-width: 250px;
}

.pin-code {
    font-size: 4em;
    font-weight: bold;
    color: #667eea;
    letter-spacing: 10px;
    margin: 20px 0;
}

.qr-display {
    flex: 1;
    min-width: 250px;
}

.qr-display img {
    max-width: 300px;
    border: 5px solid #667eea;
    border-radius: 15px;
}

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

.player-badge {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    margin: 5px;
}

/* Game Screen */
.game-screen {
    background: #1a1a2e;
    color: white;
}

.game-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #16213e;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.game-info {
    display: flex;
    gap: 30px;
    font-size: 1.2em;
}

#timer {
    color: #f39c12;
    font-weight: bold;
    font-size: 1.5em;
}

.question-display {
    background: #16213e;
    padding: 60px 40px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 30px;
}

.question-display h1 {
    font-size: 2.5em;
}

.answers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.answer-box {
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.answer-box:hover {
    transform: scale(1.05);
}

.answer-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.answer-text {
    font-size: 1.5em;
    font-weight: 600;
}

.scoreboard, .final-results {
    background: white;
    color: #333;
    padding: 40px;
    border-radius: 20px;
    text-align: center;
}

.score-item {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    margin: 10px 0;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 1.2em;
}

.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 20px;
    margin: 40px 0;
}

.podium-place {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 20px;
    border-radius: 15px;
    min-width: 150px;
}

.podium-place.first {
    height: 200px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.podium-place.second {
    height: 160px;
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

.podium-place.third {
    height: 120px;
    background: linear-gradient(135deg, #cd7f32 0%, #a0522d 100%);
}

.place-number {
    font-size: 3em;
    font-weight: bold;
}

.place-name {
    font-size: 1.2em;
    margin: 10px 0;
}

.place-score {
    font-size: 1.5em;
    font-weight: bold;
}

/* Player Screen */
.player-screen {
    background: #1a1a2e;
    color: white;
}

.player-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #16213e;
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.waiting-screen {
    background: #16213e;
    padding: 100px 40px;
    border-radius: 20px;
    text-align: center;
}

.question-screen .question-text {
    background: #16213e;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.5em;
}

.answer-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.answer-btn {
    padding: 40px 20px;
    border: none;
    border-radius: 15px;
    font-size: 1.2em;
    font-weight: 600;
    cursor: pointer;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s;
}

.answer-btn:hover {
    transform: scale(1.05);
}

.answer-icon {
    font-size: 2em;
}

.result-screen {
    padding: 100px 40px;
    text-align: center;
}

.correct {
    color: #2ecc71;
}

.incorrect {
    color: #e74c3c;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .kahoots-grid {
        grid-template-columns: 1fr;
    }
    
    .answers-grid, .answer-buttons {
        grid-template-columns: 1fr;
    }
    
    .join-info {
        flex-direction: column;
    }
    
    .pin-code {
        font-size: 3em;
    }
    
    .question-display h1 {
        font-size: 1.5em;
    }
    
    .podium-container {
        flex-direction: column;
        align-items: center;
    }
    
    .podium-place {
        width: 100%;
    }
}

/* Estadísticas */
.stats-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

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

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 1em;
    margin-bottom: 15px;
    opacity: 0.9;
}

.stat-value {
    font-size: 3em;
    font-weight: bold;
}

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

.stats-table th,
.stats-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.stats-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #667eea;
}

.stats-table tr:hover {
    background: #f8f9fa;
}

.question-stat-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    margin: 20px 0;
    border: 2px solid #e0e0e0;
}

.question-stat-card h3 {
    color: #667eea;
    margin-bottom: 20px;
}

.question-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.question-stats-grid div {
    padding: 10px;
    background: white;
    border-radius: 8px;
}

.export-section {
    margin-top: 40px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 15px;
    text-align: center;
}

.export-section h2 {
    margin-bottom: 20px;
    color: #667eea;
}

.top-players {
    margin: 40px 0;
}

.top-players h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.status-badge.active {
    background: #d4edda;
    color: #155724;
}

.status-badge.finished {
    background: #f8f9fa;
    color: #6c757d;
}

/* Sonidos */
.sounds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.sound-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #e0e0e0;
}

.sound-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sound-header h3 {
    margin: 0;
    color: #667eea;
    font-size: 1.2em;
}

.sound-status {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
}

.sound-status.active {
    background: #2ecc71;
    color: white;
}

.sound-status.inactive {
    background: #e0e0e0;
    color: #999;
}

.sound-desc {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.sound-player {
    margin: 15px 0;
}

.sound-player audio {
    width: 100%;
    height: 40px;
}

.sound-actions {
    margin: 15px 0;
}

.sound-upload-form {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.file-input-wrapper {
    position: relative;
    margin-bottom: 10px;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-label {
    display: block;
    padding: 12px 20px;
    background: white;
    border: 2px dashed #667eea;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    color: #667eea;
    font-weight: 600;
    transition: all 0.3s;
}

.file-label:hover {
    background: #f0f0ff;
    border-color: #5568d3;
}

.sound-upload-form button {
    width: 100%;
    margin-top: 10px;
}

.sound-info {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-top: 30px;
}

.sound-info h2 {
    color: #667eea;
    margin-bottom: 20px;
}

.sound-info h3 {
    color: #764ba2;
    margin: 20px 0 10px 0;
}

.sound-info ul {
    margin-left: 20px;
}

.sound-info li {
    margin: 10px 0;
}

.sound-info a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.sound-info a:hover {
    text-decoration: underline;
}

/* Auto-advance */
.auto-advance-text {
    text-align: center;
    font-size: 1.2em;
    margin: 20px 0;
    color: #667eea;
    font-weight: 600;
}

.auto-advance-text span {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 50%;
    min-width: 40px;
    font-size: 1.3em;
}
/* SIMON SAYS STYLES */
.simon-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 400px;
    margin: 20px auto;
    aspect-ratio: 1/1;
}

.simon-btn {
    border-radius: 15px;
    border: none;
    cursor: pointer;
    transition: all 0.1s;
    opacity: 0.6;
    box-shadow: 0 5px 0 rgba(0,0,0,0.2);
}

.simon-btn:active, .simon-btn.active {
    opacity: 1;
    transform: scale(0.95);
    box-shadow: 0 2px 0 rgba(0,0,0,0.2);
}

.simon-green { background-color: #2ecc71; }
.simon-red { background-color: #e74c3c; }
.simon-yellow { background-color: #f1c40f; }
.simon-blue { background-color: #3498db; }

.simon-status {
    font-size: 1.5em;
    font-weight: bold;
    margin: 20px 0;
    min-height: 1.5em;
}

/* --- SIMON / MEMORY GAME STYLES --- */
.game-options {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.simon-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-width: 400px;
    margin: 20px auto;
    aspect-ratio: 1/1; /* Cuadrado perfecto */
}

.simon-btn {
    border-radius: 20px;
    border: none;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.1s;
    box-shadow: 0 6px 0 rgba(0,0,0,0.2);
    position: relative;
}

.simon-btn:active {
    transform: translateY(4px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.2);
}

/* Clases para iluminar los botones */
.simon-btn.active {
    opacity: 1;
    filter: brightness(1.5);
    transform: scale(0.98);
    box-shadow: 0 0 20px currentColor;
}

.simon-green  { background-color: #2ecc71; color: #2ecc71; }
.simon-red    { background-color: #e74c3c; color: #e74c3c; }
.simon-yellow { background-color: #f1c40f; color: #f1c40f; }
.simon-blue   { background-color: #3498db; color: #3498db; }

.difficulty-badge {
    background: #fff;
    color: #333;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: bold;
}