/* ===== CSS Variables & Reset ===== */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #0ea5e9;
    --accent: #f59e0b;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #eab308;

    --bg-dark: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-card-hover: #252542;
    --bg-gradient: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 50%, #16213e 100%);

    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;

    --border-color: rgba(255, 255, 255, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);

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

    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== Utility Classes ===== */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===== Screen Management ===== */
.screen {
    display: none;
    min-height: 100vh;
    padding: 120px 20px 20px;
    /* Increased top padding for fixed header */
    animation: fadeIn 0.5s ease;
}

/* Page Container for secondary pages */
.page-container {
    padding-top: 120px;
    padding-bottom: 40px;
    min-height: 100vh;
}

.screen.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

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

/* ===== Language Selector ===== */
/* .language-selector-container removed (obsolete) */

.language-selector {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: var(--transition-normal);
}

/* .language-selector-container duplicate removed */

.language-selector:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.language-selector option {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* ===== Start Screen ===== */
.container {
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.hero {
    margin-bottom: 40px;
}

.logo-container {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
    overflow: hidden;
    padding: 20px;
}

.brain-icon {
    font-size: 4rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    animation: pulse 2s ease-out infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

.title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: -1px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 400px;
    margin: 0 auto;
}

/* ===== Feature Cards ===== */
.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.feature-card {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 25px 15px;
    transition: var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.feature-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===== Form Elements ===== */
.start-form {
    margin-bottom: 30px;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 16px 20px 16px 50px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: var(--transition-normal);
}

.input-group select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

.input-group select option {
    background: var(--bg-card);
    color: var(--text-primary);
}

.input-group input:focus,
.input-group select:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

.input-group input.error,
.input-group select.error {
    border-color: var(--danger);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
    animation: shake 0.5s ease;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-8px);
    }

    40%,
    80% {
        transform: translateX(8px);
    }
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.5);
}

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

.btn-secondary:hover:not(:disabled) {
    border-color: var(--primary);
    box-shadow: var(--shadow-glow);
}

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

.btn-arrow {
    font-size: 1.2rem;
    transition: var(--transition-fast);
}

.btn:hover .btn-arrow {
    transform: translateX(5px);
}

/* ===== Info Note ===== */
.info-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== Quiz Screen ===== */
.quiz-container {
    max-width: 800px;
    width: 100%;
}

.quiz-header {
    margin-bottom: 30px;
}

.progress-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border-color);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.progress-info span:first-child {
    font-weight: 600;
}

.timer {
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    color: var(--secondary);
}

.timer.warning {
    color: var(--warning);
}

.timer.danger {
    color: var(--danger);
    animation: blink 1s infinite;
}

@keyframes blink {
    50% {
        opacity: 0.5;
    }
}

.progress-bar {
    height: 8px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

/* ===== Question Card ===== */
.question-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.question-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
}

.question-badge {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.question-instruction {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 25px;
}

.question-visual {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 280px;
    /* Fixed height to prevent layout shift */
    min-height: 280px;
    padding: 20px;
}

/* ===== Options ===== */
.options-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.option-btn {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 25px;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition-normal);
    text-align: left;
}

.option-btn:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    transform: translateX(5px);
}

.option-btn.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.2);
    box-shadow: var(--shadow-glow);
}

.option-letter {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-dark);
    border-radius: 50%;
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.option-text {
    font-size: 1.5rem;
}

.quiz-footer {
    display: flex;
    justify-content: flex-end;
}

/* ===== Result Screen ===== */
#result-screen {
    padding: 5px 15px;
}

.result-container {
    max-width: 650px;
    width: 100%;
    text-align: center;
}

.result-header h1 {
    font-size: 1.6rem;
    margin-bottom: 0;
}

.result-name {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.edit-icon {
    font-size: 1rem;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition-fast);
}

.edit-icon:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* ===== IQ Display ===== */
.iq-display {
    margin-bottom: 10px;
}

.iq-circle {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 5px;
}

.iq-progress {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.iq-bg {
    fill: none;
    stroke: var(--bg-dark);
    stroke-width: 12;
}

.iq-fill {
    fill: none;
    stroke: url(#iq-gradient);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-dasharray: 565;
    stroke-dashoffset: 565;
    transition: stroke-dashoffset 2s ease, stroke 0.5s ease;
}

.iq-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.iq-value span:first-child {
    display: block;
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1;
}

.iq-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.iq-category {
    font-size: 1rem;
    font-weight: 700;
}

/* ===== Stats Grid ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.stat-icon {
    font-size: 1.2rem;
}

.stat-value {
    font-size: 0.9rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* ===== IQ Scale ===== */
.iq-scale {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    direction: ltr !important;
    /* Always LTR for correct low-to-high scale */
}

.iq-scale h3 {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.scale-bar {
    display: flex;
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    margin-bottom: 10px;
}

.scale-segment {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scale-segment span {
    font-size: 0.7rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.scale-marker {
    position: absolute;
    top: -8px;
    width: 4px;
    height: 46px;
    background: white;
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: left 1s ease;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    color: var(--text-muted);
}

.scale-description {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 10px;
    text-align: center;
    font-weight: 500;
}

/* ===== Result Description ===== */
.result-description {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 8px 10px;
    margin-bottom: 10px;
    text-align: left;
}

.result-description h4 {
    margin-bottom: 10px;
    color: var(--primary-light);
}

.result-description p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.percentile-note {
    margin-top: 5px;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 5px;
}

/* ===== Visual Matrix Styles ===== */

/* 2x2 Matrix */
.matrix-2x2 {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px;
    background: var(--bg-dark);
    border-radius: var(--radius-md);
}

.matrix-2x2 .visual-row {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.matrix-2x2 .visual-cell {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 2.2rem;
}

/* 3x3 Matrix */
.matrix-3x3 {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 20px;
    background: var(--bg-dark);
    border-radius: var(--radius-md);
}

.matrix-3x3 .visual-row {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.matrix-3x3 .visual-cell {
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1.5rem;
    letter-spacing: -1.5px;
}

.visual-cell.highlight {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.2);
    animation: pulse-highlight 1.5s ease-in-out infinite;
}

@keyframes pulse-highlight {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(99, 102, 241, 0);
    }
}

/* Sequence */
.visual-sequence {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 20px;
}

.visual-item {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1.8rem;
}

.visual-item.highlight {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.2);
}

.visual-arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
}

/* Analogy */
.visual-analogy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 20px;
}

.analogy-pair {
    display: flex;
    align-items: center;
    gap: 15px;
}

.analogy-item {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 1.8rem;
    letter-spacing: 2px;
}

.analogy-item.highlight {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.2);
}

.analogy-arrow,
.analogy-equals {
    font-size: 1.5rem;
    color: var(--text-muted);
}

/* Confetti */
.confetti-piece {
    position: fixed;
    top: -20px;
    animation: confetti-fall 3s linear forwards;
    z-index: 1000;
}

@keyframes confetti-fall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ===== RTL Support ===== */
html[dir="rtl"] .input-icon {
    left: auto;
    right: 18px;
}

html[dir="rtl"] .input-group input {
    padding: 16px 50px 16px 20px;
}

html[dir="rtl"] .btn-arrow {
    transform: scaleX(-1);
}

html[dir="rtl"] .btn:hover .btn-arrow {
    transform: scaleX(-1) translateX(-5px);
}

html[dir="rtl"] .option-btn:hover {
    transform: translateX(-5px);
}

html[dir="rtl"] .iq-scale h3 {
    direction: rtl;
    text-align: right;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .title {
        font-size: 2.5rem;
    }

    .features {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .feature-card {
        padding: 12px 8px;
    }

    .feature-icon {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }

    .feature-card h3 {
        font-size: 0.85rem;
    }

    .feature-card p {
        font-size: 0.65rem;
    }

    .options-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 20px;
    }

    .option-card {
        padding: 10px;
        min-height: 50px;
    }

    .option-key {
        width: 24px;
        height: 24px;
        font-size: 0.8rem;
    }

    .question-card {
        padding: 15px;
        margin-bottom: 15px;
        min-height: auto;
    }

    .question-visual {
        min-height: 150px;
        padding: 10px;
    }

    .quiz-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
        margin-bottom: 20px;
    }

    .stat-card {
        padding: 6px 2px;
        gap: 4px;
        border-radius: var(--radius-md);
    }

    .stat-icon {
        font-size: 1.1rem;
    }

    .stat-value {
        font-size: 0.95rem;
    }

    .stat-label {
        font-size: 0.55rem;
    }

    .question-card {
        padding: 15px;
    }

    .iq-circle {
        width: 180px;
        height: 180px;
    }

    .iq-value span:first-child {
        font-size: 3rem;
    }

    /* FIX: Reduce font size and widen container for IQ Scale on mobile */
    .iq-scale {
        margin-left: -10px;
        margin-right: -10px;
        width: calc(100% + 20px);
    }

    .scale-segment span {
        font-size: 0.6rem;
        /* Slightly larger than 0.55rem for readability */
        padding: 0 1px;
        letter-spacing: -0.5px;
    }

    .scale-description {
        font-size: 0.65rem;
    }

    .matrix-2x2 .visual-cell {
        width: 80px;
        height: 80px;
        font-size: 1.8rem;
    }

    .matrix-3x3 .visual-cell {
        width: 60px;
        height: 60px;
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .screen {
        padding: 100px 15px 15px;
        /* Ensure top padding for fixed header */
    }

    /* .language-selector-container override removed */

    .language-selector {
        padding: 4px 8px;
        font-size: 0.75rem;
    }

    .title {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .btn {
        width: 100%;
        padding: 14px 30px;
    }

    .scale-labels {
        display: none;
    }

    /* Sequence Fix for Mobile */
    .visual-sequence {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: center;
        padding: 5px 0;
        gap: 2px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .visual-sequence::-webkit-scrollbar {
        display: none;
    }

    .visual-sequence .visual-item {
        width: 38px;
        height: 38px;
        font-size: 1.1rem;
        flex-shrink: 0;
        border-width: 1.5px;
    }

    .visual-arrow {
        font-size: 0.9rem;
        min-width: 10px;
        flex-shrink: 0;
        margin: 0 1px;
    }

    /* Analogy Fix for Mobile */
    .visual-analogy {
        flex-direction: column;
        gap: 15px;
        padding: 5px 0;
        align-items: center;
        flex-wrap: nowrap;
    }

    .analogy-equals {
        transform: rotate(90deg);
        margin: 5px 0;
        font-size: 1.2rem;
    }

    .analogy-pair {
        gap: 10px;
    }

    .analogy-item {
        width: 75px;
        height: 75px;
        font-size: 1.15rem;
        letter-spacing: -1px;
    }

    /* Options Fix for Mobile */
    .option-text {
        font-size: 1.1rem;
        letter-spacing: -1px;
    }

    /* Matrix Fix for Mobile */
    .matrix-3x3 .visual-cell {
        width: 65px;
        height: 65px;
        font-size: 1rem;
        letter-spacing: -1px;
    }
}

/* ===== Social Share Buttons ===== */
.share-section {
    margin: 15px 0;
    padding: 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.share-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.share-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition-normal);
    color: white;
}

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

.share-btn.twitter {
    background: #000000;
}

.share-btn.twitter:hover {
    background: #333333;
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.facebook:hover {
    background: #166fe5;
}

.share-btn.whatsapp {
    background: #25d366;
}

.share-btn.whatsapp:hover {
    background: #20bd5a;
}

.share-btn.copy {
    background: var(--primary);
}

.share-btn.copy:hover {
    background: var(--primary-dark);
}

.share-btn.copy.copied {
    background: var(--success);
}

/* ===== Ad Banner ===== */
.ad-banner {
    display: none;
    /* Hidden for single-screen result page */
    margin: 25px 0;
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.ad-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    color: var(--text-muted);
}

.ad-placeholder span {
    font-size: 2rem;
    margin-bottom: 10px;
}

.ad-placeholder p {
    font-size: 1rem;
    font-weight: 600;
}

.ad-placeholder small {
    font-size: 0.75rem;
    opacity: 0.6;
}

/* When real AdSense is added */
.ad-banner.active {
    border: none;
}

.ad-banner.active .ad-placeholder {
    display: none;
}

@media (max-width: 480px) {
    .share-buttons {
        flex-direction: column;
    }

    .share-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===== Footer Links ===== */
.footer-links {
    margin-top: 20px;
    text-align: center;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: var(--transition-fast);
}

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

/* ===== Free Result Badge ===== */
.free-result-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(16, 185, 129, 0.1));
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 50px;
    margin-bottom: 20px;
    animation: pulse-glow 2s ease-in-out infinite;
}

.free-result-badge .badge-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    font-size: 14px;
    font-weight: bold;
}

.free-result-badge span:last-child {
    color: #22c55e;
    font-size: 0.9rem;
    font-weight: 600;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(34, 197, 94, 0.2);
    }

    50% {
        box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
    }
}

/* ===== Content Sections (AdSense Compliance) ===== */
.content-section {
    margin: 50px 0;
    text-align: left;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: center;
    color: var(--text-primary);
}

/* Steps Grid */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.step-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 25px 20px;
    text-align: center;
    position: relative;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 50%;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.step-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.step-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Content Text */
.content-text {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 25px;
}

.content-text p {
    margin-bottom: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.content-text p:last-child {
    margin-bottom: 0;
}

.content-text strong {
    color: var(--primary-light);
}

/* FAQ Accordion */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.faq-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.faq-item summary {
    padding: 18px 20px;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-normal);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.3rem;
    color: var(--primary);
    transition: var(--transition-fast);
}

.faq-item[open] summary::after {
    content: '−';
}

.faq-item summary:hover {
    background: var(--bg-card-hover);
}

.faq-item p {
    padding: 0 20px 18px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Footer Links Extended */
.footer-separator {
    color: var(--text-muted);
    margin: 0 10px;
}

/* Responsive for content sections */
@media (max-width: 768px) {
    .steps-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .content-text {
        padding: 20px;
    }

    .faq-item summary {
        padding: 15px;
    }
}

/* ===== Static Pages (About, FAQ) ===== */
.page-container {
    min-height: 100vh;
    padding: 40px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

.back-link:hover {
    color: var(--primary);
}

.page-content {
    margin-bottom: 50px;
}

.page-footer {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--glass-border);
    color: var(--text-muted);
}

.page-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

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

/* ===== Result Modal ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 40px;
    max-width: 450px;
    width: 100%;
    text-align: center;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.modal-header {
    margin-bottom: 30px;
}

.modal-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 15px;
    animation: bounce 0.6s ease;
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.modal-header h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--primary-light), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

.modal-body {
    margin-bottom: 25px;
}

.modal-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 10px;
}

/* ===== Large Button ===== */
.btn-large {
    padding: 20px 50px;
    font-size: 1.2rem;
}

@media (max-width: 480px) {
    .modal-content {
        padding: 30px 20px;
    }

    .modal-icon {
        font-size: 3rem;
    }

    .modal-header h2 {
        font-size: 1.5rem;
    }

    .btn-large {
        padding: 16px 40px;
        font-size: 1.1rem;
        width: 100%;
    }
}

/* ===== Compact Result Screen (fits on single page - DESKTOP ONLY) ===== */
@media (min-height: 800px) and (min-width: 768px) {
    .result-container {
        padding: 5px 0;
    }

    .result-header h1 {
        font-size: 2.2rem;
        margin-bottom: 5px;
    }

    .result-name {
        margin-bottom: 15px;
        gap: 5px;
        font-size: 1.1rem;
    }

    .iq-display {
        margin-bottom: 15px;
    }

    .iq-circle {
        width: 180px;
        height: 180px;
        margin: 0 auto 10px;
    }

    .iq-value span:first-child {
        font-size: 3.5rem;
    }

    .iq-category {
        font-size: 1.3rem;
    }

    .stats-grid {
        gap: 12px;
        margin-bottom: 15px;
    }

    .stat-card {
        padding: 15px 12px;
        gap: 5px;
    }

    .stat-icon {
        font-size: 1.3rem;
    }

    .stat-value {
        font-size: 1.3rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    .iq-scale {
        padding: 15px;
        margin-bottom: 15px;
    }

    .iq-scale h3 {
        margin-bottom: 10px;
        font-size: 0.95rem;
    }

    .scale-bar {
        height: 26px;
    }

    .scale-segment span {
        font-size: 0.65rem;
    }

    .scale-labels {
        font-size: 0.6rem;
    }

    .result-description {
        padding: 12px;
        margin-bottom: 10px;
    }

    .result-description h4 {
        font-size: 0.95rem;
        margin-bottom: 5px;
    }

    .result-description p {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .percentile-note {
        margin-top: 8px;
        padding-top: 8px;
        font-size: 0.75rem;
    }

    /* Share section more prominent */
    .share-section {
        margin-bottom: 5px;
        /* Minimal gap */
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .share-section h3 {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }

    .share-buttons {
        gap: 6px;
    }

    .share-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .share-btn svg {
        width: 14px;
        height: 14px;
    }

    /* Hide ad banner on result screen to save space */
    .ad-banner {
        display: none;
    }

    /* Restart button */
    #restart-btn {
        padding: 10px 25px;
        font-size: 0.95rem;
        margin-top: 5px;
    }
}

/* End of @media (min-height: 800px) and (min-width: 768px) */

/* ===== Premium Report Styles ===== */
.premium-section {
    margin: 12px 0;
    text-align: center;
}

.btn-premium {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.5);
}

.premium-icon {
    font-size: 1.1em;
}

.premium-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Premium Modal */
.premium-modal {
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
}

.premium-modal .modal-header {
    margin-bottom: 15px;
}

.premium-modal .modal-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.premium-modal .modal-header h2 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    padding-right: 30px;
    /* Prevent overlap with close button */
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.premium-body {
    padding: 10px 0;
}

.premium-section-block {
    margin-bottom: 12px;
}

.premium-section-block h3 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Category Chart */
.category-chart {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.category-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.category-name {
    width: 75px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: right;
    flex-shrink: 0;
}

.category-bar-container {
    flex: 1;
    height: 14px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 7px;
    overflow: hidden;
}

.category-bar {
    height: 100%;
    border-radius: 7px;
    transition: width 0.5s ease;
}

.category-score {
    width: 35px;
    font-size: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Premium Stats Grid */
.premium-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.premium-stat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    text-align: center;
}

.premium-stat-card.strong {
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.premium-stat-card.weak {
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.premium-stat-icon {
    font-size: 1.2rem;
}

.premium-stat-label {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.premium-stat-value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Time Analysis */
.time-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
}

.time-stat span {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.time-stat strong {
    color: var(--primary-light);
    font-size: 1rem;
}

/* Certificate Button */
.certificate-section {
    text-align: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.btn-certificate {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-certificate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(245, 158, 11, 0.4);
}

/* Mobile responsive for premium modal */
@media (max-width: 480px) {
    .premium-modal {
        max-height: 90vh;
        margin: 10px;
    }

    .category-name {
        width: 70px;
        font-size: 0.75rem;
    }

    .premium-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .btn-premium,
    .btn-certificate {
        width: 100%;
        justify-content: center;
    }
}

/* ===== Modern Layout Improvements (Added) ===== */

/* Grid for Details (Desktop) */
.result-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 10px;
    align-items: start;
}

/* Override existing margins inside grid */
.result-details-grid .iq-scale,
.result-details-grid .result-description {
    margin-bottom: 0;
    height: 100%;
    /* Equal height */
}

/* Action Buttons Row (Desktop) */
.result-actions-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 20px;
}

/* Reset existing margins for buttons in row */
.result-actions-row .premium-section {
    margin: 0;
    width: auto;
}

.result-actions-row #restart-btn {
    margin-top: 0;
}

/* Mobile Responsive Adjustments */
@media (max-width: 650px) {
    .result-details-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .result-actions-row {
        flex-direction: row;
        /* Force side-by-side */
        gap: 10px;
        align-items: stretch;
    }

    .result-actions-row .premium-section {
        width: auto;
        flex: 1;
        margin: 0;
    }

    .result-actions-row .premium-section button {
        width: 100%;
        height: 100%;
        /* Match height */
        padding: 12px 10px;
        font-size: 0.8rem;
    }

    .result-actions-row #restart-btn {
        width: auto;
        flex: 1;
        padding: 12px 10px;
        font-size: 0.8rem;
    }
}

/* ===== Dashboard Layout Styles (Split Layout) ===== */

.result-container {
    max-width: 850px;
    /* Wider for dashboard */
    width: 100%;
    text-align: center;
    padding: 10px;
}

.result-header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.dashboard-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin: 20px 0;
    text-align: left;
}

.dashboard-left {
    flex: 0 0 35%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 10px;
}

.dashboard-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* IQ Category Styling */
.iq-category {
    margin-top: 10px;
    margin-bottom: 10px;
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 700;
}

.result-description-main {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    background: var(--bg-card);
    padding: 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    width: 100%;
}

.result-description-main p {
    margin-bottom: 8px;
}

.result-description-main .percentile-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    margin-top: 8px;
}

/* Stats Grid in Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 0;
}

/* Compact Scale */
.iq-scale-compact {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 15px;
    border: 1px solid var(--border-color);
}

.iq-scale-compact h3 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-align: left;
    color: var(--text-secondary);
}

/* Actions Footer */
.dashboard-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 10px;
}

.share-section-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.share-title {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.action-buttons-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dashboard-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .dashboard-left {
        width: 100%;
        margin-bottom: 10px;
    }

    .dashboard-right {
        width: 100%;
        gap: 15px;
    }

    .stats-grid {
        gap: 5px;
    }

    .iq-scale-compact h3 {
        text-align: center;
    }

    .action-buttons-row {
        flex-direction: column;
        width: 100%;
    }

    .action-buttons-row button,
    .action-buttons-row .premium-section {
        width: 100%;
        margin: 5px 0;
    }
}

/* ===== Dashboard Layout Styles (Split Layout) ===== */

.result-container {
    max-width: 850px;
    /* Wider for dashboard */
    width: 100%;
    text-align: center;
    padding: 10px;
}

.result-header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.dashboard-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin: 20px 0;
    text-align: left;
}

.dashboard-left {
    flex: 0 0 35%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 10px;
}

.dashboard-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* IQ Category Styling */
.iq-category {
    margin-top: 10px;
    margin-bottom: 10px;
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 700;
}

.result-description-main {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    background: var(--bg-card);
    padding: 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    width: 100%;
}

.result-description-main p {
    margin-bottom: 8px;
}

.result-description-main .percentile-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    margin-top: 8px;
}

/* Stats Grid in Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 0;
}

/* Compact Scale */
.iq-scale-compact {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 15px;
    border: 1px solid var(--border-color);
}

.iq-scale-compact h3 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-align: left;
    color: var(--text-secondary);
}

/* Actions Footer */
.dashboard-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 10px;
}

.share-section-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.share-title {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.action-buttons-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dashboard-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .dashboard-left {
        width: 100%;
        margin-bottom: 10px;
    }

    .dashboard-right {
        width: 100%;
        gap: 15px;
    }

    .stats-grid {
        gap: 5px;
    }

    .iq-scale-compact h3 {
        text-align: center;
    }

    .action-buttons-row {
        flex-direction: column;
        width: 100%;
    }

    .action-buttons-row button,
    .action-buttons-row .premium-section {
        width: 100%;
        margin: 5px 0;
    }
}

/* ===== Dashboard Layout Styles (Split Layout) ===== */

.result-container {
    max-width: 850px;
    width: 100%;
    margin: 0 auto;
    text-align: center;
    padding: 10px;
}

.result-header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.dashboard-content {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin: 20px 0;
    text-align: left;
}

.dashboard-left {
    flex: 0 0 35%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 10px;
}

.dashboard-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* IQ Category Styling */
.iq-category {
    margin-top: 10px;
    margin-bottom: 10px;
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 700;
}

.result-description-main {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    background: var(--bg-card);
    padding: 15px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    width: 100%;
}

.result-description-main p {
    margin-bottom: 8px;
}

.result-description-main .percentile-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 8px;
    margin-top: 8px;
}

/* Stats Grid in Dashboard */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 0;
}

/* Compact Scale */
.iq-scale-compact {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 15px;
    border: 1px solid var(--border-color);
}

.iq-scale-compact h3 {
    font-size: 0.9rem;
    margin-bottom: 10px;
    text-align: left;
    color: var(--text-secondary);
}

/* Actions Footer */
.dashboard-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 20px;
    margin-top: 10px;
}

.share-section-compact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.share-title {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.share-buttons {
    display: flex;
    gap: 10px;
}

.action-buttons-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .dashboard-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .dashboard-left {
        width: 100%;
        margin-bottom: 10px;
    }

    .dashboard-right {
        width: 100%;
        gap: 15px;
    }

    .stats-grid {
        gap: 5px;
    }

    .iq-scale-compact h3 {
        text-align: center;
        font-size: 0.8rem;
    }

    .action-buttons-row {
        flex-direction: column;
        width: 100%;
    }

    .action-buttons-row button,
    .action-buttons-row .premium-section {
        width: 100%;
        margin: 5px 0;
    }
}

/* ===== UI Polish (Icons & Text) ===== */

/* New Stat Icon Wrappers */
.stat-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-bottom: 5px;
}

.stat-icon-wrapper svg {
    width: 18px;
    height: 18px;
    stroke-width: 2.5;
}

.stat-icon-wrapper.success {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.stat-icon-wrapper.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.stat-icon-wrapper.warning {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
}

.stat-icon-wrapper.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

/* Stat Cards Update */
.stat-card {
    padding: 12px 8px;
    gap: 8px;
}

.stat-value {
    font-size: 1.1rem;
}

/* Center Description to fix empty space */
.result-description-main {
    text-align: center;
    padding: 20px;
}

/* IQ Scale Font Fix */
.iq-scale-compact .scale-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 5px;
    padding: 0 2px;
}

.iq-scale-compact .scale-labels span {
    font-size: 0.65rem;
    /* Slightly larger/readable */
    color: var(--text-muted);
    text-align: center;
    width: 14%;
    /* Distribute evenly */
    line-height: 1.2;
}

/* Mobile fix for scale labels */
@media (max-width: 500px) {
    .iq-scale-compact .scale-labels span {
        font-size: 0.55rem;
        display: none;
        /* Hide labels on very small screens? No, keep but small */
    }

    .iq-scale-compact .scale-labels span:nth-child(2),
    /* Very Low */
    .iq-scale-compact .scale-labels span:nth-child(6) {
        /* Superior */
        display: block;
        /* Show critical ones? Or show all. Let's try showing all but small. */
        display: inline-block;
    }

    /* Better: Only Show Low, Avg, High on mobile? */
    .iq-scale-compact .scale-labels span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}


/* ===== Performance Card (Fill Gap) ===== */
.performance-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: auto;
    /* Push to bottom if flex container allows */
    min-height: 80px;
    /* Match left side height roughly */
}

.perf-icon {
    font-size: 2rem;
    background: var(--bg-card);
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.perf-content h4 {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.perf-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.perf-title {
    background: -webkit-linear-gradient(45deg, #6366f1, #a855f7);
    background: linear-gradient(45deg, #6366f1, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.perf-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.8;
}


/* ===== Vertical Layout Revert (User Feedback) ===== */

/* Force Vertical Stack Layout */
.dashboard-content {
    flex-direction: column !important;
    align-items: center !important;
    max-width: 650px !important;
    /* Compact width */
    margin: 20px auto !important;
    gap: 25px !important;
}

.dashboard-left,
.dashboard-right {
    width: 100% !important;
    flex: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    /* Center content */
}

/* Center Align Texts */
.dashboard-left {
    text-align: center !important;
    padding-top: 0 !important;
}

.result-description-main {
    text-align: center !important;
    max-width: 100% !important;
}

.iq-scale-compact h3,
.iq-category {
    text-align: center !important;
}

/* Adjust components for vertical flow */
.stats-grid {
    width: 100%;
}

.iq-scale-compact {
    width: 100%;
}

.performance-card {
    width: 100%;
    margin-top: 10px;
}

.result-container {
    padding: 20px 10px;
}


/* ===== Simplification Updates ===== */
.stat-subtext {
    display: block;
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.stat-card .stat-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Prevent text overflow */
}

/* Remove borders from dashboard main content for cleaner look in vertical mode */
.result-description-main {
    display: none;
    /* Hide if still present */
}


/* ===== Footer Alignment Fix (Center & Compact) ===== */
.dashboard-footer {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 650px !important;
    /* Match main content width */
    margin: 20px auto 0 auto !important;
    padding-top: 20px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.share-section-compact,
.action-buttons-row {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    width: 100% !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
}

/* Ensure buttons don't stretch too much */
.action-buttons-row button,
.action-buttons-row .premium-section {
    width: auto !important;
    min-width: 150px !important;
}


/* ===== Final Footer Fix ===== */
.result-container {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.dashboard-footer {
    width: 100% !important;
    margin-top: 20px !important;
    order: 10 !important;
    /* Ensure it's at the bottom */
}


/* ===== Mobile Layout Fixes (Compact & Clean) ===== */
@media (max-width: 600px) {

    /* 1. Reduce Container Padding to maximize width */
    .result-container {
        padding: 5px !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    /* 2. Scale Down IQ Header */
    .iq-display {
        transform: scale(0.9);
        margin-bottom: -10px;
        margin-top: -10px;
    }

    .iq-category {
        font-size: 1.3rem !important;
        margin: 5px 0 !important;
    }

    /* 3. Compact Stats */
    .stats-grid {
        gap: 8px !important;
    }

    .stat-card {
        padding: 8px 4px !important;
        min-height: 60px !important;
    }

    .stat-value {
        font-size: 1rem !important;
    }

    .stat-label {
        font-size: 0.7rem !important;
    }

    .stat-icon-wrapper {
        width: 24px !important;
        height: 24px !important;
    }

    .stat-icon-wrapper svg {
        width: 14px !important;
        height: 14px !important;
    }

    /* 4. Fix Footer Overlap & Spacing */
    .dashboard-footer {
        margin-top: 15px !important;
        padding-top: 15px !important;
        gap: 15px !important;
    }

    .share-section-compact {
        flex-direction: row !important;
        /* Force side-by-side */
        align-items: center !important;
        gap: 10px !important;
        margin-bottom: 0 !important;
        flex-wrap: nowrap !important;
    }

    .share-buttons {
        gap: 8px !important;
    }

    .share-btn {
        width: 32px !important;
        height: 32px !important;
    }

    /* 5. Compact Buttons */
    .action-buttons-row {
        flex-direction: column !important;
        /* Stack buttons on mobile for ease of use */
        gap: 10px !important;
        width: 100% !important;
    }

    .action-buttons-row button,
    .action-buttons-row .premium-section {
        width: 100% !important;
        max-width: 300px !important;
        /* Prevent too wide */
    }
}


/* ===== Mobile Layout Fix 2 (Vertical Footer Override) ===== */
@media (max-width: 600px) {

    /* Stack Footer Elements Vertically */
    .share-section-compact {
        flex-direction: column !important;
        gap: 20px !important;
        align-items: center !important;
        padding-bottom: 10px !important;
    }

    /* Share Row (Icons) */
    .share-buttons {
        display: flex !important;
        flex-direction: row !important;
        gap: 15px !important;
        justify-content: center !important;
        width: 100% !important;
    }

    .share-title {
        text-align: center !important;
        width: 100% !important;
        margin-bottom: 8px !important;
        display: block !important;
    }

    /* Action Buttons (Stacked) */
    .action-buttons-row {
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important;
        margin-left: 0 !important;
    }

    .action-buttons-row button,
    .action-buttons-row .premium-section {
        width: 100% !important;
        max-width: 300px !important;
        /* Limit width */
    }
}


/* ===== Ultra Compact Mobile Fix (One Screen Goal) ===== */
@media (max-width: 600px) {

    /* 1. Header Compact */
    .result-header h1 {
        font-size: 1.4rem !important;
        margin-bottom: 2px !important;
    }

    .result-header p {
        font-size: 0.9rem !important;
        margin-bottom: 5px !important;
    }

    /* 2. Scale Down IQ Circle Significantly */
    .iq-display {
        transform: scale(0.8) !important;
        margin: -15px 0 !important;
        /* Pull content closer */
    }

    .iq-category {
        font-size: 1.1rem !important;
        margin: 0 0 5px 0 !important;
    }

    /* 3. Tighter Stats */
    .stats-grid {
        gap: 5px !important;
        margin-bottom: 5px !important;
    }

    .stat-card {
        padding: 5px 2px !important;
        min-height: 50px !important;
    }

    .stat-icon-wrapper {
        width: 20px !important;
        height: 20px !important;
        margin-bottom: 2px !important;
    }

    .stat-icon-wrapper svg {
        width: 12px !important;
        height: 12px !important;
    }

    .stat-value {
        font-size: 0.9rem !important;
    }

    .stat-label {
        font-size: 0.6rem !important;
    }

    /* 4. Compact Scale */
    .iq-scale-compact {
        padding: 8px !important;
        margin-bottom: 5px !important;
    }

    .iq-scale-compact h3 {
        font-size: 0.75rem !important;
        margin-bottom: 5px !important;
        display: none !important;
        /* Hide 'IQ Scale' title on mobile to save space */
    }

    /* 5. Compact Footer */
    .dashboard-footer {
        margin-top: 5px !important;
        padding-top: 5px !important;
    }

    .share-section-compact {
        gap: 5px !important;
        padding-bottom: 5px !important;
    }

    .share-title {
        display: none !important;
        /* Hide 'Share:' text, icon is enough or implicit */
    }

    .share-buttons {
        gap: 15px !important;
        margin-bottom: 5px !important;
    }

    /* 6. Smaller Buttons */
    .action-buttons-row {
        gap: 8px !important;
    }

    .btn {
        padding: 10px !important;
        font-size: 0.9rem !important;
        height: 40px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .premium-icon,
    .premium-badge {
        font-size: 0.9rem !important;
    }
}


/* ===== Mobile Readability Fix (Scale & Buttons) ===== */
@media (max-width: 600px) {

    /* 1. Fix IQ Scale Numbers (Make them fit and readable) */
    .iq-scale-compact .scale-ranges {
        gap: 1px !important;
        /* Minimize gap between colored boxes */
    }

    .iq-scale-compact .range-box {
        font-size: 0.7rem !important;
        /* Increase size slightly */
        font-weight: 500 !important;
        /* Not too bold to avoid blur */
        letter-spacing: -0.5px !important;
        /* Compress text horizontally */
        padding: 6px 1px !important;
        /* Maximize internal space */
        overflow: hidden !important;
    }

    /* 2. Fix 'Detailed Report' Button Overflow */
    .action-buttons-row .btn,
    .action-buttons-row button {
        height: auto !important;
        /* Allow growing height */
        min-height: 48px !important;
        /* Tappable area */
        white-space: normal !important;
        /* Allow text wrapping */
        line-height: 1.2 !important;
        padding: 8px 5px !important;
        display: flex !important;
        flex-direction: row !important;
        /* Keep icon and text side-by-side if poss, or replace with wrap */
        align-items: center !important;
        justify-content: center !important;
    }

    /* Adjust text size inside button if wrapping */
    .action-buttons-row .btn span[data-i18n] {
        font-size: 0.9rem !important;
        text-align: center !important;
    }
}


/* ===== Mobile Modal & Title Fix ===== */
@media (max-width: 600px) {

    /* 1. Restore IQ Scale Title */
    .iq-scale-compact h3 {
        display: block !important;
        font-size: 0.75rem !important;
        margin-bottom: 3px !important;
        text-align: center !important;
    }

    /* 2. Compact Detailed Report Modal (One Screen Goal) */
    .modal-content {
        padding: 10px !important;
        width: 95% !important;
        max-height: 95vh !important;
        overflow-y: auto !important;
        margin: 10px auto !important;
    }

    .premium-report-container {
        gap: 10px !important;
    }

    /* Make Category List 2 Columns to save vertical space */
    .category-performance .perf-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    /* Adjust bar height/text for 2-column layout */
    .perf-row {
        margin-bottom: 0 !important;
    }

    .cat-name,
    .cat-score {
        font-size: 0.7rem !important;
    }

    .progress-bar-bg {
        height: 6px !important;
    }

    /* Compact Insights Cards */
    .insights-grid {
        grid-template-columns: 1fr 1fr !important;
        /* Side by side */
        gap: 5px !important;
    }

    .insight-card {
        padding: 8px !important;
        min-height: 60px !important;
    }

    .insight-icon {
        font-size: 1.2rem !important;
        margin-bottom: 2px !important;
    }

    .insight-card h4 {
        font-size: 0.65rem !important;
        margin-bottom: 2px !important;
    }

    .insight-card p {
        font-size: 0.7rem !important;
    }

    /* Compact Header */
    .premium-header {
        margin-bottom: 10px !important;
    }

    .premium-header h2 {
        font-size: 1.1rem !important;
    }

    .premium-icon-lg {
        font-size: 2rem !important;
    }
}


/* ===== Final Modal Adjustments ===== */

/* 1. Mobile Modal Compression (Force 2 Columns) */
@media (max-width: 600px) {
    .premium-modal .perf-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 5px 10px !important;
        margin-bottom: 5px !important;
    }

    .premium-modal .perf-row {
        margin-bottom: 0 !important;
    }

    .premium-modal .cat-name {
        font-size: 0.65rem !important;
        margin-bottom: 1px !important;
    }

    .premium-modal .progress-bar-bg {
        height: 4px !important;
        margin-top: 1px !important;
    }

    .premium-modal .premium-header h2 {
        font-size: 1rem !important;
        margin: 5px 0 !important;
    }

    .premium-modal .premium-icon-lg {
        font-size: 1.5rem !important;
        margin-bottom: 2px !important;
    }

    .premium-modal .insights-grid {
        margin-top: 5px !important;
    }
}

/* 2. Desktop Close Button Positioning (Top Right Corner) */
@media (min-width: 769px) {

    /* Desktop only */
    .close-modal {
        position: absolute !important;
        top: 15px !important;
        right: 15px !important;
        background: rgba(255, 255, 255, 0.1) !important;
        width: 32px !important;
        height: 32px !important;
        line-height: 32px !important;
        text-align: center !important;
        border-radius: 50% !important;
        font-size: 1.5rem !important;
        cursor: pointer !important;
        z-index: 100 !important;
        color: var(--text-secondary) !important;
        transition: all 0.2s ease;
    }

    .close-modal:hover {
        background: rgba(255, 0, 0, 0.2) !important;
        color: #fff !important;
    }
}


/* ===== Ultra Mobile Compression (User Request) ===== */
@media (max-width: 600px) {

    /* Shrink Fonts Further */
    .premium-modal .cat-name {
        font-size: 0.55rem !important;
        /* Tiny font */
    }

    .premium-modal .cat-score {
        font-size: 0.55rem !important;
    }

    .premium-modal .premium-header h2 {
        font-size: 0.9rem !important;
    }

    .premium-modal .premium-icon-lg {
        font-size: 1.2rem !important;
    }

    /* Reduce Vertical Gaps */
    .premium-modal .perf-row {
        margin-bottom: -1px !important;
        /* Negative margin to pull rows closer */
    }

    .premium-modal .progress-bar-bg {
        height: 3px !important;
    }

    /* Strong Areas Card Shrink */
    .premium-modal .insight-card {
        padding: 5px !important;
        min-height: 40px !important;
    }

    .premium-modal .insight-icon {
        font-size: 0.9rem !important;
    }

    .premium-modal .insight-card h4 {
        font-size: 0.55rem !important;
    }

    .premium-modal .insight-card p {
        font-size: 0.6rem !important;
    }

    /* Time Analysis Shrink */
    .premium-modal .time-analysis {
        padding: 8px !important;
        margin-top: 5px !important;
        font-size: 0.65rem !important;
    }

    /* Button Shrink */
    .premium-modal .btn-premium {
        padding: 8px !important;
        font-size: 0.8rem !important;
        height: 36px !important;
    }
}


/* ===== Final Modal Fix (Correct Selectors) ===== */
@media (max-width: 600px) {

    /* 1. Force 2-Column Layout (Correct ID) */
    #premium-category-chart {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 2px 8px !important;
        margin-bottom: 5px !important;
    }

    /* 2. Compact Rows */
    .category-row {
        margin-bottom: 2px !important;
        display: flex !important;
        align-items: center !important;
        gap: 5px !important;
    }

    .category-name {
        font-size: 0.55rem !important;
        /* Tiny font */
        width: 35% !important;
        /* Fixed width for alignment */
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .category-bar-container {
        height: 4px !important;
        flex: 1 !important;
    }

    .category-score {
        font-size: 0.55rem !important;
    }

    /* 3. Hide Scrollbar */
    .premium-body {
        scrollbar-width: none !important;
        /* Firefox */
        -ms-overflow-style: none !important;
        /* IE */
    }

    .premium-body::-webkit-scrollbar {
        display: none !important;
        /* Chrome/Safari */
    }

    /* 4. Global Scale Down to Fit Screen */
    .modal-content.premium-modal {
        max-height: 98vh !important;
        margin: 2px auto !important;
        padding: 5px !important;
    }

    .premium-body {
        padding: 5px !important;
    }
}


/* ===== Close Button Positioning Fix ===== */
.modal-content {
    position: relative !important;
    /* Ensure absolute children are relative to this */
}

/* Ensure close button stays inside on desktop */
@media (min-width: 769px) {
    .close-modal {
        top: 10px !important;
        right: 15px !important;
    }
}


/* ===== Button Icon Balance ===== */
/* Hide the left icon in Detailed Report button to match Try Again count */
#premium-report-btn .premium-icon {
    display: none !important;
}

/* Adjust padding since icon is gone */
#premium-report-btn {
    padding-left: 20px !important;
    justify-content: center !important;
    /* Center content now */
}


/* ===== Multilanguage & UI Cleanup ===== */
@media (max-width: 600px) {

    /* 1. Hide IQ Scale Labels on Mobile (Too cluttery & translation issues) */
    .iq-scale-compact .scale-labels {
        display: none !important;
    }

    /* 2. Fix Share Buttons (Hide unintended text like 'Copy') */
    .share-btn {
        font-size: 0 !important;
        /* Hides text nodes */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    .share-btn svg {
        display: block !important;
        width: 18px !important;
        height: 18px !important;
    }
}

/* ===== Leaderboard Styles ===== */
.leaderboard-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 2rem;
}

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

.leaderboard-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.leaderboard-table-container {
    overflow-x: auto;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.leaderboard-table th {
    text-align: left;
    padding: 12px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 2px solid var(--border-color);
}

.leaderboard-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.leaderboard-table tr:last-child td {
    border-bottom: none;
}

.leaderboard-table tr:hover {
    background: var(--bg-card-hover);
}

.leaderboard-table td:nth-child(1) {
    /* Rank Column */
    font-weight: 700;
    color: var(--primary);
    width: 10%;
}

.leaderboard-table td:nth-child(3) {
    /* IQ Column */
    font-weight: 700;
    color: var(--text-primary);
}

.loading-text {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-style: italic;
}

@media (max-width: 600px) {

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 8px;
        font-size: 0.8rem;
    }
}

/* FIX: Action Buttons Layout - Ensure side-by-side on mobile */
/* FIX: Action Buttons Layout - Perfect Equality via Flexbox */
/* FIX: Action Buttons Layout - Perfect & Absolute Equality via CSS Grid */
/* FIX: Action Buttons Layout - Perfect & Absolute Equality via CSS Grid */
.action-buttons-row {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    /* Strict 50% split forced */
    gap: 12px !important;
    width: 100% !important;
    max-width: 420px !important;
    margin: 15px auto 0 !important;
    align-items: center !important;
    justify-content: center !important;
}

.action-buttons-row .premium-section,
.action-buttons-row .restart-section {
    width: 100% !important;
    min-width: 0 !important;
    /* Allow shrinking below content size */
    margin: 0 !important;
    padding: 0 !important;
    display: flex !important;
}

/* Ensure inner buttons fill the container */
.action-buttons-row .restart-section #restart-btn,
.action-buttons-row .premium-section .btn-premium {
    width: 100% !important;
    margin: 0 !important;
    height: 48px !important;
    padding: 0 8px !important;
    box-sizing: border-box !important;

    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;

    display: flex !important;
    justify-content: center !important;
    align-items: center !important;

    /* Design Refresh */
    border-radius: 12px !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;

    /* Ensure EXACT box model match */
    border-width: 2px !important;
    border-style: solid !important;
}

/* Primary Action - Analysis */
.action-buttons-row .premium-section .btn-premium {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%) !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.action-buttons-row .premium-section .btn-premium:hover {
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-2px);
}

/* Secondary Action - Try Again */
.action-buttons-row .restart-section #restart-btn {
    background: transparent !important;
    color: #e2e8f0 !important;
    border-color: #475569 !important;
    box-shadow: none !important;
}

.action-buttons-row .restart-section #restart-btn:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: #94a3b8 !important;
    color: white !important;
    transform: translateY(-2px);
}

.action-buttons-row .btn .btn-arrow,
.action-buttons-row .btn .premium-badge {
    display: flex;
    align-items: center;
    margin-left: 6px !important;
    flex-shrink: 0;
}

/* Mobile overrides - Keep Grid but adjust spacing/size */
@media (max-width: 600px) {
    .action-buttons-row {
        gap: 10px !important;
        max-width: 100% !important;
        padding: 0 10px !important;
    }

    .action-buttons-row .restart-section #restart-btn,
    .action-buttons-row .premium-section .btn-premium {
        height: 46px !important;
        font-size: 0.9rem !important;
    }
}

/* Fix overlap on start screen - now handled by .screen class */
/* #start-screen { padding-top: 100px; } - Removed */

/* ===== Site Header ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    /* Ensure it stays on top of everything */
    background: rgba(15, 15, 26, 0.98);
    /* Slightly more opaque */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    transition: var(--transition-normal);
}

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

/* ... (Logo and Nav styles remain similar but ensuring clarity) ... */
.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.2rem;
}

.header-logo-icon {
    font-size: 1.5rem;
}

.header-nav {
    display: flex;
    gap: 25px;
    align-items: center;
    /* Ensure vertical alignment */
}

.header-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-fast);
    padding: 5px 0;
    position: relative;
}

/* Language Selector in Header */
.header-lang-wrapper {
    display: flex;
    align-items: center;
    margin-left: 10px;
}

.language-selector {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    /* Custom arrow for styling */
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.7)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 12px;
    padding-right: 28px;
}

.language-selector:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.language-selector option {
    background-color: #1a1a2e;
    /* Dark background for options */
    color: var(--text-color);
}


.header-nav a:hover,
.header-nav a.active {
    color: var(--text-primary);
}

.header-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
}

.header-nav a:hover::after,
.header-nav a.active::after {
    width: 100%;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1100;
}

.mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Mobile Menu Active State */
.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

/* Responsive Header */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }

    .header-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: var(--bg-card);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        transition: right 0.3s ease;
        box-shadow: var(--shadow-lg);
        z-index: 1000;
    }

    .header-nav.active {
        right: 0;
    }

    .header-nav a {
        font-size: 1.2rem;
    }
}

/* Adjust page container for fixed header - duplicate removed, see top of file */
/* Keeping max-width and structural styles */
.page-container {
    max-width: 800px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
    /* padding-top handled by global rule (120px) */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 20px;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.page-content {
    flex: 1;
}

/* ===== Contact Page Styles ===== */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.contact-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 30px;
    text-align: center;
    transition: var(--transition-normal);
}

.contact-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
}

.contact-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.contact-card h3 {
    margin-bottom: 10px;
    color: var(--text-primary);
}

.contact-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.contact-link {
    color: var(--primary-light);
    font-weight: 600;
    text-decoration: none;
    font-size: 1.1rem;
    transition: var(--transition-fast);
}

.contact-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.social-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition-fast);
}

.social-link:hover {
    color: var(--text-primary);
}

/* ===== Mobile Responsiveness Fixes ===== */
@media (max-width: 768px) {

    /* Adjust Features Grid for Tablets */
    .features {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    /* Adjust Typography */
    .title {
        font-size: 2.8rem;
    }

    .subtitle {
        font-size: 1rem;
        max-width: 90%;
    }

    /* Adjust Hero Icon */
    .brain-icon {
        font-size: 3.5rem;
    }

    .pulse-ring {
        width: 90px;
        height: 90px;
    }

    /* Adjust Language Selector in Mobile Menu */
    .header-lang-wrapper {
        margin-left: 0;
        margin-top: 15px;
    }
}

@media (max-width: 480px) {

    /* Adjust Features Grid for Mobile (Side-by-Side) */
    .features {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-bottom: 20px;
    }

    /* Compact Feature Cards */
    .feature-card {
        padding: 10px 5px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        min-height: 110px;
    }

    .feature-icon {
        font-size: 1.5rem;
        margin-bottom: 5px;
    }

    .feature-card h3 {
        font-size: 0.75rem;
        margin-bottom: 2px;
        line-height: 1.2;
    }

    .feature-card p {
        font-size: 0.6rem;
        line-height: 1.1;
        opacity: 1;
        /* Improved legibility */
        display: block;
        color: rgba(255, 255, 255, 0.7);
        /* Use rgba for subtle text instead of opacity */
    }

    /* Adjust Typography for Mobile */
    .title {
        font-size: 2.2rem;
        margin-bottom: 10px;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    /* Adjust Hero Section */
    .hero {
        margin-bottom: 30px;
        padding: 0 10px;
    }

    .logo-container {
        padding: 10px;
        margin-bottom: 15px;
    }

    .brain-icon {
        font-size: 3rem;
    }

    .pulse-ring {
        width: 80px;
        height: 80px;
    }

    /* Global Container Padding Adjustments */
    .header-container,
    .page-container,
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    /* Ensure buttons are touch-friendly */
    .btn-large {
        width: 100%;
        padding: 16px;
        font-size: 1.1rem;
    }

    /* Adjust Feature Cards */
    .feature-card {
        padding: 20px;
    }

    .feature-icon {
        font-size: 1.8rem;
    }
}