/* PEGI Rating Container */
.pegi-rating-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: middle;
    z-index: 50;
}

/* Main PEGI Icon */
.pegi-main-icon, .pegi-icon {
    width: 64px;
    height: 64px;
    cursor: pointer;
    transition: transform 0.2s ease;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.pegi-main-icon:hover, .pegi-icon:hover {
    transform: scale(1.05);
}

/* Descriptor icons roll-out strip */
.pegi-descriptors-strip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 10px;
    position: absolute;
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    white-space: nowrap;
    z-index: 51;
    /* Hidden by default — animated via JS */
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    pointer-events: none;
    transition: max-width 0.35s cubic-bezier(0.4,0,0.2,1),
                opacity 0.25s ease,
                padding 0.35s cubic-bezier(0.4,0,0.2,1);
    padding: 6px 0;
}

.pegi-descriptors-strip.is-open {
    opacity: 1;
    max-width: 500px; /* generous upper bound */
    pointer-events: auto;
    padding: 6px 12px;
}

/* Descriptor icon inside the strip */
.pegi-descriptors-strip .pegi-descriptor-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
    cursor: default;
    transition: transform 0.15s ease;
    position: relative;
}

.pegi-descriptors-strip .pegi-descriptor-icon:hover {
    transform: scale(1.15);
}

/* Native title tooltip is used; add a subtle custom one for style */
.pegi-descriptors-strip .pegi-descriptor-icon[title] {
    /* browsers show native tooltip from title attr */
}

/* Responsive: on small screens show above the PEGI icon instead of left */
@media (max-width: 600px) {
    .pegi-descriptors-strip {
        right: auto;
        left: 50%;
        top: auto;
        bottom: calc(100% + 10px);
        transform: translateX(-50%);
        flex-wrap: wrap;
        justify-content: center;
        /* Allow the strip to grow as wide as the viewport needs,
           keeping descriptor icons at their natural size */
        max-width: calc(100vw - 24px);
        width: max-content;
        box-sizing: border-box;
    }
    .pegi-descriptors-strip.is-open {
        /* Override the desktop upper bound — let content dictate width */
        max-width: calc(100vw - 24px);
    }
    /* Ensure icons never shrink below their intended size */
    .pegi-descriptors-strip .pegi-descriptor-icon {
        flex-shrink: 0;
        min-width: 36px;
        min-height: 36px;
    }
}

@media (max-width: 480px) {
    /* Descriptor icons: slightly smaller to save space */
    .pegi-descriptors-strip {
        gap: 6px;
    }
    .pegi-descriptors-strip.is-open {
        padding: 5px 10px;
    }
    .pegi-descriptors-strip .pegi-descriptor-icon {
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
    }
}

@media (max-width: 320px) {
    /* Descriptor icons: minimum size while remaining tappable */
    .pegi-descriptors-strip {
        gap: 5px;
    }
    .pegi-descriptors-strip.is-open {
        padding: 4px 8px;
    }
    .pegi-descriptors-strip .pegi-descriptor-icon {
        width: 26px;
        height: 26px;
        min-width: 26px;
        min-height: 26px;
    }
    /* Main PEGI icon matches single-game.css reduction */
    .pegi-main-icon,
    .pegi-icon {
        width: 44px;
        height: 44px;
    }
}

/* IGDB User Rating */
.igdb-user-rating {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.igdb-user-rating .stars {
    display: flex;
    gap: 2px;
}

.igdb-user-rating .rating-text {
    font-size: 0.9em;
    font-weight: 600;
    color: #495057;
}

.igdb-user-rating .igdb-logo img {
    height: 16px;
    width: auto;
    opacity: 0.7;
}

/* Compact User Rating */
.igdb-user-rating-compact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f8f9fa;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.igdb-user-rating-compact .rating-score {
    font-size: 0.9em;
    font-weight: 700;
    color: #495057;
}

.igdb-user-rating-compact .rating-votes {
    font-size: 0.85em;
    color: #6c757d;
}

.igdb-user-rating-compact .igdb-logo img {
    height: 14px;
    width: auto;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.igdb-user-rating-compact:hover .igdb-logo img {
    opacity: 0.9;
}

/* Release Dates Table */
.release-dates-table {
    overflow-x: auto;
    margin: 15px 0;
}

.release-dates-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.release-dates-table th {
    background: #f8f9fa;
    padding: 10px;
    text-align: left;
    border: 1px solid #dee2e6;
    font-weight: 600;
}

.release-dates-table td {
    padding: 8px;
    border: 1px solid #dee2e6;
}

.release-dates-table td[style*="font-weight: bold"] {
    background-color: #ebf8ff;
}

/* Game Info Container */
.game-info-container {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 0 0 8px 8px;
    border: 1px solid #dee2e6;
    border-top: none !important;
}

/* Summary with Expand/Collapse */
.game-summary-container {
    position: relative;
    line-height: 1.6;
    color: #ffffff;
}

.game-summary-short,
.game-summary-full {
    margin-bottom: 1em;
}

.game-summary-full {
    display: none; /* Hidden by default */
}

.summary-toggle-btn {
    background: transparent !important;
    padding: 8px 15px;
    border-radius: 4px;
    outline: 2px solid #f0f0f0;
    cursor: pointer;
    font-size: 0.9em;
    color: #f0f0f0;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

.summary-toggle-btn:hover {
    background: transparent !important;
    color: #5bb715 !important;
    outline-color: #5bb715;
}

.summary-toggle-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Add arrow icon */
.summary-toggle-btn .toggle-arrow {
    font-size: 0.8em;
    transition: transform 0.3s ease;
    display: inline-block;
}

.summary-toggle-btn.expanded .toggle-arrow {
    transform: rotate(180deg);
}

/* Storyline - always full */
.game-storyline {
    line-height: 1.6;
    color: #ffffff
    margin-bottom: 1.5em;
}

/* Game summary and storyline common */
.game-summary p,
.game-storyline p {
    margin-bottom: 1em;
}

/* YouTube Background Video - fullscreen cover */
.game-header-youtube {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}
.game-header-youtube iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 177.78vh; /* 16:9 ratio based on height */
    height: 56.25vw;  /* 16:9 ratio based on width */
    min-width: 100%;
    min-height: 100%;
    transform: translate(-50%, -50%);
}
/* ── Game Info: single-column layout ─────────────────────────────────────────
   The shortcode uses an inline style with repeat(auto-fit, minmax(200px, 1fr))
   which at sidebar widths puts Developer+Publisher on row 1 and everything
   else below, creating a visible "line" gap between them.
   Force a single column so all fields flow uniformly top-to-bottom.
   !important is required to beat the inline style attribute.
   ─────────────────────────────────────────────────────────────────────────── */
.game-info-container > div[style*="display: grid"] {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
}
