/*
 * DonCepymio - Estilos de Gamificación Avanzada (Glassmorphic, Animaciones y Mapa Duolingo)
 */

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

:root {
    --bg-primary: #090d16;
    --bg-secondary: #111728;
    --accent-color: #6366f1;
    --accent-gradient: linear-gradient(135deg, #6366f1, #a855f7);
    --text-main: #f8fafc;
    --text-muted: #64748b;
    --success-color: #10b981;
    --success-gradient: linear-gradient(135deg, #10b981, #059669);
    --error-color: #ef4444;
    --error-gradient: linear-gradient(135deg, #ef4444, #dc2626);
    --card-bg: rgba(255, 255, 255, 0.02);
    --card-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
    --font-sans: 'Outfit', sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding: 20px 0;
}

/* Glowing Background Orbs */
body::before, body::after {
    content: '';
    position: absolute;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.12;
    pointer-events: none;
}

body::before {
    background: #6366f1;
    top: 10%;
    left: 20%;
    animation: floatOrb 12s infinite alternate ease-in-out;
}

body::after {
    background: #d946ef;
    bottom: 10%;
    right: 20%;
    animation: floatOrb 14s infinite alternate-reverse ease-in-out;
}

@keyframes floatOrb {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(60px, 40px) scale(1.15); }
}

.app-container {
    width: 100%;
    max-width: 520px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* Card Styling - Glassmorphic */
.glass-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 28px;
    padding: 28px;
    width: 100%;
    box-shadow: var(--glass-shadow);
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

/* View panels inside card */
.view-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    animation: fadeIn 0.4s ease-out;
}

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

/* Common Header Details */
.header-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 16px;
}

/* Mascot SVG Design */
.mascot-container {
    width: 130px;
    height: 130px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 10px;
    transition: var(--transition-smooth);
}

.mascot-container.large-mascot {
    width: 150px;
    height: 150px;
}

.mascot-svg {
    width: 100%;
    height: 100%;
    transform-origin: bottom center;
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
}

/* Mascot States & Animations */
.mascot-neutral {
    animation: mascotIdle 4s infinite ease-in-out;
}

.mascot-acierto {
    animation: mascotSuccess 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.mascot-fallo {
    animation: mascotFailure 0.5s ease-in-out;
}

@keyframes mascotIdle {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-4px) rotate(1deg); }
}

@keyframes mascotSuccess {
    0% { transform: scale(1) translateY(0); }
    30% { transform: scale(1.18) translateY(-18px) rotate(6deg); }
    50% { transform: scale(0.92) translateY(0) rotate(-4deg); }
    75% { transform: scale(1.05) translateY(-6px) rotate(2deg); }
    100% { transform: scale(1) translateY(0) rotate(0); }
}

@keyframes mascotFailure {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-8px) rotate(-2deg); }
    40%, 80% { transform: translateX(8px) rotate(2deg); }
}

/* Speech Bubble (Bocadillo de Diálogo) */
.speech-bubble {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 16px 20px;
    position: relative;
    width: 100%;
    margin-top: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.speech-bubble::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent rgba(255, 255, 255, 0.05) transparent;
}

.speech-bubble p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-main);
    text-align: center;
}

/* Score Badge */
.score-badge {
    background: var(--accent-gradient);
    padding: 6px 18px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.score-badge span {
    color: rgba(255, 255, 255, 0.8);
}

.score-badge strong {
    color: #fff;
}

/* Progress bar inside Level */
.progress-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--accent-gradient);
    width: 0;
    border-radius: 10px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Vistas de Título */
.view-title {
    font-size: 1.6rem;
    font-weight: 800;
    text-align: center;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.view-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: -12px;
}

/* ---------------------------------------------------- */
/* VISTA 2: El Camino Estoico (Mapa de Niveles)         */
/* ---------------------------------------------------- */
.level-path {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    position: relative;
    max-height: 420px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.05) transparent;
    background-image: linear-gradient(rgba(15, 23, 42, 0.45), rgba(15, 23, 42, 0.45)), url("greek_path_bg.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 20px;
}

/* Cada nodo de nivel */
.level-node {
    display: flex;
    align-items: center;
    width: 76%;
    max-width: 480px;
    align-self: flex-start;
    margin-left: 3%;
    position: relative;
    z-index: 1;
    cursor: pointer;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 12px 18px;
    transition: var(--transition-smooth);
}

/* Desplazar los nodos alternando izquierda y derecha para un aspecto dinámico tipo Duolingo */
.level-node:nth-child(even) {
    align-self: flex-end;
    margin-right: 3%;
    margin-left: 0;
    flex-direction: row-reverse;
}

.level-node:hover:not(.locked) {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

/* El círculo del número de nivel */
.level-circle {
    min-width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-main);
    transition: var(--transition-smooth);
    margin: 0 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.level-node.active .level-circle {
    background: var(--accent-gradient);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
    animation: pulseActive 2s infinite;
}

.level-node.completed .level-circle {
    background: var(--success-gradient);
    border-color: transparent;
    color: #fff;
}

.level-node.locked .level-circle {
    background: rgba(255,255,255,0.01);
    border-color: rgba(255,255,255,0.05);
    color: var(--text-muted);
}

@keyframes pulseActive {
    0% { transform: scale(1); }
    50% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

/* Textos informativos de cada nodo */
.level-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.level-node:nth-child(even) .level-info {
    text-align: right;
}

.level-title-text {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
}

.level-node.locked .level-title-text {
    color: var(--text-muted);
}

.level-desc-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Indicador de candado */
.lock-indicator {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---------------------------------------------------- */
/* VISTAS DE PRUEBAS / WORKSPACES                       */
/* ---------------------------------------------------- */
.challenge-label {
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--accent-color);
    letter-spacing: 0.12em;
    text-align: center;
}

.test-question-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
    color: var(--text-main);
    padding: 0 10px;
}

.challenge-workspace {
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.test-area {
    width: 100%;
    animation: fadeIn 0.3s ease-out;
}

/* 1. Múltiple Choice Options */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.option-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    padding: 14px 18px;
    border-radius: 16px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.4;
    width: 100%;
}

.option-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
}

.option-bullet {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    min-width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    transition: var(--transition-smooth);
}

.option-btn:hover:not(:disabled) .option-bullet {
    background: var(--accent-color);
    color: #fff;
    border-color: transparent;
}

/* Clases de Corrección */
.option-btn.btn-correct {
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: var(--success-color) !important;
    color: #a7f3d0 !important;
}

.option-btn.btn-correct .option-bullet {
    background: var(--success-color) !important;
    color: #fff !important;
    border-color: transparent !important;
}

.option-btn.btn-incorrect {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: var(--error-color) !important;
    color: #fca5a5 !important;
    animation: shake 0.4s ease-in-out;
}

.option-btn.btn-incorrect .option-bullet {
    background: var(--error-color) !important;
    color: #fff !important;
    border-color: transparent !important;
}

/* 2. Rellenar Huecos / Completar Frase */
.quote-text {
    font-size: 1.1rem;
    line-height: 1.5;
    font-style: italic;
    color: var(--text-main);
    background: rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    border-radius: 16px;
    border-left: 4px solid var(--accent-color);
    margin-bottom: 20px;
    width: 100%;
}

.blank-highlight {
    background: rgba(99, 102, 241, 0.15);
    border-bottom: 2px dashed var(--accent-color);
    padding: 2px 10px;
    border-radius: 4px;
    color: #a5b4fc;
    font-weight: 700;
    transition: var(--transition-smooth);
}

.blank-highlight.filled {
    border-bottom: 2px solid var(--success-color);
    color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

/* Bancos de Palabras (Word Banks) */
.words-bank {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

.word-block {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: 10px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    user-select: none;
}

.word-block:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.word-block.used {
    opacity: 0.25;
    pointer-events: none;
    transform: scale(0.95);
}

/* 3. Word Order Target Area */
.word-order-target {
    background: rgba(0, 0, 0, 0.2);
    border: 2px dashed rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    min-height: 70px;
    padding: 12px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-content: flex-start;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.wo-placeholder {
    color: var(--text-muted);
    font-size: 0.85rem;
    pointer-events: none;
}

/* ---------------------------------------------------- */
/* VISTAS COMUNES: LOGIN / ÉXITO / FOOTERS              */
/* ---------------------------------------------------- */
.login-title {
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
}

.email-input-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.email-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 14px 18px;
    border-radius: 14px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition-smooth);
    text-align: center;
}

.email-input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.email-error {
    color: var(--error-color);
    font-size: 0.78rem;
    text-align: center;
    display: none;
}

.primary-btn {
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 14px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 100%;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.primary-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}

.primary-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.primary-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

/* Success statistics */
.success-stats {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 10px 0;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 16px;
    padding: 14px 24px;
}

.stat-val {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--success-color);
}

.stat-lbl {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.score-highlight {
    font-size: 2.8rem;
    font-weight: 800;
    color: var(--success-color);
    text-align: center;
    margin: 10px 0;
}

/* Footers and Embed styles */
.footer-actions {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.footer-link {
    cursor: pointer;
    text-decoration: underline;
    transition: var(--transition-smooth);
}

.footer-link:hover {
    color: var(--text-main);
}

.csv-file-input {
    display: none;
}

.embed-info-box {
    margin-top: 24px;
    background: rgba(17, 23, 40, 0.6);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 18px;
    padding: 16px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.embed-code-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
}

.embed-code-textarea {
    width: 100%;
    height: 60px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    color: #818cf8;
    font-family: monospace;
    font-size: 0.7rem;
    padding: 8px;
    resize: none;
    outline: none;
}

/* Shake animations for errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
.btn-incorrect {
    animation: shake 0.4s ease-in-out;
}

/* Crossword Puzzle Styles */
.crossword-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    align-items: center;
}

.crossword-grid {
    display: grid;
    gap: 4px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px;
    border-radius: 16px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.3);
}

.cw-cell {
    position: relative;
    aspect-ratio: 1;
    background: transparent;
    border-radius: 6px;
    overflow: hidden;
}

.cw-cell.empty {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.02);
}

.cw-cell.active-cell {
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
}

.cw-input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    color: var(--text-main);
    text-align: center;
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    outline: none;
    caret-color: var(--accent-color);
}

.cw-input:focus {
    background: rgba(99, 102, 241, 0.12);
    box-shadow: inset 0 0 0 2px var(--accent-color);
}

.cw-number {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 2;
}

.crossword-clues {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 14px;
}

.clue-section h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent-color);
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 4px;
}

.clue-section ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.clue-item {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.3;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition-smooth);
}

.clue-item.active-clue {
    color: var(--text-main);
    background: rgba(99, 102, 241, 0.08);
}

.cw-cell.btn-correct {
    background: rgba(16, 185, 129, 0.15) !important;
    box-shadow: inset 0 0 0 2px var(--success-color) !important;
}

.cw-cell.btn-incorrect {
    background: rgba(239, 68, 68, 0.15) !important;
    box-shadow: inset 0 0 0 2px var(--error-color) !important;
}

/* Matching Concepts Styles */
.matching-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
}

.matching-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.matching-item {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    padding: 14px 16px;
    border-radius: 14px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-smooth);
    min-height: 65px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    line-height: 1.4;
    width: 100%;
}

.matching-item:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.18);
}

.matching-item.selected {
    border-color: var(--accent-color) !important;
    background: rgba(99, 102, 241, 0.12) !important;
}

.matching-item.paired-1 { border-color: #f59e0b !important; background: rgba(245, 158, 11, 0.1) !important; }
.matching-item.paired-2 { border-color: #3b82f6 !important; background: rgba(59, 130, 246, 0.1) !important; }
.matching-item.paired-3 { border-color: #ec4899 !important; background: rgba(236, 72, 153, 0.1) !important; }

.pair-badge {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
    margin-left: 8px;
    white-space: nowrap;
}

.paired-1 .pair-badge { background: #f59e0b; }
.paired-2 .pair-badge { background: #3b82f6; }
.paired-3 .pair-badge { background: #ec4899; }

.matching-item.btn-correct {
    border-color: var(--success-color) !important;
    background: rgba(16, 185, 129, 0.12) !important;
}

.matching-item.btn-incorrect {
    border-color: var(--error-color) !important;
    background: rgba(239, 68, 68, 0.12) !important;
}

/* Odd One Out (El Intruso) Styles */
.odd-out-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    width: 100%;
}

.odd-out-btn {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-main);
    padding: 20px 16px;
    border-radius: 18px;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 100px;
    line-height: 1.4;
    width: 100%;
}

.odd-out-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
}

.odd-out-btn.selected {
    border-color: var(--accent-color) !important;
    background: rgba(99, 102, 241, 0.12) !important;
}

.odd-out-btn.btn-correct {
    background: rgba(16, 185, 129, 0.12) !important;
    border-color: var(--success-color) !important;
    color: #a7f3d0 !important;
}

.odd-out-btn.btn-incorrect {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: var(--error-color) !important;
    color: #fca5a5 !important;
    animation: shake 0.4s ease-in-out;
}

/* Memory Cards Grid Styles */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 550px;
    margin: 0 auto;
}

.memory-card {
    aspect-ratio: 4 / 3;
    perspective: 1000px;
    cursor: pointer;
    width: 100%;
}

.memory-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.memory-card.flipped .memory-card-inner {
    transform: rotateY(180deg);
}

.memory-card-front, .memory-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.4;
    user-select: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.memory-card-front {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05));
    border-color: rgba(99, 102, 241, 0.2);
    color: var(--accent-color);
    font-size: 1.6rem;
}

.memory-card-back {
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-main);
    transform: rotateY(180deg);
}

.memory-card.matched .memory-card-back {
    border-color: var(--success-color) !important;
    background: rgba(16, 185, 129, 0.08) !important;
    color: #a7f3d0 !important;
}

.memory-card.mismatched .memory-card-back {
    border-color: var(--error-color) !important;
    background: rgba(239, 68, 68, 0.08) !important;
    color: #fca5a5 !important;
}

/* ---------------------------------------------------- */
/* RULETA DEL DESTINO ESTOICO (WHEEL OF FORTUNE)         */
/* ---------------------------------------------------- */
.wheel-explanation-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 14px 18px;
    margin: 14px auto;
    text-align: center;
    max-width: 500px;
    box-shadow: inset 0 1px 4px rgba(255,255,255,0.05);
}

.wheel-explanation-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 6px;
}

.wheel-explanation-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.wheel-outer-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 18px 0;
    position: relative;
}

.wheel-pointer {
    font-size: 1.8rem;
    color: #f59e0b;
    z-index: 10;
    margin-bottom: -10px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    animation: pointerBounce 0.8s infinite alternate ease-in-out;
}

@keyframes pointerBounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

.wheel-spinner-container {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 8px solid rgba(255, 255, 255, 0.03);
    box-shadow: 0 10px 32px rgba(0,0,0,0.4), inset 0 2px 10px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    transform: rotate(0deg);
    transition: transform 4s cubic-bezier(0.1, 0.8, 0.1, 1);
    background: conic-gradient(
        #6366f1 0deg 60deg,
        #ef4444 60deg 120deg,
        #10b981 120deg 180deg,
        #f59e0b 180deg 240deg,
        #ec4899 240deg 300deg,
        #6b7280 300deg 360deg
    );
}

.wheel::after {
    content: "";
    position: absolute;
    width: 40px;
    height: 40px;
    background: #1e293b;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    z-index: 3;
}

.wheel-segment {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    transform-origin: center;
    transform: rotate(var(--angle));
    z-index: 2;
}

.wheel-segment span {
    padding-top: 20px;
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8), 0 0 2px rgba(0, 0, 0, 0.9);
    display: block;
    user-select: none;
}

.wheel-reflection-container {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 14px 18px;
    margin: 14px auto;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    animation: fadeInReflection 0.5s ease-out;
}

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

.reflection-badge {
    background: var(--accent-gradient);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 8px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.reflection-text {
    font-size: 0.85rem;
    color: var(--text-main);
    line-height: 1.5;
    font-style: italic;
}

/* Contenedor de Bienvenida Partido */
.login-split-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
    width: 100%;
}

.login-form-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

.login-info-side {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.03);
}

.info-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    padding-bottom: 14px;
}

.info-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-color);
}

.info-desc {
    font-size: 0.8rem;
    color: var(--text-main);
    opacity: 0.85;
    line-height: 1.5;
}

/* ---------------------------------------------------- */
/* ADAPTACIÓN HORIZONTAL PARA PANTALLAS DE ORDENADOR    */
/* ---------------------------------------------------- */
@media (min-width: 800px) {
    .app-container {
        max-width: 1040px;
        padding: 24px;
    }
    
    .glass-card {
        display: grid;
        grid-template-columns: 280px 1fr;
        gap: 32px;
        align-items: start;
        padding: 36px;
        transition: max-width 0.4s ease, grid-template-columns 0.4s ease;
    }
    
    /* Cuando la cabecera está oculta (login) permitir pantalla completa horizontal */
    .glass-card.header-hidden {
        grid-template-columns: 1fr !important;
        max-width: 100%;
        margin: 0 auto;
    }
    .glass-card.header-hidden .view-panel {
        grid-column: 1 / -1 !important;
        width: 100%;
    }

    /* Distribución partida del login en horizontal */
    .login-split-container {
        display: grid;
        grid-template-columns: 1fr 1.1fr;
        gap: 40px;
        align-items: stretch;
    }
    
    /* Reorganizar cabecera en modo barra lateral (sidebar) */
    .header-wrapper {
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        padding-bottom: 0;
        padding-right: 32px;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 24px;
        height: 100%;
        min-height: 480px;
    }
    
    .mascot-container {
        width: 140px;
        height: 140px;
    }
    
    .progress-container {
        width: 100%;
        margin-top: 10px;
    }
    
    .score-badge {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    /* Ajustes del crucigrama para visualizar rejilla y pistas lado a lado */
    .crossword-layout {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 28px;
        width: 100%;
    }
    
    .crossword-clues {
        flex-grow: 1;
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
    }
    
    /* Ajustes en los diálogos introductorios */
    .dialog-bubble {
        margin-top: 0;
        width: 100%;
    }
    
    /* Centrado y acomodo visual de mapas */
    .level-path {
        padding: 20px 0;
        gap: 24px;
    }
}

/* Botón Secundario (Estilo de Vidrio para Comprar Letras / Acciones Secundarias) */
.secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-main);
    padding: 10px 22px;
    border-radius: 14px;
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.secondary-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.secondary-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.secondary-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

/* Confetti Celebration Styles */
.confetti-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.confetti-particle {
    position: absolute;
    top: -20px;
    border-radius: 2px;
    opacity: 0.8;
    animation: fall linear infinite;
}

@keyframes fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(500px) rotate(360deg);
        opacity: 0;
    }
}

/* Estilos para las medallas en el sidebar */
.medal-icon {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease, opacity 0.3s ease;
}
.medal-icon.unlocked {
    filter: none !important;
    opacity: 1 !important;
    transform: scale(1.15);
    animation: medalPulse 2s infinite alternate;
}
.medal-slot:hover .medal-icon.unlocked {
    transform: scale(1.3) rotate(10deg);
}
@keyframes medalPulse {
    0% { filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.4)); }
    100% { filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.9)); }
}.continue-pulse-btn, #success-continue-btn:not(:disabled) {
    background: linear-gradient(135deg, #7f1d1d, #991b1b) !important;
    border: 1px solid #b91c1c !important;
    box-shadow: 0 0 12px rgba(185, 28, 28, 0.4) !important;
    animation: buttonPulse 1.6s infinite ease-in-out !important;
}

.continue-pulse-btn:hover, #success-continue-btn:not(:disabled):hover {
    background: linear-gradient(135deg, #991b1b, #b91c1c) !important;
    box-shadow: 0 0 18px rgba(185, 28, 28, 0.6) !important;
}

@keyframes buttonPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.03);
        opacity: 0.92;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

