*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f9f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    margin: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
    overflow-x: hidden;
}

#app {
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

h1 {
    color: #2c3e50;
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.instruction {
    color: #7f8c8d;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1rem;
    padding: 0 10px;
}

/* Navegación SPA Principal */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    width: 100%;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 10px;
    background-color: #ecf0f1;
    color: #7f8c8d;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.tab-btn.active {
    background-color: #3498db;
    color: white;
}

/* Sub-navegación: Modos de Test */
.test-modes {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    width: 100%;
}

.mode-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid #3498db;
    background: transparent;
    color: #3498db;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn.active {
    background: #3498db;
    color: white;
}

.view {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.view.hidden { display: none !important; }

/* Grilla de Práctica */
.grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
}

.card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.06);
    padding: 15px 5px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 120px;
}

.card:active { transform: scale(0.96); }
.card.revealed { background-color: #eaf2f8; }

.card .emoji { font-size: 3rem; margin-bottom: 5px; }
.card .word { font-size: 1.2rem; color: #3498db; font-weight: bold; opacity: 0; transition: opacity 0.3s; }
.card.revealed .word { opacity: 1; }

/* Score Board */
.score-board { display: flex; justify-content: space-between; width: 100%; margin-bottom: 20px; gap: 10px; }
.score-card { flex: 1; padding: 10px; text-align: center; border-radius: 10px; font-weight: bold; font-size: 1rem; }
.correct-score { background-color: #e8f8f5; color: #2ecc71; }
.incorrect-score { background-color: #fdedec; color: #e74c3c; }

/* Componentes del Test */
#quiz-container { width: 100%; }

.emoji-display {
    font-size: 4rem;
    margin-bottom: 20px;
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.06);
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 110px;
}

#repeat-audio-btn {
    background: #f39c12;
    color: white;
    border: none;
    border-radius: 15px;
    padding: 20px;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 20px;
    width: 100%;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.1s;
}
#repeat-audio-btn:active { transform: scale(0.97); }

.grid-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
}

.option-btn {
    background: white;
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    padding: 15px;
    font-size: 1.2rem;
    color: #3498db;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, transform 0.1s;
    text-align: center;
}

/* Modificador para cuando las opciones son emojis */
.option-btn.emoji-mode {
    font-size: 3rem;
    padding: 10px;
}

.option-btn:active { transform: scale(0.97); }
.option-btn.correct { background-color: #2ecc71; color: white; border-color: #2ecc71; }
.option-btn.incorrect { background-color: #e74c3c; color: white; border-color: #e74c3c; }

#feedback { margin-top: 15px; font-size: 1.2rem; font-weight: bold; text-align: center; }
.hidden { display: none !important; }

/* Media Queries */
@media (min-width: 600px) {
    body { padding: 30px; }
    h1 { font-size: 2.5rem; }
    .instruction { font-size: 1.2rem; margin-bottom: 30px; }
    .tabs { margin-bottom: 30px; gap: 15px; }
    .tab-btn { font-size: 1.2rem; padding: 15px; }
    .grid { gap: 20px; }
    .card { min-height: 160px; padding: 25px 10px; }
    .card .emoji { font-size: 4.5rem; }
    .card .word { font-size: 1.5rem; }
    .score-card { font-size: 1.2rem; padding: 12px; }
    .emoji-display { font-size: 6rem; padding: 30px; }
    .grid-options { gap: 15px; }
    .option-btn { font-size: 1.5rem; padding: 20px; }
    #feedback { font-size: 1.5rem; margin-top: 20px; }
}