/* Code Clicker - Style de base qui fonctionne */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary, #1a1a2e) 0%, var(--bg-secondary, #16213e) 50%, var(--bg-tertiary, #0f3460) 100%);
    color: var(--text-primary, #ffffff);
    min-height: 100vh;
    line-height: 1.6;
}

/* Header avec stats */
.header {
    background: rgba(0, 0, 0, 0.8);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 1rem;
    border-bottom: 2px solid var(--accent-blue, #58a6ff);
    overflow-x: auto;
}

.stats {
    display: flex;
    gap: 1.5rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
}

.progression {
    display: flex;
    gap: 1.5rem;
    flex-wrap: nowrap;
    flex-shrink: 0;
}



.stat-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
    flex-shrink: 0;
    white-space: nowrap;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary, #8b949e);
    font-weight: 500;
    white-space: nowrap;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-blue, #58a6ff);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Zone de clic principale */
.main-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
    gap: 3rem;
    width: 100%;
}

.click-zone {
    background: linear-gradient(135deg, var(--accent-blue, #58a6ff) 0%, var(--accent-purple, #1f6feb) 100%);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px var(--shadow, rgba(88, 166, 255, 0.3));
    user-select: none;
    min-width: 300px;
    max-width: 500px;
    width: 100%;
}

.click-zone:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 16px 48px rgba(88, 166, 255, 0.4);
}

.click-zone:active {
    transform: translateY(-2px) scale(1.02);
}

.click-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.click-zone h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: white;
}

.click-zone p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.click-power {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Éditeur de code */
.code-editor {
    background: #1e1e1e;
    border: 2px solid #333;
    border-radius: 8px;
    margin: 2rem auto;
    max-width: 900px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    font-family: 'Courier New', monospace;
    position: relative;
}

.editor-header {
    background: #2d2d2d;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
}

.editor-tabs {
    display: flex;
    gap: 0.5rem;
}

.tab {
    background: #3c3c3c;
    color: #ccc;
    padding: 0.5rem 1rem;
    border-radius: 4px 4px 0 0;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.tab.active {
    background: #1e1e1e;
    color: #fff;
    border-color: #444;
    border-bottom-color: #1e1e1e;
}

.tab:hover {
    background: #4a4a4a;
}

.editor-controls {
    display: flex;
    gap: 0.5rem;
}

.control-btn {
    background: #3c3c3c;
    color: #ccc;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
}

.control-btn:hover {
    background: #4a4a4a;
}

.editor-sidebar {
    position: absolute;
    left: 0;
    top: 40px;
    bottom: 30px;
    width: 50px;
    background: #252526;
    border-right: 1px solid #444;
    overflow: hidden;
}

.line-numbers {
    padding: 1rem 0.5rem;
    color: #858585;
    font-size: 0.8rem;
    line-height: 1.4;
    text-align: right;
}

.line-num {
    height: 1.4em;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.code-display {
    background: #1e1e1e;
    padding: 1rem 1rem 1rem 3rem;
    max-height: 200px;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.4;
    color: #d4d4d4;
    position: relative;
}

.code-line {
    margin: 0;
    padding: 0;
    opacity: 0;
    animation: slideDown 0.5s ease-out forwards;
    white-space: pre;
    font-family: 'Courier New', monospace;
}

.editor-footer {
    background: #2d2d2d;
    padding: 0.5rem 1rem;
    border-top: 1px solid #444;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 30px;
    font-size: 0.8rem;
}

.editor-info {
    display: flex;
    gap: 1rem;
    color: #ccc;
}

.file-info {
    color: #569cd6;
    font-weight: 500;
}

.cursor-info {
    color: #858585;
}

.editor-stats {
    color: #888;
    font-size: 0.8rem;
}

.code-line:nth-child(1) { animation-delay: 0.1s; }
.code-line:nth-child(2) { animation-delay: 0.2s; }
.code-line:nth-child(3) { animation-delay: 0.3s; }
.code-line:nth-child(4) { animation-delay: 0.4s; }
.code-line:nth-child(5) { animation-delay: 0.5s; }
.code-line:nth-child(6) { animation-delay: 0.6s; }
.code-line:nth-child(7) { animation-delay: 0.7s; }
.code-line:nth-child(8) { animation-delay: 0.8s; }

@keyframes slideDown {
    0% { 
        opacity: 0; 
        transform: translateY(-10px);
    }
    100% { 
        opacity: 1; 
        transform: translateY(0);
    }
}

/* Section des améliorations */
.upgrades-section {
    padding: 2rem;
    background: rgba(0, 0, 0, 0.3);
}

.upgrades-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #58a6ff;
}

.upgrades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.upgrade-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upgrade-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.upgrade-card.affordable {
    border-color: #58a6ff;
    background: rgba(88, 166, 255, 0.1);
}

.upgrade-card.affordable:hover {
    background: rgba(88, 166, 255, 0.2);
}

.upgrade-card.maxed {
    opacity: 0.6;
    background: linear-gradient(135deg, #666, #555);
    border-color: #666;
}

.upgrade-card.maxed .upgrade-button {
    background: linear-gradient(135deg, #666, #555);
    color: #ccc;
    cursor: not-allowed;
}

.click-animation {
    font-size: 1.5rem;
    font-weight: bold;
    color: #58a6ff;
    text-shadow: 0 0 10px rgba(88, 166, 255, 0.8);
    opacity: 0;
}

.upgrade-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.upgrade-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #58a6ff, #1f6feb);
    border-radius: 10px;
    color: white;
}

.upgrade-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.upgrade-cost {
    font-size: 1rem;
    color: #58a6ff;
    font-weight: 600;
}

.upgrade-description {
    color: #8b949e;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.4;
}

.upgrade-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    color: #8b949e;
}

.upgrade-button {
    width: 100%;
    background: linear-gradient(135deg, #238636, #2ea043);
    border: none;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upgrade-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #2ea043, #238636);
    transform: translateY(-1px);
}

.upgrade-button:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Section des boosts */
.boosts-section {
    padding: 2rem;
    background: rgba(0, 0, 0, 0.2);
}

.boosts-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    color: #f6ad55;
}

.boosts-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

.boost-item {
    background: linear-gradient(135deg, #f6ad55, #feca57);
    color: #1a1a2e;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(246, 173, 85, 0.3);
    animation: boostPulse 2s infinite;
}

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

/* Animations pour les upgrades */
@keyframes upgradePurchase {
    0% { 
        transform: scale(1) rotate(0deg); 
        filter: brightness(1);
    }
    25% { 
        transform: scale(1.3) rotate(90deg); 
        filter: brightness(1.5);
    }
    50% { 
        transform: scale(1.1) rotate(180deg); 
        filter: brightness(2);
    }
    75% { 
        transform: scale(1.2) rotate(270deg); 
        filter: brightness(1.5);
    }
    100% { 
        transform: scale(1) rotate(360deg); 
        filter: brightness(1);
    }
}

@keyframes upgradeCardPulse {
    0% { 
        transform: scale(1); 
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 8px 25px rgba(88, 166, 255, 0.3);
    }
    100% { 
        transform: scale(1); 
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
}

/* Messages de boost */
.boost-message {
    position: fixed;
    top: 80px;
    right: 20px;
    background: linear-gradient(135deg, #f6ad55, #feca57);
    color: #1a1a2e;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(246, 173, 85, 0.4);
    animation: boostAnimation 3s ease-out forwards;
    z-index: 1000;
}

/* Section d'authentification */
.auth-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 2rem;
}

.auth-buttons {
    display: flex;
    gap: 0.5rem;
}

.auth-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    min-width: 120px;
    text-align: center;
    white-space: nowrap;
}

.login-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.register-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.register-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.4);
}

.profile-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    font-size: 12px;
    padding: 6px 12px;
}

.profile-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.admin-btn {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    font-size: 12px;
    padding: 6px 12px;
}

.admin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

.logout-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    font-size: 12px;
    padding: 6px 12px;
}

.logout-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.profile-btn {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
    font-size: 12px;
    padding: 6px 12px;
}

.profile-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.4);
}

.leaderboard-btn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    font-size: 12px;
    padding: 6px 12px;
}

.leaderboard-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(240, 147, 251, 0.4);
}

.admin-btn {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%);
    color: white;
    font-weight: 600;
    font-size: 12px;
    padding: 6px 12px;
}

.admin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 216, 155, 0.4);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.welcome-text {
    color: #58a6ff;
    font-weight: 500;
    font-size: 14px;
}

/* Modales */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease-out;
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.close {
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.close:hover {
    opacity: 0.7;
}

.auth-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #e4e4e7;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #3c3c4a;
    border-radius: 8px;
    background: #2a2a3a;
    color: #e4e4e7;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group input::placeholder {
    color: #8b8b9a;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.modal-footer {
    padding: 20px 30px;
    background: #2a2a3a;
    text-align: center;
    border-top: 1px solid #3c3c4a;
}

.modal-footer p {
    margin: 0;
    color: #8b8b9a;
    font-size: 14px;
}

.modal-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.modal-footer a:hover {
    color: #8b9cff;
}

/* Animations des modales */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Responsive pour les modales */
@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .auth-section {
        margin-left: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .auth-buttons {
        flex-direction: column;
        width: 100%;
    }
    
    .auth-btn {
        width: 100%;
        text-align: center;
    }
}

@keyframes boostAnimation {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }
    20% {
        opacity: 1;
        transform: translateX(0);
    }
    80% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Texte flottant */
.floating-text {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    font-weight: bold;
    font-size: 18px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    animation: floatUp 2s ease-out forwards;
}

@keyframes floatUp {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translateY(-100px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
        gap: 2rem;
    }
    
    .click-zone {
        min-width: 250px;
        padding: 2rem;
    }
    
    .code-editor {
        min-width: 300px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .stats, .progression {
        gap: 1rem;
    }
    
    .stats-container {
        padding: 1rem;
        gap: 0.5rem;
    }
    
    .stat-item {
        min-width: 80px;
    }
    
    .stat-value {
        font-size: 1rem;
        min-width: 80px;
        max-width: 120px;
    }
}

@media (max-width: 480px) {
    .stats-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stats, .progression {
        width: 100%;
    }
    
    .stat-item {
        min-width: 70px;
    }
    
    .stat-value {
        font-size: 0.9rem;
        min-width: 70px;
        max-width: 100px;
    }
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(88, 166, 255, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(88, 166, 255, 0.7);
}

/* ===== SYSTÈME DE THÈMES ===== */

/* Variables CSS pour les couleurs */
:root {
    --bg-primary: #1a1a2e;
    --bg-secondary: #16213e;
    --bg-tertiary: #0f3460;
    --text-primary: #e4e4e7;
    --text-secondary: #8b8b9a;
    --accent-blue: #58a6ff;
    --accent-green: #4CAF50;
    --accent-purple: #9C27B0;
    --accent-orange: #ff9800;
    --accent-red: #f44336;
    --border-color: #3c3c4a;
    --shadow: rgba(0, 0, 0, 0.3);
}

/* Thème Dark Hacker */
.theme-dark-hacker {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --accent-blue: #58a6ff;
    --accent-green: #3fb950;
    --accent-purple: #a5a5ff;
    --accent-orange: #ffa657;
    --accent-red: #f85149;
    --border-color: #30363d;
    --shadow: rgba(0, 0, 0, 0.5);
}

/* Thème Light Mode */
.theme-light-mode {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-tertiary: #e1e4e8;
    --text-primary: #24292e;
    --text-secondary: #586069;
    --accent-blue: #0366d6;
    --accent-green: #28a745;
    --accent-purple: #6f42c1;
    --accent-orange: #e36209;
    --accent-red: #d73a49;
    --border-color: #d1d5da;
    --shadow: rgba(0, 0, 0, 0.1);
}

/* Thème Matrix */
.theme-matrix {
    --bg-primary: #000000;
    --bg-secondary: #001100;
    --bg-tertiary: #002200;
    --text-primary: #00ff00;
    --text-secondary: #00aa00;
    --accent-blue: #00ffff;
    --accent-green: #00ff00;
    --accent-purple: #ff00ff;
    --accent-orange: #ffaa00;
    --accent-red: #ff0000;
    --border-color: #003300;
    --shadow: rgba(0, 255, 0, 0.3);
}

/* Thème Cyberpunk */
.theme-cyberpunk {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a0a2e;
    --bg-tertiary: #16213e;
    --text-primary: #ff0080;
    --text-secondary: #ff4081;
    --accent-blue: #00ffff;
    --accent-green: #00ff41;
    --accent-purple: #ff00ff;
    --accent-orange: #ff6b00;
    --accent-red: #ff0040;
    --border-color: #ff0080;
    --shadow: rgba(255, 0, 128, 0.5);
}

/* Thème Noël */
.theme-noel {
    --bg-primary: #1a1a2e;
    --bg-secondary: #2d1b69;
    --bg-tertiary: #11998e;
    --text-primary: #ffffff;
    --text-secondary: #ffd700;
    --accent-blue: #4fc3f7;
    --accent-green: #4caf50;
    --accent-purple: #9c27b0;
    --accent-orange: #ff9800;
    --accent-red: #f44336;
    --border-color: #ffd700;
    --shadow: rgba(255, 215, 0, 0.3);
}

/* Thème Halloween */
.theme-halloween {
    --bg-primary: #1a0a0a;
    --bg-secondary: #2d1a1a;
    --bg-tertiary: #4a1a1a;
    --text-primary: #ff6600;
    --text-secondary: #ffaa00;
    --accent-blue: #8a2be2;
    --accent-green: #32cd32;
    --accent-purple: #8a2be2;
    --accent-orange: #ff6600;
    --accent-red: #dc143c;
    --border-color: #ff6600;
    --shadow: rgba(255, 102, 0, 0.5);
}

/* ===== PANEL DE THÈMES MODERNE ===== */

/* Bouton de toggle du panel de thèmes */
.theme-panel {
    position: fixed;
    top: 100px;
    left: 20px;
    z-index: 1000;
}

.theme-toggle-btn {
    background: linear-gradient(135deg, var(--accent-blue, #58a6ff) 0%, var(--accent-purple, #9C27B0) 100%);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px var(--shadow, rgba(0, 0, 0, 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle-btn:hover {
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 8px 24px var(--shadow, rgba(0, 0, 0, 0.4));
}

/* Panel de thèmes */
.theme-panel-content {
    position: absolute;
    top: 60px;
    left: 0;
    background: var(--bg-secondary, rgba(22, 33, 62, 0.95));
    border: 1px solid var(--border-color, #3c3c4a);
    border-radius: 16px;
    box-shadow: 0 20px 60px var(--shadow, rgba(0, 0, 0, 0.5));
    backdrop-filter: blur(20px);
    min-width: 400px;
    max-width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    animation: themePanelSlideIn 0.3s ease-out;
}

@keyframes themePanelSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes slideInRight {
    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;
    }
}

/* Header du panel */
.theme-panel-header {
    background: linear-gradient(135deg, var(--accent-blue, #58a6ff) 0%, var(--accent-purple, #9C27B0) 100%);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.theme-panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.theme-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Grille des thèmes */
.theme-grid {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    max-height: 400px;
    overflow-y: auto;
}

/* Carte de thème */
.theme-card {
    background: var(--bg-primary, #1a1a2e);
    border: 2px solid var(--border-color, #3c3c4a);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px var(--shadow, rgba(0, 0, 0, 0.4));
    border-color: var(--accent-blue, #58a6ff);
}

.theme-card.active {
    border-color: var(--accent-green, #4CAF50);
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.3);
}

.theme-card.locked {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

.theme-card.locked:hover {
    transform: none;
    box-shadow: none;
}

/* Aperçu du thème */
.theme-preview {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.theme-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--theme-bg-1) 0%, var(--theme-bg-2) 50%, var(--theme-bg-3) 100%);
}

/* Informations du thème */
.theme-info-card {
    text-align: center;
}

.theme-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #e4e4e7);
    margin-bottom: 4px;
}

.theme-status {
    font-size: 12px;
    color: var(--text-secondary, #8b8b9a);
}

.theme-status.unlocked {
    color: var(--accent-green, #4CAF50);
}

.theme-status.locked {
    color: var(--accent-red, #f44336);
}

.theme-status.admin {
    color: var(--accent-orange, #ff9800);
}

/* Icônes de statut */
.theme-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 16px;
}

.theme-icon.locked::before {
    content: '🔒';
}

.theme-icon.admin::before {
    content: '👑';
}

.theme-icon.active::before {
    content: '✅';
}

/* Section d'information */
.theme-info-section {
    background: var(--bg-primary, #1a1a2e);
    padding: 16px 20px;
    border-top: 1px solid var(--border-color, #3c3c4a);
}

.theme-info-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #e4e4e7);
    margin-bottom: 8px;
}

.theme-info-content {
    font-size: 12px;
    color: var(--text-secondary, #8b8b9a);
    line-height: 1.4;
}

.theme-requirement {
    margin-bottom: 4px;
}

.theme-requirement.admin-only {
    color: var(--accent-orange, #ff9800);
}

/* Overlay pour fermer le panel */
.theme-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    animation: fadeIn 0.3s ease-out;
}

/* ===== PANNEAU DE STATISTIQUES ===== */

/* Bouton de toggle des statistiques */
.stats-toggle-btn {
    background: linear-gradient(135deg, var(--accent-blue, #58a6ff) 0%, var(--accent-purple, #9C27B0) 100%);
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 16px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow, rgba(0, 0, 0, 0.2));
}

.stats-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow, rgba(0, 0, 0, 0.3));
}

/* Panneau de statistiques */
.stats-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary, rgba(22, 33, 62, 0.95));
    border: 1px solid var(--border-color, #3c3c4a);
    border-radius: 16px;
    box-shadow: 0 20px 60px var(--shadow, rgba(0, 0, 0, 0.5));
    backdrop-filter: blur(20px);
    z-index: 2000;
    min-width: 500px;
    max-width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    animation: statsPanelSlideIn 0.3s ease-out;
}

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

.stats-panel-header {
    background: linear-gradient(135deg, var(--accent-blue, #58a6ff) 0%, var(--accent-purple, #9C27B0) 100%);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.stats-panel-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-stats-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-stats-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.stats-panel-content {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    background: var(--bg-primary, #1a1a2e);
    border: 1px solid var(--border-color, #3c3c4a);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--shadow, rgba(0, 0, 0, 0.3));
    border-color: var(--accent-blue, #58a6ff);
}

.stat-icon {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--accent-blue, #58a6ff) 0%, var(--accent-purple, #9C27B0) 100%);
    border-radius: 8px;
    flex-shrink: 0;
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-title {
    font-size: 12px;
    color: var(--text-secondary, #8b8b9a);
    font-weight: 500;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #e4e4e7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Overlay pour fermer le panneau */
.stats-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .stats-panel {
        min-width: 90vw;
        margin: 20px;
        max-height: 90vh;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stat-card {
        padding: 12px;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    
    .theme-panel {
        top: 80px;
        left: 10px;
    }
    
    .theme-panel-content {
        min-width: 90vw;
        max-width: 95vw;
    }
    
    .theme-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
        padding: 16px;
    }
    
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .stats, .progression {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .stat-item {
        min-width: 100px;
        flex: 1;
    }
    
    .main-content {
        padding: 1rem;
        gap: 2rem;
    }
    
    .click-zone {
        min-width: 250px;
        padding: 2rem;
    }
    
    .code-editor {
        min-width: 250px;
    }
}

@media (max-width: 480px) {
    .stats-panel {
        min-width: 95vw;
        margin: 10px;
    }
    
    .theme-panel {
        top: 70px;
        left: 5px;
    }
    
    .theme-panel-content {
        min-width: 95vw;
        max-width: 98vw;
    }
    
    .theme-grid {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 12px;
    }
    
    .theme-card {
        padding: 12px;
    }
    
    .theme-preview {
        height: 40px;
    }
    
    .header {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .stats, .progression {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .stat-item {
        min-width: 80px;
        justify-content: center;
    }
    
    .stat-value {
        font-size: 0.9rem;
        min-width: 70px;
        max-width: 100px;
    }
    
    .click-zone {
        min-width: 200px;
        padding: 1.5rem;
    }
    
    .click-zone h1 {
        font-size: 2rem;
    }
    
    .code-editor {
        min-width: 200px;
        font-size: 12px;
    }
    
    .upgrades-container {
        grid-template-columns: 1fr;
    }
    
    .upgrade-card {
        padding: 1rem;
    }
}

/* Animations spéciales pour les thèmes */
.theme-matrix .code-line {
    animation: matrixRain 0.5s ease-out;
}

@keyframes matrixRain {
    0% { opacity: 0; transform: translateY(-20px); }
    100% { opacity: 1; transform: translateY(0); }
}

.theme-cyberpunk .click-zone {
    animation: cyberpunkGlow 2s ease-in-out infinite alternate;
}

@keyframes cyberpunkGlow {
    0% { box-shadow: 0 0 20px var(--accent-purple); }
    100% { box-shadow: 0 0 40px var(--accent-blue); }
}

.theme-noel .header {
    background: linear-gradient(135deg, #2d1b69 0%, #11998e 100%);
}

.theme-halloween .click-zone {
    background: linear-gradient(135deg, #1a0a0a 0%, #2d1a1a 100%);
}

/* ===== APPLICATION DES THÈMES ===== */

/* Application des thèmes aux éléments principaux */
.theme-dark-hacker,
.theme-light-mode,
.theme-matrix,
.theme-cyberpunk,
.theme-noel,
.theme-halloween {
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-tertiary) 100%) !important;
    color: var(--text-primary) !important;
}

.theme-dark-hacker .header,
.theme-light-mode .header,
.theme-matrix .header,
.theme-cyberpunk .header,
.theme-noel .header,
.theme-halloween .header {
    background: rgba(0, 0, 0, 0.8) !important;
    border-bottom: 2px solid var(--accent-blue) !important;
}

.theme-dark-hacker .stat-label,
.theme-light-mode .stat-label,
.theme-matrix .stat-label,
.theme-cyberpunk .stat-label,
.theme-noel .stat-label,
.theme-halloween .stat-label {
    color: var(--text-secondary) !important;
}

.theme-dark-hacker .stat-value,
.theme-light-mode .stat-value,
.theme-matrix .stat-value,
.theme-cyberpunk .stat-value,
.theme-noel .stat-value,
.theme-halloween .stat-value {
    color: var(--accent-blue) !important;
}

.theme-dark-hacker .click-zone,
.theme-light-mode .click-zone,
.theme-matrix .click-zone,
.theme-cyberpunk .click-zone,
.theme-noel .click-zone,
.theme-halloween .click-zone {
    background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-purple) 100%) !important;
    box-shadow: 0 8px 32px var(--shadow) !important;
}

.theme-dark-hacker .upgrade-card,
.theme-light-mode .upgrade-card,
.theme-matrix .upgrade-card,
.theme-cyberpunk .upgrade-card,
.theme-noel .upgrade-card,
.theme-halloween .upgrade-card {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
}

.theme-dark-hacker .upgrade-card h3,
.theme-light-mode .upgrade-card h3,
.theme-matrix .upgrade-card h3,
.theme-cyberpunk .upgrade-card h3,
.theme-noel .upgrade-card h3,
.theme-halloween .upgrade-card h3 {
    color: var(--text-primary) !important;
}

.theme-dark-hacker .upgrade-card .cost,
.theme-light-mode .upgrade-card .cost,
.theme-matrix .upgrade-card .cost,
.theme-cyberpunk .upgrade-card .cost,
.theme-noel .upgrade-card .cost,
.theme-halloween .upgrade-card .cost {
    color: var(--accent-orange) !important;
}

.theme-dark-hacker .theme-selector,
.theme-light-mode .theme-selector,
.theme-matrix .theme-selector,
.theme-cyberpunk .theme-selector,
.theme-noel .theme-selector,
.theme-halloween .theme-selector {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
}

.theme-dark-hacker .theme-selector label,
.theme-light-mode .theme-selector label,
.theme-matrix .theme-selector label,
.theme-cyberpunk .theme-selector label,
.theme-noel .theme-selector label,
.theme-halloween .theme-selector label {
    color: var(--text-primary) !important;
}

.theme-dark-hacker .theme-selector select,
.theme-light-mode .theme-selector select,
.theme-matrix .theme-selector select,
.theme-cyberpunk .theme-selector select,
.theme-noel .theme-selector select,
.theme-halloween .theme-selector select {
    background: var(--bg-primary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
}