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

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:root {
    /* ========================================
       MOODIST NEUTRAL PALETTE
       Calming, neutral grays for surfaces
       ======================================== */
    --neutral-50: #fafafa;
    --neutral-100: #f4f4f5;
    --neutral-200: #e4e4e7;
    --neutral-300: #d4d4d8;
    --neutral-400: #a1a1aa;
    --neutral-500: #71717a;
    --neutral-600: #52525b;
    --neutral-700: #3f3f46;
    --neutral-800: #27272a;
    --neutral-900: #18181b;
    --neutral-950: #09090b;
    
    /* ========================================
       OPEN BRAND COLORS (Preserved)
       ======================================== */
    --primary-warm: #4989ff;
    --primary-orange: #3B82F6;
    --accent-green: #8B9A7A;
    --accent-olive: #6B7A5A;
    --accent-brown: #8B7355;
    --success: #6366F1;
    --error: #D97757;
    --warning: #D97757;
    --surface-ghost: rgba(255, 255, 255, 0.03);
    --border-hairline: rgba(255, 255, 255, 0.05);
    
    /* ========================================
       DARK MODE (Default) - Moodist + Open
       ======================================== */
    
    /* Text */
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-tertiary: #71717a;
    
    --bg-black: #011434;
    --bg-wash: radial-gradient(90% 70% at 50% 100%, #0a274c 0%, #011434 58%);
    --bg-dark: #011434;
    --bg-card: #1c3e4e;
    --bg-card-hover: #224d5f;
    
    /* Semantic surfaces */
    --surface-background: var(--neutral-950);
    --surface-primary: var(--neutral-900);
    --surface-secondary: var(--neutral-800);
    --surface-hover: var(--neutral-800);
    
    /* Borders - Moodist subtle */
    --border-color: var(--neutral-800);
    --border-subtle: var(--neutral-800);
    --border-default: var(--neutral-700);
    
    /* Light mode — Figma Home Light */
    --light-bg: #eef4fa;
    --light-card: #ffffff;
    --light-text: #3b3555;
    --light-text-secondary: #6b6685;
    --light-border: rgba(59, 53, 85, 0.12);
    --light-primary-btn: #3b3555;
    
    /* Shadows - Moodist inspired */
    --shadow-sm: 0 1px 2px rgba(9, 9, 11, 0.05);
    --shadow-md: 0 4px 12px rgba(9, 9, 11, 0.08);
    --shadow-lg: 0 8px 24px rgba(9, 9, 11, 0.12);
    
    /* Spacing */
    --space-xs: 12px;
    --space-sm: 20px;
    --space-md: 32px;
    --space-lg: 48px;
    --space-xl: 64px;
    --space-2xl: 80px;
    
    /* Border Radius */
    --radius-sm: 16px;
    --radius-md: 24px;
    --radius-lg: 32px;
    --radius-xl: 40px;
    --radius-pill: 50px;
    
    /* Transitions - Moodist calm */
    --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-slow: 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', sans-serif;
    background: var(--bg-black);
    background-image: var(--bg-wash);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    line-height: 1.6;
    min-height: 100vh;
    letter-spacing: -0.01em;
}

/* Light Mode */
body.light-mode {
    background: var(--light-bg);
    background-image: radial-gradient(140% 90% at 50% -18%, #f7fbff 0%, #dce8f4 62%);
    color: var(--light-text);
    --primary-warm: #6a55e8;
    --text-primary: var(--light-text);
    --text-secondary: var(--light-text-secondary);
    --text-tertiary: var(--light-text-secondary);
    --bg-black: var(--light-bg);
    --bg-dark: var(--light-bg);
    --bg-card: var(--light-card);
    --bg-card-hover: #e5e7eb;
    --border-color: var(--light-border);
    --surface-ghost: var(--light-card);
    --border-hairline: var(--light-border);
    --surface-background: var(--light-bg);
    --bg-wash: radial-gradient(140% 90% at 50% -18%, #f7fbff 0%, #dce8f4 62%);
}

.app-container {
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    padding-bottom: 96px;
    background: var(--bg-black);
    background-image: var(--bg-wash);
}

@media (min-width: 480px) {
    html,
    body,
    body.light-mode {
        background: #eef4fa;
    }

    body {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 24px;
        overflow: hidden;
    }

    .app-container {
        width: 402px;
        max-width: 402px;
        height: min(874px, calc(100dvh - 48px));
        min-height: 0;
        padding-bottom: 0;
        border-radius: 48px;
        overflow: hidden;
        box-shadow: 0 24px 64px rgba(0, 0, 0, 0.14);
    }

    #landingView {
        min-height: 100%;
        height: 100%;
    }

    .view.active:not(#landingView) {
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .screen-loader,
    .feedback-menu,
    .toast,
    .modal {
        position: absolute;
    }
}

html.native-app,
html.native-app body,
html.native-app .app-container {
    background: var(--bg-black);
    background-image: var(--bg-wash);
}

html.native-app.light-mode,
html.native-app body.light-mode,
html.native-app body.light-mode .app-container {
    background: var(--light-bg);
    background-image: radial-gradient(140% 90% at 50% -18%, #f7fbff 0%, #dce8f4 62%);
}

html.native-app body {
    display: block;
    padding: 0;
    height: 100dvh;
    overflow: hidden;
    overscroll-behavior: none;
}

html.native-app .app-container {
    width: 100%;
    max-width: none;
    height: 100dvh;
    min-height: 0;
    border-radius: 0;
    box-shadow: none;
    padding-bottom: 0;
    overflow: hidden;
}

html.native-app .view.active {
    position: fixed;
    inset: 0;
    height: 100dvh;
    background: inherit;
}

html.native-app .view.active:not(#landingView) {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}

html.native-app #landingView.active {
    overflow: hidden;
}

.glass-container {
    background: transparent;
    padding: var(--space-xl);
    margin: var(--space-md);
}

.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-slow);
    position: relative;
    overflow: hidden;
}

.glass-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hairline);
}

.glass-button {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-pill);
    padding: 20px 48px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-slow);
    display: inline-block;
    text-align: center;
    letter-spacing: -0.01em;
    line-height: 1.4;
    font-family: 'Inter', -apple-system, sans-serif;
}

.glass-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
    border-color: var(--border-hairline);
    background: var(--surface-ghost);
}

.glass-button:active {
    transform: translateY(-2px) scale(0.99);
}

.glass-button.primary,
.mode-button.primary {
    color: #FFFFFF;
    font-weight: 600;
    border: 0.5px solid rgba(255, 255, 255, 0.38);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(106, 168, 255, 0.42) 42%, rgba(59, 130, 246, 0.58) 100%);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -10px 18px rgba(37, 99, 235, 0.22),
        0 10px 28px rgba(8, 28, 72, 0.28);
}

.glass-button.primary:hover,
.mode-button.primary:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.5);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.4) 0%, rgba(106, 168, 255, 0.48) 42%, rgba(59, 130, 246, 0.64) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.58),
        inset 0 -10px 18px rgba(37, 99, 235, 0.2),
        0 14px 32px rgba(8, 28, 72, 0.32);
}

.view {
    display: none;
}

.view.active {
    display: block;
    animation: screenIn 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

#landingView.active {
    display: flex;
    animation: none;
    position: absolute;
    inset: 0;
    z-index: 20;
}

.landing-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.landing-scrim {
    position: absolute;
    inset: 0;
    background: rgba(1, 20, 52, 0.18);
}

.landing-brand {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.landing-brand .home-logo {
    width: 99px;
    height: 61px;
    margin: 0;
}

.landing-title {
    margin: 0;
    font-size: 36px;
    font-weight: 500;
    line-height: 0.96;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fafafa;
    text-align: center;
    font-family: 'Inter', -apple-system, sans-serif;
}

.landing-enter {
    position: absolute;
    z-index: 1;
    left: 30px;
    right: 30px;
    bottom: calc(48px + env(safe-area-inset-bottom, 0px));
    padding: 20px 24px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(1, 20, 52, 0.1);
    color: #fafafa;
    font-size: 20px;
    font-weight: 400;
    font-family: 'Inter', -apple-system, sans-serif;
    cursor: pointer;
}

#landingView {
    position: relative;
    min-height: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #011434;
}

@keyframes screenIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.screen-loader {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: var(--bg-black);
}

.loader-car {
    font-size: 44px;
    animation: carDrive 0.8s ease-in-out infinite;
}

.loader-label {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
}

@keyframes carDrive {
    0%, 100% { transform: translateX(-18px) rotate(-6deg); }
    50% { transform: translateX(18px) rotate(6deg); }
}

@media (prefers-reduced-motion: reduce) {
    .view.active { animation: none; }
    .loader-car { animation: none; }
    .home-logo { animation: none; }
}

.home-logo {
    width: 42px;
    height: 26px;
    display: block;
    margin: 0 auto 12px;
    transform-origin: 50% 80%;
    animation: logoDrive 3.4s ease-in-out infinite;
}

.home-logo-light {
    display: none;
}

body.light-mode .home-logo-dark {
    display: none;
}

body.light-mode .home-logo-light {
    display: block;
}

@keyframes logoDrive {
    0%, 100% { transform: translateX(-2px) translateY(0) rotate(-2deg); }
    25% { transform: translateX(0) translateY(-1px) rotate(0deg); }
    50% { transform: translateX(2px) translateY(0) rotate(2deg); }
    75% { transform: translateX(0) translateY(-1px) rotate(0deg); }
}

.header-section {
    text-align: center;
    margin-bottom: 12px;
    padding-top: 8px;
}

#homeView .header-section {
    padding-top: 0;
}

#homeView .app-title {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 0;
}

.home-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 36px;
    padding-top: 0;
}

.streak-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 50px;
    background: #1c3e4e;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    font-family: 'Inter', -apple-system, sans-serif;
}

body.light-mode .streak-chip {
    background: #f3ead8;
    color: #111827;
}

.level-card {
    margin: 4px 0 16px;
}

.level-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, sans-serif;
}

#levelXp {
    font-weight: 500;
    color: var(--text-secondary);
}

.xp-road {
    position: relative;
    height: 22px;
    border-radius: 11px;
    background: #24365c;
    overflow: visible;
}

.xp-road::before {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    top: 10px;
    height: 2px;
    background: repeating-linear-gradient(90deg, rgba(250, 250, 250, 0.55) 0 10px, transparent 10px 20px);
}

.xp-road-fill {
    height: 100%;
    width: 0;
    border-radius: 11px;
    background: rgba(255, 214, 184, 0.45);
}

.xp-car {
    position: absolute;
    left: calc((100% - 42px) * var(--p, 0));
    bottom: 4px;
    z-index: 1;
    width: 42px;
    height: 26px;
    background: #fff0a6;
    -webkit-mask: url("../assets/logo-car-dark.svg") center / contain no-repeat;
    mask: url("../assets/logo-car-dark.svg") center / contain no-repeat;
    transition: left 0.4s ease;
    pointer-events: none;
}

body.light-mode .xp-road {
    background: #a4bfd8;
}

body.light-mode .xp-road-fill {
    background: #7ea8d0;
}

body.light-mode .xp-road::before {
    background: repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.88) 0 10px, transparent 10px 20px);
}

body.light-mode .xp-car {
    background: #3b3555;
}

.mode-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: var(--primary-warm);
}

.mode-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}

.mode-button.primary .mode-icon {
    color: #fff;
}

.streak-mark {
    font-size: 11px;
    font-weight: 400;
    line-height: 1;
    color: #9ec4e8;
}

.app-title {
    font-size: 56px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    letter-spacing: 0;
    line-height: 0.96;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.disclaimer {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 400;
    margin-top: 24px;
    text-align: center;
    font-style: italic;
    letter-spacing: 0.02em;
    opacity: 0.7;
    font-family: 'Inter', -apple-system, sans-serif;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-2xl);
}

.stat-card {
    text-align: center;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
}

.stat-card:hover {
    transform: none;
    border-color: transparent;
    box-shadow: none;
    background: transparent;
}

.stat-number {
    font-size: 28px;
    font-weight: 600;
    color: var(--primary-warm);
    margin-bottom: 8px;
    letter-spacing: 0;
    line-height: 1.2;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.stat-label {
    font-size: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.mode-selection {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.mode-button {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 20px 24px;
    text-align: left;
    width: 100%;
    border: 1px solid var(--border-hairline);
    cursor: pointer;
    background: var(--surface-ghost);
    border-radius: var(--radius-pill);
    transition: all var(--transition-slow);
    position: relative;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

.mode-button:hover {
    transform: translateY(-2px);
    border-color: var(--border-hairline);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
    background: var(--surface-ghost);
}

.mode-button.primary {
    border: 0.5px solid rgba(255, 255, 255, 0.38);
}

.mode-button.primary:hover {
    box-shadow: 0 16px 32px rgba(99, 102, 241, 0.28);
}

.mode-button.primary .button-text strong,
.mode-button.primary .button-text small {
    color: #FFFFFF;
}

.button-icon {
    font-size: 32px;
    min-width: 32px;
}

.button-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.button-text strong {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.button-text small {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 400;
    font-family: 'Inter', -apple-system, sans-serif;
}

.mode-button.primary .button-text small {
    color: rgba(255, 255, 255, 0.8);
}

.mode-chevron {
    width: 20px;
    height: 20px;
    margin-left: auto;
    flex-shrink: 0;
}

.mode-button.primary .mode-chevron {
    display: none;
}

.test-header,
.page-back-bar {
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    margin: 0;
    background: rgba(1, 20, 52, 0.5);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    padding: calc(env(safe-area-inset-top, 0px) + 24px) 24px 12px;
}

.test-header {
    justify-content: space-between;
}

.page-back-bar {
    gap: 16px;
    z-index: 101;
    pointer-events: auto;
}

.test-header::after,
.page-back-bar::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 28px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(1, 20, 52, 0.28), transparent);
}

body.light-mode .test-header,
body.light-mode .page-back-bar {
    background: rgba(247, 251, 255, 0.64);
}

body.light-mode .test-header::after,
body.light-mode .page-back-bar::after {
    background: linear-gradient(to bottom, rgba(247, 251, 255, 0.5), transparent);
}

.back-button {
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.18);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    flex-shrink: 0;
}

.back-button svg {
    width: 22px;
    height: 22px;
    margin-left: -2px;
}

body.light-mode .back-button {
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08);
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.22);
    color: var(--text-primary);
    border-color: transparent;
    transform: none;
    box-shadow: none;
    opacity: 1;
}

body.light-mode .back-button:hover {
    background: rgba(0, 0, 0, 0.1);
}

.test-info {
    display: flex;
    gap: 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
}

.errors {
    color: var(--error);
    font-weight: 700;
}

.progress-bar {
    width: 100%;
    height: 3px;
    background: var(--surface-ghost);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 16px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-warm);
    border-radius: 2px;
    transition: width 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: none;
}

.question-container {
    margin: 0;
    padding: 0 24px 24px;
}

.question-card {
    margin-bottom: var(--space-md);
    padding: 20px 0;
    background: transparent;
    border-radius: 0;
    border: none;
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 0;
    border-bottom: none;
}

.question-category {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #4989ff;
    background: rgba(73, 137, 255, 0.12);
    border-radius: 50px;
    padding: 4px 10px;
    font-family: 'Inter', -apple-system, sans-serif;
}

body.light-mode .question-category {
    background: rgba(73, 137, 255, 0.12);
    color: #4989ff;
}

.question-category.is-safety,
body.light-mode .question-category.is-safety {
    color: #2f8a56;
    background: rgba(47, 138, 86, 0.14);
}

.question-difficulty {
    font-size: 18px;
    line-height: 1;
    color: var(--primary-warm);
}

.question-text {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
    color: var(--text-primary);
    letter-spacing: 0;
    hyphens: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.question-text.is-translating {
    opacity: 0.45;
}

.translate-note {
    margin: -8px 0 16px;
    font-size: 11px;
    font-style: italic;
    color: var(--text-tertiary);
    font-family: 'Inter', -apple-system, sans-serif;
}

.question-image {
    width: 100%;
    height: auto;
    margin-bottom: 16px;
    border-radius: 20px;
    overflow: hidden;
}

.question-image img {
    width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: cover;
    object-position: center;
    display: block;
    border-radius: 20px;
}

.answers-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: var(--space-lg);
}

.answer-button {
    background: rgba(255, 255, 255, 0.28);
    border: none;
    border-radius: 16px;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    position: relative;
    line-height: 1.4;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, sans-serif;
}

.answer-button:hover {
    transform: none;
    border-color: transparent;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.36);
    color: var(--text-primary);
}

.answer-button.selected {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.36);
    color: var(--text-primary);
}

body.light-mode .answer-button:not(.correct):not(.wrong) {
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(17, 24, 39, 0.06);
}

body.light-mode .answer-button:not(.correct):not(.wrong):hover,
body.light-mode .answer-button.selected:not(.correct):not(.wrong) {
    background: #ffffff;
    box-shadow: 0 6px 20px rgba(17, 24, 39, 0.08);
}

.answer-button.correct,
.answer-button.wrong {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 14px 16px 14px 14px;
    border-radius: 16px;
    border-bottom: none;
    border: 1.5px solid;
    text-align: left;
    opacity: 1;
}

.answer-button.correct:hover,
.answer-button.wrong:hover {
    transform: none;
    box-shadow: none;
    color: var(--text-primary);
}

.answer-button.correct::before,
.answer-button.wrong::before {
    content: '';
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px;
}

.answer-button.correct {
    background: rgba(34, 255, 85, 0.08);
    border-color: #22FF55;
    color: var(--text-primary);
    animation: none;
}

.answer-button.correct::before {
    background-color: #22FF55;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23011434' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E");
}

.answer-button.wrong {
    background: rgba(255, 59, 48, 0.12);
    border-color: #FF3B30;
    color: var(--text-primary);
    animation: none;
}

.answer-button.wrong::before {
    background-color: #FF3B30;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
}

body.light-mode .answer-button.correct {
    background: #f0fff4;
    border-color: #16C247;
}

body.light-mode .answer-button.wrong {
    background: #fff5f5;
    border-color: #FF3B30;
}

.answer-button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.answer-button.correct:disabled,
.answer-button.wrong:disabled {
    opacity: 1;
}

.question-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    align-items: stretch;
}

.next-button {
    flex: 1;
    width: auto;
    padding: 14px 16px;
    font-size: 15px;
    margin-top: 0;
    font-weight: 600;
}

.question-explanation,
.question-explanation.glass-card {
    margin-top: var(--space-md);
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    animation: fadeInUp 0.5s var(--transition-slow);
}

.question-explanation.glass-card:hover {
    transform: none;
    box-shadow: none;
    background: transparent;
}

.explanation-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 500;
    font-family: 'Inter', -apple-system, sans-serif;
}

.explanation-header span:first-child {
    font-size: 24px;
}

.explanation-structured {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.explanation-lead,
.explanation-section {
    padding: 20px 22px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 24px;
    line-height: 1.7;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

body.light-mode .explanation-lead,
body.light-mode .explanation-section {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 8px 32px rgba(17, 24, 39, 0.06);
}

.explanation-section strong {
    display: block;
    margin-bottom: var(--space-xs);
    color: var(--primary-warm);
    font-size: 15px;
    letter-spacing: 0.3px;
}


#explanationText {
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    font-family: 'Inter', -apple-system, sans-serif;
    font-weight: 400;
}

.results-container {
    text-align: center;
    padding: var(--space-xl);
}

.results-header {
    margin-bottom: var(--space-xl);
}

.result-icon {
    width: 104px;
    height: 104px;
    margin: 0 auto 12px;
    border-radius: 52px;
    background: var(--primary-warm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    animation: scaleIn 0.5s var(--transition);
}

#resultTitle {
    font-size: 36px;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    letter-spacing: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

#resultSubtitle {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
    font-family: 'Inter', -apple-system, sans-serif;
    letter-spacing: -0.01em;
}

.results-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    margin-bottom: var(--space-xl);
}

.result-stat {
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.result-stat-value {
    font-size: 40px;
    font-weight: 600;
    color: var(--primary-warm);
    margin-bottom: 8px;
    letter-spacing: 0;
    line-height: 1.2;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.result-stat-label {
    font-size: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-family: 'Inter', -apple-system, sans-serif;
}

.results-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.results-actions button {
    width: 100%;
    padding: var(--space-md);
    font-size: 16px;
}

.page-back-bar .back-button {
    pointer-events: auto;
}

#libraryView .glass-container,
#glossaryView .glass-container {
    margin: 0;
}

#libraryView .filters {
    padding: 20px 24px 0;
}

#glossaryView .glossary-grid {
    padding-top: 20px;
}

.library-header {
    text-align: center;
    padding: 12px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.library-header h2 {
    font-size: 34px;
    font-weight: 600;
    margin-top: var(--space-sm);
    letter-spacing: 0;
    line-height: 1.05;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.library-search {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.18);
}

.library-search svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.library-search input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    outline: none;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, sans-serif;
}

.library-search input::placeholder {
    color: var(--text-secondary);
    font-weight: 500;
}

.library-search input::-webkit-search-decoration,
.library-search input::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

body.light-mode .library-search {
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08);
}

.filters {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 24px;
}

.filter-group {
    justify-content: space-between;
}

.filter-group label {
    flex-shrink: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: none;
    letter-spacing: -0.01em;
    font-family: 'Inter', -apple-system, sans-serif;
}

.filter-group select {
    flex: 1;
    min-width: 0;
    border: none;
    background-color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='%236b7280' stroke-width='2.2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 18px;
    padding: 0 22px 0 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-primary);
    text-align: right;
    font-family: 'Inter', -apple-system, sans-serif;
    appearance: none;
    -webkit-appearance: none;
}

.filter-group select:hover {
    background-color: transparent;
    transform: none;
}

.questions-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.library-more {
    display: block;
    width: 100%;
    margin: 24px 0 8px;
    padding: 16px;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--primary-warm);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', -apple-system, sans-serif;
    cursor: pointer;
}

.library-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 40px 0;
}

.question-item,
.question-item.glass-card {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 0;
    box-shadow: none;
}

.question-item:hover,
.question-item.glass-card:hover {
    transform: none;
    box-shadow: none;
    opacity: 1;
}

body.light-mode .question-item,
body.light-mode .question-item.glass-card {
    background: #ffffff;
    border: none;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.05);
}

body.light-mode .question-item:hover,
body.light-mode .question-item.glass-card:hover {
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.05);
}

.question-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}


.question-item-text {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, sans-serif;
}

.library-answers {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
}

.library-answer {
    padding: 14px 16px;
    border-radius: 20px;
    font-size: 15px;
    line-height: 1.4;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    font-family: 'Inter', -apple-system, sans-serif;
}

body.light-mode .library-answer {
    background: #f3f4f6;
}

.library-answer.is-correct {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(34, 255, 85, 0.08);
    border: 1.5px solid #22FF55;
    font-weight: 600;
}

.library-answer.is-correct::before {
    content: '';
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    background-color: #22FF55;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23011434' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E");
}

body.light-mode .library-answer.is-correct {
    background: #f0fff4;
    border-color: #16C247;
}

.glossary-header {
    text-align: center;
    padding: 12px 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.glossary-header h2 {
    font-size: 34px;
    font-weight: 600;
    margin: var(--space-sm) 0 8px;
    letter-spacing: 0;
    line-height: 1;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.glossary-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 24px;
}

.glossary-card {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-color);
    border-radius: 0;
    padding: 32px 0;
    text-align: left;
}

.glossary-card:last-of-type {
    border-bottom: none;
}

.glossary-card:hover {
    transform: none;
    box-shadow: none;
    border-color: var(--border-hairline);
    background: transparent;
}

.glossary-icon {
    display: none;
}

.glossary-term {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: var(--space-sm);
    color: var(--primary-warm);
    letter-spacing: 0;
    line-height: 1.1;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.glossary-definition {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    font-family: 'Inter', -apple-system, sans-serif;
    font-weight: 400;
}

.glossary-illustration {
    width: 200px;
    max-width: 70%;
    height: auto;
    background: var(--surface-ghost);
    border-radius: 20px;
    margin-top: 16px;
    overflow: hidden;
}

.glossary-illustration img {
    display: block;
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.glossary-credit {
    margin: 24px 0 8px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-secondary);
    font-family: 'Inter', -apple-system, sans-serif;
}

.theme-toggle {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.lang-switch,
.theme-switch {
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.light-mode .lang-switch,
body.light-mode .theme-switch {
    background: rgba(0, 0, 0, 0.06);
}

.lang-flag {
    font-size: 18px;
    line-height: 1;
    pointer-events: none;
}

.lang-flag-en { display: none; }

body.lang-en .lang-flag-en { display: block; }
body.lang-en .lang-flag-es { display: none; }

.theme-icon-moon {
    width: 16px;
    height: 16px;
    display: block;
}

.theme-icon-sun {
    width: 16px;
    height: 16px;
    display: none;
}

body.light-mode .theme-icon-moon {
    display: none;
}

body.light-mode .theme-icon-sun {
    display: block;
    filter: brightness(0);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-8px);
    }
    75% {
        transform: translateX(8px);
    }
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.5;
    }
}

@keyframes gentlePulse {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(217, 119, 87, 0.2);
    }
    50% {
        box-shadow: 0 12px 48px rgba(217, 119, 87, 0.3);
    }
}

.answer-button,
.button-text,
.app-title,
.subtitle,
.question-item-text {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

html.native-app body,
html.native-app body.light-mode {
    padding: 0;
}

@media screen and (max-width: 430px) {
    .glass-container {
        margin: 0;
        padding: 24px;
    }
    
    .glass-card {
        padding: 24px;
    }
    
    .app-title {
        font-size: 56px;
        letter-spacing: 0;
    }
    
    .subtitle {
        font-size: 11px;
        letter-spacing: 1.2px;
    }
    
    .stat-number {
        font-size: 28px;
        letter-spacing: 0;
        line-height: 1.2;
    }
    
    .stat-label {
        font-size: 8px;
        margin-top: 0;
    }
    
    .stat-card {
        padding: 0;
        min-width: 0;
        min-height: auto;
        overflow: visible;
    }
    
    .mode-button {
        padding: 20px;
    }
    
    .button-text strong {
        font-size: 16px;
    }
    
    .button-text small {
        font-size: 13px;
    }
    
    .question-container {
        padding: 0 24px;
    }
    
    .question-card {
        padding: 20px 0;
        margin-bottom: 16px;
    }
    
    .question-text {
        font-size: 22px;
        line-height: 1.3;
        margin-bottom: 16px;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: none;
        max-width: 100%;
    }
    
    .question-category {
        font-size: 10px;
        padding: 4px 10px;
    }

    .question-item .question-category {
        font-size: 8px;
        padding: 3px 8px;
    }
    
    .question-difficulty {
        font-size: 16px;
    }
    
    .answer-button:not(.correct):not(.wrong) {
        padding: 14px 16px;
        font-size: 16px;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
    }
    
    .test-header {
        padding: calc(env(safe-area-inset-top, 0px) + 24px) 24px 12px;
        margin: 0;
    }
    
    .back-button {
        width: 44px;
        height: 44px;
        padding: 0;
    }
    
    .test-info {
        font-size: 13px;
        gap: var(--space-sm);
    }
    
    .result-stat-value {
        font-size: 40px;
        letter-spacing: 0;
    }
    
    .result-stat {
        padding: 0;
    }
    
    #resultTitle {
        font-size: 36px;
    }
    
    .result-icon {
        font-size: 40px;
    }
    
    .glass-button {
        padding: 18px 40px;
        font-size: 15px;
    }

    .question-actions .glass-button {
        padding: 14px 12px;
        font-size: 14px;
    }

    .question-actions .doubt-button {
        font-size: 12px;
        padding: 14px 8px;
    }
    
    .filters {
        padding: 0 24px;
        gap: 12px;
    }
    
    .glossary-grid {
        grid-template-columns: 1fr;
        padding: 24px;
    }
    
    .glossary-term {
        font-size: 20px;
    }
    
    .glossary-icon {
        font-size: 48px;
    }
    
    .header-section {
        padding-top: 8px;
        margin-bottom: var(--space-xl);
    }
}

@media screen and (max-width: 375px) {
    .app-title {
        font-size: 48px;
    }
    
    .stat-number {
        font-size: 24px;
    }
    
    .question-text {
        font-size: 20px;
        line-height: 1.3;
    }
    
    .answer-button:not(.correct):not(.wrong) {
        padding: 14px 16px;
        font-size: 15px;
    }
    
    .glass-container {
        margin: 0;
        padding: 24px;
    }
    
    .header-section {
        padding-top: 8px;
    }
}

@media (min-width: 641px) {
    .question-text {
        font-size: 22px;
    }
    
    .mode-button.primary {
        animation: gentlePulse 4s ease-in-out infinite;
    }
    
    .glass-button.primary:not(:hover) {
        animation: gentlePulse 4s ease-in-out infinite;
    }
}

.all-answers-box {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
}

.expand-button {
    width: 100%;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-pill);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: opacity var(--transition);
    font-family: 'Inter', -apple-system, sans-serif;
    letter-spacing: -0.01em;
}

.expand-button:hover {
    opacity: 0.8;
    transform: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

body.light-mode .expand-button,
body.light-mode .expand-button:hover {
    background: #edf4ff;
    color: #111827;
    box-shadow: none;
}

.explanation-content {
    margin-top: var(--space-sm);
    padding: var(--space-xl);
    background: linear-gradient(135deg, rgba(217, 119, 87, 0.06) 0%, rgba(139, 154, 122, 0.06) 100%);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(217, 119, 87, 0.15);
    animation: fadeInUp 0.5s var(--transition-slow);
}

#homeView .glass-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: calc(env(safe-area-inset-top, 0px) + 24px) 24px 28px;
    margin: 0;
}

.stats-grid {
    padding-top: 0;
    margin-bottom: 0;
    gap: 8px;
}

.mode-selection {
    gap: 16px;
}

#homeView .stat-card,
#homeView .stat-card.glass-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 2px;
    height: 108px;
    min-height: 108px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    border-radius: 20px;
    padding: 12px 8px 14px;
    overflow: hidden;
    box-shadow: none;
    position: relative;
}

#homeView .stat-card:hover,
#homeView .stat-card.glass-card:hover {
    transform: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.14);
}

#homeView button.stat-card {
    appearance: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
    width: 100%;
}

#homeView button.stat-card:hover {
    transform: none;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.14);
}

#homeView .stat-icon {
    position: static;
    top: auto;
    left: auto;
    transform: none;
    width: 30px;
    height: 30px;
    border-radius: 15px;
    background: rgba(74, 116, 176, 0.85);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 auto;
    flex-shrink: 0;
}

#homeView .stat-icon svg {
    width: 16px;
    height: 16px;
}

#homeView .stat-number {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
    color: #ffffff;
    margin-bottom: 0;
}

#homeView .stat-label {
    font-size: 8px;
    font-weight: 500;
    letter-spacing: 0.6px;
    color: #9ec4e8;
}

body.light-mode #homeView .stat-card,
body.light-mode #homeView .stat-card.glass-card {
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 12px 8px 14px;
    box-shadow: none;
}

body.light-mode #homeView .stat-card:hover,
body.light-mode #homeView .stat-card.glass-card:hover,
body.light-mode #homeView button.stat-card:hover {
    background: #ffffff;
    box-shadow: none;
}

body.light-mode #homeView .stat-icon,
body.light-mode .results-stats .stat-icon {
    background: #4989ff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    color: #ffffff;
}

body.light-mode #homeView .stat-number {
    color: #111827;
}

body.light-mode #homeView .stat-label {
    color: #6b7280;
}

.mode-button {
    box-shadow: none;
}

.mode-button:not(.primary) {
    background: rgba(158, 196, 232, 0.1);
    border: none;
    box-shadow: none;
}

.mode-button:not(.primary):hover {
    background: rgba(158, 196, 232, 0.16);
}

.mode-button.primary {
    background: #4989ff;
    box-shadow: 0 4px 33px rgba(28, 82, 108, 0.1);
}

body.light-mode #homeView .glass-container {
    padding: calc(env(safe-area-inset-top, 0px) + 24px) 24px 28px;
    margin: 0;
}

body.light-mode .stats-grid {
    padding-top: 0;
    margin-bottom: 0;
}

body.light-mode .mode-selection {
    gap: 16px;
}

body.light-mode .mode-button {
    background: #f3ede2;
    border: none;
    box-shadow: none;
}

body.light-mode .mode-button:hover {
    background: #d4e4ff;
    box-shadow: none;
}

body.light-mode .glass-button.primary,
body.light-mode .mode-button.primary {
    border: none;
    background: #111827;
    box-shadow: 0 4px 33px rgba(28, 82, 108, 0.1);
}

body.light-mode .glass-button.primary:hover,
body.light-mode .mode-button.primary:hover {
    background: #111827;
    box-shadow: 0 4px 33px rgba(28, 82, 108, 0.16);
}

body.light-mode .filter-group select {
    background-color: transparent;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.full-width {
    width: 100%;
    margin: 0;
}

/* Setup Prompt Styles */
.setup-title {
    font-size: 22px;
    margin-bottom: var(--space-xs);
    font-weight: 700;
}

.setup-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.form-group {
    margin-bottom: var(--space-sm);
}

.form-label {
    display: block;
    font-size: 14px;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
    font-weight: 500;
}

.form-input,
.form-select {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 16px;
    font-family: 'Inter', -apple-system, sans-serif;
    transition: all var(--transition);
}

.form-select {
    appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg width=\'10\' height=\'6\' viewBox=\'0 0 10 6\' fill=\'none\' xmlns=\'http://www.w3.org/2000/svg\'%3e%3cpath d=\'M1 1L5 5L9 1\' stroke=\'%23999\' stroke-width=\'1.5\' stroke-linecap=\'round\' stroke-linejoin=\'round\'/%3e%3c/svg%3e');
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-warm);
    box-shadow: 0 0 0 3px rgba(217, 119, 87, 0.1);
}

.button-group {
    display: flex;
    gap: var(--space-xs);
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 16px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all var(--transition);
    font-family: 'Inter', -apple-system, sans-serif;
    border: none;
}

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

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

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

/* Daily Session Card */
.daily-session-card {
    margin-bottom: var(--space-md);
    background: linear-gradient(135deg, rgba(217, 119, 87, 0.15) 0%, rgba(139, 154, 122, 0.15) 100%);
    border: 2px solid var(--primary-warm);
    padding: var(--space-md);
}

.session-title {
    font-size: 22px;
    margin-bottom: var(--space-xs);
    font-weight: 700;
}

.session-description {
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
    font-size: 15px;
}

/* Doubt Button */
.doubt-button {
    flex: 1;
    width: auto;
    margin-top: 0;
    padding: 14px 10px;
    font-size: 13px;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    color: var(--text-primary);
    font-weight: 600;
    box-shadow: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.doubt-button.is-marked::before {
    content: '';
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5l5.2 5.3L20 7'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 12.5l5.2 5.3L20 7'/%3E%3C/svg%3E") center / contain no-repeat;
}

.doubt-button.is-marked,
.doubt-button.is-marked:hover {
    background: rgba(139, 154, 122, 0.28);
    border-color: rgba(255, 255, 255, 0.35);
    color: var(--text-primary);
}

.doubt-button:hover {
    transform: none;
    background: transparent;
    box-shadow: none;
    border-color: rgba(255, 255, 255, 0.55);
    color: var(--text-primary);
}

body.light-mode .doubt-button {
    background: transparent;
    border-color: #111827;
    color: #111827;
}

body.light-mode .doubt-button:hover {
    background: transparent;
    border-color: #111827;
    color: #111827;
}

body.light-mode .doubt-button.is-marked,
body.light-mode .doubt-button.is-marked:hover {
    background: #e8ebe6;
    border-color: #111827;
    color: #111827;
}

/* ========================================
   FEEDBACK SYSTEM - Discrete & iOS Style
   ======================================== */

/* Question Header Update */
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.question-header-left {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.review-chip {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #6366f1;
    background: rgba(99, 102, 241, 0.14);
    border-radius: 50px;
    padding: 4px 10px;
    font-family: 'Inter', -apple-system, sans-serif;
}

body.light-mode .review-chip {
    background: rgba(99, 102, 241, 0.12);
}

/* 3-Dot Menu Button */
.menu-button {
    position: relative;
    z-index: 5;
    background: var(--surface-ghost);
    border: 1px solid var(--border-hairline);
    padding: 0;
    width: 40px;
    height: 40px;
    cursor: pointer;
    border-radius: 20px;
    transition: all var(--transition);
    opacity: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.menu-button:hover {
    opacity: 1;
    background: var(--bg-card-hover);
    transform: scale(1.1);
}

.menu-button:active {
    transform: scale(0.95);
}

/* Feedback Menu Dropdown */
.feedback-menu {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    animation: slideUp 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid var(--border-color);
    max-width: 600px;
    margin: 0 auto;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

.feedback-menu-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md);
    margin-bottom: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    text-align: left;
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.feedback-menu-item:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-warm);
}

.feedback-menu-item:active {
    transform: translateY(0);
}

.feedback-menu-item.cancel {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    justify-content: center;
    font-weight: 600;
    margin-top: var(--space-xs);
}

.feedback-menu-item.cancel:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--text-secondary);
}

.feedback-icon {
    font-size: 20px;
    min-width: 24px;
}

.feedback-text {
    flex: 1;
    line-height: 1.4;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-pill);
    box-shadow: var(--shadow-floating);
    border: 1px solid var(--border-color);
    z-index: 3000;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, sans-serif;
    max-width: 90%;
    text-align: center;
    opacity: 0;
    pointer-events: none;
}

.toast.show {
    animation: toastIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards, 
               toastOut 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) 2.6s forwards;
}

@keyframes toastIn {
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes toastOut {
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

/* Photo Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    animation: fadeIn 0.3s var(--transition);
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 400px;
    width: 100%;
    animation: scaleIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.modal-title {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, sans-serif;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    font-family: 'Inter', -apple-system, sans-serif;
}

.photo-preview {
    margin: var(--space-md) 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.photo-preview img {
    width: 100%;
    display: block;
}

.modal-actions {
    display: flex;
    gap: var(--space-xs);
    margin-top: var(--space-md);
}

.modal-actions .glass-button {
    flex: 1;
    padding: 14px;
    font-size: 15px;
}

.modal-note {
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
    margin-top: var(--space-sm);
    font-style: italic;
}

.question-item .question-category {
    font-size: 8px;
    padding: 3px 8px;
    letter-spacing: 0.06em;
}

.library-explain {
    margin-top: 16px;
}

.library-report {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 0;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: #9ec4e8;
    text-decoration: underline;
    cursor: pointer;
    font-family: 'Inter', -apple-system, sans-serif;
    text-align: center;
}

.question-card .library-report {
    margin-top: 16px;
}

.library-report:hover {
    opacity: 0.7;
}

body.light-mode .library-report {
    color: #1c3e4e;
}

/* Figma Pantallas — Home / Pregunta / Resultados / Biblioteca / Glosario */
#homeView .home-logo,
#homeView .subtitle {
    display: none;
}

#homeView .header-section {
    text-align: left;
    padding-top: 0;
    margin-bottom: 0;
}

#homeView .app-title {
    font-size: 32px;
    font-weight: 600;
    margin: 0;
}

.streak-chip {
    background: rgba(158, 196, 232, 0.12);
    border-radius: 20px;
    padding: 6px 12px 6px 10px;
    font-weight: 500;
}

.streak-mark {
    font-size: 11px;
    font-weight: 400;
    line-height: 1;
    color: #9ec4e8;
}

.lang-switch,
.theme-switch {
    width: 32px;
    height: 32px;
    background: rgba(158, 196, 232, 0.12);
}

.level-card {
    margin: 0;
}

.level-bar {
    height: 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.12);
}

#levelLabel {
    font-weight: 500;
}

#levelXp {
    font-weight: 400;
    color: #9ec4e8;
}

.stats-grid {
    padding-top: 0;
    margin: 0;
}

#homeView .stat-card,
#homeView .stat-card.glass-card {
    align-items: flex-start;
    justify-content: flex-start;
    height: 108px;
    min-height: 108px;
    border-radius: 20px;
    padding: 12px 8px 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

.results-stats .result-stat,
.results-stats .result-stat.glass-card {
    position: relative;
    align-items: flex-start;
    justify-content: flex-end;
    height: 108px;
    min-height: 108px;
    border-radius: 20px;
    padding: 18px 8px 14px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
}

#homeView .stat-icon {
    position: static;
    width: 30px;
    height: 30px;
    border-radius: 15px;
    background: rgba(74, 116, 176, 0.85);
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0 auto;
}

.results-stats .stat-icon {
    position: absolute;
    top: 5px;
    left: 6px;
    transform: none;
    width: 30px;
    height: 30px;
    border-radius: 15px;
    background: rgba(74, 116, 176, 0.85);
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

#homeView .stat-icon svg,
.results-stats .stat-icon svg {
    width: 16px;
    height: 16px;
}

#homeView .stat-label {
    color: #9ec4e8;
    text-transform: uppercase;
}

#homeView .mode-selection .mode-button,
#homeView .mode-selection .mode-button.primary,
#homeView .mode-selection .mode-button:hover,
#homeView .mode-selection .mode-button.primary:hover {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 2px;
    height: 94px;
    min-height: 94px;
    max-height: 94px;
    padding: 18px;
    border: none;
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
    transform: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

#homeView .mode-card-photo {
    position: absolute;
    left: 0;
    bottom: -46px;
    width: 363px;
    height: 242px;
    max-width: none;
    object-fit: cover;
    pointer-events: none;
    z-index: 0;
}

#homeView .mode-card-photo-exam {
    left: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    transform: none;
    object-position: 50% 42%;
}

#homeView .mode-selection .mode-button::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(236.02deg, rgba(255, 255, 255, 0) 35.09%, rgba(1, 20, 52, 0.4) 91.1%);
    pointer-events: none;
    z-index: 1;
}

#homeView .mode-selection .mode-button.primary::after {
    background: linear-gradient(180deg, rgba(1, 20, 52, 0.22) 8%, rgba(1, 20, 52, 0.78) 100%);
}

#homeView .mode-selection .mode-button:nth-child(2)::after {
    background: linear-gradient(232.6deg, rgba(255, 255, 255, 0) 12.8%, rgba(1, 20, 52, 0.4) 75.97%);
}

#homeView .mode-selection .mode-button:nth-child(3)::after {
    background: linear-gradient(236.63deg, rgba(255, 255, 255, 0) 33.05%, rgba(1, 20, 52, 0.4) 92.36%);
}

#homeView .mode-selection .mode-button:nth-child(4)::after {
    background: linear-gradient(239.49deg, rgba(255, 255, 255, 0) 29.73%, rgba(1, 20, 52, 0.4) 93.99%);
}

#homeView .mode-selection .button-text {
    position: relative;
    z-index: 2;
    flex: none;
    gap: 2px;
}

#homeView .mode-selection .button-text strong,
#homeView .mode-selection .mode-button.primary .button-text strong {
    font-size: 20px;
    font-weight: 600;
    line-height: 24px;
    color: #fafafa;
}

#homeView .mode-selection .button-text small,
#homeView .mode-selection .mode-button.primary .button-text small {
    font-size: 8px;
    font-weight: 500;
    line-height: 10px;
    letter-spacing: 0.6px;
    color: #d0e8ff;
    white-space: nowrap;
}

.button-text small {
    font-size: 12px;
    color: #9ec4e8;
}

.disclaimer {
    color: #7a93b3;
    font-style: normal;
    opacity: 1;
    margin-top: 0;
}

.store-footer {
    display: flex;
    justify-content: center;
    margin: 8px 0 4px;
}

.store-footer img {
    height: 40px;
    width: auto;
}

.store-footer .store-badge-light {
    display: none;
}

.store-footer .store-badge-dark {
    display: block;
}

body.light-mode .store-footer .store-badge-dark {
    display: none;
}

body.light-mode .store-footer .store-badge-light {
    display: block;
}

html.native-app .store-footer {
    display: none;
}

.errors {
    color: #ff8a80;
    font-weight: 500;
}

.test-info {
    font-size: 14px;
    font-weight: 500;
    gap: 12px;
}

#questionCounter {
    color: #fafafa;
}

.progress-bar {
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
}

.progress-fill {
    border-radius: 4px;
}

.question-category {
    background: rgba(73, 137, 255, 0.12);
    padding: 4px 10px;
    text-transform: none;
    letter-spacing: 0.02em;
    font-size: 10px;
    font-weight: 600;
    color: #4989ff;
}

.question-text {
    font-size: 20px;
    font-weight: 600;
}

.question-image {
    border-radius: 16px;
    background: #0a274c;
    min-height: 0;
}

.question-image img {
    border-radius: 16px;
}

.answer-button {
    background: rgba(255, 255, 255, 0.1);
}

.answer-button:hover,
.answer-button.selected {
    background: rgba(255, 255, 255, 0.16);
}

.library-report {
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
}

.results-container {
    padding: 80px 24px 32px;
}

html.native-app .results-container {
    padding-top: calc(env(safe-area-inset-top, 0px) + 24px);
}

.result-icon {
    width: auto;
    height: auto;
    margin: 0 0 8px;
    background: none;
    border-radius: 0;
    font-size: 48px;
    line-height: 1;
    color: #22ff55;
}

.result-icon.is-fail {
    color: #ff8a80;
}

#resultTitle {
    font-size: 32px;
}

#resultSubtitle {
    color: #9ec4e8;
}

.results-stats {
    gap: 8px;
}

.results-stats .result-stat {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.result-stat-value {
    font-size: 20px;
    color: #fafafa;
    margin: 0;
}

.result-stat-label {
    color: #9ec4e8;
    text-transform: none;
    letter-spacing: 0.6px;
}

.results-actions {
    gap: 8px;
}

.results-actions .glass-button.primary,
.results-actions .glass-button.primary:hover {
    background: #d6e6ff;
    color: #0b1f3d;
    border: none;
    box-shadow: none;
    transform: none;
}

.results-actions .glass-button:not(.primary) {
    background: rgba(158, 196, 232, 0.12);
    border: none;
    box-shadow: none;
}

.page-back-bar h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, sans-serif;
}

.library-search {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
}

.library-search.filter-group {
    position: relative;
}

.library-search.filter-group label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.filter-group select {
    text-align: left;
    padding: 0 22px 0 0;
    width: 100%;
}

.question-item,
.question-item.glass-card {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 16px;
    padding: 16px;
}

.question-item-header {
    margin-bottom: 8px;
}

.question-item .question-category {
    font-size: 10px;
    padding: 4px 10px;
}

.question-item-text {
    font-size: 15px;
}

.glossary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 24px 28px;
}

.glossary-card,
.glossary-card.glass-card {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 16px;
    padding: 12px;
}

.glossary-card:hover,
.glossary-card.glass-card:hover {
    background: rgba(255, 255, 255, 0.14);
    border: none;
}

.glossary-illustration {
    width: 100%;
    max-width: none;
    height: 88px;
    margin: 0 0 8px;
    border-radius: 12px;
    background: #0a274c;
}

.glossary-illustration img {
    height: 88px;
}

.glossary-term {
    font-size: 14px;
    color: #fafafa;
    margin: 0;
    line-height: 1.3;
}

.glossary-definition {
    font-size: 12px;
    margin: 4px 0 0;
}

.glossary-credit {
    grid-column: 1 / -1;
}

body.light-mode .streak-chip {
    background: rgba(17, 24, 39, 0.06);
    color: #111827;
}

body.light-mode .streak-mark {
    color: #6b7280;
}

body.light-mode .lang-switch,
body.light-mode .theme-switch {
    background: rgba(17, 24, 39, 0.06);
}

body.light-mode .level-bar {
    background: #e0ecff;
}

body.light-mode #levelXp,
body.light-mode .button-text small,
body.light-mode #resultSubtitle,
body.light-mode .result-stat-label,
body.light-mode #homeView .stat-label {
    color: #6b7280;
}

body.light-mode #homeView .stat-card,
body.light-mode #homeView .stat-card.glass-card,
body.light-mode .results-stats .result-stat,
body.light-mode .results-stats .result-stat.glass-card,
body.light-mode .question-item,
body.light-mode .question-item.glass-card,
body.light-mode .glossary-card,
body.light-mode .glossary-card.glass-card,
body.light-mode .library-search,
body.light-mode .answer-button:not(.correct):not(.wrong) {
    background: #ffffff;
}

body.light-mode .mode-button.primary,
body.light-mode .mode-button.primary:hover,
body.light-mode .results-actions .glass-button.primary,
body.light-mode .results-actions .glass-button.primary:hover {
    background: #111827;
}

body.light-mode .mode-button.primary .mode-icon,
body.light-mode .mode-button.primary .button-text strong,
body.light-mode .results-actions .glass-button.primary {
    color: #ffffff;
}

body.light-mode #homeView .mode-selection .mode-button,
body.light-mode #homeView .mode-selection .mode-button.primary,
body.light-mode #homeView .mode-selection .mode-button:hover,
body.light-mode #homeView .mode-selection .mode-button.primary:hover {
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
    transform: none;
}

body.light-mode #homeView .mode-selection .button-text strong,
body.light-mode #homeView .mode-selection .mode-button.primary .button-text strong {
    color: #fafafa;
}

body.light-mode #homeView .mode-selection .button-text small,
body.light-mode #homeView .mode-selection .mode-button.primary .button-text small {
    color: #d0e8ff;
}

body.light-mode .mode-button.primary .button-text small {
    color: rgba(255, 255, 255, 0.72);
}

body.light-mode .result-stat-value,
body.light-mode .glossary-term {
    color: #111827;
}

body.light-mode .question-image,
body.light-mode .glossary-illustration {
    background: #e0ecff;
}

body.light-mode .disclaimer {
    color: #6b6685;
}

.app-tabbar[hidden] {
    display: none !important;
}

.app-tabbar {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 12px;
    z-index: 30;
    display: flex;
    gap: 2px;
    padding: 6px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 10px 36px rgba(28, 18, 48, 0.14);
}

.app-tabbar button {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 0 6px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    color: #1c1228;
    font: 600 11px/1.2 Inter, -apple-system, sans-serif;
    cursor: pointer;
}

.app-tabbar button svg {
    width: 22px;
    height: 22px;
}

.app-tabbar button[aria-current="page"] {
    background: #efeaf3;
    color: #1c1228;
}

body.light-mode .app-tabbar {
    background: #fff;
}

html.native-app .app-tabbar {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    padding: 6px;
}

#landingView.active ~ .app-tabbar,
#testView.active ~ .app-tabbar,
#resultsView.active ~ .app-tabbar {
    display: none !important;
}

#gameView {
    padding-bottom: 100px;
}

.dash-wrap {
    padding: 4px 24px 0;
    text-align: center;
}

.dash-sub,
.dash-note {
    margin: 0 auto;
    max-width: 340px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.45;
}

.dash-note {
    margin-top: 14px;
}

.dash-stage {
    position: relative;
    width: min(100%, 300px);
    margin: 14px auto 0;
}

#dashCanvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
    overflow: hidden;
    background: #4A4468;
    touch-action: none;
}

.dash-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
}

.dash-overlay[hidden] {
    display: none;
}

.dash-overlay-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: max-content;
    max-width: 72%;
    padding: 16px 18px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.38);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 0.5px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 18px 40px rgba(20, 14, 40, 0.32);
}

.dash-overlay-title {
    margin: 0;
    color: #3b3555;
    font: 700 20px/1.2 Inter, -apple-system, sans-serif;
}

.dash-overlay-sub {
    margin: 0;
    color: #6b6685;
    font: 500 13px/1.3 Inter, -apple-system, sans-serif;
}

.dash-pad {
    display: flex;
    gap: 10px;
    max-width: 300px;
    margin: 12px auto 0;
}

.dash-pad button {
    flex: 1;
    height: 56px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #3b3555;
    cursor: pointer;
}

.dash-pad button svg {
    width: 26px;
    height: 26px;
    margin: 0 auto;
}

.dash-play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    margin: 0;
    border: 0.5px solid rgba(255, 255, 255, 0.7);
    border-radius: 999px;
    padding: 9px 18px;
    background: rgba(255, 255, 255, 0.58);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    box-shadow: 0 8px 20px rgba(20, 14, 40, 0.18);
    color: #3b3555;
    font: 600 15px Inter, -apple-system, sans-serif;
    cursor: pointer;
}

body:not(.light-mode) .dash-pad button {
    background: var(--bg-card);
    color: var(--text-primary);
}

body.light-mode .dash-sub,
body.light-mode .dash-note {
    color: var(--light-text-secondary);
}
