/* ... manter todo o seu CSS anterior ... */

:root {
    --rucoy-blue: #3CBCFC;
    --rucoy-bg: #121212;
    --rucoy-drawer-bg: #2173b3;
    --white: #F3F3F3;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Roboto', sans-serif; }
body { background-color: var(--rucoy-bg); color: var(--white); overflow-x: hidden; min-height: 100vh; }

header {
    background-color: var(--rucoy-blue);
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.top-bar-action {
    display: flex;
    align-items: center;
    height: 100%;
    padding-right: 30px;
    cursor: pointer;
}

.menu-btn img {
    width: 24px;
    filter: brightness(0) invert(1);
    margin-right: 20px;
}

#current-page-title { font-size: 20px; font-weight: 500; color: white; }

#drawer {
    position: fixed;
    top: 0; left: -280px; width: 280px; height: 100%;
    background-color: var(--rucoy-drawer-bg);
    z-index: 200;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#drawer.active { left: 0; }

.drawer-banner {
    width: 100%; height: 150px;
    background: url('/res/icon/draweBanner.png') no-repeat center;
    background-size: cover;
}

.drawer-list { list-style: none; padding: 8px 0; flex-grow: 1; }

.drawer-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    font-size: 16px;
}

.drawer-item img { width: 24px; height: 24px; margin-right: 32px; filter: brightness(0) invert(1); }

.settings-highlight {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #000000 !important;
    font-weight: bold;
}

.settings-highlight img { filter: brightness(0) !important; }

#overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); display: none; z-index: 150;
}

main { padding: 76px 20px 20px 20px; min-height: 100vh; }

#search, #rarityFilter {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    background: #222;
    border: 1px solid #444;
    color: white;
    border-radius: 8px;
}

#lista {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    padding-bottom: 80px;
}

.item-card {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1;
    background-size: 100% 100%;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    image-rendering: pixelated;
    cursor: pointer;
    transition: transform 0.2s ease, border 0.1s ease;
    border: 2px solid transparent;
}

.item-card:hover {
    transform: scale(1.05);
    border: 2px solid white;
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

.item-name {
    position: absolute;
    bottom: 4px;
    width: 100%;
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    z-index: 2;
    padding: 0 4px;
    line-height: 1.1;
    filter: drop-shadow(1px 1px 1px #000) drop-shadow(-1px -1px 1px #000) drop-shadow(0px 0px 3px #000);
}

.sprite-wrap {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(3.5);
    image-rendering: pixelated;
}

@media (max-width: 600px) {
    #lista { grid-template-columns: repeat(4, 1fr); gap: 5px; }
    .sprite-wrap { transform: scale(2.8); }
    .item-name { font-size: 10px; }
}

.sprite { background-repeat: no-repeat; image-rendering: pixelated; }

#details-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    overflow-y: auto;
}

.big-item-card {
    width: 200px;
    height: 200px;
    background-size: 100% 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    image-rendering: pixelated;
    margin-bottom: 20px;
}

.big-sprite-wrap { transform: scale(8); image-rendering: pixelated; }

.details-title {
    font-size: 28px;
    font-weight: bold;
    text-transform: capitalize;
    margin-bottom: 30px;
    text-align: center;
    filter: drop-shadow(2px 2px 2px #000);
}

.info-container {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    width: 100%;
    max-width: 400px;
    line-height: 1.6;
}

.info-row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #222;
    padding: 8px 0;
    font-size: 18px;
}

.description-text {
    white-space: pre-line;
    text-align: right;
    color: #ccc;
    font-size: 16px;
}

.info-row:last-child { border-bottom: none; }
.val-positive { color: #00ff41; }
.val-negative { color: #ff3b3b; }

.btn-close {
    position: absolute;
    top: 20px; right: 20px;
    background: none; border: none;
    color: white; font-size: 40px; cursor: pointer;
}

/* NOVO: Estilo do Gráfico */
.chart-container {
    width: 100%;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 15px;
    margin-top: 20px;
    margin-bottom: 40px;
}

/* --- MODO APP (ESCONDER INTERFACE) --- */
body.is-app header, 
body.is-app #drawer, 
body.is-app #overlay {
    display: none !important;
}

body.is-app main {
    padding-top: 20px !important; /* Remove o espaço do header no App */
}

/* Ajuste para o scroll não bugar no mobile do App */
body.is-app {
    overflow-x: hidden;
}