/* ============================================
   Test de Edad Mental — Design System & Styles
   ============================================ */

/* --- Variables & Tokens --- */
:root {
    --clr-bg-start: #0f0c29;
    --clr-bg-mid: #1a1145;
    --clr-bg-end: #24243e;
    --clr-surface: rgba(255, 255, 255, 0.06);
    --clr-surface-hover: rgba(255, 255, 255, 0.1);
    --clr-glass-border: rgba(255, 255, 255, 0.12);
    --clr-primary: #8b5cf6;
    --clr-primary-light: #a78bfa;
    --clr-primary-dark: #6d28d9;
    --clr-accent: #06b6d4;
    --clr-accent-light: #22d3ee;
    --clr-success: #10b981;
    --clr-danger: #ef4444;
    --clr-warning: #f59e0b;
    --clr-text: #f1f5f9;
    --clr-text-muted: #94a3b8;
    --clr-text-dim: #64748b;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Outfit', 'Inter', sans-serif;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.25);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    color: var(--clr-text);
    background: linear-gradient(135deg, var(--clr-bg-start) 0%, var(--clr-bg-mid) 50%, var(--clr-bg-end) 100%);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(139, 92, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* --- App Container --- */
.app-container {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 16px 40px;
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Screens --- */
.screen {
    display: none;
    width: 100%;
    animation: fadeSlideIn 0.5s ease forwards;
}

.screen.active {
    display: block;
}

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

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes countPulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(139, 92, 246, 0.3); }
    50% { box-shadow: 0 0 40px rgba(139, 92, 246, 0.6); }
}

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

/* --- Card (Glassmorphism) --- */
.card {
    background: var(--clr-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--clr-glass-border);
    border-radius: var(--radius-lg);
    padding: 40px 28px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 16px;
    padding: 14px 32px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.2;
}

.btn-primary {
    background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-dark));
    color: white;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

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

.btn-glow {
    animation: glowPulse 2s infinite;
}

.btn-secondary {
    background: var(--clr-surface);
    color: var(--clr-text);
    border: 1px solid var(--clr-glass-border);
}

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

.btn-share {
    font-size: 14px;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    flex: 1;
    min-width: 0;
}

.btn-twitter {
    background: #1d9bf0;
    color: white;
}
.btn-twitter:hover { background: #1a8cd8; }

.btn-whatsapp {
    background: #25d366;
    color: white;
}
.btn-whatsapp:hover { background: #20bd5a; }

.btn-copy {
    background: var(--clr-surface);
    color: var(--clr-text);
    border: 1px solid var(--clr-glass-border);
}
.btn-copy:hover { background: var(--clr-surface-hover); }

/* --- Header / Navigation --- */
.main-header {
    width: 100%;
    padding: 16px 24px;
    background: rgba(15, 12, 41, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--clr-glass-border);
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    color: var(--clr-text);
    text-decoration: none;
    background: linear-gradient(135deg, var(--clr-text), var(--clr-primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 16px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--clr-text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--clr-accent-light);
}

/* --- Difficulty Selector --- */
.difficulty-selector {
    margin-bottom: 32px;
}

.difficulty-label {
    font-size: 14px;
    color: var(--clr-text-muted);
    margin-bottom: 12px;
}

.difficulty-options {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.btn-diff {
    background: var(--clr-surface);
    border: 1px solid var(--clr-glass-border);
    color: var(--clr-text-muted);
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-diff.active {
    background: rgba(139, 92, 246, 0.2);
    border-color: var(--clr-primary);
    color: var(--clr-primary-light);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.4);
}

.btn-diff:hover:not(.active) {
    background: var(--clr-surface-hover);
    color: var(--clr-text);
}

/* --- Welcome Screen --- */
.welcome-card {
    text-align: center;
    padding: 48px 28px;
}

.welcome-icon {
    margin-bottom: 16px;
    animation: pulse 2s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-icon svg {
    width: 72px;
    height: 72px;
}

.welcome-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 7vw, 44px);
    font-weight: 900;
    background: linear-gradient(135deg, var(--clr-text), var(--clr-primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
    margin-bottom: 16px;
}

.welcome-subtitle {
    font-size: 16px;
    color: var(--clr-text-muted);
    max-width: 400px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.welcome-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-bottom: 36px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    color: var(--clr-accent-light);
}

.stat-label {
    font-size: 13px;
    color: var(--clr-text-dim);
    margin-top: 2px;
}

.welcome-note {
    margin-top: 20px;
    font-size: 13px;
    color: var(--clr-text-dim);
}

/* --- Instructions Screen --- */
.instruction-card {
    text-align: center;
    padding: 48px 28px;
}

.progress-bar-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.05);
    border-radius: 2px 2px 0 0;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--clr-primary), var(--clr-accent));
    border-radius: 2px;
    transition: width 0.5s ease;
    width: 0%;
}

.game-badge {
    display: inline-block;
    background: var(--clr-surface-hover);
    border: 1px solid var(--clr-glass-border);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 13px;
    color: var(--clr-text-muted);
    margin-bottom: 24px;
}

.instruction-icon {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.instruction-icon svg {
    width: 56px;
    height: 56px;
}

.instruction-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--clr-text);
}

.instruction-text {
    font-size: 15px;
    color: var(--clr-text-muted);
    max-width: 360px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

/* --- Game Card shared --- */
.game-card {
    padding: 32px 24px;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.game-badge-small {
    font-size: 13px;
    color: var(--clr-text-muted);
    background: var(--clr-surface-hover);
    padding: 4px 12px;
    border-radius: 12px;
}

.game-level, .game-timer {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--clr-accent-light);
}

.game-prompt {
    text-align: center;
    font-size: 16px;
    color: var(--clr-text-muted);
    margin-bottom: 20px;
}

.game-hint {
    text-align: center;
    font-size: 13px;
    color: var(--clr-text-dim);
    margin-top: 16px;
}

/* --- Game 1: Reaction Time --- */
.reaction-zone {
    width: 100%;
    height: 280px;
    border-radius: var(--radius-md);
    background: var(--clr-danger);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
}

.reaction-zone.waiting {
    background: var(--clr-danger);
}

.reaction-zone.ready {
    background: var(--clr-success);
}

.reaction-zone.clicked {
    background: var(--clr-accent);
}

.reaction-zone.too-early {
    background: var(--clr-warning);
}

.reaction-content {
    text-align: center;
    padding: 20px;
}

.reaction-text {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: white;
}

.reaction-time-result {
    font-family: var(--font-display);
    font-size: 48px;
    font-weight: 900;
    color: white;
    margin-top: 8px;
}

/* --- Game 2: Number Memory --- */
.number-display-area {
    text-align: center;
    margin-bottom: 24px;
}

.number-display {
    font-family: var(--font-display);
    font-size: clamp(36px, 10vw, 56px);
    font-weight: 900;
    letter-spacing: 8px;
    color: var(--clr-accent-light);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.number-timer-bar {
    height: 4px;
    background: linear-gradient(90deg, var(--clr-primary), var(--clr-accent));
    border-radius: 2px;
    margin-top: 16px;
    transition: width linear;
}

.number-input-area {
    text-align: center;
}

.number-input {
    width: 100%;
    max-width: 280px;
    padding: 14px 20px;
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    letter-spacing: 4px;
    background: rgba(255,255,255,0.08);
    border: 2px solid var(--clr-glass-border);
    border-radius: var(--radius-sm);
    color: var(--clr-text);
    outline: none;
    transition: border-color var(--transition);
    margin-bottom: 16px;
}

.number-input:focus {
    border-color: var(--clr-primary);
}

.number-input::-webkit-outer-spin-button,
.number-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.number-input[type=number] {
    -moz-appearance: textfield;
}

.number-feedback {
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
}

.number-feedback.correct {
    background: rgba(16, 185, 129, 0.15);
    color: var(--clr-success);
}

.number-feedback.wrong {
    background: rgba(239, 68, 68, 0.15);
    color: var(--clr-danger);
}

/* --- Game 3: Pattern Recognition --- */
.pattern-sequence {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    min-height: 80px;
}

.pattern-item {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: var(--clr-surface-hover);
    border: 2px solid var(--clr-glass-border);
}

.pattern-item.mystery {
    border: 2px dashed var(--clr-primary);
    font-size: 24px;
    color: var(--clr-primary-light);
    animation: pulse 1.5s infinite;
}

.pattern-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.pattern-option {
    padding: 16px;
    font-size: 28px;
    background: var(--clr-surface);
    border: 2px solid var(--clr-glass-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    color: var(--clr-text);
    text-align: center;
}

.pattern-option:hover {
    background: var(--clr-surface-hover);
    border-color: var(--clr-primary);
    transform: translateY(-2px);
}

.pattern-option.correct-answer {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--clr-success);
}

.pattern-option.wrong-answer {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--clr-danger);
}

.pattern-score {
    text-align: center;
    font-size: 14px;
    color: var(--clr-text-muted);
}

/* --- Game 4: Math Speed --- */
.math-problem {
    text-align: center;
    font-family: var(--font-display);
    font-size: clamp(32px, 8vw, 48px);
    font-weight: 900;
    color: var(--clr-text);
    margin-bottom: 28px;
    min-height: 60px;
}

.math-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.math-option {
    padding: 16px;
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    background: var(--clr-surface);
    border: 2px solid var(--clr-glass-border);
    border-radius: var(--radius-sm);
    color: var(--clr-text);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.math-option:hover {
    background: var(--clr-surface-hover);
    border-color: var(--clr-primary);
    transform: translateY(-2px);
}

.math-option.correct-answer {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--clr-success);
}

.math-option.wrong-answer {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--clr-danger);
}

.math-score {
    text-align: center;
    font-size: 14px;
    color: var(--clr-text-muted);
}

/* --- Game 5: Simon (Sequence Memory) --- */
.simon-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 300px;
    margin: 0 auto;
}

.simon-btn {
    aspect-ratio: 1;
    border: 2px solid var(--clr-glass-border);
    border-radius: var(--radius-sm);
    background: var(--clr-surface);
    cursor: pointer;
    transition: all 0.15s ease;
}

.simon-btn:hover {
    background: var(--clr-surface-hover);
}

.simon-btn.flash {
    background: var(--clr-primary) !important;
    border-color: var(--clr-primary-light) !important;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
    transform: scale(1.05);
}

.simon-btn.user-tap {
    background: var(--clr-accent) !important;
    border-color: var(--clr-accent-light) !important;
    transform: scale(0.95);
}

.simon-btn.error-flash {
    background: var(--clr-danger) !important;
    border-color: var(--clr-danger) !important;
}

.simon-btn:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* --- Results Screen --- */
.results-card {
    text-align: center;
    padding: 40px 24px;
}

.results-header {
    margin-bottom: 24px;
}

.results-icon {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.results-icon svg {
    width: 52px;
    height: 52px;
}

.results-label {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    color: var(--clr-text-muted);
    margin-bottom: 8px;
}

.results-age {
    font-family: var(--font-display);
    font-size: clamp(64px, 18vw, 96px);
    font-weight: 900;
    background: linear-gradient(135deg, var(--clr-primary-light), var(--clr-accent-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    animation: scoreReveal 0.6s ease;
}

.results-age-label {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    color: var(--clr-text-muted);
    margin-top: -4px;
}

.results-percentile {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(6, 182, 212, 0.12));
    border: 1px solid var(--clr-glass-border);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    font-size: 15px;
    color: var(--clr-text-muted);
    margin-bottom: 32px;
}

.results-percentile strong {
    color: var(--clr-accent-light);
}

.results-breakdown {
    text-align: left;
    margin-bottom: 28px;
}

.breakdown-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--clr-text);
    margin-bottom: 16px;
}

.breakdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.breakdown-label {
    font-size: 13px;
    color: var(--clr-text-muted);
    min-width: 110px;
    white-space: nowrap;
}

.breakdown-bar-bg {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    overflow: hidden;
}

.breakdown-bar {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--clr-primary), var(--clr-accent));
    transition: width 1s ease;
    width: 0%;
}

.breakdown-value {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    color: var(--clr-accent-light);
    min-width: 30px;
    text-align: right;
}

.results-share {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

/* --- Ad Containers --- */
.ad-container {
    max-width: 640px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.ad-top {
    padding: 10px 16px;
}

.ad-results {
    margin: 24px 0;
}

.ad-placeholder {
    width: 100%;
    min-height: 90px;
    border: 2px dashed rgba(255,255,255,0.1);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: var(--clr-text-dim);
    background: rgba(255,255,255,0.02);
}

/* --- Footer --- */
.footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--clr-glass-border);
    padding: 24px 16px;
    margin-top: 20px;
}

.footer-content {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-brand {
    font-size: 14px;
    color: var(--clr-text-dim);
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    font-size: 13px;
    color: var(--clr-text-dim);
    text-decoration: none;
    transition: color var(--transition);
}

.footer-links a:hover {
    color: var(--clr-primary-light);
}

/* --- Info Sections (below fold) --- */
.info-sections {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

.info-card {
    background: var(--clr-surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--clr-glass-border);
    border-radius: var(--radius-lg);
    padding: 36px 28px;
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.info-card h2 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--clr-text), var(--clr-primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    text-align: center;
}

.info-card h3 {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 700;
    color: var(--clr-accent-light);
    margin-bottom: 8px;
    margin-top: 20px;
}

.info-card h3:first-of-type {
    margin-top: 0;
}

.info-card p {
    font-size: 15px;
    color: var(--clr-text-muted);
    line-height: 1.7;
    margin-bottom: 12px;
}

.info-card p:last-child {
    margin-bottom: 0;
}

/* How it works steps */
.steps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 8px;
}

.step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-number {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--clr-primary), var(--clr-primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 16px;
    color: white;
}

.step-content h3 {
    margin-top: 0;
    font-size: 16px;
}

.step-content p {
    font-size: 14px;
    margin-bottom: 0;
}

/* Test detail cards */
.test-detail {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--clr-glass-border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
}

.test-detail:last-child {
    margin-bottom: 0;
}

.test-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.test-detail-header svg {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.test-detail-header h3 {
    margin: 0;
    font-size: 16px;
}

.test-detail p {
    font-size: 14px;
    margin-bottom: 8px;
}

.test-detail .test-metric {
    display: inline-block;
    background: rgba(139, 92, 246, 0.12);
    border-radius: 12px;
    padding: 4px 12px;
    font-size: 12px;
    color: var(--clr-primary-light);
    font-weight: 600;
    margin-right: 6px;
    margin-top: 4px;
}

/* FAQ */
.faq-item {
    border-bottom: 1px solid var(--clr-glass-border);
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.faq-item h3 {
    color: var(--clr-text);
    font-size: 15px;
    margin-top: 0;
}

.faq-item p {
    font-size: 14px;
    margin-bottom: 0;
}

/* --- Ranking & Stats Additions --- */
.ranking-submit-area {
    margin-bottom: 32px;
    padding: 24px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-md);
}

.ranking-input-group {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.ranking-input-group input {
    flex: 1;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--clr-glass-border);
    border-radius: var(--radius-sm);
    color: var(--clr-text);
    outline: none;
    transition: border-color var(--transition);
}

.ranking-input-group input:focus {
    border-color: var(--clr-primary);
}

.btn-submit-score {
    padding: 12px 24px;
    font-weight: 700;
    font-family: var(--font-body);
    font-size: 16px;
    background: linear-gradient(135deg, var(--clr-primary), var(--clr-accent));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-submit-score:hover {
    opacity: 0.9;
}

.btn-submit-score:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ranking-msg {
    font-size: 13px;
    color: var(--clr-success);
    font-weight: 600;
    min-height: 20px;
}

/* Particles / Más chulo effects */
.particle {
    position: fixed;
    pointer-events: none;
    background: var(--clr-accent-light);
    border-radius: 50%;
    z-index: 1000;
    animation: simpleParticle 1s ease-out forwards;
}

@keyframes simpleParticle {
    0% { transform: scale(1) translateY(0); opacity: 1; }
    100% { transform: scale(0) translateY(-100px); opacity: 0; }
}

.shake {
    animation: shakeAnim 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shakeAnim {
    10%, 90% { transform: translate3d(-3px, 0, 0); }
    20%, 80% { transform: translate3d(5px, 0, 0); }
    30%, 50%, 70% { transform: translate3d(-10px, 0, 0); }
    40%, 60% { transform: translate3d(10px, 0, 0); }
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .card {
        padding: 32px 20px;
        border-radius: var(--radius-md);
    }

    .welcome-card {
        padding: 36px 20px;
    }

    .welcome-stats {
        gap: 20px;
    }

    .btn {
        padding: 12px 24px;
        font-size: 15px;
    }

    .pattern-item {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }

    .simon-grid {
        max-width: 240px;
        gap: 8px;
    }

    .results-share {
        flex-direction: column;
    }

    .breakdown-label {
        min-width: 90px;
        font-size: 12px;
    }

    .info-card {
        padding: 28px 20px;
        border-radius: var(--radius-md);
    }

    .info-card h2 {
        font-size: 20px;
    }
}

@media (min-width: 769px) {
    .app-container {
        padding: 40px 20px 60px;
    }

    .card {
        padding: 48px 40px;
    }
}

/* --- V3: Global Comparison --- */
.global-comparison {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(6, 182, 212, 0.15));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin: 16px 0;
    text-align: center;
}

.comparison-text {
    color: var(--clr-text);
    font-size: 14px;
    line-height: 1.6;
}

.comparison-text strong {
    color: var(--clr-accent-light);
    font-family: var(--font-display);
    font-size: 18px;
}

/* --- V3: Shimmer Progress Bar --- */
.progress-bar {
    background: linear-gradient(90deg, var(--clr-primary), var(--clr-accent), var(--clr-primary));
    background-size: 200% 100%;
    animation: shimmer 2s linear infinite;
}

/* --- V3: Floating Feedback --- */
.float-feedback {
    position: absolute;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 24px;
    color: var(--clr-success);
    pointer-events: none;
    z-index: 50;
    animation: floatUp 0.8s ease forwards;
}

@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-60px) scale(1.3); }
}

/* --- V3: Challenge Button Hover --- */
#btn-challenge:hover, #btn-download-card:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}
