:root {
    --bg-color: #162463;
    --text-white: #ffffff;
    --card-bg: #ffffff;
    --btn-border: #ffffff;
}

.btn-start-img {
    width: 160px;
    height: auto;
    cursor: pointer;
    margin-top: 10px;
}

/* Grid View - Smaller Button */
.grid-card .btn-start-img {
    width: 80px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: url('./res/img/index_v2_background.jpg') no-repeat top center / 100% auto, var(--bg-color);
    background-attachment: scroll;
    color: var(--text-white);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding-top: 60px;
}

/* Card Common Styles */
.card-image {
    width: 100%;
    height: 65%;
    object-fit: cover;
    background-color: #eee;
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    background: white;
}

.game-title {
    font-size: 22px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #000;
}

.game-desc {
    font-size: 14px;
    color: #888;
    margin-bottom: 20px;
}

/* --- Grid View Layout --- */
.game-grid-container {
    width: 100%;
    max-width: 600px;
    padding: 20px;
    padding-bottom: 200px;
    display: grid;
    margin-top: 30vw;
    /* responsive spacing matching background aspect ratio */
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

/* Card Style for Grid */
.grid-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    opacity: 0;
    animation: fadeInUp 0.5s ease forwards;
}

/* Stagger delays for up to 10 items */
.grid-card:nth-child(1) {
    animation-delay: 0.1s;
}

.grid-card:nth-child(2) {
    animation-delay: 0.2s;
}

.grid-card:nth-child(3) {
    animation-delay: 0.3s;
}

.grid-card:nth-child(4) {
    animation-delay: 0.4s;
}

.grid-card:nth-child(5) {
    animation-delay: 0.5s;
}

.grid-card:nth-child(6) {
    animation-delay: 0.6s;
}

.grid-card:nth-child(7) {
    animation-delay: 0.7s;
}

.grid-card:nth-child(8) {
    animation-delay: 0.8s;
}

.grid-card:nth-child(9) {
    animation-delay: 0.9s;
}

.grid-card:nth-child(10) {
    animation-delay: 1.0s;
}

.grid-card:nth-child(11) {
    animation-delay: 1.1s;
}

.grid-card:nth-child(12) {
    animation-delay: 1.2s;
}

.grid-card:nth-child(13) {
    animation-delay: 1.3s;
}

.grid-card:nth-child(14) {
    animation-delay: 1.4s;
}

.grid-card:nth-child(15) {
    animation-delay: 1.5s;
}

.grid-card:nth-child(16) {
    animation-delay: 1.6s;
}

.grid-card:nth-child(17) {
    animation-delay: 1.7s;
}

.grid-card:nth-child(18) {
    animation-delay: 1.8s;
}

.grid-card:nth-child(19) {
    animation-delay: 1.9s;
}

.grid-card:nth-child(20) {
    animation-delay: 2.0s;
}

.grid-card:nth-child(21) {
    animation-delay: 2.1s;
}

.grid-card:nth-child(22) {
    animation-delay: 2.2s;
}

.grid-card:nth-child(23) {
    animation-delay: 2.3s;
}

.grid-card:nth-child(24) {
    animation-delay: 2.4s;
}

.grid-card:nth-child(25) {
    animation-delay: 2.5s;
}

.grid-card:nth-child(26) {
    animation-delay: 2.6s;
}

.grid-card:nth-child(27) {
    animation-delay: 2.7s;
}

.grid-card:nth-child(28) {
    animation-delay: 2.8s;
}

.grid-card:nth-child(29) {
    animation-delay: 2.9s;
}

.grid-card:nth-child(30) {
    animation-delay: 3.0s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.grid-card:active {
    transform: scale(0.95);
}

.grid-card .card-image {
    height: 100px;
    /* Smaller height for grid */
}

.grid-card .card-content {
    padding: 10px;
}

.grid-card .game-title {
    font-size: 16px;
    margin-bottom: 4px;
}

.grid-card .game-desc {
    display: none;
    /* Hide desc in compact grid */
}

.grid-card .btn-start {
    padding: 4px 12px;
    font-size: 12px;
    width: 100%;
    margin-top: 5px;
}