/* Games page specific styles */

/* Ensure main element has proper width */
main {
    width: 100%;
    max-width: 1200px;
    margin: 60px auto 0; /* Preserve top margin for fixed header */
    padding: 0 20px;
}

/* Adjust for mobile header height */
@media (max-width: 768px) {
    main {
        margin-top: 76px; /* Account for taller mobile header with touch targets */
    }
}

/* Ensure grid layout from components.css is used */
.jai-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

@media (width >= 769px) and (width <= 1024px) {
    .jai-container {
        grid-template-columns: repeat(2, minmax(280px, 400px));
        justify-content: center;
    }
}

@media (width <= 768px) {
    .jai-container {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
}

/* Game-specific card styles */
.game-card {
    position: relative;
    cursor: pointer;
}

/* Clickable card overlay */
.jai-card-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Standardize card heights to match apps/tools pages */
.jai-card {
    min-height: 340px;
    height: 100%;
}

.jai-image {
    height: 160px;
    background-color: var(--bg-tertiary);
    background-position: center;
    background-size: cover;
    position: relative;
}

/* Fix padding that was overridden by apps-page.css */
.game-card .jai-content {
    padding: 20px 20px 15px;
    position: relative; /* Required for absolute positioned ::after element */
}

/* Override the external-link.css styles for games page */
.game-card.external-game::after {
    display: none; /* Hide the card-level badge from external-link.css */
}

/* External game indicator - place on jai-content for better positioning */
.game-card.external-game .jai-content::after {
    content: "External";
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgb(0 0 0 / 70%);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    pointer-events: none; /* Ensure badge doesn't interfere with clicks */
    z-index: 2; /* Above content but below links */
}

/* Under construction indicator - override external badge */
.game-card.under-construction .jai-content::after {
    content: "Under Construction";
    background: rgb(180 83 9 / 90%);
}

/* Under construction warning badge on image */
.game-card.under-construction .jai-image::after {
    content: "Known Issues";
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgb(180 83 9 / 90%);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Creator link styles */
.creator-link {
    text-decoration: none;
    display: inline-block;
    position: relative;
    z-index: 10;
    pointer-events: all;
}

.x-handle {
    display: inline-flex;
    align-items: center;
    background-color: var(--color-x-primary);
    color: var(--text-inverse);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    margin: 6px 0;
}

.x-handle:hover {
    background-color: var(--color-x-hover);
}

.x-logo {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    display: inline-block;
    vertical-align: middle;
}

/* External link styles - arrow removed per request */

/* Footer adjustments for games */
.jai-footer {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
    margin-top: auto;
    justify-content: space-between;
}

/* Ensure footer links remain clickable above card overlay */
.jai-footer .jai-link {
    position: relative;
    z-index: 10;
    pointer-events: all;
}

/* Game-specific image styles for real mode */
html.real-mode-html .jai-card:nth-child(1) .jai-image {
    background-image: url("../../images/backgrounds/claudewords.png");
}

html.real-mode-html .jai-card:nth-child(2) .jai-image {
    background-image: url("../../images/llama-checkers-logo.png");
}

html.real-mode-html .jai-card:nth-child(3) .jai-image {
    background-image: url("../../images/app-banners/kettlebell-game-banner.svg");
}

html.real-mode-html .jai-card:nth-child(4) .jai-image {
    background-image: url("../../images/app-banners/ai-no-suika-banner.svg");
}