* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #ffffff;
    color: #1a1a2e;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo i {
    font-size: 2rem;
    color: #f39c12;
}

.logo .edu {
    color: #f39c12;
    font-weight: 400;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-menu a:hover {
    color: #f39c12;
}

/* Search Section */
.search-section {
    margin-bottom: 30px;
}

.search-form {
    max-width: 600px;
    margin: 0 auto;
}

.search-wrapper {
    display: flex;
    background: #f5f5f5;
    border-radius: 50px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    transition: all 0.3s;
}

.search-wrapper:focus-within {
    border-color: #f39c12;
    box-shadow: 0 0 0 3px rgba(243,156,18,0.1);
}

.search-wrapper i {
    padding: 15px 0 15px 20px;
    color: #999;
}

.search-wrapper input {
    flex: 1;
    padding: 15px;
    border: none;
    background: transparent;
    font-size: 1rem;
    outline: none;
}

.search-wrapper button {
    padding: 15px 30px;
    background: #f39c12;
    border: none;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.search-wrapper button:hover {
    background: #e67e22;
}

/* Main Grid */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #eee;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #1a1a2e;
}

.card p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
    line-height: 1.5;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 0.8rem;
}

.tematica {
    background: #f0f0f0;
    padding: 4px 10px;
    border-radius: 20px;
    color: #555;
}

.dificultad {
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.dificultad.facil { background: #d4edda; color: #155724; }
.dificultad.intermedio { background: #fff3cd; color: #856404; }
.dificultad.dificil { background: #f8d7da; color: #721c24; }

.btn-play {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 12px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: opacity 0.3s;
}

.btn-play:hover {
    opacity: 0.9;
}

.btn-disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination a {
    padding: 10px 15px;
    background: #f5f5f5;
    text-decoration: none;
    color: #333;
    border-radius: 8px;
    transition: all 0.3s;
}

.pagination a.active {
    background: #f39c12;
    color: white;
}

.pagination a:hover:not(.active) {
    background: #e0e0e0;
}

/* Ranking Section */
.ranking-section {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 20px;
    position: sticky;
    top: 100px;
    height: fit-content;
}

.ranking-section h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
}

.ranking-table th,
.ranking-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.ranking-table th {
    color: #666;
    font-weight: 500;
    font-size: 0.8rem;
}

.posicion {
    font-weight: 700;
    width: 50px;
}

.puntaje {
    font-weight: 700;
    color: #f39c12;
}

/* Game Container */
.game-container {
    max-width: 1000px;
    margin: 0 auto;
}

.game-header {
    margin-bottom: 30px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #f39c12;
    text-decoration: none;
    margin-bottom: 20px;
}

.progress-steps {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
}

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: #f5f5f5;
    border-radius: 30px;
    font-size: 0.85rem;
}

.step.completed {
    background: #d4edda;
    color: #155724;
}

.step.active {
    background: #f39c12;
    color: white;
}

.step-num {
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

.step.active .step-num {
    background: white;
    color: #f39c12;
}

.game-title h1 {
    font-size: 1.8rem;
    color: #1a1a2e;
}

.game-title h2 {
    font-size: 1.3rem;
    color: #f39c12;
    margin: 10px 0;
}

.game-area {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 30px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.option-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.option-item.selected {
    border-color: #f39c12;
    background: #fff8f0;
}

.sortable-list {
    list-style: none;
    padding: 0;
}

.sortable-item {
    background: white;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: move;
    transition: all 0.3s;
}

.sortable-item.dragging {
    opacity: 0.5;
}

.classification-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.category {
    background: white;
    border-radius: 12px;
    padding: 15px;
    border: 2px dashed #ccc;
    min-height: 200px;
}

.category h4 {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.drag-items {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.drag-item {
    background: #f39c12;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: grab;
}

.btn-verify {
    display: block;
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
}

.game-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.game-message.success {
    background: #d4edda;
    color: #155724;
}

.game-message.error {
    background: #f8d7da;
    color: #721c24;
}

/* Profile Page */
.profile-container {
    max-width: 1000px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 20px;
    color: white;
}

.profile-avatar i {
    font-size: 5rem;
    color: #f39c12;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 20px;
    padding: 25px;
    text-align: center;
}

.stat-card i {
    font-size: 2rem;
    color: #f39c12;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 10px 0;
}

.progreso-item {
    display: flex;
    align-items: center;
    gap: 20px;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
}

.progreso-icon {
    font-size: 2rem;
}

.progreso-info {
    flex: 1;
}

.progress-bar-container {
    background: #e0e0e0;
    border-radius: 10px;
    height: 8px;
    margin: 10px 0;
    overflow: hidden;
}

.progress-bar {
    background: #f39c12;
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s;
}

.progreso-stats {
    display: flex;
    gap: 20px;
    font-size: 0.85rem;
    color: #666;
}

.btn-continuar {
    padding: 10px 20px;
    background: #f39c12;
    color: white;
    text-decoration: none;
    border-radius: 10px;
}

/* Auth Pages */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    padding: 20px;
}

.auth-card {
    background: white;
    border-radius: 30px;
    padding: 40px;
    max-width: 450px;
    width: 100%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header i {
    font-size: 3rem;
    color: #f39c12;
}

.auth-header h1 {
    margin: 10px 0;
    color: #1a1a2e;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.auth-form label i {
    margin-right: 8px;
    color: #f39c12;
}

.auth-form input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.auth-footer a {
    color: #f39c12;
    text-decoration: none;
}

.alert {
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* Footer */
footer {
    background: #1a1a2e;
    color: white;
    text-align: center;
    padding: 30px;
    margin-top: 60px;
}

.scroll-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #f39c12;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.scroll-top.show {
    opacity: 1;
    visibility: visible;
}

/* Responsive */
@media (max-width: 1024px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .main-grid {
        grid-template-columns: 1fr;
    }
    .ranking-section {
        position: static;
        order: -1;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
    .nav-menu {
        display: none;
        width: 100%;
        margin-top: 15px;
    }
    .nav-menu.active {
        display: block;
    }
    .nav-menu ul {
        flex-direction: column;
        gap: 10px;
    }
    .cards-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .progreso-item {
        flex-direction: column;
        text-align: center;
    }
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
}
.instructions {
    background: #e8f4fd;
    padding: 12px 20px;
    border-radius: 10px;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #0066cc;
    border-left: 4px solid #f39c12;
}

.instructions i {
    margin-right: 8px;
    color: #f39c12;
}