/* Would You Rather - Styles */
:root {
    --primary: #8b5cf6;
    --primary-light: #a78bfa;
    --primary-dark: #7c3aed;
    --choice-a: #3b82f6;
    --choice-b: #ef4444;
    --bg: #0a0a1a;
    --bg-card: rgba(255,255,255,0.06);
    --bg-card-hover: rgba(255,255,255,0.1);
    --text: #f0f0f0;
    --text-secondary: rgba(255,255,255,0.6);
    --border: rgba(255,255,255,0.1);
    --shadow: 0 8px 32px rgba(0,0,0,0.3);
}

[data-theme="light"] {
    --bg: #f5f3ff;
    --bg-card: rgba(139,92,246,0.06);
    --bg-card-hover: rgba(139,92,246,0.1);
    --text: #1a1a2e;
    --text-secondary: rgba(26,26,46,0.6);
    --border: rgba(139,92,246,0.15);
    --shadow: 0 8px 32px rgba(139,92,246,0.1);
}

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

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

.skip-link {
    position: absolute; top: -40px; left: 0;
    background: var(--primary); color: #fff; padding: 8px 16px;
    z-index: 10001; transition: top 0.3s;
}
.skip-link:focus { top: 0; }

.app-loader {
    position: fixed; inset: 0; background: var(--bg);
    display: flex; align-items: center; justify-content: center;
    z-index: 10000; transition: opacity 0.3s;
}
.app-loader.hidden { opacity: 0; pointer-events: none; }
.loader-content { text-align: center; }
.loader-emoji { font-size: 48px; animation: pulse 1.5s infinite; }
.loader-spinner {
    width: 40px; height: 40px; margin: 16px auto;
    border: 3px solid var(--border); border-top-color: var(--primary);
    border-radius: 50%; animation: spin 0.8s linear infinite;
}
.loader-text { color: var(--text-secondary); font-size: 14px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }

.theme-toggle {
    position: fixed; top: 12px; right: 12px;
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--bg-card);
    font-size: 20px; cursor: pointer; z-index: 100;
    backdrop-filter: blur(10px);
}

.language-selector { position: fixed; top: 12px; right: 64px; z-index: 100; }
.lang-btn {
    width: 44px; height: 44px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--bg-card);
    font-size: 20px; cursor: pointer; backdrop-filter: blur(10px);
}
.lang-menu {
    position: absolute; top: 52px; right: 0;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: 12px; padding: 8px;
    display: flex; flex-direction: column; gap: 2px; min-width: 160px;
    backdrop-filter: blur(20px); box-shadow: var(--shadow);
}
.lang-menu.hidden { display: none; }
.lang-option {
    padding: 8px 12px; border: none; background: transparent;
    color: var(--text); font-size: 14px; border-radius: 8px;
    cursor: pointer; text-align: left;
}
.lang-option:hover, .lang-option.active { background: var(--bg-card-hover); }

.screen { display: none; min-height: 100vh; padding: 80px 16px 100px; }
.screen.active { display: flex; flex-direction: column; align-items: center; justify-content: center; }

.app-title {
    font-size: 28px; font-weight: 800; text-align: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text; margin-bottom: 4px;
}
.app-subtitle { color: var(--text-secondary); font-size: 15px; text-align: center; margin-bottom: 20px; }

.progress-info {
    width: 100%; max-width: 440px;
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 20px;
}
.progress-info span { font-size: 13px; color: var(--text-secondary); white-space: nowrap; }
.progress-bar {
    flex: 1; height: 4px; background: var(--border);
    border-radius: 2px; overflow: hidden;
}
.progress-fill {
    height: 100%; width: 0;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 2px; transition: width 0.4s ease;
}

.question-card { max-width: 440px; width: 100%; }

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

.choice-btn {
    position: relative; width: 100%;
    padding: 24px 20px; border: 2px solid var(--border);
    border-radius: 16px; background: var(--bg-card);
    color: var(--text); cursor: pointer;
    transition: all 0.3s; text-align: left;
    display: flex; flex-direction: column; gap: 8px;
    min-height: 90px;
}
.choice-btn:hover { border-color: var(--primary); transform: translateY(-2px); }
.choice-btn:active { transform: scale(0.98); }

.choice-a.selected { border-color: var(--choice-a); background: rgba(59,130,246,0.1); }
.choice-b.selected { border-color: var(--choice-b); background: rgba(239,68,68,0.1); }
.choice-btn.disabled { pointer-events: none; opacity: 0.95; }

.choice-emoji { font-size: 28px; }
.choice-text { font-size: 17px; font-weight: 600; line-height: 1.4; color: var(--text); -webkit-text-fill-color: var(--text); }

.choice-result { margin-top: 8px; }
.choice-result.hidden { display: none; }
.result-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.result-fill {
    height: 100%; width: 0; border-radius: 4px;
    transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}
.choice-a .result-fill { background: var(--choice-a); }
.choice-b .result-fill { background: var(--choice-b); }
.result-pct { font-size: 20px; font-weight: 800; display: block; margin-top: 4px; }
.choice-a .result-pct { color: var(--choice-a); }
.choice-b .result-pct { color: var(--choice-b); }

.or-divider {
    text-align: center; font-size: 16px; font-weight: 800;
    color: var(--primary); padding: 4px 0;
}

.stats-bar { margin-top: 16px; font-size: 13px; color: var(--text-secondary); text-align: center; }

/* Summary */
.summary-card { max-width: 440px; width: 100%; text-align: center; }
.summary-emoji { font-size: 64px; margin-bottom: 12px; }
.summary-title { font-size: 28px; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.summary-desc { color: var(--text-secondary); font-size: 15px; margin-bottom: 24px; }

.summary-stats {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 12px; margin-bottom: 24px;
}
.stat-item {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 12px; padding: 16px; text-align: center;
}
.stat-value { font-size: 28px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

.action-buttons { display: flex; gap: 12px; }
.btn-action {
    flex: 1; padding: 14px; border: none; border-radius: 12px;
    font-size: 16px; font-weight: 700; cursor: pointer; transition: all 0.3s;
}
.btn-share { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; }
.btn-retry { background: var(--bg-card); border: 1px solid var(--border); color: var(--text); }
.btn-action:hover { transform: translateY(-2px); }

.app-footer {
    position: fixed; bottom: 0; left: 0; right: 0;
    padding: 12px; text-align: center;
    background: linear-gradient(transparent, var(--bg)); z-index: 50;
}
.back-link {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--text-secondary); text-decoration: none; font-size: 13px;
}
.back-link:hover { color: var(--primary); }

@media (max-width: 480px) { .app-title { font-size: 24px; } }

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