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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    overflow-x: hidden;
}

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

/* Écrans */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.screen.active {
    display: flex;
    transform: translateX(0);
}

/* Écran d'accueil */
#home-screen {
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.animated-bg {
    position: absolute;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 226, 0.3) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(-25%, -25%) rotate(0deg); }
    50% { transform: translate(-25%, -25%) rotate(180deg); }
}

.home-content {
    text-align: center;
    z-index: 2;
    color: white;
}

.game-logo {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 4px 20px rgba(255,255,255,0.3); }
    to { text-shadow: 0 4px 30px rgba(255,255,255,0.6); }
}

.game-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 3rem;
    font-weight: 300;
}

/* Boutons */
.primary-button {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(255, 107, 107, 0.6);
}

.primary-button:active {
    transform: translateY(0);
}

/* Header des écrans */
.screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

.back-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 10px;
    transition: background 0.2s ease;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.add-button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.add-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* Choix de personnage */
.character-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
    overflow-y: auto;
}

.character-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.character-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
}

.character-avatar {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.character-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.character-card p {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Dashboard */
#dashboard {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem;
    padding-bottom: 80px;
}

.hud-container {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    color: white;
}

.player-info {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.avatar-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-right: 1rem;
}

.player-stats h3 {
    font-size: 1.2rem;
    margin-bottom: 0.2rem;
}

.level-info {
    opacity: 0.8;
    font-size: 0.9rem;
}

.progress-bars {
    margin-bottom: 1rem;
}

.stat-bar {
    display: flex;
    align-items: center;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
}

.stat-bar label {
    width: 80px;
    font-weight: 500;
}

.progress-bg {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin: 0 0.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.xp-bar {
    background: linear-gradient(90deg, #4facfe, #00f2fe);
}

.energy-bar {
    background: linear-gradient(90deg, #43e97b, #38f9d7);
}

.currency-display {
    text-align: center;
    font-size: 1.1rem;
    font-weight: 600;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.action-button {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: none;
    color: white;
    padding: 1rem;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.active-quests {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 1.5rem;
    color: white;
}

.active-quests h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Navigation bottom */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-around;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.5rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.nav-button.active {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

/* Carte du monde */
.map-container {
    padding: 1rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    overflow-y: auto;
}

.map-zone {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.map-zone.unlocked:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.25);
}

.map-zone.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.zone-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.map-zone h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.map-zone p {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* Quêtes */
.quest-categories {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
}

.category-tab {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.category-tab.active {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.quests-container {
    padding: 0 1rem 1rem;
    overflow-y: auto;
    flex: 1;
}

.quest-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 1rem;
    margin-bottom: 1rem;
    color: white;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    transition: all 0.3s ease;
}

.quest-item:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.2);
}

.quest-info {
    flex: 1;
}

.quest-info h4 {
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.quest-info p {
    font-size: 0.8rem;
    opacity: 0.8;
}

.quest-xp {
    background: rgba(255, 215, 0, 0.3);
    color: #ffd700;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.complete-button {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    border: none;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.complete-button:hover {
    transform: scale(1.05);
}

/* Inventaire */
.inventory-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1rem;
    overflow-y: auto;
}

.inventory-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 15px;
    padding: 1rem;
    text-align: center;
    color: white;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.inventory-item:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.25);
}

.item-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.item-name {
    font-size: 0.8rem;
    font-weight: 500;
}

.item-quantity {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(255, 215, 0, 0.8);
    color: #333;
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 10px;
    font-weight: bold;
}

.item-use-hint {
    font-size: 0.7rem;
    opacity: 0.7;
    margin-top: 0.3rem;
}

/* Profil */
.profile-content {
    padding: 1rem;
    color: white;
    overflow-y: auto;
}

.profile-header {
    text-align: center;
    margin-bottom: 2rem;
}

.large-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin: 0 auto 1rem;
}

.stats-section, .achievements-section {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.stats-section h4, .achievements-section h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    font-size: 0.9rem;
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.achievement-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    font-size: 0.8rem;
}

.achievement-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Guilde */
.guild-content {
    padding: 1rem;
    color: white;
    text-align: center;
}

.guild-info {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 1rem;
}

.guild-info h3 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.guild-info p {
    margin-bottom: 2rem;
    opacity: 0.9;
    line-height: 1.5;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
}

.modal form input,
.modal form textarea,
.modal form select {
    width: 100%;
    padding: 0.8rem;
    margin-bottom: 1rem;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.8);
}

.modal form textarea {
    resize: vertical;
    min-height: 80px;
}

/* Notification de niveau */
.level-up-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.level-up-popup.active {
    display: flex;
}

.level-up-content {
    background: linear-gradient(135deg, #ffd700, #ff6b6b);
    color: white;
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    animation: levelUpBounce 0.6s ease-out;
}

@keyframes levelUpBounce {
    0% { 
        transform: scale(0.3); 
        opacity: 0; 
    }
    50% { 
        transform: scale(1.1); 
    }
    100% { 
        transform: scale(1); 
        opacity: 1; 
    }
}

.level-up-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.level-up-content button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 20px;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 1rem;
}

/* Nouvelles animations */
@keyframes starFloat {
    0% { 
        transform: translate(-50%, -50%) scale(0); 
        opacity: 1; 
    }
    100% { 
        transform: translate(calc(-50% + var(--random-x)), calc(-50% + var(--random-y))) scale(1); 
        opacity: 0; 
    }
}

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

@keyframes explorationPopup {
    0% { 
        transform: translate(-50%, -50%) scale(0) rotate(10deg); 
        opacity: 0; 
    }
    10% { 
        transform: translate(-50%, -50%) scale(1.1) rotate(-5deg); 
        opacity: 1; 
    }
    20% { 
        transform: translate(-50%, -50%) scale(0.95) rotate(2deg); 
        opacity: 1; 
    }
    30% { 
        transform: translate(-50%, -50%) scale(1) rotate(0deg); 
        opacity: 1; 
    }
    90% { 
        transform: translate(-50%, -50%) scale(1) rotate(0deg); 
        opacity: 1; 
    }
    100% { 
        transform: translate(-50%, -50%) scale(1) rotate(0deg); 
        opacity: 1; 
    }
}

/* Améliorations responsive */
@media (min-width: 768px) {
    .character-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .map-container {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .inventory-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 480px) {
    .game-logo {
        font-size: 2.5rem;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
    }
    
    .inventory-item {
        min-height: 100px;
        padding: 0.8rem;
    }
    
    .item-icon {
        font-size: 1.5rem;
    }
    
    .item-name {
        font-size: 0.75rem;
    }
}

/* Quests list styling */
.quest-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 10px;
    color: white;
}
.quest-card .quest-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.quest-card .quest-difficulty { font-size:0.8rem; opacity:0.9; }
.quest-card .quest-meta { font-size:0.8rem; opacity:0.85; margin-top:6px; }
.quest-card .quest-actions { margin-top:8px; }
.quest-card .complete-quest { background: linear-gradient(90deg,#4facfe,#00f2fe); color:#012; border:none; padding:6px 10px; border-radius:8px; cursor:pointer; }
.quest-card .completed { color:#8ee7a1; font-weight:700; }
