/* ==========================================================================
   MacBlash Free Web Games — Isolated Stylesheet
   Index (/all-services-free)  +  Detail & In-Page Arena (/show-service/{id} type=price)
   rusty create | 2026-09-09 18:20
   Action: dark-glass free-games directory + immersive in-page game theater.
           Namespaced .mac-fg- / .fg- and scoped under .mac-fg-page / .mac-fg-arena-page
           so the shared .game-item / .page-single-* rules in style.css keep working for
           the other Service listings (unfree / need / train).
   ========================================================================== */

:root {
    --fg-bg: #0a0a0f;
    --fg-surface: rgba(18, 18, 26, 0.75);
    --fg-surface-solid: #12121a;
    --fg-glass-border: rgba(6, 182, 212, 0.12);
    --fg-glass-border-hover: rgba(6, 182, 212, 0.45);
    --fg-gold: #e4c59e;
    --fg-cyan: #06b6d4;
    --fg-purple: #8b5cf6;
    --fg-green: #22c55e;
    --fg-text: #e2e8f0;
    --fg-text-muted: #94a3b8;
    --fg-radius: 16px;
    --fg-radius-sm: 10px;
    --fg-radius-xs: 6px;
}

/* ==========================================================================
   1. INDEX
   ========================================================================== */

.mac-fg-page {
    background: transparent !important;
    position: relative;
    z-index: 2;
}

.mac-fg-hero {
    text-align: center;
    padding: 36px 0 26px;
}

.mac-fg-hero-title {
    font-size: 38px;
    font-weight: 800;
    color: var(--fg-gold);
    letter-spacing: -0.02em;
    margin: 0 0 10px;
}

.mac-fg-hero-desc {
    font-size: 16px;
    color: var(--fg-text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Filter pills (client-side, derived) */
.mac-fg-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 22px auto 8px;
}

.mac-fg-pill {
    padding: 7px 18px;
    border-radius: 999px;
    border: 1px solid var(--fg-glass-border);
    background: var(--fg-surface);
    color: var(--fg-text-muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.mac-fg-pill:hover { color: var(--fg-text); border-color: var(--fg-glass-border-hover); }

.mac-fg-pill.is-active {
    background: var(--fg-cyan);
    border-color: var(--fg-cyan);
    color: #001014;
}

.mac-fg-suggest-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--fg-radius-sm);
    background: linear-gradient(135deg, var(--fg-purple), var(--fg-cyan));
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin: 12px 0 22px;
}
.mac-fg-suggest-btn:hover { transform: scale(1.04); color: #fff; box-shadow: 0 0 24px rgba(6, 182, 212, 0.5); }

/* Grid */
.mac-fg-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-top: 10px;
}

@media (max-width: 1199px) { .mac-fg-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .mac-fg-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  {
    .mac-fg-grid { grid-template-columns: 1fr; gap: 16px; }
    .mac-fg-card { will-change: auto !important; }
}

/* Card */
.mac-fg-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--fg-radius);
    background: var(--fg-surface-solid);
    border: 1px solid var(--fg-glass-border);
    overflow: hidden;
    text-decoration: none;
    color: var(--fg-text);
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1),
                border-color 0.3s ease, box-shadow 0.3s ease;
}

.mac-fg-card:hover {
    transform: translateY(-5px);
    border-color: var(--fg-glass-border-hover);
    box-shadow: 0 0 28px rgba(6, 182, 212, 0.16);
    color: var(--fg-text);
    text-decoration: none;
}

.mac-fg-card-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #0d0d14;
}

.mac-fg-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.mac-fg-card:hover .mac-fg-card-img { transform: scale(1.07); }

.mac-fg-card-media::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 15, 0.9) 0%, transparent 55%);
}

.mac-fg-badge {
    position: absolute;
    top: 12px;
    inset-inline-start: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #001014;
    background: var(--fg-green);
}

.mac-fg-rate-badge {
    position: absolute;
    bottom: 12px;
    inset-inline-start: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: #f59e0b;
    background: rgba(10, 10, 15, 0.65);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.mac-fg-card-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px 16px;
    flex: 1;
}

.mac-fg-card-title {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mac-fg-card-desc {
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--fg-text-muted);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.mac-fg-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 4px;
}

.mac-fg-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.mac-fg-tag {
    font-size: 10px;
    font-weight: 700;
    color: var(--fg-text-muted);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--fg-radius-xs);
    padding: 2px 8px;
}

.mac-fg-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 800;
    color: var(--fg-cyan);
    white-space: nowrap;
    transition: gap 0.25s ease;
}
.mac-fg-card:hover .mac-fg-card-cta { gap: 9px; }

.mac-fg-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--fg-text-muted);
    border: 1px dashed var(--fg-glass-border);
    border-radius: var(--fg-radius);
}
.mac-fg-empty i { font-size: 40px; color: var(--fg-cyan); display: block; margin-bottom: 12px; }

.mac-fg-page .pagination { justify-content: center; margin-top: 36px; }
.mac-fg-page .pagination .page-link {
    background: var(--fg-surface);
    border-color: var(--fg-glass-border);
    color: var(--fg-text-muted);
    border-radius: var(--fg-radius-xs);
    margin: 0 3px;
}
.mac-fg-page .pagination .page-item.active .page-link {
    background: var(--fg-cyan);
    border-color: var(--fg-cyan);
    color: #001014;
}

/* ==========================================================================
   2. DETAIL + ARENA
   ========================================================================== */

.mac-fg-arena-page {
    background: transparent !important;
    position: relative;
    z-index: 2;
}

.mac-fg-detail {
    /* GPU sandbox — trap the iframe/theater composite work inside this widget */
    isolation: isolate !important;
    position: relative;
    z-index: 2;
}

.mac-fg-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}
@media (max-width: 991px) { .mac-fg-detail-layout { grid-template-columns: 1fr; } }

/* Hero */
.mac-fg-hero-card {
    position: relative;
    border-radius: var(--fg-radius);
    overflow: hidden;
    border: 1px solid var(--fg-glass-border);
    border-top: 2px solid var(--fg-cyan);
    min-height: 320px;
    display: flex;
    align-items: flex-end;
    margin-bottom: 20px;
}

.mac-fg-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mac-fg-hero-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 15, 0.97) 8%, rgba(10, 10, 15, 0.55) 55%, transparent 100%);
}

.mac-fg-hero-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: clamp(18px, 3vw, 34px);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mac-fg-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--fg-green);
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.32);
}

.mac-fg-detail-title {
    font-size: clamp(22px, 3vw, 34px);
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1.25;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
}

.mac-fg-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}

/* Big play CTA */
.mac-fg-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: var(--fg-radius-sm);
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 800;
    color: #001014;
    background: linear-gradient(135deg, var(--fg-cyan), #22d3ee);
    box-shadow: 0 0 24px rgba(6, 182, 212, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mac-fg-play-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(6, 182, 212, 0.55); }
.mac-fg-play-btn i { font-size: 16px; }

/* Round icon buttons (favorite / share / preview) */
.mac-fg-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--fg-surface);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--fg-text);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.mac-fg-icon-btn:hover {
    color: var(--fg-cyan);
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 0 16px rgba(6, 182, 212, 0.25);
}
.mac-fg-icon-btn.is-fav { color: #ef4444; border-color: rgba(239, 68, 68, 0.45); }
.mac-fg-icon-btn.is-fav i { font-weight: 900; }

/* Body prose */
.mac-fg-body {
    color: var(--fg-text);
    font-size: 15.5px;
    line-height: 1.85;
    word-break: break-word;
}
.mac-fg-body p { margin: 0 0 18px; }
.mac-fg-body img { max-width: 100%; height: auto; border-radius: var(--fg-radius-sm); border: 1px solid rgba(255,255,255,0.1); }
.mac-fg-body a { color: var(--fg-cyan); }

/* Gallery */
.mac-fg-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 22px 0;
}
.mac-fg-gallery-item {
    aspect-ratio: 4 / 3;
    border-radius: var(--fg-radius-sm);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #0d0d14;
}
.mac-fg-gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.mac-fg-gallery-item:hover img { transform: scale(1.06); }

/* Sidebar cards */
.mac-fg-panel {
    background: var(--fg-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--fg-glass-border);
    border-radius: var(--fg-radius);
    padding: 18px;
}
.mac-fg-panel + .mac-fg-panel { margin-top: 18px; }
.mac-fg-panel.cyan-top { border-top: 2px solid var(--fg-cyan); }
.mac-fg-panel.purple-top { border-top: 2px solid var(--fg-purple); }

.mac-fg-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fg-text-muted);
    margin-bottom: 14px;
}
.mac-fg-panel-title i { color: var(--fg-purple); }

/* Controls guide */
.mac-fg-controls { display: flex; flex-direction: column; gap: 10px; }
.mac-fg-control {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: var(--fg-text);
}
.mac-fg-control i {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--fg-radius-sm);
    background: rgba(6, 182, 212, 0.12);
    color: var(--fg-cyan);
    font-size: 14px;
}

.mac-fg-spec-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.mac-fg-spec-row:last-child { border-bottom: 0; }
.mac-fg-spec-row .k { color: var(--fg-text-muted); }
.mac-fg-spec-row .v { color: var(--fg-text); font-weight: 700; }

/* Related */
.mac-fg-related { margin-top: 44px; padding-top: 30px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
.mac-fg-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 18px;
}
.mac-fg-section-title i { color: var(--fg-cyan); }
.mac-fg-section-title .count {
    font-size: 12px;
    font-weight: 700;
    color: var(--fg-cyan);
    background: rgba(6, 182, 212, 0.14);
    border-radius: 999px;
    padding: 2px 10px;
}
.mac-fg-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
}
@media (max-width: 991px) { .mac-fg-related-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .mac-fg-related-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .mac-fg-related-grid { grid-template-columns: 1fr; } }

/* Rating widget host — the .live-* / .mac-forum-star-rating widget is styled entirely by
   macblash-training.css (global) so it renders identical to the Event page's glass card.
   Nothing is overridden here. Submit-button alignment (left in RTL / right in LTR) lives
   in macblash-training.css for every rating widget. */
.mac-fg-reviews { margin-top: 40px; }

.mac-fg-guest {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    border-radius: var(--fg-radius);
    background: var(--fg-surface);
    border: 1px dashed var(--fg-glass-border);
    color: var(--fg-text-muted);
    font-size: 14px;
}
.mac-fg-guest a { color: var(--fg-cyan); font-weight: 700; text-decoration: none; }

/* ==========================================================================
   3. IN-PAGE GAME THEATER (full-viewport overlay)
   ========================================================================== */

.mac-fg-theater {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    background: #05050a;
    background-image: radial-gradient(circle at 50% 0%, rgba(6, 182, 212, 0.12) 0%, transparent 55%);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
.mac-fg-theater.is-open { opacity: 1; visibility: visible; }

/* Lock page scroll while the theater is open */
body.mac-fg-theater-open { overflow: hidden; }

/* HUD bar */
.mac-fg-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--fg-glass-border);
    flex-shrink: 0;
}

.mac-fg-hud-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
}
.mac-fg-hud-title .dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--fg-green);
    box-shadow: 0 0 8px var(--fg-green);
    flex-shrink: 0;
}
.mac-fg-hud-title span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mac-fg-hud-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.mac-fg-hud-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.05);
    color: var(--fg-text);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.mac-fg-hud-btn:hover { color: #fff; background: rgba(6, 182, 212, 0.16); border-color: rgba(6, 182, 212, 0.4); }
.mac-fg-hud-btn.exit:hover { color: #fff; background: rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.5); }
.mac-fg-hud-btn .label { display: inline; }
@media (max-width: 560px) { .mac-fg-hud-btn .label { display: none; } .mac-fg-hud-btn { padding: 0 10px; } }

.mac-fg-stage {
    flex: 1;
    position: relative;
    min-height: 0;
    background: #000;
}

.mac-fg-stage iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.mac-fg-stage-loader {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--fg-text-muted);
    font-size: 13px;
    font-weight: 700;
}
.mac-fg-stage-loader .spin {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid rgba(6, 182, 212, 0.2);
    border-top-color: var(--fg-cyan);
    animation: mac-fg-spin 0.9s linear infinite;
}
.mac-fg-stage.is-loaded .mac-fg-stage-loader { display: none; }

@keyframes mac-fg-spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   4. TOAST (showMacblashToast)
   ========================================================================== */

.mac-fg-toast {
    position: fixed;
    inset-block-start: 24px;
    inset-inline: 0;
    margin-inline: auto;
    width: fit-content;
    max-width: 90vw;
    z-index: 100001;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 999px;
    background: rgba(10, 10, 15, 0.92);
    backdrop-filter: blur(12px);
    border: 1px solid var(--fg-glass-border-hover);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(6, 182, 212, 0.25);
    transform: translateY(-24px);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.35s ease;
    pointer-events: none;
}
.mac-fg-toast.is-show { transform: translateY(0); opacity: 1; }
.mac-fg-toast i { color: var(--fg-cyan); }

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    .mac-fg-card, .mac-fg-card-img, .mac-fg-hero-bg,
    .mac-fg-theater, .mac-fg-toast { transition: none !important; animation: none !important; }
    .mac-fg-stage-loader .spin { animation: none !important; }
}
