/* Past Life Job Test - Styles */
:root {
    --primary: #C9A96E;
    --primary-dark: #A8884D;
    --bg: #1a1420;
    --bg-light: #241e30;
    --surface: rgba(201, 169, 110, 0.08);
    --surface-hover: rgba(201, 169, 110, 0.15);
    --text: #f0e6d3;
    --text-dim: rgba(240, 230, 211, 0.5);
    --border: rgba(201, 169, 110, 0.2);
    --radius: 16px;
    --gold: #FFD700;
}

/* Light mode overrides */
[data-theme="light"] {
    --bg: #f5f0e8;
    --bg-light: #ede5d8;
    --surface: rgba(160, 120, 60, 0.08);
    --surface-hover: rgba(160, 120, 60, 0.14);
    --text: #2a2018;
    --text-dim: rgba(42, 32, 24, 0.5);
    --border: rgba(160, 120, 60, 0.2);
}
[data-theme="light"] body {
    background: var(--bg);
    color: var(--text);
}
[data-theme="light"] .app-loader {
    background: var(--bg);
}
[data-theme="light"] .answer-btn {
    background: rgba(201, 169, 110, 0.08);
    border-color: rgba(201, 169, 110, 0.2);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(160, 120, 60, 0.06);
}
[data-theme="light"] .answer-btn:hover,
[data-theme="light"] .answer-btn:active {
    background: rgba(201, 169, 110, 0.15);
    border-color: rgba(201, 169, 110, 0.35);
}
[data-theme="light"] .stat-card,
[data-theme="light"] .result-card,
[data-theme="light"] .question-card {
    background: rgba(201, 169, 110, 0.06);
    border-color: rgba(201, 169, 110, 0.15);
    box-shadow: 0 4px 16px rgba(160, 120, 60, 0.06);
}
[data-theme="light"] .compat-item {
    background: rgba(201, 169, 110, 0.06);
    border-color: rgba(201, 169, 110, 0.12);
}
[data-theme="light"] .premium-section,
[data-theme="light"] .detail-section {
    background: rgba(201, 169, 110, 0.05);
    border-color: rgba(201, 169, 110, 0.12);
}
[data-theme="light"] .premium-story {
    color: var(--text);
}
[data-theme="light"] .back-link {
    color: var(--primary);
}
[data-theme="light"] .back-link:hover {
    color: var(--gold);
}
[data-theme="light"] .recommend-grid .compat-item {
    background: rgba(201, 169, 110, 0.06);
    border-color: rgba(201, 169, 110, 0.12);
}
[data-theme="light"] .signal-item,
[data-theme="light"] .discover-item {
    background: rgba(201, 169, 110, 0.06);
    border-color: rgba(201, 169, 110, 0.12);
}
[data-theme="light"] #screen-intro {
    color: var(--text);
}
[data-theme="light"] .lang-btn {
    background: rgba(201, 169, 110, 0.1);
    color: var(--text);
    border-color: rgba(201, 169, 110, 0.2);
}
[data-theme="light"] .lang-menu {
    background: rgba(245, 240, 232, 0.95);
    border-color: rgba(201, 169, 110, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .lang-option {
    color: #5a4a30;
}
[data-theme="light"] .lang-option:hover {
    background: rgba(201, 169, 110, 0.15);
    color: var(--text);
}
[data-theme="light"] .lang-option.active {
    background: rgba(201, 169, 110, 0.2);
    color: var(--text);
}
[data-theme="light"] .loader-spinner {
    border-color: rgba(201, 169, 110, 0.15);
    border-top-color: var(--primary);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* 터치 최적화 */
button, a, input, [role="button"], [role="link"] {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

input[type="text"], textarea {
    -webkit-user-select: text;
    user-select: text;
}

/* 스크롤 영역 모멘텀 */
.screen, [role="region"], .content-area {
    -webkit-overflow-scrolling: touch;
}

/* App Loader */
.app-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.app-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}
.loader-emoji {
    font-size: 48px;
    animation: loader-bounce 1s ease-in-out infinite;
}
.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: loader-spin 0.8s linear infinite;
}
.loader-text {
    font-size: 14px;
    color: var(--text-dim);
    letter-spacing: 1px;
    font-weight: 500;
}
@keyframes loader-spin {
    to { transform: rotate(360deg); }
}
@keyframes loader-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100dvh;
    position: relative;
}

/* Ad Banner */
.ad-banner {
    width: 100%;
    height: 50px;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    color: var(--text-dim);
    font-family: sans-serif;
}

/* Screens */
.screen {
    display: none;
    flex-direction: column;
    padding: 24px;
    min-height: calc(100dvh - 100px);
}
.screen.active { display: flex; }

/* Intro Screen */
#screen-intro {
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 16px;
    background: linear-gradient(180deg, #1a1420 0%, #241e30 50%, #1a1420 100%);
    position: relative;
    overflow: hidden;
}

#screen-intro::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 50% 30%, rgba(201, 169, 110, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.intro-icon {
    font-size: 80px;
    animation: float 3s ease-in-out infinite;
    position: relative;
    z-index: 1;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(3deg); }
}

.intro-title {
    font-size: 30px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
    position: relative;
    z-index: 1;
}

.intro-subtitle {
    font-size: 15px;
    color: var(--text-dim);
    line-height: 1.6;
    max-width: 320px;
    position: relative;
    z-index: 1;
}

.intro-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.intro-tag {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    background: var(--surface);
    color: var(--primary);
    border: 1px solid var(--border);
    font-family: sans-serif;
}

.intro-signals {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
    margin: 8px 0;
}

.signal-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: rgba(201, 169, 110, 0.15);
    border: 1px solid rgba(201, 169, 110, 0.3);
    border-radius: 20px;
    font-size: 13px;
    color: var(--primary);
    font-family: sans-serif;
    font-weight: 600;
    animation: pulse-signal 2s ease-in-out infinite;
    transition: all 0.3s ease;
}

.signal-item.pulse-highlight {
    background: rgba(255, 100, 100, 0.15);
    border-color: rgba(255, 100, 100, 0.4);
    color: #ff6464;
    animation: pulse-highlight 1.5s ease-in-out infinite;
}

.signal-emoji {
    font-size: 16px;
}

@keyframes pulse-signal {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

@keyframes pulse-highlight {
    0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 100, 100, 0.3); }
    50% { transform: scale(1.02); box-shadow: 0 0 0 4px rgba(255, 100, 100, 0); }
}

/* "What you'll discover" bullets */
.intro-discover {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    max-width: 320px;
    position: relative;
    z-index: 1;
}

.discover-item {
    font-size: 13px;
    color: var(--text);
    font-family: sans-serif;
    padding: 8px 14px;
    background: rgba(201, 169, 110, 0.08);
    border-left: 3px solid var(--primary);
    border-radius: 0 8px 8px 0;
    text-align: left;
    line-height: 1.4;
}

/* CTA pulse animation */
@keyframes btn-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201, 169, 110, 0.4); }
    50% { box-shadow: 0 0 0 12px rgba(201, 169, 110, 0); }
}

.btn-pulse {
    animation: btn-pulse 2s infinite, button-pulse 2s ease-in-out infinite;
}

/* Buttons */
.btn {
    padding: 16px 32px;
    border: none;
    border-radius: var(--radius);
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    font-family: inherit;
    width: 100%;
    max-width: 300px;
    position: relative;
    z-index: 1;
}

.btn:active { transform: scale(0.96); }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #DEB887);
    color: #1a1420;
}

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

.btn-gold {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #1a1420;
}

.btn-share {
    background: linear-gradient(135deg, #1da1f2, #0077b5);
    color: white;
}

.btn-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 300px;
}

.btn-large {
    max-width: 100%;
    width: 100%;
    padding: 20px 32px;
    font-size: 18px;
    font-weight: 800;
    position: relative;
    z-index: 10;
    box-shadow: 0 8px 24px rgba(201, 169, 110, 0.25);
    animation: button-pulse 2s ease-in-out infinite;
    min-height: 56px;
    touch-action: manipulation;
}

.btn-large:hover {
    box-shadow: 0 12px 40px rgba(201, 169, 110, 0.5);
    animation: none;
    transform: translateY(-3px);
}

.btn-large:active {
    transform: scale(0.98);
}

@keyframes button-pulse {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(201, 169, 110, 0.35); }
}

.intro-cta-sub {
    font-size: 12px;
    color: var(--text-dim);
    position: relative;
    z-index: 1;
    font-family: sans-serif;
    font-style: italic;
}

/* Quiz Screen */
#screen-quiz {
    gap: 24px;
    padding-top: 32px;
}

.progress-bar-wrap {
    width: 100%;
    height: 6px;
    background: var(--surface);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--gold));
    border-radius: 3px;
    transition: width 0.4s ease;
}

.question-counter {
    font-size: 13px;
    color: var(--text-dim);
    text-align: center;
    font-family: sans-serif;
}

.question-text {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    line-height: 1.5;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.answer-btn {
    padding: 18px 20px;
    background: var(--surface);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    line-height: 1.4;
    min-height: 56px;
    position: relative;
    overflow: hidden;
}

.answer-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(201, 169, 110, 0.15);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.answer-btn:hover {
    background: var(--surface-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(201, 169, 110, 0.15);
}

.answer-btn:active {
    transform: scale(0.96);
}

.answer-btn:active::before {
    width: 300px;
    height: 300px;
    animation: ripple-expand 0.4s ease-out;
}

@keyframes ripple-expand {
    0% { width: 0; height: 0; }
    100% { width: 300px; height: 300px; }
}

.answer-btn.selected {
    background: rgba(201, 169, 110, 0.2);
    border-color: var(--primary);
    color: var(--gold);
    animation: selectScale 0.3s ease;
}

@keyframes selectScale {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Loading Screen */
#screen-loading {
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 24px;
}

.loading-icon {
    font-size: 60px;
    animation: spin-slow 4s linear infinite;
}

@keyframes spin-slow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-size: 18px;
    color: var(--primary);
    font-weight: 700;
}

.loading-sub {
    font-size: 14px;
    color: var(--text-dim);
    font-family: sans-serif;
}

.loading-bar-wrap {
    width: 200px;
    height: 4px;
    background: var(--surface);
    border-radius: 2px;
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--gold));
    border-radius: 2px;
    animation: loading-progress 3s ease-in-out forwards;
}

@keyframes loading-progress {
    0% { width: 0%; }
    30% { width: 40%; }
    60% { width: 70%; }
    90% { width: 90%; }
    100% { width: 100%; }
}

/* Result Screen */
#screen-result {
    align-items: center;
    gap: 16px;
    padding-bottom: 40px;
}

.result-label {
    font-size: 14px;
    color: var(--text-dim);
    font-family: sans-serif;
}

.result-emoji {
    font-size: 72px;
    animation: float 3s ease-in-out infinite;
}

.result-type {
    font-size: 28px;
    font-weight: 900;
    text-align: center;
}

.result-era {
    font-size: 14px;
    color: var(--primary);
    background: var(--surface);
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    font-family: sans-serif;
}

.result-desc {
    font-size: 15px;
    line-height: 1.8;
    text-align: center;
    color: var(--text);
    max-width: 380px;
    animation: fadeInUp 0.6s ease 0.15s both;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.result-quote {
    font-size: 16px;
    font-style: italic;
    color: var(--gold);
    text-align: center;
    padding: 16px 20px;
    background: var(--surface);
    border-radius: var(--radius);
    border-left: 3px solid var(--gold);
    max-width: 380px;
    width: 100%;
}

/* Stats Section */
.result-stats {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.stat-label {
    font-size: 14px;
    color: var(--text-dim);
    font-family: sans-serif;
}

.stat-value {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.stat-tag {
    padding: 4px 10px;
    background: rgba(201, 169, 110, 0.15);
    border-radius: 8px;
    font-size: 12px;
    color: var(--primary);
    font-family: sans-serif;
}

.stat-tag.weak {
    background: rgba(231, 76, 60, 0.15);
    color: #E74C3C;
}

/* Compatibility Section */
.compat-section {
    width: 100%;
    max-width: 380px;
}

.compat-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary);
}

.compat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.compat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.compat-emoji {
    font-size: 28px;
    flex-shrink: 0;
}

.compat-info {
    flex: 1;
}

.compat-name {
    font-size: 14px;
    font-weight: 700;
}

.compat-score {
    font-size: 12px;
    font-family: sans-serif;
}

.compat-bar-bg {
    width: 60px;
    height: 6px;
    background: var(--surface);
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
}

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

/* Premium Section */
.premium-section {
    width: 100%;
    max-width: 380px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(255, 165, 0, 0.05));
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: var(--radius);
    text-align: center;
}

.premium-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 8px;
}

.premium-desc {
    font-size: 13px;
    color: var(--text-dim);
    margin-bottom: 16px;
    line-height: 1.6;
    font-family: sans-serif;
}

.premium-content {
    display: none;
    text-align: left;
}

.premium-content.visible {
    display: block;
}

.premium-story {
    font-size: 14px;
    line-height: 2;
    color: var(--text);
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius);
    margin-bottom: 12px;
}

.premium-modern {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-dim);
    padding: 12px 16px;
    background: var(--surface);
    border-radius: var(--radius);
}

.premium-modern-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
}

/* Canvas Preview */
.result-image-wrap {
    width: 100%;
    max-width: 380px;
}

#resultCanvas {
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* Ad Overlay */
.ad-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 100;
}

.ad-overlay.active { display: flex; }

.ad-overlay p {
    color: var(--text-dim);
    font-size: 14px;
    font-family: sans-serif;
}

.ad-countdown {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
    color: var(--primary);
}

/* === RECOMMENDATIONS === */
.recommend-section {
    width: 100%;
    max-width: 380px;
}

.recommend-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--primary);
}

.recommend-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.recommend-grid .compat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    cursor: pointer;
}

.recommend-grid .compat-item:hover,
.recommend-grid .compat-item:active {
    background: rgba(201, 169, 110, 0.15);
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(201, 169, 110, 0.2);
}

.recommend-grid .compat-emoji {
    font-size: 32px;
}

.recommend-grid .compat-info {
    flex: 1;
    width: 100%;
}

.recommend-grid .compat-name {
    font-size: 12px;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recommend-grid .compat-score {
    display: none;
}

.recommend-grid .compat-bar-bg {
    display: none;
}

/* Responsive */
@media (max-width: 480px) {
    .intro-signals {
        gap: 12px;
    }

    .signal-item {
        font-size: 12px;
        padding: 8px 10px;
    }

    .btn-large {
        padding: 16px 28px;
        font-size: 16px;
        min-height: 52px;
    }

    .intro-tags {
        gap: 6px;
    }

    .intro-tag {
        font-size: 11px;
        padding: 5px 12px;
    }

    .recommend-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .recommend-grid .compat-item {
        padding: 10px;
    }

    .recommend-grid .compat-emoji {
        font-size: 28px;
    }

    .recommend-grid .compat-name {
        font-size: 11px;
    }
}

@media (max-width: 360px) {
    .intro-title { font-size: 24px; }
    .intro-subtitle { font-size: 14px; }
    .question-text { font-size: 19px; }
    .result-type { font-size: 24px; }
    .btn { padding: 14px 20px; font-size: 15px; }
    .btn-large { padding: 16px 24px; font-size: 16px; min-height: 50px; }
    .answer-btn { padding: 14px 16px; font-size: 14px; min-height: 48px; }

    .intro-signals {
        flex-direction: column;
        gap: 10px;
        width: 100%;
        max-width: 280px;
    }

    .signal-item {
        justify-content: center;
        width: 100%;
        font-size: 13px;
    }

    #screen-intro {
        padding: 16px;
    }

    .recommend-grid {
        grid-template-columns: 1fr;
        gap: 6px;
    }

    .recommend-grid .compat-item {
        flex-direction: row;
        gap: 8px;
        text-align: left;
    }

    .recommend-grid .compat-emoji {
        font-size: 24px;
        flex-shrink: 0;
    }

    .recommend-grid .compat-name {
        font-size: 12px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* 언어 선택기 - Language Selector */
.language-selector {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.lang-btn {
    background: rgba(139, 92, 246, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #fff;
    font-size: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lang-btn:hover {
    background: rgba(139, 92, 246, 0.5);
    transform: scale(1.05);
}

.lang-menu {
    position: absolute;
    top: 52px;
    right: 0;
    background: rgba(10, 8, 25, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 8px;
    min-width: 150px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.lang-menu.hidden {
    display: none;
}

.lang-option {
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    font-size: 14px;
    color: #e0d8f8;
    transition: background 0.2s;
    font-family: inherit;
}

.lang-option:hover {
    background: rgba(139, 92, 246, 0.2);
}

.lang-option.active {
    background: rgba(139, 92, 246, 0.3);
    font-weight: 600;
}

/* === FOOTER === */
.game-footer {
    text-align: center;
    padding: 20px 0;
    margin-top: 20px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    font-size: 13px;
    padding: 12px 0;
    transition: color 0.2s;
}

.back-link:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* === Accessibility Improvements === */
button:focus-visible,a:focus-visible,input:focus-visible,[role="button"]:focus-visible{outline:3px solid #f39c12;outline-offset:2px;}
button,a[href],input[type="button"],input[type="submit"],[role="button"]{min-width:44px;min-height:44px;display:inline-flex;align-items:center;justify-content:center;}
.skip-link{position:absolute;top:-40px;left:0;background:#f39c12;color:white;padding:8px;text-decoration:none;z-index:100;}
.skip-link:focus{top:0;}
[role="dialog"]{z-index:1000;}
@media (prefers-reduced-motion: reduce){*{animation-duration:0.01ms !important;animation-iteration-count:1 !important;transition-duration:0.01ms !important;scroll-behavior:auto !important;}}
@media (prefers-contrast: more){button{border:2px solid #f39c12;}}
.rec-card:focus-visible{outline:3px solid #f39c12;outline-offset:4px;}

/* Enhanced button accessibility */
button:focus-visible,
input[type="button"]:focus-visible,
input[type="submit"]:focus-visible,
[role="button"]:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 2px;
}

button:active,
input[type="button"]:active,
input[type="submit"]:active,
[role="button"]:active {
    transform: scale(0.98);
}

/* High contrast mode */
@media (prefers-contrast: more) {
    button,
    input[type="button"],
    input[type="submit"],
    [role="button"] {
        border: 2px solid currentColor;
        font-weight: bold;
    }
}

/* Enhanced form accessibility */
label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
    font-size: 16px;
    min-height: 44px;
    padding: 10px 12px;
}

input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
input[type="password"]:focus-visible,
input[type="number"]:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 1px;
}

/* Error handling accessibility */
.error-message,
[aria-invalid="true"] {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

[aria-invalid="true"] {
    border-color: #dc2626;
}

/* Non-color focus indicators */
:focus-visible {
    outline-width: 3px;
}

/* Icon patterns for colorblind users */
.error::before {
    content: "x ";
}

.success::before {
    content: "✓ ";
}

.warning::before {
    content: "! ";
}

.info::before {
    content: "i ";
}

/* High contrast scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark, #f1f5f9);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color, #3b82f6);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark, #1e40af);
}

/* Firefox scrollbar */
* {
    scrollbar-color: var(--primary-color, #3b82f6) var(--bg-dark, #f1f5f9);
    scrollbar-width: thin;
}

/* Selection Color */
::selection {
    background: #C9A96E;
    color: white;
}

::-moz-selection {
    background: #C9A96E;
    color: white;
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 76px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.08);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: all 0.3s ease;
}
.theme-toggle:hover { transform: scale(1.1); }
.theme-toggle:active { transform: scale(0.95); }
[data-theme="light"] .theme-toggle {
    background: rgba(0,0,0,0.05);
    border-color: rgba(0,0,0,0.1);
    color: #333;
}
