/* ============================================
   KAPSÜL GAMECUBE - Zihinsel Fitness
   Global Styles - Beyaz/Mavi/Yeşil Tema
   ============================================ */

:root {
    /* Colors - Beyaz/Mavi/Yeşil Fresh Tema */
    --bg-primary: #f8fafb;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f4f8;
    --bg-element: #f1f3f5;
    /* Yeni: Hafif gri buton/kutu rengi */

    --accent-primary: #3498db;
    --accent-secondary: #27ae60;
    --accent-gradient: linear-gradient(135deg, #3498db 0%, #27ae60 100%);
    --bg-water-green: #e0f2f1;
    /* Su yeşili */

    --success: #27ae60;
    --error: #e74c3c;
    --warning: #f39c12;
    --gold: #f1c40f;

    --text-primary: #2c3e50;
    --text-secondary: #5d6d7e;
    --text-muted: #95a5a6;

    /* Typography */
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 12px;
    --spacing-lg: 20px;
    --spacing-xl: 24px;
    --spacing-2xl: 32px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;

    /* Shadows - Soft */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 20px rgba(52, 152, 219, 0.3);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
}

/* ============================================
   Reset & Base
   ============================================ */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
}

/* Soft dekoratif arka plan */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 0% 0%, rgba(52, 152, 219, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 100% 100%, rgba(39, 174, 96, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

/* ============================================
   App Container
   ============================================ */

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-sm) var(--spacing-lg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Dashboard'da kaydırma, oyunlarda sabit */
#dashboard {
    overflow-y: auto;
    flex: 1;
}

#gameView {
    display: none;
    /* Varsayılan olarak gizli */
    height: calc(var(--app-vh, 1vh) * 100);
    max-height: calc(var(--app-vh, 1vh) * 100);
    overflow: hidden;
    flex-direction: column;
}

#gameView.active {
    display: flex;
    /* GÖRÜNÜR YAP */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #121420;
    /* Koyu Lacivert */
    color: #ffffff;
    z-index: 100;
    padding: var(--spacing-sm) var(--spacing-lg);
}

/* Oyun içi koyu tema override */
#gameView.active .game-header {
    background: #1c1e2d;
    border-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

#gameView.active .game-header h2 {
    color: #ffffff;
}

#gameView.active .btn-back {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

#gameView.active .btn-back:hover {
    background: rgba(255, 255, 255, 0.1);
}

#gameView.active .game-area {
    background: #1c1e2d;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#gameView.active .game-area button {
    /* Oyun içi butonlar */
    border-color: rgba(255, 255, 255, 0.1);
}

#gameView.active .mode-btn,
#gameView.active .size-btn,
#gameView.active .level-btn,
#gameView.active .diff-btn {
    background-color: #252838 !important;
    /* Koyu kart */
    color: #a4a8b6 !important;
}

#gameView.active .mode-btn[style*="var(--accent-primary)"],
#gameView.active .size-btn[style*="var(--accent-primary)"] {
    background: var(--accent-primary) !important;
    color: white !important;
}

#gameView.active .instructions-panel {
    background: #1c1e2d;
    border-color: var(--accent-primary);
}

#gameView.active .instructions-panel p {
    color: #a4a8b6;
}

/* ============================================
   Header
   ============================================ */

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    background: var(--bg-card);
    border: 1px solid #e8ecef;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    position: relative;
    min-height: 60px;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.logo-icon {
    font-size: 2rem;
    /* 2.5rem -> 2rem */
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.header-right {
    display: none;
}

.brand-logos {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: 0;
    border: none;
    z-index: 1;
}

.brand-logo {
    height: 50px;
    width: auto;
    border-radius: var(--radius-lg);
    transition: var(--transition-normal);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    object-fit: contain;
    background: white;
    padding: 4px;
}

.brand-logo:hover {
    transform: scale(1.05);
}

.logo h1 {
    font-size: 1.5rem;
    /* 1.75rem -> 1.5rem */
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo .accent {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    /* Öğeler arası eşit boşluk */
    z-index: 2;
    /* Logoların üstünde olması için (gerekirse) */
    margin-right: -20px;
    /* 3+2=5 birim (25px) sağa kaydırma */
}

.header-stats {
    display: flex;
    gap: var(--spacing-xl);
    margin-right: 0;
    /* Margin kaldırıldı */
}

.stat-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--bg-card);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    font-size: 1.25rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gold);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.view {
    display: none;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- View Transitions --- */
.view-transition-container {
    perspective: 1000px;
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 100%;
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(-100%);
        opacity: 0;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes slideInTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutBottom {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

@keyframes slideInBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutTop {
    from {
        transform: translateY(0);
        opacity: 1;
    }

    to {
        transform: translateY(-100%);
        opacity: 0;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes zoomOut {
    from {
        transform: scale(1);
        opacity: 1;
    }

    to {
        transform: scale(1.2);
        opacity: 0;
    }
}

/* Animation Classes */
.anim-slide-in-right {
    animation: slideInRight 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.anim-slide-out-left {
    animation: slideOutLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.anim-slide-in-left {
    animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.anim-slide-out-right {
    animation: slideOutRight 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.anim-slide-in-top {
    animation: slideInTop 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.anim-slide-out-bottom {
    animation: slideOutBottom 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.anim-slide-in-bottom {
    animation: slideInBottom 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.anim-slide-out-top {
    animation: slideOutTop 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.anim-zoom-in {
    animation: zoomIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.anim-zoom-out {
    animation: zoomOut 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.view.exiting {
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 5;
    pointer-events: none;
}

/* Ensure entering view is relative to fill space once transition ends */
.view.entering {
    z-index: 10;
    position: relative;
    width: 100%;
}


/* ============================================
   Welcome Section
   ============================================ */

.welcome-section {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.welcome-section h2 {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

.welcome-section p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-lg);
}

/* ============================================
   Buttons
   ============================================ */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    background: var(--accent-gradient);
    color: var(--text-primary);
    border: none;
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-large {
    padding: var(--spacing-lg) var(--spacing-2xl);
    font-size: 1.15rem;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-lg);
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.btn-icon {
    font-size: 1.25rem;
}

.btn-back {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-back:hover {
    background: var(--bg-card);
    border-color: var(--accent-primary);
}

/* ============================================
   Games Grid
   ============================================ */

.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    /* 280px -> 240px */
    gap: var(--spacing-md);
    /* LG -> MD */
    margin-bottom: var(--spacing-xl);
}

.game-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-gradient);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.game-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg);
}

.game-card:hover::before {
    opacity: 1;
}

.game-icon {
    font-size: 1.75rem;
    /* 2rem -> 1.75rem */
    /* 3rem'den 2rem'e düşürüldü */
    margin-bottom: var(--spacing-sm);
}

/* Header Stats */
/* Header Stats */
.header-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.header-stats {
    display: flex;
    gap: var(--spacing-sm);
}

.stat-item {
    background: var(--bg-element);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.9rem;
    color: var(--text-secondary);
    border: 1px solid rgba(0, 0, 0, 0.05);
    height: 44px;
    /* Buton ile aynı yükseklik */
    box-sizing: border-box;
}

.stat-value {
    font-weight: 700;
    color: var(--accent-primary);
    font-size: 1rem;
}

.fullscreen-btn {
    background: var(--bg-element);
    /* Arka plan eşitlendi */
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Border eşitlendi */
    color: var(--text-primary);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-md);
    /* Radius eşitlendi */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    box-shadow: none;
}

.fullscreen-btn:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    border-color: var(--accent-primary);
}

.game-header-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.instructions-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    display: none;
    /* JS ile açılacak */
    animation: fadeIn 0.3s ease;
}

.instructions-panel h3 {
    color: var(--gold);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: 10px;
}

.instructions-panel p {
    color: var(--text-primary);
    line-height: 1.5;
}

.game-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.game-card p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
}

.game-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.difficulty {
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    /* Su yeşili dolgu */
    border: 1px solid transparent;
}

.difficulty.easy {
    color: #fff;
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: transparent;
}

.difficulty.medium {
    color: #fff;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: transparent;
}

.difficulty.hard {
    color: #fff;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: transparent;
}

.best-score {
    color: var(--text-secondary);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    background: var(--bg-water-green);
    font-weight: 500;
}

/* ============================================
   Today Stats
   ============================================ */

.today-stats {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
}

.today-stats h3 {
    font-size: 1.1rem;
    margin-bottom: var(--spacing-lg);
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
}

.stat-box {
    text-align: center;
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(0, 0, 0, 0.05);
}


.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: var(--spacing-xs);
}

.stat-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ============================================
   Game View
   ============================================ */

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) 0;
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.game-header h2 {
    font-size: 1.5rem;
}

.game-info {
    display: flex;
    gap: var(--spacing-lg);
}

.timer,
.score {
    background: var(--bg-card);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    font-weight: 600;
}

.timer {
    color: var(--warning);
}

.score {
    color: var(--success);
}

.game-area {
    flex: 1;
    min-height: 0;
    /* Flex child için önemli */
    max-height: calc((var(--app-vh, 1vh) * 100) - 190px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: 0;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
}

/* ============================================
   Result View
   ============================================ */

#resultView {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1200;
    width: 100%;
    height: calc(var(--app-vh, 1vh) * 100);
    padding: 16px;
    overflow-y: auto;
    justify-content: center;
    align-items: center;
    min-height: calc(var(--app-vh, 1vh) * 100);
}

#resultView.active {
    display: flex;
}

.result-card {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-xl);
    padding: var(--spacing-2xl);
    text-align: center;
    max-width: 450px;
    width: 100%;
    margin: auto;
    max-height: calc((var(--app-vh, 1vh) * 100) - 32px);
    overflow-y: auto;
    animation: scaleIn 0.4s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============================================
   Gamification Elements (Phase 2)
   ============================================ */

/* Gamified Header Stats */
.gamification-stats {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-right: 15px;
}

/* Header Level Badge */
.user-level-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    cursor: default;
    transition: transform 0.2s ease;
}

.user-level-badge:hover {
    transform: translateY(-2px);
}

.level-icon {
    font-size: 1.1em;
}

/* Header Streak Badge */
.streak-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 107, 107, 0.1);
    color: #ff6b6b;
    border: 1px solid rgba(255, 107, 107, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
}

.streak-icon {
    font-size: 1.1em;
    filter: drop-shadow(0 0 4px rgba(255, 107, 107, 0.5));
    animation: pulseSubtle 2s infinite;
}

@keyframes pulseSubtle {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.9;
    }

    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

/* Header XP Bar */
.xp-container {
    display: flex;
    flex-direction: column;
    width: 160px;
}

.xp-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    margin-bottom: 3px;
    color: var(--text-secondary);
    font-weight: 600;
}

.xp-val {
    color: var(--accent-primary);
}

.xp-progress-bar {
    height: 8px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.xp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
}

/* Daily Missions Widget */
.missions-container {
    background: var(--bg-card);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    position: relative;
    overflow: hidden;
}

.missions-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-gradient);
}

.missions-container h3 {
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
}

.missions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.mission-card {
    background: var(--bg-element);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.mission-card:hover {
    transform: translateY(-2px);
    background: white;
    box-shadow: var(--shadow-sm);
    border-color: rgba(0, 0, 0, 0.05);
}

.mission-card.completed {
    background: rgba(39, 174, 96, 0.05);
    border-color: rgba(39, 174, 96, 0.2);
    opacity: 0.8;
}

.mission-icon {
    font-size: 1.5rem;
    background: white;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: var(--shadow-sm);
}

.mission-info {
    flex: 1;
}

.mission-text {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    display: block;
}

.mission-reward {
    font-size: 0.75rem;
    color: var(--accent-primary);
    background: rgba(52, 152, 219, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.mission-check {
    width: 24px;
    height: 24px;
    border: 2px solid #ddd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.2s ease;
}

.mission-card.completed .mission-check {
    background: var(--success);
    border-color: var(--success);
}

.result-card h2 {
    font-size: 1.75rem;
    margin-bottom: var(--spacing-lg);
}

.result-score {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

.score-label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
}

.score-value {
    font-size: 3rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.result-details {
    margin-bottom: var(--spacing-xl);
    color: var(--text-secondary);
}

.result-actions {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
}

/* ============================================
   Game Specific Styles
   ============================================ */

/* Memory Cards */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    max-width: 500px;
    /* Reduced max-width to constrain grid size */
    width: 100%;
}

.memory-card {
    aspect-ratio: 1;
    min-width: 70px;
    min-height: 70px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    position: relative;
    transform-style: preserve-3d;
    box-shadow: var(--shadow-md);
}

.memory-card.flipped {
    transform: rotateY(180deg);
}

.memory-card.matched {
    background: var(--success);
    cursor: default;
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;

    border-radius: var(--radius-md);
}

/* ============================================
   Level Up Modal
   ============================================ */
.level-up-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.level-up-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid var(--accent-primary);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 0 50px rgba(52, 152, 219, 0.5);
    animation: zoomIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.level-up-header h2 {
    font-size: 2.5rem;
    background: linear-gradient(90deg, #f1c40f, #e67e22);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.level-badge-large {
    font-size: 5rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 0 20px rgba(241, 196, 15, 0.6));
    animation: float 3s ease-in-out infinite;
}

.level-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-size: 3rem;
    font-weight: 800;
    margin: 30px 0;
    color: white;
}

.level-arrow {
    color: var(--accent-primary);
    font-size: 2rem;
}

.new-level {
    color: var(--success);
    text-shadow: 0 0 20px rgba(46, 204, 113, 0.6);
}

.level-rewards {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 30px;
}

.reward-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-primary);
}

.level-up-btn {
    width: 100%;
    padding: 15px;
    font-size: 1.2rem;
    background: linear-gradient(90deg, #f1c40f, #e67e22);
    border: none;
    box-shadow: 0 5px 15px rgba(230, 126, 34, 0.4);
    cursor: pointer;
    border-radius: var(--radius-md);
    color: white;
}

.level-up-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(230, 126, 34, 0.6);
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Modal Helpers */
.modal.show {
    display: flex;
}

/* In-game instruction modal: force full-screen centered layout */
.instruction-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.75);
    z-index: 2000;
}

.instruction-modal[style*="display: flex"],
.instruction-modal[style*="display:flex"],
.instruction-modal[style*="display: block"],
.instruction-modal[style*="display:block"] {
    display: flex !important;
}

.instruction-modal .instruction-content {
    position: relative;
    width: min(560px, 100%);
    max-height: calc(100vh - 32px);
    margin: 0;
    overflow-y: auto;
    padding: 24px;
    border-radius: 16px;
}

.instruction-modal .instruction-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 14px;
}

.instruction-modal .instruction-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.instruction-modal .instruction-header h3 {
    margin: 0;
    font-size: 1.35rem;
    text-align: center;
}

.instruction-modal .instruction-body {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 12px;
    padding: 14px 16px;
}

.instruction-modal .instruction-body p {
    margin: 0;
    text-align: justify;
    text-justify: inter-word;
}

.instruction-modal .instruction-footer {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.instruction-modal .instruction-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.instruction-modal .instruction-checkbox input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.instruction-modal .instruction-checkbox label {
    margin: 0;
    line-height: 1.3;
    cursor: pointer;
}

.card-front {
    background: var(--accent-gradient);
}

.card-back {
    background: var(--bg-secondary);
    transform: rotateY(180deg);
}

/* Number Sequence */
.sequence-display {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-primary);
    margin-bottom: var(--spacing-xl);
    min-height: 60px;
}

.sequence-input {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--spacing-md);
    max-width: 400px;
}

.number-btn {
    padding: var(--spacing-lg);
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.number-btn:hover {
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
}

.number-btn:active {
    transform: scale(0.95);
}

/* Stroop Test */
.stroop-word {
    font-size: 4rem;
    font-weight: 800;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-xl);
}

.stroop-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    max-width: 600px;
}

.color-btn {
    padding: var(--spacing-lg) var(--spacing-xl);
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    color: white;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.color-btn:hover {
    transform: scale(1.05);
}

.color-btn:active {
    transform: scale(0.95);
}

/* Quick Math */
.math-problem {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xl);
}

.math-input {
    display: flex;
    gap: var(--spacing-md);
    align-items: center;
}

.math-input input {
    width: 150px;
    padding: var(--spacing-md);
    font-size: 1.5rem;
    text-align: center;
    background: var(--bg-secondary);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
}

.math-input input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

/* Pattern */
.pattern-display {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.pattern-item {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.pattern-options {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
}

.pattern-option {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    transition: all var(--transition-fast);
}

.pattern-option:hover {
    border-color: var(--accent-primary);
    transform: scale(1.1);
}

/* Reaction Test */
.reaction-area {
    width: 300px;
    height: 300px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.1s;
}

.reaction-area.waiting {
    background: var(--error);
}

.reaction-area.ready {
    background: var(--success);
}

.reaction-area.clicked {
    background: var(--accent-primary);
}

.reaction-result {
    font-size: 2rem;
    font-weight: 700;
    margin-top: var(--spacing-lg);
}

/* ============================================
   Animations
   ============================================ */

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.3s ease;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.bounce {
    animation: bounce 0.5s ease;
}

@keyframes glow {

    0%,
    100% {
        box-shadow: 0 0 5px var(--accent-primary);
    }

    50% {
        box-shadow: 0 0 20px var(--accent-primary);
    }
}

.glow {
    animation: glow 1s ease infinite;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    #gameView.active {
        padding: 8px;
    }

    .header {
        flex-direction: column;
        gap: var(--spacing-sm);
        text-align: center;
        padding: var(--spacing-sm);
    }

    .brand-logos {
        position: static;
        transform: none;
        order: -1;
        margin-bottom: var(--spacing-xs);
    }

    .brand-logo {
        height: 35px;
    }

    .logo {
        order: 0;
    }

    .logo h1 {
        font-size: 1.1rem;
    }

    .logo-icon {
        font-size: 1.5rem;
    }

    .header-stats {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: var(--spacing-xs);
    }

    .games-grid {
        grid-template-columns: 1fr;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .game-header {
        flex-direction: column;
        gap: 8px;
        padding: 4px 0;
        margin-bottom: 8px;
    }

    .game-header h2 {
        font-size: 1.1rem;
    }

    .game-info {
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .game-area {
        padding: 8px;
        max-height: calc((var(--app-vh, 1vh) * 100) - 150px);
    }

    .stroop-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .sequence-input {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ============================================
   Mode Selection Styles
   ============================================ */

.mode-select {
    text-align: center;
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
    max-width: 600px;
    margin: 0 auto;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xl);
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
}

.mode-btn:hover {
    border-color: var(--accent-primary);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

.mode-icon {
    font-size: 2.5rem;
}

.mode-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.mode-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Stroop 6 color grid */
.stroop-options {
    grid-template-columns: repeat(3, 1fr) !important;
    max-width: 500px !important;
}

@media (max-width: 768px) {
    .mode-grid {
        grid-template-columns: 1fr;
    }

    .stroop-options {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

.info-btn {
    width: 32px;
    height: 32px;
    border: 2px solid var(--text-secondary);
    border-radius: 50%;
    color: var(--text-secondary);
    background: transparent;
    font-weight: bold;
    font-family: 'Times New Roman', serif;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 10px;
}

.info-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

/* --- Advanced Page Transitions --- */

/* Base Transition Class */
.main-content {
    /* Varsayılan transition'ı kaldırıyoruz, JS ile kontrol edeceğiz */
    transition: none;
}

/* 1. Slide Left (Original/Default) */
.trans-slide-left-exit {
    animation: slideLeftExit 0.7s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

.trans-slide-left-enter {
    animation: slideLeftEnter 0.7s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

@keyframes slideLeftExit {
    to {
        transform: translateX(-100px);
        opacity: 0;
    }
}

@keyframes slideLeftEnter {
    from {
        transform: translateX(100px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* 2. Zoom Fade */
.trans-zoom-exit {
    /* Zoom biraz daha hızlı olabilir ki oyun hemen gelsin */
    animation: zoomExit 0.6s ease-in forwards;
}

.trans-zoom-enter {
    animation: zoomEnter 0.8s ease-out forwards;
}

@keyframes zoomExit {
    to {
        transform: scale(0.9);
        opacity: 0;
    }
}

@keyframes zoomEnter {
    from {
        transform: scale(1.1);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 3. Flip Rotate */
.trans-flip-exit {
    animation: flipExit 0.7s ease-in forwards;
    transform-origin: center;
}

.trans-flip-enter {
    animation: flipEnter 0.7s ease-out forwards;
    transform-origin: center;
}

@keyframes flipExit {
    to {
        transform: rotateY(90deg);
        opacity: 0;
    }
}

@keyframes flipEnter {
    from {
        transform: rotateY(-90deg);
        opacity: 0;
    }

    to {
        transform: rotateY(0);
        opacity: 1;
    }
}

/* 4. Glitch/Cyber (Hafif) */
.trans-cyber-exit {
    animation: cyberExit 0.3s steps(5) forwards;
}

.trans-cyber-enter {
    animation: cyberEnter 0.3s steps(5) forwards;
}

@keyframes cyberExit {
    0% {
        transform: translate(0);
    }

    20% {
        transform: translate(-5px, 5px);
    }

    40% {
        transform: translate(5px, -5px);
        opacity: 0.8;
    }

    100% {
        transform: translate(0);
        opacity: 0;
    }
}

@keyframes cyberEnter {
    0% {
        transform: translate(0);
        opacity: 0;
    }

    60% {
        transform: translate(-5px, 5px);
        opacity: 0.8;
    }

    100% {
        transform: translate(0);
        opacity: 1;
    }
}

/* ============================================
   User Menu & Profile
   ============================================ */

.user-menu {
    position: relative;
}

.user-menu-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-element);
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: var(--radius-md);
    padding: 6px 12px;
    cursor: pointer;
    transition: all var(--transition-normal);
    height: 44px;
}

.user-menu-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.user-avatar {
    font-size: 1.4rem;
}

.user-level {
    font-size: 1rem;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--radius-lg);
    padding: 12px 0;
    min-width: 220px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
}

.user-menu:hover .user-dropdown,
.user-menu:focus-within .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 8px 16px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 8px;
}

.dropdown-name {
    display: block;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.dropdown-level {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.dropdown-xp {
    padding: 0 16px 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    margin-bottom: 8px;
}

.xp-bar-mini {
    height: 6px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.xp-fill-mini {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 3px;
    width: 0%;
    transition: width 0.5s ease;
}

.xp-text-mini {
    font-size: 11px;
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-family: inherit;
}

.dropdown-item:hover {
    background: var(--bg-element);
}

.logout-item {
    color: #e74c3c;
}

.logout-item:hover {
    background: rgba(231, 76, 60, 0.1);
}

/* ============================================
   AI Banner
   ============================================ */

.ai-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(39, 174, 96, 0.1) 100%);
    border: 1px solid rgba(52, 152, 219, 0.3);
    border-radius: var(--radius-lg);
    padding: 16px 24px;
    margin-bottom: var(--spacing-lg);
    animation: fadeIn 0.3s ease;
}

.ai-banner-content {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ai-banner-icon {
    font-size: 2rem;
}

.ai-banner-text {
    display: flex;
    flex-direction: column;
}

.ai-banner-text strong {
    font-size: 15px;
    color: var(--text-primary);
}

.ai-banner-text span {
    font-size: 13px;
    color: var(--text-secondary);
}

.btn-ai-banner {
    background: var(--accent-gradient);
    color: #fff;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-normal);
}

.btn-ai-banner:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

@media (max-width: 768px) {
    .ai-banner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .ai-banner-content {
        flex-direction: column;
    }

    .btn-ai-banner {
        width: 100%;
    }
}

/* ============================================
   Cognitive Badges
   ============================================ */
.game-card {
    position: relative;
    overflow: hidden;
}

.badge-container {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 5px;
    z-index: 2;
}

.cognitive-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
    border: 1px solid currentColor;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.game-card:hover .cognitive-badge {
    transform: scale(1.05);
}

.cognitive-badge .badge-icon {
    font-size: 0.9em;
}

/* ============================================
   Daily Briefing Modal (AI Recommendation)
   ============================================ */
.daily-briefing-modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Fixed overlay */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: rgba(15, 15, 35, 0.95);
    /* Dark focus bg */
    backdrop-filter: blur(15px);
    z-index: 9999;
    /* Highest priority */
}

/* When active, use flex (managed by JS, but good to have helper class) */
.daily-briefing-modal.active {
    display: flex;
}

.briefing-content {
    background: linear-gradient(145deg, rgba(30, 30, 50, 0.9), rgba(20, 20, 40, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(52, 152, 219, 0.2);
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    border-radius: 24px;
    text-align: center;
    position: relative;
    animation: modalPopIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.briefing-header {
    margin-bottom: 2rem;
}

.briefing-badge {
    background: linear-gradient(90deg, #3498db, #9b59b6);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.briefing-header h2 {
    font-size: 2rem;
    margin: 15px 0 10px 0;
    color: #fff;
}

.rec-highlight-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease;
}

.rec-highlight-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(52, 152, 219, 0.3);
}

.rec-icon-large {
    font-size: 3rem;
    min-width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.briefing-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #666;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal-btn:hover {
    color: #fff;
}

/* ============================================
   Analytics View Overlay
   ============================================ */
.analytics-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 25, 0.95);
    backdrop-filter: blur(10px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    display: none;
}

/* Helper for JS toggling */
.analytics-overlay.active {
    display: flex;
}

.analytics-content {
    width: 90%;
    max-width: 900px;
    height: 85vh;
    background: #f5f5f7;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-y: auto;
}

.analytics-header {
    text-align: center;
    margin-bottom: 20px;
}

.analytics-header h2 {
    font-size: 2rem;
    color: #111;
    margin: 0;
}

.analytics-header p {
    color: #333;
    margin: 5px 0 0 0;
}

.chart-container-large {
    flex-grow: 1;
    min-height: 300px;
    background: #fff;
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.analytics-summary {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.summary-card {
    background: #fff;
    padding: 15px 25px;
    border-radius: 12px;
    text-align: center;
    flex: 1;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.summary-card .value {
    display: block;
    font-size: 1.8rem;
    font-weight: bold;
    color: #111;
}

.summary-card .label {
    font-size: 0.9rem;
    color: #333;
}

.close-analytics-btn {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    color: #111;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
}

.close-analytics-btn:hover {
    color: #333;
}

/* ============================================
   Daily Briefing Modal (AI Recommendation)
   ============================================ */
.daily-briefing-modal {
    display: none;
    /* Hidden by default */
    position: fixed;
    /* Fixed overlay */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    background: rgba(15, 15, 35, 0.95);
    /* Dark focus bg */
    backdrop-filter: blur(15px);
    z-index: 9999;
    /* Highest priority */
}

/* When active, use flex (managed by JS, but good to have helper class) */
.daily-briefing-modal.active {
    display: flex;
}

.briefing-content {
    background: linear-gradient(145deg, rgba(30, 30, 50, 0.9), rgba(20, 20, 40, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(52, 152, 219, 0.2);
    width: 90%;
    max-width: 500px;
    padding: 2rem;
    border-radius: 24px;
    text-align: center;
    position: relative;
    animation: modalPopIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.briefing-header {
    margin-bottom: 2rem;
}

.briefing-badge {
    background: linear-gradient(90deg, #3498db, #9b59b6);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.briefing-header h2 {
    font-size: 2rem;
    margin: 15px 0 10px 0;
    color: #fff;
}

.rec-highlight-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s ease;
}

.rec-highlight-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(52, 152, 219, 0.3);
}

.rec-icon-large {
    font-size: 3rem;
    min-width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

.briefing-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #666;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.3s;
}

.close-modal-btn:hover {
    color: #fff;
}

/* Login View Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at center, var(--bg-secondary) 0%, var(--bg-primary) 100%);
}

.login-card {
    width: 100%;
    max-width: 400px;
    padding: 2.5rem;
    border-radius: 24px;
    text-align: center;
}

.login-header {
    margin-bottom: 2rem;
}

.login-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: inline-block;
    animation: float 3s ease-in-out infinite;
}

.login-form .form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-form input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.login-form input:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
    outline: none;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.login-divider {
    margin: 1.5rem 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.login-divider span {
    padding: 0 10px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.full-width {
    width: 100%;
    justify-content: center;
}

.login-footer {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.login-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.login-footer a:hover {
    text-decoration: underline;
}

/* Loading View */
#loadingView {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    z-index: 9999;
}

#loadingView.active {
    display: flex;
}

.loading-logo {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(52, 152, 219, 0.3);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ============================================
   About Section
   ============================================ */
.about-section {
    margin-bottom: var(--spacing-xl);
}

.about-content {
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.05) 0%, rgba(39, 174, 96, 0.05) 100%);
    border: 1px solid rgba(52, 152, 219, 0.15);
}

.about-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.about-icon {
    font-size: 2rem;
}

.about-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.about-body p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--spacing-md);
}

.about-lead {
    font-size: 1.05rem;
}

.about-features {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.feature-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: var(--bg-card);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-md);
    border: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.9rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}

.feature-item:hover {
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 1.2rem;
}

/* ============================================
   Contact Section
   ============================================ */
.contact-section {
    margin-top: var(--spacing-2xl);
    margin-bottom: var(--spacing-lg);
}

.contact-content {
    padding: var(--spacing-xl);
    border-radius: var(--radius-xl);
    background: var(--bg-card);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.contact-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.contact-icon {
    font-size: 1.75rem;
}

.contact-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.contact-text {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.contact-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.contact-item:last-child {
    border-bottom: none;
}

.contact-label {
    font-weight: 500;
    color: var(--text-primary);
    min-width: 120px;
}

.contact-value {
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .about-features {
        flex-direction: column;
    }

    .contact-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }

    .contact-label {
        min-width: auto;
    }
}

/* ================================ */
/* Dashboard Controls Grid Layout  */
/* ================================ */
.dashboard-controls-grid {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
    padding: 15px 0;
}

.info-buttons-left {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-info:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-info .icon {
    font-size: 1rem;
}

.training-button-center {
    display: flex;
    justify-content: center;
}

.btn-large {
    padding: 16px 32px !important;
    font-size: 1.1rem !important;
}

.spacer-right {
    min-width: 100px;
}

@media (max-width: 900px) {
    .dashboard-controls-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .info-buttons-left {
        justify-content: center;
    }

    .spacer-right {
        display: none;
    }
}

/* ================================ */
/* Modal Dialogs */
/* ================================ */
.info-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    max-width: 600px;
    max-height: 85vh;
    width: 90%;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
    background: #ffffff !important;
    color: #333333 !important;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--accent-primary);
    color: white;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.modal-icon {
    font-size: 2.5rem;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-primary);
}

.modal-body {
    line-height: 1.7;
}

.modal-body h4 {
    margin: 20px 0 12px;
    color: var(--text-primary);
}

.modal-body .lead-text {
    font-size: 1.05rem;
    color: var(--text-primary);
}

.modal-body .quote-text {
    font-style: italic;
    color: var(--text-secondary);
    text-align: center;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    margin-top: 20px;
}

.modal-body .highlight-text {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-primary);
    margin-top: 20px;
}

.solutions-list,
.features-list {
    list-style: none;
    padding: 0;
    margin: 10px 0;
}

.solutions-list li,
.features-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
}

.solutions-list li:last-child,
.features-list li:last-child {
    border-bottom: none;
}

/* Contact Modal Specific */
.contact-details {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
}

.contact-row {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.contact-row:last-child {
    border-bottom: none;
}

.contact-icon-small {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.contact-row div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-row strong {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-row a,
.contact-row span {
    color: var(--text-primary);
    font-size: 1rem;
    text-decoration: none;
}

.contact-row a:hover {
    color: var(--accent-primary);
}

.note-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-top: 15px;
}

/* ================================ */
/* Equal Button Row Layout */
/* ================================ */
.dashboard-buttons-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-action:hover {
    background: var(--bg-secondary);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.btn-action .icon {
    font-size: 1.2rem;
}

/* Training button special style */
.btn-action.btn-training {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    border: none;
}

.btn-action.btn-training:hover {
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

@media (max-width: 768px) {
    .dashboard-buttons-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .dashboard-buttons-row {
        grid-template-columns: 1fr;
    }
}

/* ================================ */
/* AI Recommendation Popup */
/* ================================ */
.ai-recommendation-popup {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.ai-recommendation-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
}

.ai-recommendation-content {
    position: relative;
    max-width: 450px;
    width: 90%;
    background: var(--bg-primary);
    border-radius: 20px;
    overflow: hidden;
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ai-rec-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    text-align: center;
}

.ai-rec-header .ai-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    display: block;
}

.ai-rec-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.ai-rec-header p {
    margin: 8px 0 0;
    opacity: 0.9;
    font-size: 0.9rem;
}

.ai-rec-body {
    padding: 25px;
    text-align: center;
}

.weakness-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    margin-bottom: 15px;
}

.recommended-game {
    background: var(--bg-tertiary);
    border-radius: 15px;
    padding: 20px;
    margin: 15px 0;
}

.recommended-game .game-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.recommended-game h4 {
    margin: 0 0 5px;
    font-size: 1.2rem;
}

.recommended-game p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.ai-rec-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.ai-rec-actions button {
    flex: 1;
    padding: 14px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-play-now {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.btn-play-now:hover {
    transform: scale(1.02);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-later {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-later:hover {
    background: var(--bg-secondary);
}

.ai-rec-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-rec-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ============================================
   Premium Packages Modal
   ============================================ */

.premium-packages-modal .modal-content {
    max-width: 900px;
    width: 95%;
    padding: var(--spacing-xl);
}

.packages-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.packages-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f39c12 0%, #e74c3c 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.packages-header h2 {
    font-size: 1.75rem;
    margin-bottom: var(--spacing-xs);
}

.packages-header p {
    color: var(--text-secondary);
}

.packages-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.package-card {
    background: var(--bg-card);
    border: 2px solid transparent;
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    text-align: center;
    transition: all var(--transition-normal);
    position: relative;
}

.package-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.package-card.featured {
    border-color: var(--accent-primary);
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(39, 174, 96, 0.1) 100%);
}

.package-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-gradient);
    color: white;
    padding: 4px 16px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.package-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-sm);
}

.package-card h3 {
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
}

.package-price {
    margin-bottom: var(--spacing-md);
}

.package-price .price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.package-price .period {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.package-features {
    list-style: none;
    padding: 0;
    margin-bottom: var(--spacing-lg);
    text-align: left;
}

.package-features li {
    padding: var(--spacing-xs) 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.btn-package {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--bg-element);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
    color: var(--accent-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-package:hover {
    background: var(--accent-primary);
    color: white;
}

.btn-package.btn-featured {
    background: var(--accent-gradient);
    border: none;
    color: white;
}

.btn-package.btn-featured:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.packages-footer {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.packages-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.packages-footer a:hover {
    text-decoration: underline;
}

/* Activation Code Modal */
.activation-modal .modal-content {
    max-width: 400px;
    padding: var(--spacing-xl);
}

.activation-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.activation-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: var(--spacing-sm);
}

.activation-header h3 {
    margin-bottom: var(--spacing-xs);
}

.activation-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.activation-body {
    margin-bottom: var(--spacing-lg);
}

.activation-body input {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--bg-element);
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    text-align: center;
    font-family: monospace;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.activation-body input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.activation-actions {
    display: flex;
    gap: var(--spacing-md);
}

.activation-actions button {
    flex: 1;
}

/* Modal responsive */
@media (max-width: 768px) {
    .packages-grid {
        grid-template-columns: 1fr;
    }

    .package-card.featured {
        order: -1;
    }
}

/* ============================================
   Family Panel Styles
   ============================================ */

.family-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.family-section {
    animation: fadeIn 0.3s ease;
}

.family-empty-state {
    text-align: center;
    padding: 2rem;
    background: var(--bg-element);
    border-radius: var(--radius-lg);
}

.family-empty-state .empty-icon {
    font-size: 4rem;
    margin-bottom: var(--spacing-md);
}

.family-empty-state h4 {
    margin-bottom: var(--spacing-sm);
}

.family-empty-state p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.family-info-card {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1) 0%, rgba(39, 174, 96, 0.1) 100%);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
}

.family-badge {
    display: inline-block;
    background: var(--accent-gradient);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.family-badge.owner {
    background: linear-gradient(135deg, #f39c12 0%, #e74c3c 100%);
}

.family-owner-header {
    background: var(--bg-element);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.subscription-end {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.family-members-section,
.invite-codes-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.family-members-section h4,
.invite-codes-section h4 {
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.info-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-md);
}

/* ============================================
   Activation Modal Centering Fix
   ============================================ */
.activation-modal {
    display: none;
    /* Varsayılan gizli - JS açana kadar görünmesin */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
}

/* JS ile display:block veya display:flex yapıldığında flex merkezlemesi korunsun diye */
.activation-modal[style*="display: block"],
.activation-modal[style*="display:block"],
.activation-modal[style*="display: flex"],
.activation-modal[style*="display:flex"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* ============================================
   SEO Landing Links
   ============================================ */
.seo-links {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    border: 1px solid #dce6ef;
    background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
    box-shadow: var(--shadow-sm);
}

.seo-links-accordion {
    width: 100%;
}

.seo-links-accordion summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-weight: 700;
    color: var(--text-primary);
}

.seo-links-accordion summary::-webkit-details-marker {
    display: none;
}

.seo-links-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid #d8e1ea;
    background: #fff;
    font-size: 0.82rem;
    font-weight: 700;
}

.seo-links p {
    margin: var(--spacing-sm) 0 var(--spacing-md);
    color: var(--text-secondary);
}

.seo-links-toolbar {
    display: grid;
    grid-template-columns: auto repeat(2, minmax(180px, 1fr));
    gap: var(--spacing-sm);
    align-items: end;
    margin-bottom: var(--spacing-md);
}

.seo-link-pill {
    text-decoration: none;
    color: var(--text-primary);
    background: #fff;
    border: 1px solid #d8e1ea;
    border-radius: 999px;
    padding: 10px 14px;
    font-weight: 600;
    white-space: nowrap;
}

.seo-filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.seo-filter-field select,
.seo-filter-field input {
    width: 100%;
    border-radius: var(--radius-md);
    border: 1px solid #d8e1ea;
    background: #fff;
    color: var(--text-primary);
    padding: 10px 12px;
    font-size: 0.9rem;
}

.seo-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--spacing-sm);
}

.seo-link-card {
    display: block;
    text-decoration: none;
    color: var(--text-primary);
    background: #fff;
    border: 1px solid #d8e1ea;
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-weight: 600;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.seo-link-card:hover {
    transform: translateY(-1px);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-sm);
}

.seo-links-empty {
    margin-top: var(--spacing-sm);
    margin-bottom: 0;
    font-size: 0.9rem;
}

@media (max-width: 860px) {
    .seo-links-toolbar {
        grid-template-columns: 1fr;
    }

    .seo-link-pill {
        text-align: center;
    }
}

.activation-content {
    margin: 0 !important;
    /* Otomatik marginleri ez */
    position: relative;
    max-width: 400px;
    width: 90%;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--accent-primary);
    box-shadow: 0 0 30px rgba(52, 152, 219, 0.4);
}

/* Age Badges - Updated */
.age-badge {
    padding: 3px 7px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.age-6 {
    background: linear-gradient(135deg, #facc15, #eab308);
    color: #422006;
}

.age-7 {
    background: linear-gradient(135deg, #10b981, #059669);
}

.age-8 {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
}

.age-10 {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.age-12 {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
}

/* ============================================
   LEADERBOARD OVERLAY
   ============================================ */
.lb-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lb-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lb-container {
    background: #fff;
    border-radius: 20px;
    width: min(580px, 94vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: lbSlideUp 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    overflow: hidden;
}

@keyframes lbSlideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.lb-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 22px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.lb-header h2 {
    margin: 0;
    font-size: 1.3rem;
    color: #1e293b;
}

.lb-close {
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1rem;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.lb-close:hover {
    background: #e2e8f0;
    color: #334155;
}

.lb-tabs-row {
    display: flex;
    gap: 0;
    padding: 12px 22px 0;
}

.lb-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.lb-tab:first-child {
    border-radius: 10px 0 0 10px;
}

.lb-tab:last-child {
    border-radius: 0 10px 10px 0;
}

.lb-tab.active {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
}

.lb-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    flex-wrap: wrap;
}

.lb-game-select select {
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    font-size: 0.85rem;
    color: #334155;
    cursor: pointer;
    min-width: 180px;
}

.lb-period-tabs {
    display: flex;
    gap: 0;
    margin-left: auto;
}

.lb-period {
    padding: 7px 14px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.lb-period:first-child {
    border-radius: 8px 0 0 8px;
}

.lb-period:last-child {
    border-radius: 0 8px 8px 0;
}

.lb-period.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.lb-table-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 0 22px 12px;
    min-height: 200px;
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
}

.lb-table thead th {
    padding: 10px 8px;
    text-align: left;
    font-size: 0.75rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #f1f5f9;
    position: sticky;
    top: 0;
    background: #fff;
}

.lb-table tbody tr {
    border-bottom: 1px solid #f8fafc;
    transition: background 0.15s;
}

.lb-table tbody tr:hover {
    background: #f0f7ff;
}

.lb-table td {
    padding: 10px 8px;
    font-size: 0.88rem;
}

.lb-rank {
    font-weight: 700;
    color: #64748b;
    width: 40px;
    text-align: center;
}

.lb-name {
    color: #1e293b;
    font-weight: 500;
}

.lb-name small {
    color: #3b82f6;
    font-weight: 700;
}

.lb-score {
    font-weight: 700;
    color: #3b82f6;
    text-align: right;
}

.lb-row-me {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(99, 102, 241, 0.08)) !important;
    border-left: 3px solid #3b82f6;
}

.lb-my-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px;
    background: linear-gradient(135deg, #eff6ff, #eef2ff);
    font-weight: 700;
    color: #3b82f6;
    font-size: 0.95rem;
    border-top: 1px solid #e0e7ff;
}

.lb-loading,
.lb-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    color: #94a3b8;
    font-size: 0.9rem;
}

.lb-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: lbSpin 0.6s linear infinite;
    display: inline-block;
}

@keyframes lbSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Leaderboard Button on Dashboard */
.lb-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    animation: lbPulse 2s ease-in-out infinite;
}

.lb-fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(245, 158, 11, 0.5);
}

@keyframes lbPulse {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(245, 158, 11, 0.4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(245, 158, 11, 0.6);
    }
}

@media (max-width: 600px) {
    .lb-container {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .lb-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .lb-period-tabs {
        margin-left: 0;
        justify-content: center;
    }

    .lb-game-select select {
        width: 100%;
    }
}