:root {
    --color-primario: #234f9e;
    --color-secundario: #e23c1b;
    --color-blanco: #fff;
    --color-negro: #111;
    --glass-surface: rgba(17, 17, 17, 0.55);
    --glass-outline: rgba(255, 255, 255, 0.08);
    --app-header-offset: 120px;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--app-header-offset) + 12px);
}

.section-container {
    scroll-margin-top: calc(var(--app-header-offset) + 12px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: radial-gradient(circle at top, rgba(35, 79, 158, 0.8) 0%, rgba(17, 17, 17, 0.95) 55%, #000 100%);
    color: var(--color-blanco);
    line-height: 1.6;
    min-height: 100dvh;
    padding: 0 18px 140px;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
    line-height: 0;
        radial-gradient(110% 110% at 15% 110%, rgba(35, 79, 158, 0.25) 0%, transparent 65%);
    pointer-events: none;
    z-index: -1;
}

.hidden {
    display: none !important;
}

.app-shell {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0 auto;
    padding: 0 24px;
}


.app-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: 64px 1fr 64px;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    border-radius: 20px;
    background: var(--glass-surface);
    border: 1px solid var(--glass-outline);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.32);
    backdrop-filter: blur(18px);
}

.header-start {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
}

.header-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.user-profile {
    justify-self: center;
    width: 46px;
    height: 46px;
    border-radius: 15px;
    border: 1px solid var(--glass-outline);
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-blanco);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.user-profile:hover,
.user-profile:focus-visible {
    transform: translateY(-1px);
    background: rgba(35, 79, 158, 0.22);
    border-color: rgba(35, 79, 158, 0.45);
    outline: 2px solid var(--color-secundario);
    outline-offset: 4px;
}

.logo-button {
    background: transparent;
    border: none;
    color: var(--color-blanco);
    font: inherit;
    padding: 0;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
}

.logo-button:hover,
.logo-button:focus-visible {
    color: rgba(255, 255, 255, 0.85);
    transform: translateY(-1px);
}

.logo-button:focus-visible {
    outline: 2px solid var(--color-secundario);
    outline-offset: 4px;
}

.audio-controls img {
    width: 20px;
    height: 20px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.section-titles {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.section-description {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.section-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.back-button {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    border: 1px solid var(--glass-outline);
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-blanco);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    padding: 0;
}

.back-button:hover {
    transform: translateY(-1px);
    background: rgba(226, 60, 27, 0.25);
    border-color: rgba(226, 60, 27, 0.45);
}

.back-button--global {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}

.back-button--global.is-active {
    opacity: 1;
    cursor: pointer;
    pointer-events: auto;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(35, 79, 158, 0.32), rgba(35, 79, 158, 0.08));
    border: 1px solid rgba(35, 79, 158, 0.35);
    color: var(--color-blanco);
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at 20% 20%, rgba(226, 60, 27, 0.25), transparent 60%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.card:hover,
.card:focus {
    transform: translateY(-4px);
    border-color: rgba(226, 60, 27, 0.4);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35);
}

.card:hover::before,
.card:focus::before {
    opacity: 1;
}

.card:focus-visible {
    outline: 2px solid var(--color-secundario);
    outline-offset: 4px;
}

.card h3 {
    font-size: 1.1rem;
    color: var(--color-blanco);
}

.shortcuts-panel {
    margin-bottom: 14px;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shortcuts-header {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
}

.shortcuts-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.shortcut-card {
    padding: 8px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(35, 79, 158, 0.2);
    color: var(--color-blanco);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.shortcut-card:hover,
.shortcut-card:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(35, 79, 158, 0.55);
    background: rgba(35, 79, 158, 0.32);
}

.content-container {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 8px 12px;
    max-height: none;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-primario) transparent;
}

.content-container::-webkit-scrollbar {
    width: 6px;
}

.content-container::-webkit-scrollbar-thumb {
    background: var(--color-primario);
    border-radius: 999px;
}

.article-content p {
    margin-bottom: 14px;
    color: var(--color-blanco);
}

.content-list {
    list-style: disc;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--color-blanco);
}

.content-list a {
    color: var(--color-primario);
    text-decoration: none;
    font-weight: 600;
}

.content-list a:hover,
.content-list a:focus-visible {
    text-decoration: underline;
}

.podcast-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.presentacion-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.infografia-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.presentacion-card {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    scroll-margin-top: calc(var(--app-header-offset) + 16px);
}

.presentacion-card.is-active {
    border-color: rgba(255, 215, 0, 0.65);
    box-shadow: 0 10px 22px rgba(255, 215, 0, 0.18);
}

.presentacion-header h3 {
    font-size: 1.05rem;
}

.presentacion-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.presentacion-meta__item {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.presentacion-description {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 6px;
}

.presentacion-embed {
    width: 100%;
    min-height: 320px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
}

.presentacion-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.presentacion-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 12px;
    background: rgba(35, 79, 158, 0.85);
    color: var(--color-blanco);
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
}

.presentacion-link:hover,
.presentacion-link:focus-visible {
    background: rgba(35, 79, 158, 1);
}

.presentacion-warning {
    color: var(--color-secundario);
    font-size: 0.95rem;
}

.infografia-card {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    scroll-margin-top: calc(var(--app-header-offset) + 16px);
}

.infografia-card.is-active {
    border-color: rgba(255, 215, 0, 0.65);
    box-shadow: 0 10px 22px rgba(255, 215, 0, 0.18);
}

.infografia-header h3 {
    font-size: 1.05rem;
}

.infografia-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

.infografia-meta__item {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.infografia-image-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.infografia-image {
    display: block;
    width: 100%;
    height: auto;
}

.infografia-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.infografia-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 12px;
    background: rgba(35, 79, 158, 0.85);
    color: var(--color-blanco);
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
}

.infografia-link:hover,
.infografia-link:focus-visible {
    background: rgba(35, 79, 158, 1);
}

.infografia-warning {
    color: var(--color-secundario);
    font-size: 0.95rem;
}

.podcast-card {
    padding: 14px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    scroll-margin-top: calc(var(--app-header-offset) + 16px);
}

.podcast-card.is-playing {
    border-color: rgba(35, 79, 158, 0.65);
    box-shadow: 0 8px 18px rgba(35, 79, 158, 0.25);
}

.podcast-card.has-error {
    border-color: rgba(226, 60, 27, 0.6);
}

.podcast-card.is-active {
    border-color: rgba(255, 215, 0, 0.65);
    box-shadow: 0 10px 22px rgba(255, 215, 0, 0.18);
}

.podcast-header h3 {
    font-size: 1.05rem;
}

.podcast-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.podcast-meta__item {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.78rem;
    letter-spacing: 0.02em;
}

.podcast-description {
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.75);
    margin-top: 6px;
}

.podcast-warning {
    color: var(--color-secundario);
    font-size: 0.95rem;
}

.podcast-audio {
    display: none;
}

.podcast-timeline {
    display: flex;
    align-items: center;
    gap: 12px;
}

.podcast-time {
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    min-width: 46px;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
}

.podcast-slider {
    flex: 1;
    appearance: none;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
}

.podcast-slider::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
}

.podcast-slider::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-primario);
    cursor: pointer;
}

.podcast-slider::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
}

.podcast-slider::-moz-range-progress {
    height: 6px;
    border-radius: 999px;
    background: rgba(35, 79, 158, 0.45);
}

.podcast-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-primario);
    cursor: pointer;
    border: none;
}

.podcast-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
}

.podcast-button {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-blanco);
    font-size: 0.92rem;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.podcast-button:hover,
.podcast-button:focus-visible {
    transform: translateY(-1px);
    background: rgba(35, 79, 158, 0.28);
    border-color: rgba(35, 79, 158, 0.6);
}

.podcast-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.global-audio-player {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 520px;
    bottom: 24px;
    padding: 10px 14px;
    border-radius: 16px;
    background: rgba(17, 17, 17, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    backdrop-filter: blur(16px);
    z-index: 50;
}

.global-audio-core {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1 1 220px;
    min-width: 0;
    flex-wrap: wrap;
}

.global-audio-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.global-audio-button {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-blanco);
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.global-audio-button:focus-visible {
    background: rgba(35, 79, 158, 0.35);
    transform: translateY(-1px);
}

.global-audio-button--close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(226, 60, 27, 0.18);
    border: 1px solid rgba(226, 60, 27, 0.35);
    flex-shrink: 0;
    align-self: flex-start;
}

.global-audio-slider {
    display: flex;
    align-items: center;
    line-height: 0;
    flex: 1;
}

.global-audio-slider input[type="range"] {
    flex: 1;
    accent-color: var(--color-primario);
}

.global-audio-slider input[type="range"]:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.global-audio-time {
    min-width: 48px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.75);
}

.global-audio-marquee {
    display: flex;
    align-items: center;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.global-audio-marquee__inner {
    display: inline-flex;
    align-items: center;
    gap: 32px;
    min-width: 100%;
    animation: marquee 14s linear infinite;
    font-size: 0.86rem;
    color: rgba(255, 255, 255, 0.85);
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.pregunta {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-blanco);
    margin-bottom: 18px;
}

.opciones {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.opcion {
    padding: 14px 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--color-blanco);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.opcion:hover {
    transform: translateY(-2px);
    background: rgba(35, 79, 158, 0.22);
    border-color: rgba(35, 79, 158, 0.45);
}

.opcion.selected {
    background: rgba(35, 79, 158, 0.32);
    border-color: rgba(35, 79, 158, 0.7);
}

.opcion.correct {
    background: rgba(76, 175, 80, 0.22);
    border-color: rgba(76, 175, 80, 0.55);
}

.opcion.incorrect {
    background: rgba(226, 60, 27, 0.22);
    border-color: rgba(226, 60, 27, 0.55);
}

.feedback {
    border-radius: 18px;
    padding: 16px;
    background: rgba(226, 60, 27, 0.28);
    border: 1px solid rgba(226, 60, 27, 0.45);
    color: var(--color-blanco);
}

.feedback.correct {
    background: rgba(76, 175, 80, 0.22);
    border-color: rgba(76, 175, 80, 0.55);
}

.feedback.incorrect {
    background: rgba(226, 60, 27, 0.24);
    border-color: rgba(226, 60, 27, 0.48);
}

.progress-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 14px 16px;
}

.progress-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-primario);
    width: 0;
    border-radius: inherit;
    transition: width 0.3s ease, background 0.3s ease;
}

.progress-text {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    justify-content: flex-end;
}

.button,
.primary-button,
.secondary-button {
    border-radius: 16px;
    padding: 14px 18px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.primary-button {
    background: linear-gradient(135deg, var(--color-secundario), #ff6a4c);
    color: var(--color-blanco);
    border: none;
    box-shadow: 0 16px 30px rgba(226, 60, 27, 0.28);
}

.primary-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(226, 60, 27, 0.32);
}

.secondary-button {
    background: rgba(255, 255, 255, 0.05);
    color: var(--color-blanco);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.secondary-button:hover {
    border-color: rgba(35, 79, 158, 0.5);
    background: rgba(35, 79, 158, 0.22);
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: transparent;
    padding: 0;
    position: static;
}

.action-buttons.stacked {
    gap: 12px;
}

.app-footer {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.78rem;
}

.results-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.teoria-player {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.teoria-progress {
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.teoria-progress__fill {
    width: 0%;
    height: 100%;
    background: var(--color-primario);
    transition: width 0.2s ease;
}

.audio-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 6px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.audio-button {
    display: none;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: transparent;
    border: none;
    color: var(--color-blanco);
    font-size: 1.1rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.audio-button:hover,
.audio-button:focus-visible {
    background: rgba(35, 79, 158, 0.26);
    transform: translateY(-1px);
    outline: none;
}

.audio-controls .audio-visible {
    display: inline-flex;
}
