/* Oposiciones Bilbao - Estilos principales */
/* Sistema de colores basado en el diseño de referencia */

:root {
    --color-primary: #C41E3A;
    --color-dark: #2D3748;
    --color-purple: #8B5CF6;
    --color-bg: #F7FAFC;
    --color-white: #FFFFFF;
    --color-text: #2D3748;
    --color-text-light: #718096;
    --color-border: #E2E8F0;
    --color-success: #48BB78;
    --color-error: #F56565;
    --color-warning: #ED8936;

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

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

html.disable-pull-refresh, body.disable-pull-refresh {
    overscroll-behavior-y: none !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page {
    display: none;
    min-height: 100vh;
    padding: 2rem 1rem;
}

.page.active {
    display: block;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ====== PÁGINA PRINCIPAL ====== */
.logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

#main-menu .container {
    padding-top: 10vh;
}

.logo-square {
    width: 80px;
    height: 80px;
    background: var(--color-primary);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.logo-bg {
    position: absolute;
    font-size: 28px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.25);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    letter-spacing: 3px;
    z-index: 0;
    user-select: none;
    pointer-events: none;
}

.logo-text {
    font-size: 48px;
    font-weight: 900;
    color: var(--color-white);
    position: relative;
    z-index: 1;
}

.main-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 15px;
    font-weight: 400;
    text-align: center;
    color: var(--color-text-light);
    margin-bottom: 3rem;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* --- ONBOARDING & PROFILE --- */
.onboarding-container {
    max-width: 500px;
    padding-top: 1rem;
    padding-bottom: 4rem;
    text-align: center;
}

.onboarding-desc {
    color: var(--color-gray-500);
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--color-dark);
}

.form-control {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 2px solid #E2E8F0;
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 16px;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
}

.conditional-group {
    background: #F7FAFC;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-primary);
    margin-top: 1rem;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.topics-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.topic-check-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: white;
    border: 1px solid #E2E8F0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.topic-check-item:hover {
    background: #EDF2F7;
}

.topic-check-item input {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

#welcome-msg {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    color: var(--color-text-light);
    margin-bottom: 0.5rem;
    min-height: 1.5rem;
}

.user-name-highlight {
    color: var(--color-primary);
}

.btn-config {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* ====== BOTONES ====== */
.btn {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-primary:hover {
    background: #A01830;
}

.btn-dark {
    background: var(--color-dark);
    color: var(--color-white);
}

.btn-dark:hover {
    background: #1A202C;
}

.btn-purple {
    background: var(--color-purple);
    color: var(--color-white);
}

.btn-purple:hover {
    background: #7C3AED;
}

.btn-secondary {
    background: var(--color-white);
    color: var(--color-text);
    border: 2px solid var(--color-border);
}

.btn-secondary:hover {
    border-color: var(--color-text-light);
    background: var(--color-bg);
}

.btn-validate {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 1.25rem;
}

.btn-validate:hover {
    background: #A01830;
}

.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}

.btn-outline:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.btn-retry {
    background: var(--color-white);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    margin-bottom: 1rem;
}

.btn-retry:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

/* ====== PÁGINA DE TEMAS ====== */
.back-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: var(--color-text-light);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.back-button:hover {
    color: var(--color-text);
}

.topics-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.topic-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.topic-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

/* ====== GRUPOS DE PREGUNTAS ====== */

.topic-chevron {
    color: var(--color-text-light);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.topic-card:hover .topic-chevron {
    color: var(--color-primary);
    transform: translateX(4px);
}

.groups-section-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-primary);
}

.group-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.group-card .topic-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.group-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-light);
}

.group-card-all {
    border-left: 4px solid var(--color-primary);
    background: rgba(196, 30, 58, 0.03);
}

.group-card-all:hover {
    background: rgba(196, 30, 58, 0.07);
}

.groups-separator {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.75rem 0;
    color: var(--color-text-light);
    font-size: 13px;
    font-weight: 500;
}

.groups-separator::before,
.groups-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

.groups-placeholder {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--color-text-light);
}

.groups-placeholder svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.groups-placeholder p {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.groups-placeholder span {
    font-size: 14px;
    line-height: 1.6;
}

.btn-sm {
    width: auto;
    padding: 0.5rem 1.25rem;
    font-size: 13px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ====== PÁGINA DE QUIZ ====== */
.quiz-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.back-button-small {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    color: var(--color-text-light);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.back-button-small:hover {
    color: var(--color-text);
}

.quiz-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    background: var(--color-white);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
}

.stat-correct {
    background: #DCFCE7;
    color: var(--color-success);
}

.stat-incorrect {
    background: #FED7D7;
    color: var(--color-error);
}

.btn-finish-small {
    background: none;
    border: 1px solid var(--color-primary);
    color: var(--color-primary);
    padding: 0.5rem 1rem;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-finish-small:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.topic-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.question-container {
    background: var(--color-white);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.btn-justification {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--color-primary);
    background: var(--color-white);
    color: var(--color-primary);
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
    z-index: 2;
}

.btn-justification:hover {
    background: var(--color-primary);
    color: var(--color-white);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(196, 30, 58, 0.3);
}

/* ====== MARQUESINA DE ADVERTENCIA (Q11/Q58) ====== */
.question-warning-marquee {
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #FFFBEB 0%, #FFF3E0 100%);
    border: 1px solid #FFB74D;
    border-left: 4px solid #FB8C00;
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.85rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
    gap: 0.6rem;
    animation: fadeIn 0.3s ease;
    box-shadow: 0 1px 4px rgba(251, 140, 0, 0.12);
}

.question-warning-marquee::before {
    content: '⚠';
    font-size: 15px;
    flex-shrink: 0;
    color: #E65100;
    line-height: 1;
}

.marquee-content {
    display: inline-block;
    white-space: nowrap;
    color: #BF360C;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.2px;
    padding-left: 100%;
    animation: marquee-scroll 18s linear infinite;
}

@keyframes marquee-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* ====== BOTÓN AYUDA (A) ====== */
.btn-help {
    position: absolute;
    top: 1rem;
    right: 3.5rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #A0AEC0;
    background: var(--color-white);
    color: #A0AEC0;
    font-size: 15px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    line-height: 1;
    z-index: 2;
}

@media (hover: hover) {
    .btn-help:hover {
        border-color: #48BB78;
        color: #48BB78;
        transform: scale(1.1);
        box-shadow: 0 2px 8px rgba(72, 187, 120, 0.25);
    }
}

.btn-help.active {
    background: #48BB78;
    border-color: #38A169;
    color: var(--color-white);
    box-shadow: 0 0 14px rgba(72, 187, 120, 0.5);
    transform: scale(1.05);
}

/* ====== EFECTOS AYUDA ====== */
/* Tachado con línea roja (fino para que se lea la palabra) */
.help-strikethrough {
    text-decoration: line-through;
    text-decoration-color: #E53E3E;
    text-decoration-thickness: 1px;
    color: #A0AEC0;
}

/* Fondo rojo tipo subrayado */
.help-highlight-red {
    background: rgba(229, 62, 62, 0.2);
    padding: 1px 4px;
    border-radius: 3px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* Fondo verde */
.help-highlight-green {
    background: rgba(72, 187, 120, 0.25);
    padding: 1px 4px;
    border-radius: 3px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* Fondo rojo + tachado combinado */
.help-highlight-red.help-strikethrough,
.help-red-strike {
    background: rgba(229, 62, 62, 0.2);
    text-decoration: line-through;
    text-decoration-color: #E53E3E;
    text-decoration-thickness: 1px;
    padding: 1px 4px;
    border-radius: 3px;
}

/* Subrayar palabra individual */
.help-underline-word {
    text-decoration: underline;
    text-decoration-color: var(--color-text);
    text-decoration-thickness: 2px;
    text-underline-offset: 2px;
}

/* Subrayar toda la opción */
.option.help-underline-option {
    border-left: 4px solid var(--color-success) !important;
    background: rgba(72, 187, 120, 0.06) !important;
}

.option.help-underline-option .option-text {
    text-decoration: underline;
    text-decoration-color: var(--color-success);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

/* Subrayar con tachado toda la opción */
.option.help-strikethrough-option {
    border-left: 4px solid #E53E3E !important;
    background: rgba(229, 62, 62, 0.04) !important;
}

.option.help-strikethrough-option .option-text {
    text-decoration: line-through;
    text-decoration-color: #E53E3E;
    text-decoration-thickness: 1px;
    color: #A0AEC0;
}

/* Marca de agua sobre la respuesta */
.option.help-has-watermark {
    position: relative;
    overflow: hidden;
}

.help-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 15px;
    font-weight: 900;
    color: rgba(229, 62, 62, 0.28);
    text-transform: uppercase;
    letter-spacing: 3px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1;
    user-select: none;
}

/* Texto añadido en rojo */
.help-added-text {
    color: #E53E3E;
    font-weight: 700;
    font-style: italic;
    font-size: 13px;
}

/* Efectos sobre el enunciado (question-text) */
.help-enunciado-enlarged {
    font-weight: 900;
    text-transform: uppercase;
    font-size: 1.15em;
}

.help-enunciado-highlight-green {
    background: rgba(72, 187, 120, 0.25);
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Justification Overlay */
.justification-overlay {
    margin-top: 1rem;
    animation: fadeIn 0.3s ease;
}

.justification-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    color: var(--color-text-light);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.justification-back:hover {
    color: var(--color-text);
}

.justification-card {
    background: var(--color-white);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.justification-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.justification-question {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-light);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.justification-text {
    font-size: 15px;
    font-weight: 400;
    color: var(--color-text);
    line-height: 1.7;
    white-space: pre-wrap;
}

.question-number {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.75rem;
}

.question-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--color-bg);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.3s ease;
}

.option:hover {
    border-color: var(--color-border);
    background: var(--color-white);
}

.option input[type="radio"] {
    margin-top: 0.25rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.option-letter {
    font-weight: 600;
    color: var(--color-text);
    min-width: 24px;
}

.option-text {
    flex: 1;
    font-size: 14px;
    color: var(--color-text);
    line-height: 1.5;
}

.option input[type="radio"]:checked+.option-letter {
    color: var(--color-primary);
}

.option:has(input[type="radio"]:checked) {
    border-color: var(--color-primary);
    background: rgba(196, 30, 58, 0.05);
}

/* Estados de respuesta */
.option.correct {
    border-color: var(--color-success) !important;
    background-color: #DCFCE7 !important;
}

.option.correct .option-letter,
.option.correct .option-text {
    color: #065F46 !important;
    font-weight: 700;
}

.option.incorrect {
    border-color: var(--color-error) !important;
    background-color: #FEE2E2 !important;
}

.option.incorrect .option-letter,
.option.incorrect .option-text {
    color: #991B1B !important;
}

.quiz-actions {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr;
    gap: 1rem;
}

/* ====== PÁGINA DE RESULTADOS ====== */
.results-card {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    border: 1px solid var(--color-border);
}

.results-header {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.final-score {
    font-size: 64px;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.score-label {
    font-size: 16px;
    color: var(--color-text-light);
    margin-bottom: 2.5rem;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.result-box {
    padding: 1.25rem;
    border-radius: var(--radius-md);
    text-align: center;
}

.result-correct {
    background: #DCFCE7;
}

.result-incorrect {
    background: #FED7D7;
}

.result-skipped {
    background: #E2E8F0;
}

.result-time {
    background: #BEE3F8;
}

.result-number {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.result-correct .result-number {
    color: var(--color-success);
}

.result-incorrect .result-number {
    color: var(--color-error);
}

.result-skipped .result-number {
    color: var(--color-text-light);
}

.result-time .result-number {
    color: #2C5282;
}

.result-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text);
}

/* ====== QUIZ LAYOUT & PALETTE ====== */
.quiz-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 2rem;
    align-items: start;
}

.quiz-main-content {
    min-width: 0;
}

.quiz-sidebar {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    position: sticky;
    top: 2rem;
    max-height: calc(100vh - 8rem);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overscroll-behavior: contain;
}

.palette-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.question-palette {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.5rem;
    overflow-y: auto;
    overscroll-behavior: contain;
    min-height: 0;
    flex: 1;
    padding-bottom: 0.25rem;
}

.palette-item {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-light);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.palette-item:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: var(--color-white);
    transform: translateY(-1px);
}

.palette-item.active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: var(--color-white);
    box-shadow: 0 0 0 2px rgba(196, 30, 58, 0.2);
}

.palette-item.answered {
    background: #E2E8F0;
    color: var(--color-text);
    border-color: #CBD5E0;
}

.palette-item.correct {
    background: #DCFCE7;
    color: #047857;
    border-color: #86EFAC;
}

.palette-item.incorrect {
    background: #FEE2E2;
    color: #B91C1C;
    border-color: #FCA5A5;
}

.palette-item.skipped {
    background: #FFFAF0;
    color: #DD6B20;
    border-color: #FBD38D;
}

/* ====== MODO EXAMEN: Estilos especiales ====== */

/* Paleta: celda respondida en modo examen (color neutro, sin revelar correcto/incorrecto) */
.palette-item.exam-answered {
    background: #DBEAFE;
    color: #1E40AF;
    border-color: #93C5FD;
}

/* Opción seleccionada en modo examen (marca visual sutil sin revelar resultado) */
.exam-mode .option:has(input[type="radio"]:checked) {
    border-color: #93C5FD !important;
    background-color: #EFF6FF !important;
}

.exam-mode .option:has(input[type="radio"]:checked) .option-letter {
    color: #1E40AF !important;
    font-weight: 700;
}

/* Opción errónea del usuario al repetir falladas de examen (fondo amarillo suave) */
.option.exam-user-wrong {
    border-color: #F59E0B !important;
    background-color: #FEF3C7 !important;
    position: relative;
}

.option.exam-user-wrong::after {
    content: 'Tu respuesta';
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 10px;
    font-weight: 700;
    color: #92400E;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.option.exam-user-wrong .option-letter,
.option.exam-user-wrong .option-text {
    color: #92400E !important;
}

/* Dark mode overrides para modo examen */
[data-theme="dark"] .palette-item.exam-answered {
    background: rgba(59, 130, 246, 0.2);
    color: #93C5FD;
    border-color: rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .exam-mode .option:has(input[type="radio"]:checked) {
    border-color: rgba(59, 130, 246, 0.5) !important;
    background-color: rgba(59, 130, 246, 0.1) !important;
}

[data-theme="dark"] .exam-mode .option:has(input[type="radio"]:checked) .option-letter {
    color: #93C5FD !important;
}

[data-theme="dark"] .option.exam-user-wrong {
    border-color: #D97706 !important;
    background-color: rgba(245, 158, 11, 0.15) !important;
}

[data-theme="dark"] .option.exam-user-wrong::after {
    color: #FBBF24;
}

[data-theme="dark"] .option.exam-user-wrong .option-letter,
[data-theme="dark"] .option.exam-user-wrong .option-text {
    color: #FCD34D !important;
}

/* ====== BOTÓN ESTADÍSTICAS MENÚ ====== */
.btn-stats {
    background: #e2e8f0;
    color: var(--color-purple);
    border: 2px solid var(--color-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

#btn-biblioteca {
    text-transform: none !important;
    letter-spacing: normal !important;
    color: var(--color-text);
}

[data-theme="dark"] #btn-biblioteca {
    color: #FFFFFF;
}

.btn-stats:hover {
    background: var(--color-purple);
    color: var(--color-white);
}

.btn-stats svg {
    flex-shrink: 0;
}

/* ====== PÁGINA DE ESTADÍSTICAS ====== */
.stats-page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.stats-page-subtitle {
    font-size: 14px;
    color: var(--color-text-light);
    margin-bottom: 2rem;
}

.stats-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.stats-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stats-card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stats-avg-card .stats-card-icon {
    background: #BEE3F8;
    color: #2C5282;
}

.stats-tests-card .stats-card-icon {
    background: #DCFCE7;
    color: #047857;
}

.stats-card-content {
    flex: 1;
}

.stats-card-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-light);
    margin-bottom: 0.25rem;
}

.stats-card-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.1;
}

.stats-avg-card .stats-card-value {
    color: #2C5282;
}

.stats-tests-card .stats-card-value {
    color: #047857;
}

.stats-top-section {
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

.stats-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary);
}

.stats-top-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.stats-item {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.stats-item:hover {
    border-color: var(--color-error);
    box-shadow: var(--shadow-sm);
}

.stats-item-rank {
    font-size: 20px;
    font-weight: 800;
    color: var(--color-primary);
    min-width: 32px;
    text-align: center;
}

.stats-item-info {
    flex: 1;
    min-width: 0;
}

.stats-item-question {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.15rem;
}

.stats-item-preview {
    font-size: 12px;
    color: var(--color-text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats-item-badge {
    background: #FED7D7;
    color: #C53030;
    font-size: 12px;
    font-weight: 700;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.stats-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--color-text-light);
    font-size: 15px;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    border: 1px dashed var(--color-border);
}

.btn-reset {
    background: var(--color-white);
    color: var(--color-error);
    border: 2px solid var(--color-error);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.btn-reset:hover {
    background: var(--color-error);
    color: var(--color-white);
}

/* ====== RESPONSIVE ====== */
@media (max-width: 900px) {
    .quiz-layout {
        grid-template-columns: 1fr;
    }

    .quiz-sidebar {
        order: 2;
        /* Put sidebar below on mobile/tablet */
        position: static;
        max-height: none;
        overscroll-behavior: auto;
    }

    .question-palette {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
        overflow-y: visible;
        max-height: none;
        overscroll-behavior: auto;
    }
}

@media (max-width: 640px) {
    .page {
        padding: 1rem 0.5rem;
    }

    .container {
        padding: 0 0.5rem;
    }

    #main-menu .container {
        padding-top: 4vh;
    }

    .main-title {
        font-size: 24px;
    }

    .logo-square {
        width: 70px;
        height: 70px;
    }

    .logo-square span {
        font-size: 36px;
    }

    .quiz-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .quiz-stats {
        flex-wrap: wrap;
        justify-content: space-between;
        background: white;
        padding: 0.5rem;
        border-radius: var(--radius-sm);
        border: 1px solid var(--color-border);
    }

    .stat-item {
        flex-grow: 1;
        justify-content: center;
        border: none;
        box-shadow: none;
        padding: 0.25rem;
        font-size: 13px;
    }

    .question-container {
        padding: 1.25rem;
    }

    .quiz-actions {
        grid-template-columns: 1fr;
    }

    .btn-secondary {
        order: 2;
    }

    .final-score {
        font-size: 56px;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }
}

/* ====== ANIMACIONES ====== */
.page.active {
    animation: fadeIn 0.3s ease;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.option.correct,
.option.incorrect {
    animation: pulse 0.5s ease;
}

@keyframes questionFade {
    from {
        opacity: 0.4;
    }

    to {
        opacity: 1;
    }
}

/* ====== RATING SYSTEM ====== */
.rating-section {
    text-align: center;
    margin-top: 1rem;
    padding-top: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stars-container {
    display: inline-flex;
    flex-direction: row;
    gap: 0.3rem;
    cursor: pointer;
}

.star {
    font-size: 28px;
    color: #cbd5e0;
    transition: color 0.2s ease, transform 0.2s ease;
}

.star.hovered,
.star.selected {
    color: #a0a5aa;
    transform: scale(1.1);
    text-shadow: 0px 1px 2px rgba(0,0,0,0.2);
}

[data-theme="dark"] .star {
    color: #4a5568;
}

[data-theme="dark"] .star.hovered,
[data-theme="dark"] .star.selected {
    color: #e2e8f0;
    text-shadow: 0px 1px 3px rgba(255,255,255,0.3);
}

/* ====== FOOTER ====== */
.app-footer {
    text-align: center;
    font-size: 0.75rem;
    color: #6b7280;
    padding: 1.5rem 0 1rem;
    margin-top: 1rem;
}

.app-footer p + p {
    margin-top: 0.25rem;
}

/* ====== CUSTOM ALERT OVERLAY ====== */
.custom-alert-overlay {
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    border-radius: var(--radius-lg);
}

.custom-alert-content {
    margin: auto;
    max-width: 90%;
    width: 400px;
    padding: 2rem;
    border-radius: 1rem;
    text-align: center;
}

.custom-alert-text {
    font-size: 1.15rem;
    margin-bottom: 2rem;
}

.update-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(196, 30, 58, 0.2);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ====== ADMIN PANEL ====== */
.admin-login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99998;
    padding: 1rem;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(4px);
}

.admin-login-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 380px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.admin-login-icon {
    font-size: 48px;
    margin-bottom: 1rem;
}

.admin-login-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.admin-login-subtitle {
    font-size: 14px;
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
}

.admin-login-input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 16px;
    text-align: center;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.admin-login-input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.admin-login-error {
    color: var(--color-error);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: none;
}

.admin-login-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Admin page */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.admin-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
}

.admin-badge {
    background: var(--color-primary);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-section {
    margin-bottom: 2rem;
}

.admin-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-profile-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.admin-profile-card:hover {
    box-shadow: var(--shadow-sm);
}

.admin-profile-card.disabled {
    opacity: 0.5;
    background: #F7FAFC;
}

.admin-profile-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.admin-profile-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
}

.admin-profile-desc {
    font-size: 12px;
    color: var(--color-text-light);
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #CBD5E0;
    border-radius: 26px;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--color-success);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

/* Admin password row (input + delete button) */
.admin-pass-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-delete-pass {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
}

.btn-delete-pass:hover {
    background: #FFF5F5;
    border-color: #FC8181;
}

[data-theme="dark"] .btn-delete-pass {
    border-color: #4A5568;
}

[data-theme="dark"] .btn-delete-pass:hover {
    background: rgba(245, 101, 101, 0.15);
    border-color: #FC8181;
}

/* Admin Tabs */
.admin-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 1.5rem;
    background: var(--color-bg, #F7FAFC);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid var(--color-border);
}

.admin-tab {
    flex: 1;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    color: var(--color-text-light);
    font-family: inherit;
}

.admin-tab.active {
    background: var(--color-white);
    color: var(--color-text);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.admin-tab:hover:not(.active) {
    color: var(--color-text);
}

@media (max-width: 640px) {
    .admin-tabs {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .admin-tab {
        padding: 9px 8px;
        font-size: 13px;
        text-align: center;
        justify-content: center;
    }
    .admin-tab:last-child:nth-child(odd) {
        grid-column: span 2;
    }
}

/* ====== PUSH NOTIFICATIONS BANNER ====== */
.push-notification-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 440px;
    background: var(--color-white);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 99990;
    padding: 1rem;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate(-50%, 30px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.push-banner-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.push-banner-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.push-banner-icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
}

.push-banner-text strong {
    display: block;
    font-size: 14px;
    color: var(--color-text);
    margin-bottom: 2px;
}

.push-banner-text p {
    font-size: 12px;
    color: var(--color-text-light);
    margin: 0;
    line-height: 1.35;
}

.push-banner-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
    justify-content: flex-end;
}

.push-banner-actions .btn {
    padding: 6px 14px;
    font-size: 13px;
}

/* Push Admin Panel UI */
.push-admin-stats-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: var(--color-card-bg, #FFFFFF);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.push-stat-icon {
    font-size: 32px;
    line-height: 1;
}

.push-stat-info {
    flex: 1;
}

.push-stat-number {
    font-size: 24px;
    font-weight: 800;
    color: var(--color-primary);
}

.push-stat-label {
    font-size: 13px;
    color: var(--color-text-light);
}

.push-compose-card {
    background: var(--color-card-bg, #FFFFFF);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.push-send-status {
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
}

.push-send-status.success {
    background: rgba(72, 187, 120, 0.15);
    color: #2F855A;
    border: 1px solid #48BB78;
}

.push-send-status.error {
    background: rgba(245, 101, 101, 0.15);
    color: #C53030;
    border: 1px solid #FC8181;
}

[data-theme="dark"] .push-notification-banner {
    background: #1A202C;
    border-color: #E53E3E;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

[data-theme="dark"] .push-admin-stats-card,
[data-theme="dark"] .push-compose-card {
    background: #1A202C;
    border-color: #4A5568;
}

[data-theme="dark"] .admin-tabs {
    background: #1A202C;
    border-color: #4A5568;
}

[data-theme="dark"] .admin-tab.active {
    background: #2D3748;
    color: #F7FAFC;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* Access denied overlay */
.access-denied-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99997;
    padding: 1rem;
    backdrop-filter: blur(6px);
}

.access-denied-card {
    background: var(--color-white);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    text-align: center;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.access-denied-icon {
    font-size: 56px;
    margin-bottom: 1rem;
}

.access-denied-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.access-denied-text {
    font-size: 14px;
    color: var(--color-text-light);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.access-denied-btn {
    padding: 0.85rem 1.5rem;
    font-size: 14px;
}
/* ====== PERFILES EN CASCADA (BILBAO) ====== */
.bilbao-profiles-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.profiles-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.profile-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.profile-input-box {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--color-white);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.profile-input-box:hover {
    border-color: #CBD5E0;
}
.profile-input-box.active {
    border-color: var(--color-primary);
    background: rgba(196, 30, 58, 0.03);
    box-shadow: 0 0 0 1px var(--color-primary);
}
.profile-radio {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 2px solid var(--color-border);
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    font-weight: bold;
    flex-shrink: 0;
    transition: all 0.2s ease;
}
.profile-input-box.active .profile-radio {
    background: var(--color-primary);
    border-color: var(--color-primary);
}
.profile-name-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: inherit;
    font-size: 16px;
    color: var(--color-text);
    outline: none;
    cursor: text;
}
.profile-name-input::placeholder {
    color: #A0AEC0;
}
.btn-delete-profile {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: transparent;
    border: 2px solid var(--color-border);
    color: var(--color-text-light);
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-delete-profile:hover {
    border-color: var(--color-error);
    color: var(--color-error);
    background: #FFF5F5;
}
.add-profile-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: transparent;
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.5rem 0.5rem 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.add-profile-box:hover {
    border-color: var(--color-primary);
    background: rgba(196, 30, 58, 0.02);
}
.add-profile-box .add-text {
    font-size: 16px;
    color: var(--color-text-light);
    font-weight: 500;
}
.btn-icon-add {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-md);
    background: var(--color-dark);
    color: var(--color-white);
    border: none;
    font-size: 20px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s;
}
.btn-icon-add:hover {
    background: var(--color-primary);
}

/* App Version Display */
.app-version-display {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 10px;
    color: var(--color-text-light);
    opacity: 0.5;
    font-weight: 500;
    user-select: none;
    pointer-events: none;
}

/* ====== DARK MODE ====== */
[data-theme="dark"] {
    --color-bg: #1A202C;
    --color-white: #2D3748;
    --color-text: #F7FAFC;
    --color-text-light: #A0AEC0;
    --color-border: #4A5568;
    --color-dark: #E2E8F0;
    --color-primary: #C41E3A;
}

/* Botones en dark mode: sin relleno, texto blanco */
[data-theme="dark"] .btn-primary, 
[data-theme="dark"] .btn-validate {
    background: transparent;
    color: #FFFFFF;
    border: 2px solid var(--color-primary);
    box-shadow: none;
}

[data-theme="dark"] .btn-primary:hover, 
[data-theme="dark"] .btn-validate:hover {
    background: var(--color-primary);
    color: #FFFFFF;
    transform: translateY(-2px);
}

[data-theme="dark"] .btn-purple {
    background: transparent;
    color: #FFFFFF;
    border: 2px solid var(--color-purple);
}

[data-theme="dark"] .btn-purple:hover {
    background: var(--color-purple);
    color: #FFFFFF;
}

[data-theme="dark"] .btn-stats {
    background: transparent;
    color: #FFFFFF;
    border: 2px solid var(--color-purple);
}

[data-theme="dark"] .btn-stats:hover {
    background: var(--color-purple);
    color: #FFFFFF;
}

[data-theme="dark"] .btn-outline {
    background: transparent;
    color: #FFFFFF;
    border: 2px solid var(--color-primary);
}

[data-theme="dark"] .btn-outline:hover {
    background: var(--color-primary);
    color: #FFFFFF;
}

[data-theme="dark"] .logo-square {
    background: var(--color-primary);
    box-shadow: none;
}

[data-theme="dark"] .logo-text {
    color: #FFFFFF;
}

[data-theme="dark"] .logo-bg {
    color: rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .option.selected {
    background: transparent !important;
    border-color: var(--color-primary) !important;
}

[data-theme="dark"] .btn-justification {
    background: transparent;
    color: #FFFFFF;
    border-color: var(--color-primary);
}

[data-theme="dark"] .btn-justification:hover {
    background: var(--color-primary);
    color: #FFFFFF;
}

[data-theme="dark"] .btn-dark {
    background: transparent;
    color: #FFFFFF;
    border: 2px solid #E2E8F0;
}

[data-theme="dark"] .btn-dark:hover {
    background: #E2E8F0;
    color: #1A202C;
}

[data-theme="dark"] .conditional-group {
    background: #2D3748;
}

[data-theme="dark"] .topic-check-item,
[data-theme="dark"] .stat-item,
[data-theme="dark"] .topic-card,
[data-theme="dark"] .biblio-item {
    background: #2D3748;
    border-color: #4A5568;
}

[data-theme="dark"] .topic-check-item:hover,
[data-theme="dark"] .topic-card:hover,
[data-theme="dark"] .biblio-item:hover {
    background: #4A5568;
}

[data-theme="dark"] .form-control {
    background: #1A202C;
    color: #F7FAFC;
    border-color: #4A5568;
}

[data-theme="dark"] .quiz-stats .stat-correct {
    background: transparent;
    color: #68D391;
    border-color: rgba(72, 187, 120, 0.3);
}

[data-theme="dark"] .quiz-stats .stat-incorrect {
    background: transparent;
    color: #FC8181;
    border-color: rgba(245, 101, 101, 0.3);
}

[data-theme="dark"] .option.help-strikethrough-option {
    background: rgba(245, 101, 101, 0.1) !important;
}

[data-theme="dark"] .option.help-underline-option {
    background: rgba(72, 187, 120, 0.1) !important;
}

[data-theme="dark"] .groups-separator::before,
[data-theme="dark"] .groups-separator::after {
    background: #4A5568;
}

[data-theme="dark"] .btn-secondary {
    background: transparent;
    color: #FFFFFF;
    border-color: #4A5568;
}

[data-theme="dark"] .btn-secondary:hover {
    background: #4A5568;
    color: #FFFFFF;
}

/* ====== SECCIÓN AJUSTES (engranaje) ====== */
.settings-section {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
    gap: 5px;
}

.btn-settings-gear {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: var(--color-white);
    color: var(--color-text-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
}

.btn-settings-gear:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    transform: rotate(45deg);
}

.btn-settings-gear.active {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(196, 30, 58, 0.05);
    transform: rotate(45deg);
}

[data-theme="dark"] .btn-settings-gear {
    border-color: #4A5568;
    color: #A0AEC0;
}

[data-theme="dark"] .btn-settings-gear:hover,
[data-theme="dark"] .btn-settings-gear.active {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background: rgba(252, 129, 129, 0.1);
}

.settings-panel {
    width: 100%;
    max-width: 400px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    animation: fadeIn 0.3s ease;
}

.settings-panel-header {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-panel-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 0.75rem;
}

.settings-label-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text);
    font-size: 15px;
    font-weight: 500;
}

.settings-label-group svg {
    color: var(--color-text-light);
}

.settings-reset-btn {
    margin-top: 0.5rem;
    font-size: 13px;
    padding: 0.75rem 1rem;
}

[data-theme="dark"] .settings-panel-row {
    border-bottom-color: rgba(255,255,255,0.05);
}

/* MARCOS NEGRO PURO EN MODO OSCURO */
[data-theme="dark"] .btn-primary, 
[data-theme="dark"] .btn-validate,
[data-theme="dark"] .btn-purple,
[data-theme="dark"] .btn-stats,
[data-theme="dark"] .btn-outline,
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .question-container,
[data-theme="dark"] .quiz-sidebar {
    border: 2px solid #000000 !important;
}

/* Correcciones Dark Mode: fondo intermedio, texto gris y marco negro para TODOS LOS TEMAS */
[data-theme="dark"] .btn-dark,
[data-theme="dark"] .btn-primary, 
[data-theme="dark"] .btn-validate,
[data-theme="dark"] .btn-purple,
[data-theme="dark"] .btn-stats,
[data-theme="dark"] .btn-outline,
[data-theme="dark"] .btn-secondary,
[data-theme="dark"] .btn-challenge {
    border: 2px solid #000000 !important;
    background: #0A0D14 !important;
    color: #A0AEC0 !important;
}

[data-theme="dark"] .question-container,
[data-theme="dark"] .quiz-sidebar {
    background: #0A0D14 !important;
}

/* ====== AVISO LEGAL (DISCLAIMER) ====== */
.disclaimer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999; /* Highest priority */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.disclaimer-content {
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border: 3px solid var(--color-primary);
}

.disclaimer-icon {
    font-size: 48px;
    margin-bottom: 1rem;
    line-height: 1;
}

.disclaimer-content h2 {
    color: var(--color-primary);
    margin-bottom: 1.5rem;
    font-size: 24px;
    font-weight: 900;
}

.disclaimer-content p {
    color: var(--color-text);
    margin-bottom: 1rem;
    line-height: 1.6;
    font-size: 15px;
    text-align: left;
}

.disclaimer-content p strong {
    color: var(--color-primary);
}

.disclaimer-content .btn {
    width: 100%;
    margin-top: 1.5rem;
    font-size: 16px;
    padding: 1rem;
}

[data-theme="dark"] .disclaimer-content {
    background: #0A0D14;
    border-color: #000000;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .disclaimer-content p {
    color: #A0AEC0;
}

[data-theme="dark"] .disclaimer-content p strong {
    color: var(--color-primary);
}

/* ===== BIBLIOTECA ===== */

.biblio-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 40px;
    border: none;
    overflow: visible;
}
.biblio-tab {
    flex: none;
    padding: 10px 24px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f3f4f6;
    color: var(--color-text);
}
.biblio-tab.active {
    background: var(--color-text);
    color: #fff;
}
/* Dark mode chips */
[data-theme="dark"] .biblio-tab {
    background: #272727;
    color: #f1f1f1;
}
[data-theme="dark"] .biblio-tab.active {
    background: #f1f1f1;
    color: #0f0f0f;
}
.biblio-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.biblio-item {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-text, #1f2937);
}
.biblio-item:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.biblio-item:active { transform: scale(0.98); }

.biblio-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.biblio-item-icon.podcast { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; }
.biblio-item-icon.pdf { background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff; }

.biblio-item-info { flex: 1; min-width: 0; }
.biblio-item-title {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
    word-break: break-word;
}
.biblio-item-meta {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 3px;
}
.biblio-item-arrow {
    opacity: 0.4;
    flex-shrink: 0;
}

/* Audio player inline */
.biblio-audio-player {
    width: 100%;
    margin-top: 10px;
    border-radius: 8px;
}

/* ===== BIBLIOTECA (YOUTUBE STYLE PARA PODCASTS) ===== */
.biblio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.biblio-card {
    display: flex;
    flex-direction: column;
    background: transparent;
    cursor: pointer;
    transition: transform 0.2s;
}

.biblio-card:hover {
    transform: translateY(-2px);
}

.biblio-card-thumbnail {
    width: 100%;
    height: 180px;
    background: #1a1e29;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.biblio-card-player-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40px;
}
.biblio-card-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    backdrop-filter: blur(4px);
    z-index: 1;
    transition: background 0.2s, transform 0.2s;
}

.biblio-card:hover .biblio-card-icon {
    background: var(--color-primary, #C41E3A);
    transform: scale(1.1);
}

.biblio-card-info {
    margin-top: 10px;
    padding: 0 4px;
}

.biblio-card-title {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    color: var(--color-text, #1f2937);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

[data-theme="dark"] .biblio-card-title {
    color: #e5e7eb;
}

.biblio-card-meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
}

[data-theme="dark"] .biblio-card-meta {
    color: #9ca3af;
}

/* Reproductor de audio bajo la tarjeta */
.biblio-card-player-container {
    margin-top: 10px;
    width: 100%;
}

.biblio-card-player {
    width: 100%;
    border-radius: 8px;
    height: 40px;
}

/* ====== MODO RETO STYLES ====== */

/* Botón MODO RETO */
.btn-challenge {
    background: #ffffff;
    color: #b8860b;
    border: 2px solid #daa520;
    box-shadow: 0 2px 8px rgba(218, 165, 32, 0.15);
    font-weight: 700;
}

.btn-challenge:hover {
    background: #fdf6e3;
    color: #996515;
    border-color: #b8860b;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(218, 165, 32, 0.3);
}

/* Grid del Lobby */
.lobby-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .lobby-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.lobby-card-box {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .lobby-card-box {
    background: #1e1e2f;
    border-color: #2d2d44;
}

.lobby-sub-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-primary);
}

/* Listado de opositores */
.lobby-users-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.lobby-user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

[data-theme="dark"] .lobby-user-row {
    background: #252538;
    border-color: #33334d;
}

.lobby-user-row:hover {
    border-color: #8b5cf6;
    box-shadow: var(--shadow-sm);
}

.lobby-user-name {
    font-weight: 600;
    font-size: 15px;
}

.lobby-loading, .lobby-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-light);
    font-size: 14px;
}

/* Pestañas de Rankings */
.ranking-scope-tabs, .ranking-metric-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ranking-scope-tabs {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.5rem;
}

[data-theme="dark"] .ranking-scope-tabs {
    border-color: #2d2d44;
}

.scope-tab, .metric-tab {
    background: none;
    border: none;
    padding: 0.4rem 0.8rem;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    color: var(--color-text-light);
    transition: all 0.2s ease;
}

.scope-tab.active {
    background: var(--color-primary);
    color: var(--color-white);
}

.metric-tab {
    border: 1px solid var(--color-border);
}

[data-theme="dark"] .metric-tab {
    border-color: #33334d;
}

.metric-tab.active {
    background: #8b5cf6;
    color: #ffffff;
    border-color: #8b5cf6;
}

/* Lista de Clasificación */
.lobby-rankings-board {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 280px;
    overflow-y: auto;
}

.ranking-row {
    display: flex;
    align-items: center;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    padding: 0.55rem 0.85rem;
    font-size: 14px;
}

[data-theme="dark"] .ranking-row {
    background: #252538;
}

.ranking-position {
    font-weight: 700;
    width: 30px;
    color: #8b5cf6;
}

.ranking-name {
    flex: 1;
    font-weight: 600;
}

.ranking-value {
    font-weight: 700;
    color: var(--color-text);
}

/* JUEGO RETO - PANTALLA DIVIDIDA */
.game-container-wide {
    max-width: 1200px;
    margin: 0 auto;
}

.lobby-status-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.25rem 0.6rem;
    border-radius: 50px;
    letter-spacing: 0.5px;
}
.lobby-status-badge.status-offline {
    background: rgba(245, 101, 101, 0.1);
    color: var(--color-error);
    border: 1px solid rgba(245, 101, 101, 0.3);
}
.lobby-status-badge.status-online {
    background: rgba(72, 187, 120, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.challenge-question-card {
    background: var(--color-white);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .challenge-question-card {
    background: #1e1e2f;
    border-color: var(--color-primary);
}

.challenge-game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.75rem 1.25rem;
    margin-bottom: 1.5rem;
}

[data-theme="dark"] .challenge-game-header {
    background: #1e1e2f;
    border-color: #2d2d44;
}

.challenge-timer-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 600px;
}

.challenge-timer-track {
    flex: 1;
    height: 10px;
    background: var(--color-border);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

[data-theme="dark"] .challenge-timer-track {
    background: #33334d;
}

.challenge-timer-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #8b5cf6 0%, #6366f1 100%);
    border-radius: 5px;
    transition: width 0.2s linear;
}

#challenge-timer-text {
    font-weight: 700;
    font-size: 14px;
    min-width: 30px;
}

.split-game-layout {
    display: flex;
    gap: 1.5rem;
}

@media (max-width: 992px) {
    .split-game-layout {
        flex-direction: column;
        gap: 1.25rem;
    }
}

.game-panel {
    flex: 1;
    background: var(--color-white);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
}

[data-theme="dark"] .game-panel {
    background: #1e1e2f;
    border-color: #2d2d44;
}

.player-self-panel {
    border-left: 5px solid #8b5cf6;
}

.player-rival-panel {
    border-left: 5px solid #ed8936;
}

.game-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

[data-theme="dark"] .game-panel-header {
    border-color: #2d2d44;
}

.game-panel-header .player-name {
    font-weight: 700;
    font-size: 16px;
    text-transform: uppercase;
}

.game-panel-header .player-score {
    font-weight: 600;
    font-size: 14px;
    background: var(--color-bg);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
}

[data-theme="dark"] .game-panel-header .player-score {
    background: #252538;
}

.challenge-question-text {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.challenge-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Panel Rival — Opciones Espejadas */
.rival-options-mirror {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    pointer-events: none;
    user-select: none;
}

.rival-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0.7rem 1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    font-size: 14px;
    line-height: 1.4;
    transition: all 0.35s ease;
    opacity: 0.7;
}

[data-theme="dark"] .rival-option {
    background: #1a1a2e;
    border-color: #2d2d44;
    color: #A0AEC0;
}

.rival-option .rival-option-letter {
    font-weight: 700;
    min-width: 22px;
    color: var(--color-text-light);
}

.rival-option-selected {
    border-color: #ed8936 !important;
    background: rgba(237, 137, 54, 0.08) !important;
    opacity: 1;
    box-shadow: 0 0 0 1px rgba(237, 137, 54, 0.3);
    animation: rivalPulse 0.4s ease;
}

.rival-option-selected .rival-option-letter {
    color: #ed8936 !important;
}

[data-theme="dark"] .rival-option-selected {
    background: rgba(237, 137, 54, 0.12) !important;
}

.rival-option.correct {
    border-color: var(--color-success) !important;
    background: rgba(72, 187, 120, 0.12) !important;
    opacity: 1;
}

.rival-option.correct .rival-option-letter {
    color: var(--color-success) !important;
}

.rival-option.incorrect {
    border-color: var(--color-error) !important;
    background: rgba(245, 101, 101, 0.12) !important;
    opacity: 1;
}

.rival-option.incorrect .rival-option-letter {
    color: var(--color-error) !important;
}

.rival-status-text {
    text-align: center;
    padding: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-light);
    margin-top: 0.5rem;
}

@keyframes rivalPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.015); }
    100% { transform: scale(1); }
}

/* Mensaje flotante de ronda */
.challenge-round-message {
    background: var(--color-dark);
    color: var(--color-white);
    text-align: center;
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    margin-top: 1rem;
    animation: fadeIn 0.2s ease;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.spinner-loader {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(139, 92, 246, 0.15);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

/* Optimización móvil para MODO RETO (Pantalla Dividida) */
@media (max-width: 992px) {
    #challenge-game-page {
        padding: 0.5rem 0.5rem;
    }
    
    .challenge-game-header {
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.75rem;
        gap: 0.75rem;
        border-radius: var(--radius-sm);
    }
    
    .challenge-timer-container {
        font-size: 13px;
    }
    
    .split-game-layout {
        gap: 0.75rem;
        flex-direction: column;
    }
    
    .game-panel {
        padding: 1rem;
        border-radius: var(--radius-md);
    }
    
    .challenge-question-container {
        min-height: auto;
    }
    
    .challenge-question-text {
        font-size: 15px;
        margin-bottom: 1rem;
    }
    
    .challenge-options {
        gap: 0.5rem;
    }
    
    #challenge-options .option {
        padding: 0.6rem 0.8rem;
        font-size: 14px;
        min-height: auto;
    }
    
    .rival-options-mirror {
        gap: 0.4rem;
    }
    
    .rival-option {
        padding: 0.5rem 0.7rem;
        font-size: 13px;
    }
    
    .rival-status-text {
        font-size: 12px;
    }
}
