/* Variables de color */
:root {
    --color-celeste-mar: #7AB5E0;
    --color-arena-bloque: #F9D66A;
    --color-sombra: rgba(0, 0, 0, 0.2);
    --color-texto: #333;
    --color-descuento: #e74c3c;
    --color-precio-original: #7f8c8d;
}

/* Estilos base */
body {
    box-sizing: border-box;
    min-height: 100dvh;
    font-family: 'VT323', monospace;
    margin: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    color: var(--color-texto);
    line-height: 1.4;
}

.corpo {
    background-image: url("../img/mar.png");
    background-size: cover;
    background-attachment: fixed;
}

/* Header */
header {
    display: flex;
    flex-direction: column;
}

h1 {
    position: absolute;
    width: 100%;
    top: -1rem;
    text-align: center;
    background-color: transparent;
    z-index: -1;
    line-height: 1;
    letter-spacing: 1rem;
    font-size: 2.5rem;
    color: white;
    text-shadow: 2px 2px 4px var(--color-sombra);
}

.nav__ol {
    position: fixed;
    right: 0;
    z-index: 100;
    display: flex;
    gap: 1rem;
    padding: 1rem;
}

ol {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

/* Main content */
main {
    flex: 1;
    padding: 1rem;
}

/* Grid de juegos */
.grid {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
    padding: 0.625rem;
    margin-bottom: 0.625rem;
    justify-content: center;
}

.grid-item {
    background-color: var(--color-arena-bloque);
    padding: 10px;
    border-radius: 15%;
    box-shadow: 0 4px 8px var(--color-sombra);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.grid-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px var(--color-sombra);
}

.subgrid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.subgrid-item > h2 {
    width: 100%;
    font-size: 1rem;
    text-align: center;
    margin: 0.5rem 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subgrid-item__link > img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10%;
    border: 2px solid var(--color-celeste-mar);
    transition: filter 0.3s ease;
}

.grid-item:hover .subgrid-item__link > img {
    filter: brightness(0.9);
}

/* Rating */
.game-rating {
    display: flex;
    justify-content: center;
    gap: 2px;
    margin: 0.5rem 0;
}

.subgrid-item__img {
    width: 1rem;
    height: 1rem;
}

/* Precios */
.game-price {
    text-align: center;
    font-weight: bold;
    font-size: 1.1rem;
    margin: 0.3rem 0;
}

.discount {
    color: var(--color-descuento);
    animation: pulse 1.5s infinite;
}

.original-price {
    text-decoration: line-through;
    color: var(--color-precio-original);
    font-size: 0.9rem;
}

/* Descripción */
.game-description {
    position: absolute;
    bottom: -100%;
    left: 0;
    right: 0;
    background: rgba(249, 214, 106, 0.95);
    padding: 0.5rem;
    transition: bottom 0.3s ease;
    font-size: 0.8rem;
    border-radius: 0 0 15% 15%;
    max-height: 60%;
    overflow-y: auto;
    text-align: center;
}

.grid-item:hover .game-description {
    bottom: 0;
}

/* Efecto de gotas */
.grid-item:hover::before {
    content: url("../img/gotas.png");
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    animation: aparecer 0.5s forwards;
}

/* Footer */
footer {
    width: 100%;
    background-image: url("../img/orilla.png");
    background-size: contain;
    background-position: 0% 0%;
    text-align: center;
    text-transform: uppercase;
    font-weight: 700;
    padding: 1.5rem 0;
    margin-top: auto;
    color: white;
    text-shadow: 1px 1px 2px var(--color-texto);
}

/* Animaciones */
@keyframes aparecer {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.grid-item {
    animation: aparecer linear forwards;
    animation-timeline: view();
    animation-range: cover 0% contain 40%;
}

/* Scrollbar personalizada */
.game-description::-webkit-scrollbar {
    width: 5px;
}

.game-description::-webkit-scrollbar-track {
    background: rgba(122, 181, 224, 0.3);
    border-radius: 10px;
}

.game-description::-webkit-scrollbar-thumb {
    background: var(--color-celeste-mar);
    border-radius: 10px;
}

/* Media Queries */
@media screen and (max-width: 600px) {
    .grid {
        grid-template-columns: repeat(2, minmax(100px, 1fr));
    }
    
    .subgrid-item__link > img {
        height: 100px;
    }
    
    .game-description {
        font-size: 0.7rem;
        padding: 0.3rem;
    }
}

@media screen and (min-width: 601px) and (max-width: 900px) {
    .grid {
        grid-template-columns: repeat(3, minmax(120px, 1fr));
    }
    
    h1 {
        font-size: 3rem;
    }
}

@media screen and (min-width: 901px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .subgrid-item__link > img {
        height: 150px;
    }
    
    .subgrid-item > h2 {
        font-size: 1.1rem;
    }
}

@media screen and (min-width: 1200px) {
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.5rem;
    }
    
    .subgrid-item__link > img {
        height: 180px;
    }
    
    .game-description {
        font-size: 0.9rem;
        padding: 0.8rem;
    }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
    .grid-item:hover::before {
        animation-duration: 1s;
    }
    
    .grid-item, .discount {
        animation: none;
    }
    
    .grid-item:hover {
        transform: none;
    }
}

/* Clases utilitarias */
.icon-32 {
    border-radius: 150px;
    width: 32px;
    height: 32px;
    object-fit: cover;
}

.grid-noti {
    display: grid;
    grid-template-columns: repeat(1, minmax(max-content, 1fr));
    grid-template-rows: repeat(auto-fit, minmax(6.25rem, 1fr));
    gap: 5px;
    padding: 10px;
    grid-auto-flow: row;
    margin-bottom: 10px;
}