/* =========================================
   STUDIEHOF KIDS - Stylesheet
   Modern, Gamified, Kid-Friendly Design
   ========================================= */

/* ---- CSS Variables ---- */
:root {
    --primary: #6C63FF;
    --primary-light: #8B83FF;
    --primary-dark: #4A42DB;
    --secondary: #FF6584;
    --secondary-light: #FF8DA1;
    --success: #00C853;
    --success-light: #69F0AE;
    --warning: #FFD600;
    --warning-light: #FFF176;
    --info: #00B0FF;
    --info-light: #80D8FF;
    --danger: #FF1744;
    --danger-light: #FF5252;

    --bg-main: #F0F2FF;
    --bg-card: #FFFFFF;
    --bg-dark: #1A1A2E;
    --text-primary: #2D3436;
    --text-secondary: #636E72;
    --text-light: #B2BEC3;
    --border: #E8EAF6;

    --shadow-sm: 0 2px 8px rgba(108, 99, 255, 0.08);
    --shadow-md: 0 4px 20px rgba(108, 99, 255, 0.12);
    --shadow-lg: 0 8px 40px rgba(108, 99, 255, 0.16);
    --shadow-xl: 0 16px 60px rgba(108, 99, 255, 0.2);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    --font: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg-main);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

#app {
    position: relative;
    min-height: 100vh;
}

/* ---- Screen System ---- */
.screen {
    display: none;
    min-height: 100vh;
    position: relative;
}

.screen.active {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease;
}

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

/* =========================================
   LOGIN SCREEN
   ========================================= */
#screen-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow: hidden;
}

.login-container {
    text-align: center;
    z-index: 10;
    max-width: 500px;
    width: 100%;
}

.login-header {
    margin-bottom: 40px;
}

.logo-animation {
    margin-bottom: 15px;
}

.logo-icon {
    font-size: 80px;
    display: inline-block;
    animation: bounce 2s ease infinite;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.2));
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.logo-text {
    font-size: 42px;
    font-weight: 900;
    color: white;
    text-shadow: 0 4px 15px rgba(0,0,0,0.2);
    letter-spacing: -1px;
}

.text-gradient {
    background: linear-gradient(135deg, #FFD600, #FF6584);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    font-size: 20px;
    color: rgba(255,255,255,0.9);
    font-weight: 600;
    margin-top: 8px;
}

.user-cards {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.user-card {
    background: rgba(255,255,255,0.95);
    border-radius: var(--radius-lg);
    padding: 30px 40px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    backdrop-filter: blur(10px);
    border: 3px solid transparent;
}

.user-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary);
}

.user-card:active {
    transform: translateY(-2px) scale(0.98);
}

.user-card-avatar {
    font-size: 64px;
    display: block;
    margin-bottom: 10px;
    animation: wiggle 3s ease infinite;
}

.user-card:nth-child(2) .user-card-avatar {
    animation-delay: 0.5s;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(5deg); }
    75% { transform: rotate(-5deg); }
}

.user-card-name {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
}

.user-card-group {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 4px;
}

.user-card-theme {
    font-size: 12px;
    font-weight: 700;
    margin-top: 8px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    color: #E65100;
    display: inline-block;
}

/* ---- Guest card button ---- */
.guest-card-btn {
    border: 3px dashed rgba(108, 99, 255, 0.3) !important;
    background: rgba(255,255,255,0.85) !important;
}

.guest-card-btn:hover {
    border-color: var(--primary) !important;
    border-style: dashed !important;
}

.guest-card-btn .user-card-avatar {
    animation: pulse 2s ease infinite !important;
}

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

/* =========================================
   PIN CODE MODAL
   ========================================= */
.pin-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 600;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.pin-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    width: 100%;
    max-width: 340px;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.pin-avatar {
    font-size: 56px;
    margin-bottom: 8px;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.pin-title {
    font-size: 24px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.pin-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.pin-dots {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 8px;
    transition: transform 0.1s;
}

.pin-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 3px solid var(--border);
    background: transparent;
    transition: all 0.2s ease;
}

.pin-dot.filled {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.15);
}

.pin-dots.shake {
    animation: pinShake 0.5s ease;
}

@keyframes pinShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-12px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-8px); }
    80% { transform: translateX(6px); }
}

.pin-error {
    color: var(--danger);
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
    animation: fadeIn 0.3s ease;
}

.pin-keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 260px;
    margin: 16px auto 0;
}

.pin-key {
    width: 100%;
    aspect-ratio: 1.3;
    border: none;
    border-radius: var(--radius-lg);
    background: var(--bg-main);
    font-size: 28px;
    font-weight: 800;
    font-family: var(--font);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pin-key:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: scale(1.05);
}

.pin-key:active {
    transform: scale(0.95);
    background: var(--primary);
    color: white;
}

.pin-key-empty {
    background: transparent;
    cursor: default;
    pointer-events: none;
}

.pin-key-back {
    font-size: 22px;
    color: var(--text-secondary);
}

.pin-key-back:hover {
    color: var(--danger);
    background: #FFE0E0;
}

.user-card-lock {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: 14px;
    opacity: 0.6;
}

.user-card {
    position: relative;
}

/* =========================================
   GUEST CARD (LOGIN)
   ========================================= */
.guest-card-btn {
    border: 3px dashed var(--border);
    background: var(--bg-main);
}

.guest-card-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.guest-card-btn .user-card-avatar {
    font-size: 42px;
}

/* =========================================
   GUEST SETUP MODAL
   ========================================= */
.guest-setup {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 500;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.guest-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 32px 28px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.guest-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--bg-main);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-family: var(--font);
    color: var(--text-secondary);
}

.guest-close:hover {
    background: #FFE0E0;
    color: var(--danger);
}

.guest-title {
    font-size: 24px;
    font-weight: 900;
    text-align: center;
    margin-bottom: 24px;
    color: var(--text-primary);
}

.guest-field {
    margin-bottom: 20px;
}

.guest-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.guest-input {
    width: 100%;
    padding: 14px 18px;
    border: 3px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition);
    background: var(--bg-main);
}

.guest-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(108, 99, 255, 0.15);
}

.guest-input::placeholder {
    color: var(--text-light);
    font-weight: 600;
}

.guest-group-select {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.group-btn {
    padding: 12px 8px;
    border: 3px solid var(--border);
    border-radius: var(--radius-md);
    background: white;
    font-family: var(--font);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.group-btn:hover {
    border-color: var(--primary-light);
    background: var(--bg-main);
}

.group-btn.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, #F0F0FF, #E8EAF6);
    color: var(--primary);
    box-shadow: 0 2px 12px rgba(108, 99, 255, 0.2);
}

.guest-icon-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.icon-btn {
    width: 100%;
    aspect-ratio: 1;
    border: 3px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    font-size: 28px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.icon-btn:hover {
    border-color: var(--primary-light);
    transform: scale(1.1);
    background: var(--bg-main);
}

.icon-btn.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, #F0F0FF, #E8EAF6);
    box-shadow: 0 2px 12px rgba(108, 99, 255, 0.25);
    transform: scale(1.1);
}

.guest-start-btn {
    width: 100%;
    margin-top: 8px;
    font-size: 18px;
    padding: 16px;
}

/* Floating shapes */
.floating-shapes {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.shape {
    position: absolute;
    font-size: 30px;
    opacity: 0.3;
    animation: float 6s ease-in-out infinite;
}

.shape-1 { top: 10%; left: 10%; animation-delay: 0s; }
.shape-2 { top: 20%; right: 15%; animation-delay: 1s; font-size: 40px; }
.shape-3 { bottom: 30%; left: 8%; animation-delay: 2s; }
.shape-4 { top: 60%; right: 10%; animation-delay: 3s; }
.shape-5 { bottom: 15%; left: 30%; animation-delay: 4s; font-size: 35px; }
.shape-6 { top: 40%; left: 50%; animation-delay: 5s; }

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(10deg); }
    66% { transform: translateY(10px) rotate(-5deg); }
}

/* =========================================
   APP HEADER (Dashboard)
   ========================================= */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    font-size: 36px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-main);
    border-radius: var(--radius-full);
}

.header-info {
    display: flex;
    flex-direction: column;
}

.header-name {
    font-weight: 800;
    font-size: 18px;
    color: var(--text-primary);
}

.level-badge {
    display: inline-flex;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    width: fit-content;
}

.header-right {
    display: flex;
    gap: 12px;
}

.header-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 15px;
}

.xp-stat {
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    color: #E65100;
}

.coin-stat {
    background: linear-gradient(135deg, #FFF8E1, #FFECB3);
    color: #F57F17;
}

.stat-icon {
    font-size: 18px;
}

/* XP Bar */
.xp-bar-container {
    padding: 8px 20px 12px;
    background: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.xp-bar {
    flex: 1;
    height: 10px;
    background: #E8EAF6;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: var(--radius-full);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.xp-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

.xp-bar-text {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* =========================================
   DASHBOARD
   ========================================= */
.dashboard-content {
    padding: 20px;
    padding-bottom: 100px;
}

.section-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.category-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px 20px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 3px solid transparent;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 4px 4px 0 0;
}

.category-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.category-card:active {
    transform: scale(0.97);
}

.category-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}

.category-name {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.category-desc {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.category-progress {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    gap: 6px;
}

.level-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border: 2px solid #E0E0E0;
    color: #BDBDBD;
    background: white;
    transition: var(--transition);
}

.level-dot.unlocked {
    border-color: var(--primary);
    color: var(--primary);
    background: #F0F0FF;
}

.level-dot.completed {
    border-color: var(--success);
    color: white;
    background: var(--success);
}

.level-dot.locked {
    opacity: 0.5;
}

/* =========================================
   SUB HEADER
   ========================================= */
.sub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.sub-header h2 {
    font-size: 20px;
    font-weight: 800;
}

.back-btn {
    background: none;
    border: none;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.back-btn:hover {
    background: var(--bg-main);
}

/* =========================================
   LEVELS SCREEN
   ========================================= */
.levels-content {
    padding: 20px;
    padding-bottom: 100px;
}

.levels-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 500px;
    margin: 0 auto;
}

.level-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.level-card:hover:not(.level-locked) {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.level-card.level-locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.level-card.level-locked::after {
    content: '🔒';
    position: absolute;
    right: 20px;
    font-size: 24px;
}

.level-number {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 900;
    color: white;
    flex-shrink: 0;
}

.level-info {
    flex: 1;
}

.level-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-primary);
}

.level-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.level-stars {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.level-stars .star {
    font-size: 18px;
    opacity: 0.3;
}

.level-stars .star.earned {
    opacity: 1;
}

/* =========================================
   QUIZ SCREEN
   ========================================= */
#screen-quiz {
    background: linear-gradient(180deg, #F0F2FF 0%, #E8EAF6 100%);
}

.quiz-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 16px;
    background: white;
    box-shadow: var(--shadow-sm);
}

.quiz-quit {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: #F5F5F5;
    border: none;
    cursor: pointer;
    font-weight: 700;
    color: var(--text-secondary);
    transition: var(--transition);
}

.quiz-quit:hover {
    background: var(--danger-light);
    color: white;
}

.quiz-progress {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quiz-progress-bar {
    flex: 1;
    height: 12px;
    background: #E8EAF6;
    border-radius: var(--radius-full);
    overflow: hidden;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--info));
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.quiz-progress-text {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.quiz-streak {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    border-radius: var(--radius-full);
    font-weight: 800;
    font-size: 16px;
    color: #E65100;
    transition: var(--transition);
}

.quiz-streak.active {
    animation: pulse 0.5s ease;
    background: linear-gradient(135deg, #FF6D00, #FF9100);
    color: white;
}

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

.quiz-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

.question-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    box-shadow: var(--shadow-md);
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.question-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.4;
}

.answers-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.answer-btn {
    background: white;
    border: 3px solid #E8EAF6;
    border-radius: var(--radius-md);
    padding: 18px 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    text-align: left;
}

.answer-btn:hover:not(:disabled) {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.answer-btn:active:not(:disabled) {
    transform: scale(0.97);
}

.answer-letter {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-main);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: var(--primary);
    flex-shrink: 0;
}

.answer-btn.correct {
    background: #E8F5E9;
    border-color: var(--success);
    animation: correctAnswer 0.5s ease;
}

.answer-btn.correct .answer-letter {
    background: var(--success);
    color: white;
}

.answer-btn.wrong {
    background: #FFEBEE;
    border-color: var(--danger);
    animation: shake 0.5s ease;
}

.answer-btn.wrong .answer-letter {
    background: var(--danger);
    color: white;
}

.answer-btn.eliminated {
    opacity: 0.3;
    pointer-events: none;
    text-decoration: line-through;
}

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

@keyframes correctAnswer {
    0% { transform: scale(1); }
    30% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

/* Power-ups bar */
.powerups-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 10px;
}

.powerup-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    border: 2px solid #E0E0E0;
    background: white;
    cursor: pointer;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.powerup-btn:hover:not(:disabled) {
    border-color: var(--primary);
    transform: scale(1.05);
}

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

.powerup-icon {
    font-size: 18px;
}

.powerup-count {
    background: var(--primary);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
}

/* =========================================
   RESULTS SCREEN
   ========================================= */
#screen-results {
    background: linear-gradient(180deg, #F0F2FF 0%, #E8EAF6 100%);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.results-container {
    max-width: 500px;
    width: 100%;
    text-align: center;
    z-index: 10;
}

.results-stars {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.results-stars .star {
    font-size: 48px;
    opacity: 0.2;
    transition: all 0.5s ease;
}

.results-stars .star.earned {
    opacity: 1;
    animation: starPop 0.5s ease;
}

@keyframes starPop {
    0% { transform: scale(0); opacity: 0; }
    60% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

.results-title {
    font-size: 32px;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.score-circle {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: var(--shadow-lg);
    border: 4px solid var(--primary);
}

.score-number {
    font-size: 42px;
    font-weight: 900;
    color: var(--primary);
    line-height: 1;
}

.score-total {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 700;
}

.results-rewards {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: white;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
}

.reward-icon {
    font-size: 20px;
}

.reward-value {
    font-weight: 800;
    font-size: 16px;
    color: var(--text-primary);
}

.new-badges-container {
    margin-bottom: 20px;
    padding: 16px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.new-badges-container h3 {
    font-size: 18px;
    margin-bottom: 12px;
}

.new-badges-list {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.new-badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    animation: badgePop 0.6s ease;
}

.new-badge-item .badge-icon {
    font-size: 40px;
}

.new-badge-item .badge-name {
    font-size: 12px;
    font-weight: 700;
}

@keyframes badgePop {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    60% { transform: scale(1.2) rotate(10deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.level-up-container {
    margin-bottom: 20px;
}

.level-up-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: levelUp 0.8s ease;
}

.level-up-text {
    font-size: 28px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--warning), #FF6D00);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.new-level {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
}

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

.unlock-container {
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--success-light), var(--success));
    color: white;
    border-radius: var(--radius-md);
    font-weight: 700;
    margin-bottom: 20px;
    animation: slideUp 0.5s ease;
}

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

.results-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
}

.results-details-toggle {
    margin-bottom: 16px;
}

.answer-details {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: left;
    box-shadow: var(--shadow-sm);
}

.answer-detail-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.answer-detail-item:last-child {
    border-bottom: none;
}

.detail-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.detail-question {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.detail-answer {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Confetti */
.confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1000;
    overflow: hidden;
}

.confetti-piece {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* =========================================
   SHOP SCREEN
   ========================================= */
.shop-content {
    padding: 20px;
    padding-bottom: 100px;
}

.shop-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 20px;
    font-size: 15px;
}

.header-coins {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: 18px;
    color: #F57F17;
}

.shop-grid {
    display: grid;
    gap: 16px;
    max-width: 500px;
    margin: 0 auto;
}

.shop-item {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.shop-item:hover {
    box-shadow: var(--shadow-md);
}

.shop-item-icon {
    font-size: 40px;
    width: 60px;
    height: 60px;
    background: var(--bg-main);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.shop-item-info {
    flex: 1;
}

.shop-item-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.shop-item-desc {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.shop-item-owned {
    font-size: 12px;
    color: var(--primary);
    font-weight: 700;
    margin-top: 2px;
}

.shop-buy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius-full);
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.shop-buy-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.4);
}

.shop-buy-btn:disabled {
    background: #BDBDBD;
    cursor: not-allowed;
}

/* =========================================
   BADGES SCREEN
   ========================================= */
.badges-content {
    padding: 20px;
    padding-bottom: 100px;
}

.badge-counter {
    font-weight: 800;
    font-size: 16px;
    color: var(--primary);
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    max-width: 500px;
    margin: 0 auto;
}

.badge-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px 12px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
}

.badge-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.badge-card.locked {
    opacity: 0.5;
    filter: grayscale(0.8);
}

.badge-card-icon {
    font-size: 40px;
    display: block;
    margin-bottom: 8px;
}

.badge-card-name {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.badge-card-desc {
    font-size: 10px;
    color: var(--text-secondary);
    font-weight: 600;
}

.badge-progress-bar {
    height: 6px;
    background: #E8EAF6;
    border-radius: var(--radius-full);
    margin-top: 8px;
    overflow: hidden;
}

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

.badge-earned-check {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 16px;
}

/* =========================================
   RANKING SCREEN
   ========================================= */
.ranking-content {
    padding: 20px;
    padding-bottom: 100px;
}

.ranking-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    justify-content: center;
}

.rank-tab {
    padding: 10px 18px;
    border-radius: var(--radius-full);
    border: 2px solid var(--border);
    background: white;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.rank-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.rank-tab:hover:not(.active) {
    border-color: var(--primary);
    color: var(--primary);
}

.ranking-list {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rank-item {
    background: white;
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.rank-item:first-child {
    background: linear-gradient(135deg, #FFF8E1, #FFECB3);
    border: 2px solid #FFD600;
}

.rank-item:nth-child(2) {
    background: linear-gradient(135deg, #F5F5F5, #E0E0E0);
    border: 2px solid #BDBDBD;
}

.rank-item:nth-child(3) {
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    border: 2px solid #FF9800;
}

.rank-position {
    font-size: 24px;
    font-weight: 900;
    width: 40px;
    text-align: center;
    color: var(--text-secondary);
}

.rank-item:first-child .rank-position { color: #F57F17; }
.rank-item:nth-child(2) .rank-position { color: #757575; }
.rank-item:nth-child(3) .rank-position { color: #E65100; }

.rank-avatar {
    font-size: 32px;
}

.rank-info {
    flex: 1;
}

.rank-name {
    font-size: 16px;
    font-weight: 800;
}

.rank-stats {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
}

.rank-xp {
    font-size: 18px;
    font-weight: 900;
    color: var(--primary);
}

/* =========================================
   BUTTONS
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    border: none;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.btn:hover {
    transform: translateY(-2px);
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4);
}

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

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-ghost {
    background: transparent;
    color: var(--primary);
    padding: 8px 16px;
}

.btn-ghost:hover {
    background: rgba(108, 99, 255, 0.08);
}

.btn-lg {
    padding: 16px 32px;
    font-size: 18px;
}

/* =========================================
   BOTTOM NAVIGATION
   ========================================= */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
    z-index: 200;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    transition: var(--transition);
    font-family: var(--font);
    border-radius: var(--radius-sm);
}

.nav-btn:hover {
    background: var(--bg-main);
}

.nav-icon {
    font-size: 24px;
}

.nav-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
}

.nav-btn.active .nav-label {
    color: var(--primary);
}

.nav-btn.active {
    background: rgba(108, 99, 255, 0.08);
}

/* =========================================
   MODAL
   ========================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    padding: 32px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: var(--shadow-xl);
    animation: modalPop 0.3s ease;
}

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

.modal-icon {
    font-size: 56px;
    display: block;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 8px;
}

.modal-text {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 24px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* =========================================
   TOAST
   ========================================= */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 14px 24px;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 700;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    animation: slideInRight 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 320px;
}

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

.toast.success { background: linear-gradient(135deg, var(--success), #2E7D32); }
.toast.error { background: linear-gradient(135deg, var(--danger), #C62828); }
.toast.info { background: linear-gradient(135deg, var(--info), #0277BD); }
.toast.warning { background: linear-gradient(135deg, var(--warning), #F57F17); color: #333; }

/* =========================================
   LOADING
   ========================================= */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #E8EAF6;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 640px) {
    .logo-text { font-size: 32px; }
    .logo-icon { font-size: 64px; }
    .user-cards { flex-direction: column; align-items: center; }
    .user-card { min-width: 160px; padding: 24px 30px; }
    
    .categories-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .category-card { padding: 20px 14px; }
    .category-icon { font-size: 40px; }
    .category-name { font-size: 15px; }
    
    .question-text { font-size: 18px; }
    .answers-grid { grid-template-columns: 1fr; gap: 10px; }
    .answer-btn { padding: 14px 12px; font-size: 15px; }
    
    .badges-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .badge-card { padding: 14px 8px; }
    .badge-card-icon { font-size: 32px; }
    
    .results-title { font-size: 26px; }
    .score-circle { width: 100px; height: 100px; }
    .score-number { font-size: 36px; }
    
    .header-stat { padding: 4px 10px; font-size: 13px; }

    .guest-card { padding: 24px 20px; }
    .guest-icon-grid { grid-template-columns: repeat(6, 1fr); gap: 6px; }
    .icon-btn { font-size: 24px; }
    .guest-title { font-size: 20px; }

    .pin-card { padding: 24px 20px; max-width: 300px; }
    .pin-avatar { font-size: 44px; }
    .pin-title { font-size: 20px; }
    .pin-key { font-size: 24px; }
    .pin-keypad { gap: 8px; max-width: 230px; }
}

@media (min-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
        max-width: 800px;
        margin: 0 auto;
    }
    
    .quiz-content {
        max-width: 700px;
    }
    
    .answers-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* =========================================
   THEMES - Dino (Cas) & Lego (Pim)
   ========================================= */

/* ---- DINO THEME (Cas) ---- */
[data-theme="dino"] {
    --primary: #2E7D32;
    --primary-light: #4CAF50;
    --primary-dark: #1B5E20;
    --secondary: #FF8F00;
    --secondary-light: #FFB74D;
    --bg-main: #E8F5E9;
    --border: #C8E6C9;
}

[data-theme="dino"] #screen-login {
    background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 40%, #66BB6A 70%, #A5D6A7 100%);
}

[data-theme="dino"] .logo-text .text-gradient {
    background: linear-gradient(135deg, #FF8F00, #FF6D00);
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="dino"] .user-card:hover {
    border-color: var(--primary);
}

[data-theme="dino"] .level-badge {
    background: linear-gradient(135deg, #2E7D32, #4CAF50);
}

[data-theme="dino"] .xp-bar-fill {
    background: linear-gradient(90deg, #2E7D32, #FF8F00);
}

[data-theme="dino"] .answer-btn:hover:not(:disabled):not(.correct):not(.wrong):not(.eliminated) {
    border-color: #2E7D32;
    background: #E8F5E9;
}

[data-theme="dino"] .btn-primary {
    background: linear-gradient(135deg, #2E7D32, #4CAF50);
}

[data-theme="dino"] .btn-primary:hover {
    background: linear-gradient(135deg, #1B5E20, #388E3C);
}

[data-theme="dino"] .quiz-progress-fill {
    background: linear-gradient(90deg, #2E7D32, #4CAF50);
}

[data-theme="dino"] .bottom-nav .nav-btn.active {
    color: #2E7D32;
}

[data-theme="dino"] .score-circle {
    background: linear-gradient(135deg, #2E7D32, #4CAF50);
}

[data-theme="dino"] .theme-mascot::after {
    content: '🦕';
    position: fixed;
    bottom: 80px;
    right: 10px;
    font-size: 50px;
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
    animation: dinoWalk 4s ease-in-out infinite;
}

@keyframes dinoWalk {
    0%, 100% { transform: translateX(0) scaleX(1); }
    50% { transform: translateX(-20px) scaleX(1); }
}

/* ---- LEGO THEME (Pim) ---- */
[data-theme="lego"] {
    --primary: #D32F2F;
    --primary-light: #EF5350;
    --primary-dark: #B71C1C;
    --secondary: #1565C0;
    --secondary-light: #42A5F5;
    --bg-main: #FFF3E0;
    --border: #FFE0B2;
}

[data-theme="lego"] #screen-login {
    background: linear-gradient(135deg, #D32F2F 0%, #F44336 30%, #FFD600 60%, #1565C0 100%);
}

[data-theme="lego"] .logo-text .text-gradient {
    background: linear-gradient(135deg, #FFD600, #D32F2F);
    -webkit-background-clip: text;
    background-clip: text;
}

[data-theme="lego"] .user-card:hover {
    border-color: var(--primary);
}

[data-theme="lego"] .level-badge {
    background: linear-gradient(135deg, #D32F2F, #EF5350);
}

[data-theme="lego"] .xp-bar-fill {
    background: linear-gradient(90deg, #D32F2F, #FFD600);
}

[data-theme="lego"] .answer-btn:hover:not(:disabled):not(.correct):not(.wrong):not(.eliminated) {
    border-color: #D32F2F;
    background: #FFF3E0;
}

[data-theme="lego"] .btn-primary {
    background: linear-gradient(135deg, #D32F2F, #EF5350);
}

[data-theme="lego"] .btn-primary:hover {
    background: linear-gradient(135deg, #B71C1C, #D32F2F);
}

[data-theme="lego"] .quiz-progress-fill {
    background: linear-gradient(90deg, #D32F2F, #FFD600);
}

[data-theme="lego"] .bottom-nav .nav-btn.active {
    color: #D32F2F;
}

[data-theme="lego"] .score-circle {
    background: linear-gradient(135deg, #D32F2F, #1565C0);
}

[data-theme="lego"] .theme-mascot::after {
    content: '🧱';
    position: fixed;
    bottom: 80px;
    right: 10px;
    font-size: 50px;
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
    animation: legoBounce 2s ease-in-out infinite;
}

@keyframes legoBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(10deg); }
}

/* Theme floating shapes override */
[data-theme="dino"] .shape-1::before { content: '🦕'; }
[data-theme="dino"] .shape-2::before { content: '🌿'; }
[data-theme="dino"] .shape-3::before { content: '🦖'; }
[data-theme="dino"] .shape-4::before { content: '🌋'; }
[data-theme="dino"] .shape-5::before { content: '🥚'; }
[data-theme="dino"] .shape-6::before { content: '🦎'; }

[data-theme="lego"] .shape-1::before { content: '🧱'; }
[data-theme="lego"] .shape-2::before { content: '🔴'; }
[data-theme="lego"] .shape-3::before { content: '🔵'; }
[data-theme="lego"] .shape-4::before { content: '🟡'; }
[data-theme="lego"] .shape-5::before { content: '🟢'; }
[data-theme="lego"] .shape-6::before { content: '🧱'; }

/* Theme welcome banner */
.theme-welcome {
    text-align: center;
    padding: 12px 20px;
    font-weight: 700;
    font-size: 14px;
    border-radius: var(--radius-md);
    margin: 0 20px 16px;
}

[data-theme="dino"] .theme-welcome {
    background: linear-gradient(135deg, #E8F5E9, #C8E6C9);
    color: #1B5E20;
}

[data-theme="lego"] .theme-welcome {
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    color: #BF360C;
}

/* =========================================
   UTILITY CLASSES
   ========================================= */
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* =========================================
   DARK MODE TOGGLE
   ========================================= */
.dark-mode-toggle {
    background: none;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: var(--radius-full);
    width: 36px;
    height: 36px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    padding: 0;
}

.dark-mode-toggle:hover {
    border-color: rgba(255,255,255,0.6);
    transform: rotate(20deg);
}

/* =========================================
   DAILY STREAK BANNER
   ========================================= */
.daily-streak-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    margin: 0 20px 16px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #FFF3E0, #FFE0B2);
    color: #E65100;
    font-size: 14px;
    font-weight: 600;
    animation: fadeIn 0.4s ease;
}

.daily-streak-banner .streak-flames {
    font-size: 20px;
}

/* =========================================
   CATEGORY PROGRESS BAR
   ========================================= */
.category-progress-bar {
    margin-top: 10px;
    height: 6px;
    background: #E8EAF6;
    border-radius: 3px;
    overflow: hidden;
}

.category-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
}

.category-progress-text {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* =========================================
   DARK MODE 
   ========================================= */
[data-dark="true"] {
    --bg-main: #1a1a2e;
    --bg-card: #16213e;
    --text-primary: #E8EAF6;
    --text-secondary: #9e9eb3;
    --text-light: #636380;
    --border: #2a2a4a;
    --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);
}

[data-dark="true"] body {
    background: var(--bg-main);
    color: var(--text-primary);
}

[data-dark="true"] .app-header {
    background: #0f3460;
}

[data-dark="true"] .category-card {
    background: var(--bg-card);
    border-color: #2a2a4a !important;
}

[data-dark="true"] .category-card:hover {
    box-shadow: 0 4px 20px rgba(108, 99, 255, 0.2);
}

[data-dark="true"] .category-progress-bar {
    background: #2a2a4a;
}

[data-dark="true"] .level-dot {
    background: var(--bg-card);
    border-color: #3a3a5a;
    color: #7a7a9a;
}

[data-dark="true"] .level-card {
    background: var(--bg-card);
    border-color: #2a2a4a;
}

[data-dark="true"] .question-card {
    background: var(--bg-card);
    color: var(--text-primary);
}

[data-dark="true"] .answer-btn {
    background: var(--bg-card);
    border-color: #2a2a4a;
    color: var(--text-primary);
}

[data-dark="true"] .answer-btn:hover:not(:disabled):not(.correct):not(.wrong):not(.eliminated) {
    background: #1e2a4a;
    border-color: var(--primary);
}

[data-dark="true"] .bottom-nav {
    background: #0f1a30;
    border-top-color: #2a2a4a;
}

[data-dark="true"] .sub-header {
    background: #0f3460;
    color: var(--text-primary);
}

[data-dark="true"] .shop-item {
    background: var(--bg-card);
    border-color: #2a2a4a;
}

[data-dark="true"] .badge-card {
    background: var(--bg-card);
}

[data-dark="true"] .rank-item {
    background: var(--bg-card);
    border-color: #2a2a4a;
}

[data-dark="true"] .results-container {
    background: var(--bg-card);
    color: var(--text-primary);
}

[data-dark="true"] .daily-streak-banner {
    background: linear-gradient(135deg, #2a1a00, #3a2a10);
    color: #FFB74D;
}

[data-dark="true"] .theme-welcome {
    background: #1a2a3a !important;
}

[data-dark="true"][data-theme="dino"] .theme-welcome {
    color: #81C784 !important;
}

[data-dark="true"][data-theme="lego"] .theme-welcome {
    color: #FFB74D !important;
}

[data-dark="true"] .xp-bar {
    background: #2a2a4a;
}

[data-dark="true"] .modal-content {
    background: var(--bg-card);
    color: var(--text-primary);
}

[data-dark="true"] .ranking-tabs {
    background: #0f1a30;
}

[data-dark="true"] .rank-tab {
    color: var(--text-secondary);
}

[data-dark="true"] .rank-tab.active {
    color: var(--text-primary);
}

[data-dark="true"] .login-container {
    background: rgba(22, 33, 62, 0.95);
}

[data-dark="true"] .user-card {
    background: var(--bg-card);
    border-color: #2a2a4a;
    color: var(--text-primary);
}

[data-dark="true"] .guest-card {
    background: var(--bg-card);
}

[data-dark="true"] .pin-card {
    background: var(--bg-card);
}

[data-dark="true"] .dark-mode-toggle {
    border-color: rgba(255,255,255,0.3);
}

[data-dark="true"] .answer-detail-item {
    background: #1e2a4a;
}

[data-dark="true"] .powerup-btn {
    background: var(--bg-card);
    border-color: #2a2a4a;
    color: var(--text-primary);
}

[data-dark="true"] .section-title {
    color: var(--text-primary);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #C5CAE9;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-light);
}

/* Selection color */
::selection {
    background: var(--primary-light);
    color: white;
}
