/* All Games Grid */

.ag-grid-wrap {
    padding-top: 10px;
}

.ag-grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* Card */
.ag-game-card {
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    transition: transform 0.18s ease;
    -webkit-tap-highlight-color: transparent;
}

.ag-game-card:active {
    transform: scale(0.97);
}

/* Image area */
.ag-card-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
    background: #1d1c1f;
    flex-shrink: 0;
    border-radius: 10px;
}

.ag-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 10px;
}

/* Top-left fav base */
.ag-fav-btn {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.52);
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2;
    padding: 0;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.ag-fav-btn:hover {
    background: rgba(0, 0, 0, 0.75);
}

/* Top-right info — positioned only, styling comes from .info_btn */
.ag-info-btn {
    position: absolute;
    z-index: 2;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* Top-left: Favorite — hidden */
.ag-fav-btn {
    top: 7px;
    left: 7px;
    display: none;
}

.ag-fav-btn svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    transition: fill 0.2s, stroke 0.2s;
}

.ag-fav-btn.active svg {
    fill: #ff4444;
    stroke: #ff4444;
}

/* Top-right: Info — use existing .info_btn styling, positioned on image */
.info_btn.ag-info-btn,
.info_btn.ag-info-btn:hover {
    top: 10px;
    right: 16px;
    box-shadow: inset 0 2px #ffffff4d, 0 3px 6px #0006;
    border: 0px;
    background: #ff7e33;
}

.info_btn.ag-info-btn svg,
.info_btn.ag-info-btn svg:hover {
    width: 14px;
    height: 14px;
    fill: white;
    stroke: white;
    border: 0px;
    transition: 0.25s ease;
}

.info_btn.ag-info-btn {
    transition: 0.25s ease;
}

.info_btn.ag-info-btn:hover {
    transform: translate(10px, -14px);
    transition: 0.25s ease;
}

.info_btn_icon svg path {
    fill: white!important;
    stroke: white!important;
}

.info_btn_icon:hover > svg path {
    fill: white!important;
    stroke: white!important;
}

/* Bottom-left: Play */
.ag-play-btn {
    /* position: absolute; */
    /* bottom: 8px; */
    /* left: 8px; */
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #fff !important;
    background: linear-gradient(to bottom, #ff7e33, #ff4d00);
    border: none;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 13px;
    font-family: var(--primary-700, sans-serif);
    cursor: pointer;
    z-index: 2;
    line-height: 1;
    transition: opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
    /* width: 100%; */
}


/* Bottom-right: Demo */
.ag-demo-label {
    /* position: absolute; */
    /* bottom: 8px; */
    /* right: 8px; */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    background: linear-gradient(to bottom, #ff7e33, #ff4d00);
    font-family: var(--primary-400, sans-serif);
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
    padding: 10px 16px;
    border: none;
    border-radius: 15px;
    line-height: 1;
    z-index: 2;
    transition: opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.ag-demo-label,
.button-bottom {
    transition: 0.25s ease;
}

.ag-demo-label:hover,
.button-bottom:hover {
    transform: translateY(-3px);
    transition: 0.25s ease;
}

/* Footer: game name only */
.ag-card-footer {
    display: flex;
    align-items: center;
    padding: 10px 4px;
    background: transparent;
    flex-shrink: 0;
}

.ag-card-name {
    color: #fff;
    font-size: 12px;
    line-height: 1.3;
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* Loading / empty */
.ag-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #555;
    padding: 3rem 0;
}

.button-bottom {
    position: absolute;
    bottom: 10px;
}

.button-bottom button {
    max-width: 75px;
    width: 100%;
    text-align: center;
    margin-left: 3px;
    margin-right: 3px;
    display: flex;
    justify-content: center;
    box-shadow: inset 0 3px #ffffff4d, 0 3px 6px #0006;
}

.ag-card-name .info_btn {
    display: none;
}

/* Coming soon card — non-interactive, dimmed, shown inline with other games */
.ag-coming-soon {
    cursor: default;
}

.ag-coming-soon:active {
    transform: none;
}

/* Disabled "Coming Soon" button — same shape as play button, width-safe.
   Overrides .button-bottom button's 75px cap so the longer label fits without
   wrapping or overflowing the card. */
.button-bottom .ag-coming-soon-btn {
    background: #5a5a5a !important;
    cursor: not-allowed !important;
    opacity: 0.9;
    max-width: calc(100% - 16px);
    width: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

.ag-coming-soon-btn:hover {
    transform: none;
}
