/**
 * Nom du Projet : [https://faudatv.github.io/Tracker-Zelda/]
 * Auteur : [FaudaTV]
 * GitHub : https://github.com/FaudaTV
 * Licence : GNU AGPLv3
 * * Note : Les images Nintendo sont la propriété de Nintendo.
 */

/* --- VARIABLES ET DESIGN GLOBAL --- */
:root {
    --gold: #ffd700;
    --dark-bg: #0a0a0a;
    --card-bg: rgba(30, 30, 30, 0.9);
}

body {
    background-color: var(--dark-bg);
    background-image: radial-gradient(circle, #1a1a1a 0%, #000 100%);
    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    min-height: 100vh;
}

h2 {
    font-size: 0.8vw;
}

p {
    font-size: 0.6vw;
}

/* --- TITRES --- */
.main-title {
    text-align: center;
    letter-spacing: 4px;
    color: var(--gold);
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    padding: 4.5vh 0;
    margin: 0;
    font-size: 1.5vw;
    text-transform: uppercase;
}

.section-title {
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 1vw;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    text-align: center;
}

/* --- CONTENEURS D'ACCUEIL ET SELECTION (Cartes de jeux) --- */
.card-container, .quest-container {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    max-width: 80vw;
    margin: 0 auto;
}

.main-content {
    padding: 40px;
    gap: 40px;
}

/* --- STYLE DES CARTES (Image cover + texte) --- */
.quest-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background-color: #000;
    display: flex;
}

.quest-card .cover-img {
    display: block;
    max-height: 28vh;
    width: auto;
    height: auto;
}

.quest-card:hover {
    transform: scale(1.05);
    border-color: var(--gold);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}

.overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 20%, transparent 100%);
    z-index: 1;
}

.content {
    position: absolute;
    bottom: 25px;
    left: 25px;
    right: 15px;
    z-index: 2;
    text-align: left;
}

.quest-number {
    font-size: 1vw;
    font-weight: bold;
    opacity: 0.5;
    display: block;
}

/* --- SPECIFIQUE TRACKER (OOT.HTML) --- */
main.quest-container {
    flex-direction: column; /* Empile Titre / Row / Map verticalement */
    align-items: center;
    gap: 2vw;
}

/* La ligne qui contient les 3 colonnes d'items */
.inventory-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 1.17vw;
    width: 80%;
}

.row-full {
    width: 100%;
}

/* Les 3 blocs : Equipement / Colonne(Son+Acc) / Médaillon */
.split-3-columns > .inventory-section, 
.split-3-columns > .inventory-column {
    max-width: 22vw; /* Garde tes 3 colonnes */
    display: grid;
    justify-items: center;
}

.split-2-columns > .inventory-section, 
.split-2-columns > .inventory-column {
    max-width: 35vw; /* Garde tes 2 colonnes */
    display: grid;
    justify-items: center;
}

.inventory-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* La colonne pour empiler Son et Accessoire */
.inventory-column {
    gap: 1.17vw;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

/* --- DESIGN DES CADRES D'INVENTAIRE --- */
.inventory-card {
    background: var(--card-bg);
    border: 2px solid var(--gold);
    border-radius: 20px;
    padding: 1vw;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
    display: inline-block;
    width: fit-content;
}

.purple-card { border-color: #aa00aa; background: rgba(50, 10, 50, 0.9); }
.red-card { border-color: #aa1100; background: rgba(50, 10, 10, 0.9); }
.green-card { border-color: #00aa00; background: rgba(10, 50, 10, 0.9); }
.blue-card { border-color: #0080ff; background: rgba(10, 30, 50, 0.9); }
.dark-card { border-color: #555555; background: rgba(20, 20, 20, 0.9); }
.orange-card { border-color: #ff8800; background: rgba(50, 30, 10, 0.9); }
.brown-card { border-color: #885522; background: rgba(40, 25, 10, 0.9); }
.pink-card { border-color: #ff55aa; background: rgba(50, 10, 30, 0.9); }
.white-card { border-color: #ffffff; background: rgba(50, 50, 50, 0.9); }
.cyan-card { border-color: #00ffff; background: rgba(10, 50, 50, 0.9); }
.emerald-card { border-color: #00aa88; background: rgba(10, 40, 30, 0.9); }
.grey-card { border-color: #888888; background: rgba(30, 30, 30, 0.9); }

/* --- GRILLE D'OBJETS --- */
.tracker-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.8vw;
}

.item-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2vw;
    position: relative;
}

.item {
    width: 1.56vw; 
    height: 1.56vw;
    object-fit: contain; 
    cursor: pointer;
    filter: grayscale(1) brightness(0.2); 
    transition: all 0.3s ease;
}

.item.active {
    filter: grayscale(0) brightness(1.2) drop-shadow(0 0 10px var(--gold));
    transform: scale(1.1);
}

.item-name {
    font-size: 0.8rem;
    color: #888;
    padding: 0;
    margin: 0;
}

/* --- PROGRESSION MAP (DONJONS) --- */
.dungeon-grid {
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
}

.dungeon-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6vw;
    padding: 10px 20px;
    position: relative;
}

.dungeon-column:not(:first-child)::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10%;
    height: 90%;
    width: 1px;
    background: rgba(255, 215, 0, 0.3);
}

.dungeon-title {
    font-size: 0.9rem;
    color: var(--gold);
    margin-bottom: 5px;
}

.split-column {
    display: flex;
    flex-direction: column;
    gap: 0.6vw;
    align-items: center;
    margin-left: 0.6vw;
    margin-right: 0.6vw;
}

.split-row {
    display: flex;
    flex-direction: row;
    gap: 0.6vw;
}

/* --- NAVIGATION --- */
.back-link {
    position: absolute;
    top: 20px;
    left: 20px;
    color: var(--gold);
    text-decoration: none;
    font-weight: bold;
    z-index: 10;
}

.item.boss-item {
    width: 4vw;  /* Double la taille par rapport aux autres items */
    height: 4vw;
}

.gros-item {
    width: 2.5vw;
    height: 2.5vw;
}

/* Effet au survol/actif pour Ganon */
.item.boss-item.active {
    filter: grayscale(0) brightness(1.2) drop-shadow(0 0 20px #ff0000);
    transform: scale(1.2); /* S'agrandit encore plus quand il est activé */
}

.item.active + .item-name {
    color: var(--gold);
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.item-name.maxed {
    color: #00ffff !important; /* Exemple : Cyan électrique */
    text-shadow: 0 0 12px rgba(0, 255, 255, 1);
    font-weight: bold;
    transform: scale(1.2); /* Légèrement plus gros pour bien le voir */
}

/* --- POPUP MODALE --- */
.modal {
    display: none;
    position: absolute; /* Changement de fixed à absolute */
    z-index: 100;
    /* On enlève le background noir plein écran */
    background-color: transparent; 
}

.modal-content {
    background-color: rgba(20, 20, 20, 0.95); /* Fond sombre mais compact */
    padding: 0.1rem 0.3rem 0.3rem 0.3rem;
    border: 1px solid var(--gold);
    border-radius: 10px;
    width: fit-content;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content .section-title {
    font-size: 0.7vw;
}

/* On réduit la taille des icônes dans la popup pour la discrétion */
.modal-content .item {
    width: 1.2vw;
    height: 1.2vw;
}

.close-btn {
    display: none; /* Plus besoin du bouton annuler, on cliquera ailleurs */
}

.item-star {
    position: relative; /* Indispensable pour le placement des étoiles */
    display: inline-block;
}

.star-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 30px; /* À ajuster selon la taille de tes icônes */
    height: 30px;
    pointer-events: none; /* Pour que le clic passe à travers l'étoile et touche l'arme */
    display: none; /* Caché par défaut (0 étoile) */
}

/* Quand l'étoile est active */
.star-badge.visible {
    display: block;
}

a.hw-warriors {
    min-width: 10vw;
    max-width: 10vw;
    min-height: 28vh;
    max-height: 28vh;
    justify-content: center;
}

span.hw-warriors {
    font-size: 0.8vw;
    font-weight: bold;
    opacity: 0.5;
    display: block;
}

h2.hw-warriors {
    font-size: 0.6vw;
}

p.hw-warriors {
    font-size: 0.5vw;
}

.hw-illustration {
    padding: 0;
    margin: 0;
    gap: 0;
    height: auto;
    width: auto;
}

.hw-ill-im {
    width: 6vw;
}

.hw-illustration > .active {
    transform: none;
    filter: grayscale(0) brightness(1.2);
}

.hw-image {
    max-width: 100%;    /* Empêche de déborder à gauche/droite */
    max-height: 100%;   /* Empêche de déborder en haut/bas */
    width: auto;        /* Calcule la largeur proportionnellement */
    height: auto;       /* Calcule la hauteur proportionnellement */
    display: block;     /* Supprime l'espace sous l'image */
    margin: auto;
}

.invisible-item {
    opacity: 0;
    cursor: default;
}

.map {
    padding: 2px;
    border: solid 2px grey;
}

.star-container {
    color: #ffd700;
    font-size: 12px;
    height: 16px;
    text-shadow: 0 0 2px black;
    user-select: none;
    pointer-events: none;
}

.my-fairy {
    width: auto;
    height: auto;
    padding: 0 0.3vw;
    user-select: none;
}

.my-fairy.active {
    color: var(--gold);
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.item-text {
    position: absolute; /* <--- DOIT ÊTRE absolute pour survoler l'image */
    bottom: 0;          /* Aligné en bas de l'image */
    right: 0;           /* Aligné à droite de l'image */
    
    /* Garde le reste de ton style (font-size, color, etc.) tel quel */
    color: #ffffff;
    font-family: 'Arial', sans-serif;
    font-size: 25px; /* Tu peux baisser à 1vw si c'est trop gros sur petit écran */
    font-weight: bold;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0px 0px 5px rgba(0,0,0,0.8);
    pointer-events: none;
    z-index: 10;
}

.item-text.maxed {
    color: var(--gold); 
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    pointer-events: none;
    z-index: 10;
}

@media screen and (max-width: 1920px) {
    .item {
        width: 1.7vw;
        height: 1.7vw;
    }

    .item.boss-item {
        width: 4.5vw;
        height: 4.5vw;
    }

    .tracker-grid {
        gap: 0.5vw;
    }

    .inventory-row {
        width: 90%;
    }

    .split-3-columns > .inventory-section, 
    .split-3-columns > .inventory-column {
        max-width: 23vw;
    }

    .item-wrapper {
        gap: 0;
    }

    main.quest-container {
        gap: 1vw;
    }

    .main-title {
        font-size: 1.5vw;
        padding: 2vh 0;
    }

    .section-title {
        font-size: 0.7vw;
    }

    .content {
        bottom: 10px;
        left: 15px;
        right: 15px;
    }

    .hw-illustration {
        padding: 0;
        margin: 0;
        gap: 0;
        height: auto;
        width: auto;
    }

    .hw-ill-im {
        width: 6vw;
    }

    .gros-item {
        width: 2.5vw;
        height: 2.5vw;
    }

    .item-text {
        font-size: 18px;
    }

    .star-badge {
        width: 20px;
        height: 20px;
    }
}