:root { 
    --primary: #5c6bc0; --secondary: #26a69a; --bg-dark: #121212; 
    --bg-panel: #1e1e1e; --bg-input: #2c2c2c; --text-main: #e0e0e0; 
    --text-muted: #a0a0a0; --accent: #ffca28; --coord-bg: #1565c0; 
    --radius: 12px; --text-coord: #4fc3f7; 
}

* { box-sizing: border-box; }

::-webkit-scrollbar { width: 8px; } 
::-webkit-scrollbar-track { background: var(--bg-dark); } 
::-webkit-scrollbar-thumb { background-color: var(--primary); border-radius: 20px; border: 3px solid var(--bg-dark); }

body { 
    font-family: 'Poppins', sans-serif; 
    background-color: var(--bg-dark); 
    color: var(--text-main); 
    margin: 0; padding: 0; 
    display: flex; flex-direction: column; 
    height: 100vh; overflow: hidden; 
}

/* HEADER */
header { 
    background-color: rgba(30, 30, 30, 0.95); 
    padding: 15px 30px; 
    box-shadow: 0 4px 20px rgba(0,0,0,0.4); 
    position: sticky; top: 0; z-index: 100; 
    border-bottom: 2px solid var(--primary); 
    display: flex; justify-content: space-between; align-items: center; gap: 20px; 
}

.header-left, .header-right { display: flex; gap: 12px; flex-shrink: 0; }

.nav-btn { 
    background-color: var(--bg-input); color: #e0e0e0; 
    border: 1px solid #444; padding: 10px 20px; 
    border-radius: 8px; cursor: pointer; 
    font-weight: 500; font-size: 0.9em; 
    display: flex; align-items: center; gap: 8px; 
    transition: all 0.2s ease; 
}

.nav-btn:hover { background-color: #333; border-color: var(--primary); color: white; transform: translateY(-1px); }
.nav-btn.active { background-color: rgba(92, 107, 192, 0.2); border-color: var(--primary); color: var(--primary); }
.btn-icon { font-size: 1.1em; }

.search-container { flex-grow: 1; max-width: 700px; }
input[type="text"] { 
    width: 100%; padding: 12px 25px; 
    border-radius: 30px; border: 2px solid transparent; 
    background: var(--bg-input); color: white; 
    font-size: 15px; transition: all 0.3s ease; 
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2); 
}
input[type="text"]:focus { outline: none; border-color: var(--primary); background: #333; box-shadow: 0 0 15px rgba(92, 107, 192, 0.3); }

/* LAYOUT */
.container { display: flex; flex: 1; max-width: 1800px; margin: 0 auto; width: 100%; overflow: hidden; }
aside { width: 320px; padding: 30px; background-color: var(--bg-panel); border-right: 1px solid #333; overflow-y: auto; display: flex; flex-direction: column; gap: 25px; }

.filter-group h3 { color: var(--primary); margin: 0 0 15px 0; font-size: 1.1em; text-transform: uppercase; letter-spacing: 1px; border-bottom: 2px solid #333; padding-bottom: 8px; }
select, input[type="number"] { width: 100%; padding: 12px; margin-bottom: 10px; background: var(--bg-input); border: 1px solid #444; color: white; border-radius: 8px; }

.checkbox-group label { display: flex; align-items: center; margin-bottom: 10px; cursor: pointer; padding: 8px; border-radius: 6px; }
.checkbox-group label:hover { background: rgba(255,255,255,0.05); }
input[type="checkbox"] { accent-color: var(--primary); width: 18px; height: 18px; margin-right: 10px; }

main { flex: 1; padding: 30px; overflow-y: auto; background-image: radial-gradient(circle at top right, #1f2235 0%, #121212 60%); }
#quest-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 25px; padding-bottom: 50px; }

/* CARD */
.quest-card { background-color: var(--bg-panel); border-radius: var(--radius); padding: 20px; border-top: 4px solid var(--primary); transition: all 0.3s; display: flex; flex-direction: column; box-shadow: 0 4px 6px rgba(0,0,0,0.2); }
.quest-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.4); border-top-color: var(--accent); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px; }

.npc-name { font-weight: 700; font-size: 1.4em; color: var(--accent); }
.quest-level { background: var(--primary); color: white; padding: 4px 12px; border-radius: 20px; font-size: 0.8em; font-weight: 600; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
.quest-loc { color: var(--text-muted); font-size: 0.95em; margin-bottom: 15px; display: flex; flex-direction: column; line-height: 1.4; }
.quest-loc span:first-child { color: #fff; font-weight: 500; }

.header-coord { color: var(--text-coord); cursor: pointer; font-weight: bold; transition: all 0.2s; display: inline-block; }
.header-coord:hover { color: #fff; text-decoration: underline; transform: scale(1.05); }

.quest-section { background: rgba(0,0,0,0.2); padding: 15px; border-radius: 8px; font-size: 0.95em; margin-bottom: 10px; border: 1px solid rgba(255,255,255,0.05); }
.reward-section { background: linear-gradient(90deg, rgba(255, 202, 40, 0.1) 0%, rgba(0,0,0,0) 100%); border-left: 4px solid var(--accent); }
.reward-header { color: var(--accent); font-weight: bold; margin-bottom: 5px; display: block; text-transform: uppercase; font-size: 0.85em; letter-spacing: 1px; }
.reward-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: #fff; margin-top: 5px; font-size: 0.95em; }
.reward-ball-img { height: 24px; width: 24px; vertical-align: middle; }

/* ITENS E ICONS (Pixel Art Focus) */
.poke-line { display: flex; align-items: center; width: 100%; padding: 6px 0; margin-bottom: 4px; border-bottom: 1px solid rgba(255,255,255,0.03); }
.poke-line:last-child { border-bottom: none; }

.poke-icon { 
    height: 48px; width: auto; 
    vertical-align: middle; 
    filter: drop-shadow(0 3px 5px rgba(0,0,0,0.5)); 
    transition: transform 0.2s; 
    margin-right: 10px;
    /* Garante nitidez nos ícones */
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.poke-icon:hover { transform: scale(1.15); }
.qty-badge { font-weight: 700; color: #fff; background: rgba(255,255,255,0.1); padding: 2px 8px; border-radius: 10px; margin-left: auto; font-size: 1.1em; }
.item-text-line { background: rgba(255, 255, 255, 0.03); padding: 10px 12px; border-radius: 6px; border-left: 3px solid var(--secondary); margin-bottom: 8px; font-size: 0.95em; color: #eceff1; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; line-height: 1.5; }

.task-label { color: var(--secondary); font-size: 0.9em; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-top: 15px; margin-bottom: 8px; display: flex; align-items: center; }
.task-label::before { content: '•'; color: var(--secondary); font-size: 1.5em; margin-right: 6px; line-height: 0; }
.task-label:first-child { margin-top: 0; }

.coord-btn { background: transparent; color: var(--text-coord); padding: 0; border-radius: 0; cursor: pointer; font-family: 'Courier New', monospace; font-weight: bold; font-size: 0.95em; display: inline; gap: 0; box-shadow: none; border: none; transition: all 0.2s; }
.coord-btn:hover { background: transparent; color: #fff; text-decoration: underline; transform: scale(1.05); box-shadow: none; }

.tag { display: inline-block; padding: 4px 10px; border-radius: 6px; font-size: 0.75em; font-weight: 600; text-transform: uppercase; margin-right: 5px; margin-bottom: 5px; }
.tag-capturar { background: rgba(171, 71, 188, 0.2); color: #e1bee7; border: 1px solid #ab47bc; }
.tag-derrotar { background: rgba(239, 83, 80, 0.2); color: #ffcdd2; border: 1px solid #ef5350; }
.tag-entregar { background: rgba(102, 187, 106, 0.2); color: #c8e6c9; border: 1px solid #66bb6a; }
.tag-quest { background: rgba(92, 107, 192, 0.2); color: #c5cae9; border: 1px solid #5c6bc0; }

/* MODAL & MAPA (Otimização Máxima) */
.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.9); backdrop-filter: blur(5px); align-items: center; justify-content: center; }
.modal-content { position: relative; background-color: #121212; padding: 0; border: 2px solid #444; width: 95vw; height: 95vh; border-radius: 8px; box-shadow: 0 0 20px rgba(0,0,0,0.8); display: flex; flex-direction: column; overflow: hidden; }

.close { position: absolute; top: 15px; right: 25px; color: #fff; font-size: 30px; font-weight: bold; cursor: pointer; z-index: 200; background: rgba(0,0,0,0.7); width: 50px; height: 50px; border-radius: 50%; text-align: center; line-height: 50px; border: 2px solid #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.close:hover { background: rgba(255, 0, 0, 0.8); }

.map-viewport { width: 100%; height: 100%; overflow: hidden; position: relative; background: #0b0b0b; cursor: grab; }
.map-viewport.grabbing { cursor: grabbing; }

.map-wrapper { 
    position: absolute; left: 0; top: 0; 
    transform-origin: 0 0; 
    will-change: transform;
    /* Força aceleração de hardware para zoom mais liso */
    backface-visibility: hidden;
}

#gameMap { 
    display: block; 
    width: auto; 
    max-width: none;
    /* ESSENCIAL: Impede que o mapa fique borrado no zoom */
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

#mapPin { position: absolute; width: 50px; height: 50px; background-image: url('pino.png'); background-size: contain; background-repeat: no-repeat; background-position: center bottom; transform: translate(-50%, -100%); z-index: 20; display: none; pointer-events: none; animation: pinBounce 2s infinite ease-in-out; }

.spawn-marker { 
    position: absolute; width: 40px; height: 40px; 
    transform: translate(-50%, -100%); 
    cursor: pointer; z-index: 10; 
    display: flex; flex-direction: column; align-items: center; overflow: visible; 
}

.spawn-marker img { 
    width: 100%; height: 100%; 
    object-fit: contain; 
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
    /* Nitidez para os pokémons no mapa */
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

.marker-name { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, 0.7); color: #fff; padding: 1px 4px; border-radius: 4px; font-size: 10px; white-space: nowrap; pointer-events: none; text-shadow: 0 1px 2px black; border: 1px solid rgba(255,255,255,0.2); }

.map-search-bar { position: absolute; top: 20px; left: 20px; z-index: 100; background: rgba(30, 30, 30, 0.9); padding: 8px; border-radius: 8px; border: 1px solid #444; display: flex; gap: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.map-search-bar input { background: #222; border: 1px solid #555; padding: 8px 12px; color: white; border-radius: 4px; width: 250px; font-size: 0.9em; }

@keyframes pinBounce { 0%, 100% { transform: translate(-50%, -100%) translateY(0); } 50% { transform: translate(-50%, -100%) translateY(-5px); } }