@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');

:root {
    --bg: #050511;
    --white: #fff;
    --purple: #7c3aed;
    --accent: #7c3aed;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', sans-serif;
}

body {
    background: var(--bg);
    color: var(--white);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto; /* Libera a rolagem da página */
    display: flex;
    flex-direction: column;
}

.gdp-col {
    min-width: 0; /* O segredo para não quebrar o Grid */
}

.gdp-bottom-games-track, .gdp-dev-games {
    cursor: grab; /* Mãozinha indicando que pode arrastar */
}

    .gdp-bottom-games-track.active-drag, .gdp-dev-games.active-drag {
        cursor: grabbing; /* Mãozinha fechada durante o arraste */
    }

.gdp-bottom-game-card img, .gdp-dev-game-card img {
    /* Previne o drag "fantasma" padrão do navegador nas imagens */
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    pointer-events: none;
}

.gdp-bottom-games-track,
.gdp-dev-games,
.gdp-bottom-game-card,
.gdp-dev-game-card,
.gdp-bottom-game-card img,
.gdp-dev-game-card img {
    -webkit-user-select: none; /* Safari / Chrome antigo */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE / Edge antigo */
    user-select: none; /* Padrão moderno */
}

/* --- LOADER OVERLAY --- */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #050511;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out;
}

/* --- ESTILO DOS RELÓGIOS PIXEL ART --- */
.gdp-clock-circle.retro-clock {
    background: transparent; /* Remove a cor creme de fundo */
    box-shadow: none; /* Remove a sombra do círculo antigo */
    width: auto;
    height: auto;
    gap: 5px; /* Espaço entre a imagem e o texto */
}

    .gdp-clock-circle.retro-clock img {
        width: 50px;
        height: 50px;
        border-radius: 8px; /* Quebra as pontas quadradas para ficar suave */
        object-fit: cover;
        /* O SEGREDO DO PIXEL ART: Impede que a imagem fique embaçada ao redimensionar */
        image-rendering: pixelated;
        image-rendering: -moz-crisp-edges;
        image-rendering: crisp-edges;
        border: 1px solid #2d3345; /* Bordinha para combinar com os cards */
        box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    }

    .gdp-clock-circle.retro-clock span {
        color: #deb37e; /* Coloca a cor creme no texto das horas para destacar */
        font-size: 16px;
        font-weight: 800;
    }

.loader-spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(124, 58, 237, 0.3);
    border-top: 5px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

/* --- CORREÇÃO 1: CENTRALIZAÇÃO DO TEXTO DO LOADER --- */
.loader-text {
    font-family: 'Orbitron', sans-serif;
    color: white;
    letter-spacing: 2px;
    font-size: 14px;
    animation: pulse 1.5s infinite ease-in-out;
    /* Garante centralização em telas pequenas */
    text-align: center;
    width: 100%;
    padding: 0 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

/* --- HEADER --- */
.top-nav-bar {
    width: 100%;
    height: 60px;
    background: #12121a;
    border-bottom: 1px solid #282830;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    flex-shrink: 0;
}

.top-nav-content {
    width: 100%;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.top-nav-logo {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: white;
    background: linear-gradient(90deg, #fff, #a2a2a2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-decoration: none;
}

/* --- BUSCA --- */
.search-wrap {
    position: relative;
    z-index: 1000;
    width: 100%;
    max-width: 500px;
    margin: 0 15px;
}

.search-pill {
    background: #181825;
    border: 1px solid #333;
    border-radius: 50px;
    padding: 6px 20px;
    display: flex;
    align-items: center;
    height: 40px;
}

.search-input {
    background: transparent;
    border: none;
    color: white;
    width: 100%;
    margin-left: 10px;
    outline: none;
    font-size: 0.9rem;
}

.search-results {
    position: absolute;
    top: 110%;
    left: 0;
    width: 100%;
    background: #1a1a24;
    border: 1px solid #333;
    border-radius: 10px;
    display: none;
    z-index: 2000;
    max-height: 400px;
    overflow-y: auto;
}

    .search-results.active {
        display: block;
    }

.result-item {
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    border-bottom: 1px solid #282830;
}



    .result-item img {
        width: 84px;
        height: 30px;
        border-radius: 4px;
        margin-right: 10px;
        object-fit: cover;
    }

/* --- LAYOUT GERAL --- */
.top-area {
    /* flex: grow | shrink | basis */
    flex: 1 0 55vh;
    min-height: 400px; /* Garante que o grafo nunca será esmagado */
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
}

.graph-container {
    position: relative;
    width: 100%;
    height: 100%;
    margin-top: 0px;
}

.svg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.blob {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
}

.node {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 10;
    transition: all 0.4s ease;
}

    .node img {
        width: 123px;
        border-radius: 12px;
        border: 2px solid #444;
        object-fit: cover;
        background: #000;
    }

    .node span {
        font-size: 10px;
        margin-top: 5px;
        background: rgba(0,0,0,0.6);
        padding: 2px 5px;
        border-radius: 4px;
        color: #ccc;
        text-align: center;
        white-space: nowrap;
        max-width: 140px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .node.main img {
        width: 130px;
        border-radius: 50%;
        height: 130px;
        border: 3px solid gold;
    }

    .node.main span {
        font-size: 16px;
        font-weight: bold;
        color: white;
    }

    .node.sub.active img {
        transform: scale(1.4);
        border-color: white;
        box-shadow: 0 0 20px rgba(255,255,255,0.4);
    }

    .node.sub.active span {
        transform: translateY(22px);
        transition: transform 0.4s ease;
        font-weight: bold;
        background: rgba(0,0,0,0.8);
        z-index: 20;
    }

.bottom-area {
    /* Fixa o carrossel na parte inferior antes do painel */
    flex: 0 0 30vh;
    min-height: 250px; /* Garante espaço suficiente para os cards */
    background: linear-gradient(to top, #050511 85%, transparent);
    z-index: 50;
    position: relative;
    overflow: hidden;
}

.cards-track {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 230px;
    transform: translateY(-50%);
    transition: 0.5s;
}

.game-card {
    position: absolute;
    width: 380px;
    height: 210px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 0.4;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    /* --- CORREÇÃO 2: EVITA SELEÇÃO AO CLICAR/ARRASTAR --- */
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

    .game-card.active-card {
        opacity: 1;
        z-index: 100;
        border: 1px solid rgba(255,255,255,0.3);
        transform: scale(1.05);
    }

    .game-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        mask-image: linear-gradient(to bottom, black 60%, transparent);
        /* --- CORREÇÃO 2: EVITA ARRASTE FANTASMA DA IMAGEM --- */
        -webkit-user-drag: none;
        -khtml-user-drag: none;
        -moz-user-drag: none;
        -o-user-drag: none;
        pointer-events: none; /* Deixa o clique passar para o card pai */
    }

.card-meta {
    position: absolute;
    bottom: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(transparent, #050511);
}

.card-title {
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 12px;
}

#hoverInfo {
    position: fixed;
    display: none;
    width: 340px;
    height: auto;
    max-height: 80vh;
    overflow-y: auto;
    background: rgba(18, 18, 28, 0.98);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(124, 58, 237, 0.3);
    border-radius: 12px;
    z-index: 5000;
    pointer-events: auto;
    box-shadow: 0 10px 50px rgba(0,0,0,0.9);
    font-size: 13px;
    color: #ddd;
    transition: opacity 0.2s;
}

    #hoverInfo::-webkit-scrollbar {
        width: 6px;
    }

    #hoverInfo::-webkit-scrollbar-thumb {
        background: #7c3aed;
        border-radius: 3px;
    }

    #hoverInfo::-webkit-scrollbar-track {
        background: rgba(0,0,0,0.3);
    }

.hover-header {
    padding: 12px 15px;
    background: linear-gradient(90deg, rgba(124, 58, 237, 0.1), transparent);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hover-title {
    font-weight: 800;
    font-size: 14px;
    color: #fff;
    text-transform: uppercase;
}

.hover-score {
    background: #7c3aed;
    color: #fff;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
}

.hover-body {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hover-desc {
    font-size: 12px;
    line-height: 1.4;
    color: #ccc;
    font-style: italic;
    border-left: 2px solid #555;
    padding-left: 10px;
}

.hover-footer {
    background: rgba(0,0,0,0.3);
    padding: 8px 15px;
    font-size: 10px;
    color: #777;
    display: flex;
    justify-content: space-between;
}

/* --- MOBILE OPTIMIZATION (HORIZONTAL CAROUSEL) --- */
@media (max-width: 768px) {

    body {
        height: auto !important;
        min-height: 100vh;
        overflow-y: auto !important;
        overflow-x: hidden;
        display: flex;
        flex-direction: column;
    }

    /* 1. TOP NAV */
    .top-nav-bar {
        order: 1;
        height: auto;
        padding: 10px 0;
        align-items: flex-start;
        flex-shrink: 0;
    }

    /* 2. TOP AREA (GRAFO) */
    .top-area {
        order: 2;
        height: 50vh;
        flex: none;
    }

    .node img {
        width: 90px;
    }

    .node.main img {
        width: 100px;
        height: 100px;
    }

    /* 3. BOTTOM AREA (CARROSSEL) */
    .bottom-area {
        order: 3;
        height: 320px !important;
        flex: none;
        background: transparent;
        margin-bottom: 0;
        padding-bottom: 20px;
        position: relative;
    }

    /* CARROSSEL HORIZONTAL NATIVO */
    .cards-track {
        position: relative !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        width: 100% !important;
        height: 100% !important;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 0 20px;
        gap: 15px;
        scrollbar-width: none;
    }

        .cards-track::-webkit-scrollbar {
            display: none;
        }

    /* ESTILO DOS CARDS NO MOBILE */
    .game-card {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        flex: 0 0 85%;
        width: 85% !important;
        height: 220px !important;
        margin: 0 !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        z-index: 10 !important;
        scroll-snap-align: center;
        box-shadow: 0 4px 15px rgba(0,0,0,0.6);
        border: 1px solid rgba(255,255,255,0.1);
    }

        .game-card.active-card {
            transform: none !important;
            border: 1px solid var(--accent);
        }

    .card-title {
        font-size: 15px;
    }

    .card-meta {
        padding: 12px;
    }

    /* 4. INFO BOX */
    #hoverInfo {
        order: 4;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        bottom: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: none !important;
        background: #0a0a14;
        border: none;
        border-top: 2px solid var(--accent);
        border-radius: 0;
        box-shadow: none;
        margin: 0;
        z-index: 100;
        padding-bottom: 40px;
    }

    /* HEADER MOBILE */
    .top-nav-content {
        flex-wrap: wrap;
        gap: 10px;
        padding: 0 15px;
    }

    .top-nav-left, .top-nav-right {
        display: flex !important;
        flex: 1;
        width: auto;
    }

    .top-nav-logo {
        font-size: 1.2rem;
    }

    .top-nav-right {
        justify-content: flex-end;
    }

    .search-wrap {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin: 5px 0 0 0;
    }

    .search-pill {
        height: 45px;
    }

    .hover-header {
        background: #14141e;
        padding: 15px 20px;
    }

    .hover-body {
        padding: 20px;
    }

    #hoverInfo::-webkit-scrollbar {
        display: none;
    }
}

/* =========================================
   PAINEL DE DETALHES (ESTILO STELLARIS)
========================================= */

/* =========================================
   SEÇÃO INFERIOR: MAIS JOGOS (CARDS LARGOS)
========================================= */
.gdp-bottom-section {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #2d3345; /* Linha sutil separando os requisitos */
}

.gdp-bottom-games-track {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 15px;
}

    /* Custom Scrollbar da parte de baixo */
    .gdp-bottom-games-track::-webkit-scrollbar {
        height: 8px;
    }

    .gdp-bottom-games-track::-webkit-scrollbar-thumb {
        background: #374151;
        border-radius: 4px;
    }

    .gdp-bottom-games-track::-webkit-scrollbar-track {
        background: transparent;
    }

.gdp-bottom-game-card {
    flex: 0 0 240px; /* Largura fixa para formato paisagem */
    height: 110px;
    border-radius: 8px;
    border: 1px solid #2d3345;
    overflow: hidden;
    cursor: pointer;
    transition: 0.3s ease;
    position: relative;
    background: #12141d;
}

    .gdp-bottom-game-card:hover {
        border-color: #7c3aed;
        transform: translateY(-5px); /* Efeito de pular um pouquinho */
        box-shadow: 0 8px 20px rgba(0,0,0,0.6);
    }

    .gdp-bottom-game-card img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* Corta a imagem vertical para caber no horizontal perfeitamente */
        object-position: center 20%; /* Foca na parte de cima da capa (onde costuma estar o logo) */
    }

.gdp-container {
    width: 98%;
    margin: 20px auto 40px auto;
    background: #151922; /* Cor de fundo idêntica à foto */
    border: 1px solid #2d3345;
    border-radius: 12px;
    overflow: hidden;
    color: #a3abbd;
    font-family: 'Inter', 'Roboto', sans-serif;
}

.gdp-header {
    position: relative;
    height: 260px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid #2d3345;
}

.gdp-header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, rgba(21, 25, 34, 0.95) 10%, rgba(21, 25, 34, 0.6) 50%, rgba(21, 25, 34, 0.2));
}

.gdp-header-content {
    position: relative;
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 100%;
}

.gdp-header h1 {
    font-size: 36px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
}

.gdp-close {
    background: rgba(45, 51, 69, 0.8);
    border: 1px solid #4a5472;
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: 0.2s;
}


.gdp-body {
    padding: 25px;
}

    .gdp-body h3 {
        font-size: 15px;
        color: #e2e8f0;
        margin-bottom: 12px;
        font-weight: 600;
    }

/* Grids do Layout */
.gdp-row-top {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid #2d3345;
    border-radius: 8px;
}

.gdp-row-mid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 20px;
    margin-bottom: 20px;
}

.gdp-card {
    border: 1px solid #2d3345;
    border-radius: 8px;
    padding: 20px;
}

/* Coluna 2 (Descrição e Dev Games) */
.gdp-desc-col p {
    font-size: 13px;
    line-height: 1.6;
    color: #a3abbd;
}

/* Cards de outros jogos da Dev */
.gdp-dev-games {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

    .gdp-dev-games::-webkit-scrollbar {
        height: 6px;
    }

    .gdp-dev-games::-webkit-scrollbar-thumb {
        background: #2d3345;
        border-radius: 4px;
    }

.gdp-dev-game-card {
    min-width: 140px;
    height: 80px;
    border-radius: 6px;
    border: 1px solid #2d3345;
    overflow: hidden;
    cursor: pointer;
    transition: 0.2s;
}

    .gdp-dev-game-card:hover {
        border-color: #7c3aed;
        transform: scale(1.05);
    }

    .gdp-dev-game-card img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

/* Coluna 3 (Info) */
.gdp-info-col p {
    font-size: 13px;
    margin-bottom: 8px;
}

.gdp-text-white {
    color: #fff;
}

/* Chart, Clocks e Specs */
.gdp-chart-wrapper {
    height: 180px;
    width: 100%;
}

.gdp-clocks {
    display: flex;
    gap: 30px;
}

.gdp-clock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.gdp-clock-circle {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    background: #deb37e; /* Cor creme dos relógios */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #12141d;
    font-weight: bold;
    font-size: 14px;
}

.gdp-clock-item span:last-child {
    font-size: 12px;
    color: #a3abbd;
}

.gdp-btn-store {
    background: #232a3b;
    border: 1px solid #374151;
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    margin-top: 10px;
    width: 100%;
}

    .gdp-btn-store:hover {
        background: #374151;
    }

.gdp-specs-text {
    font-size: 12px;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* --- TELAS MÉDIAS (Notebooks e Tablets em pé - entre 900px e 1200px) --- */
@media (max-width: 1200px) {
    .gdp-row-top {
        grid-template-columns: 1fr 1fr; /* Muda de 3 para 2 colunas */
    }

    .gdp-desc-col {
        grid-column: 1 / -1; /* Joga a descrição para a linha de baixo ocupando tudo */
        margin-top: 15px;
    }
}

/* --- TELAS PEQUENAS (Celulares - menores que 900px) --- */
@media (max-width: 900px) {
    .gdp-row-top {
        grid-template-columns: 1fr; /* Tudo em 1 coluna vertical */
    }

    .gdp-desc-col {
        grid-column: 1 / -1;
    }

    .gdp-row-mid {
        grid-template-columns: 1fr;
    }

    .gdp-clocks {
        flex-wrap: wrap; /* Permite que os relógios quebrem de linha se faltar espaço */
        justify-content: space-around;
        gap: 15px;
    }
}