/*
 * FunnyHaven — Core Stylesheet
 * Domain: funnyhaven.top
 * Dark neon theme with left-sidebar layout
 * Covers: layout, cards, detail, article, footer, 404, iframe, FAQ
 */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --fh-bg: #0b0f1a;
    --fh-bg-card: #131829;
    --fh-bg-card-hover: #1a2038;
    --fh-bg-surface: #10152480;
    --fh-bg-glass: rgba(19, 24, 41, 0.75);
    --fh-primary: #00e5ff;
    --fh-primary-rgb: 0, 229, 255;
    --fh-accent: #ff2d78;
    --fh-accent-rgb: 255, 45, 120;
    --fh-neon-green: #39ff14;
    --fh-neon-green-rgb: 57, 255, 20;
    --fh-neon-purple: #b14dff;
    --fh-neon-purple-rgb: 177, 77, 255;
    --fh-neon-yellow: #ffe600;
    --fh-text: #e8eaf6;
    --fh-text-mid: #9ea4c1;
    --fh-text-soft: #5c6280;
    --fh-border: rgba(255, 255, 255, 0.06);
    --fh-border-glow: rgba(0, 229, 255, 0.2);
    --fh-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --fh-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    --fh-shadow-md: 0 8px 32px rgba(0, 0, 0, 0.5);
    --fh-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
    --fh-glow-primary: 0 0 20px rgba(0, 229, 255, 0.15);
    --fh-glow-accent: 0 0 20px rgba(255, 45, 120, 0.15);
    --fh-radius: 14px;
    --fh-radius-sm: 8px;
    --fh-radius-lg: 20px;
    --fh-radius-xl: 28px;
    --fh-radius-full: 9999px;
    --fh-ease: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --fh-max-w: 1340px;
    --fh-sidebar-w: 220px;
    --fh-font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--fh-font);
    color: var(--fh-text);
    background: var(--fh-bg);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 229, 255, 0.06), transparent),
        radial-gradient(ellipse 60% 40% at 80% 100%, rgba(255, 45, 120, 0.04), transparent);
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--fh-ease);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    border: 0;
}

ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ==========================================
   LEFT SIDEBAR NAVIGATION
   ========================================== */

/* --- Sidebar overlay (mobile backdrop) --- */
.fh-sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 199;
    backdrop-filter: blur(4px);
}

.fh-sidebar-overlay.is-visible {
    display: block;
}

/* --- Fixed left sidebar --- */
.fh-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--fh-sidebar-w);
    height: 100vh;
    background: rgba(11, 15, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid var(--fh-border);
    z-index: 200;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--fh-border) transparent;
}

.fh-sidebar::-webkit-scrollbar { width: 4px; }
.fh-sidebar::-webkit-scrollbar-track { background: transparent; }
.fh-sidebar::-webkit-scrollbar-thumb { background: var(--fh-border); border-radius: 4px; }

/* --- Sidebar brand area --- */
.fh-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 18px;
    border-bottom: 1px solid var(--fh-border);
    flex-shrink: 0;
}

.fh-sidebar-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.fh-sidebar-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--fh-text);
    letter-spacing: -0.5px;
}

.fh-sidebar-title span {
    background: linear-gradient(135deg, var(--fh-primary), var(--fh-neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Sidebar navigation links --- */
.fh-sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fh-sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--fh-text-mid);
    font-size: 0.84rem;
    font-weight: 500;
    border-radius: var(--fh-radius-sm);
    transition: var(--fh-ease);
    white-space: nowrap;
}

.fh-sidebar-link:hover {
    background: rgba(var(--fh-primary-rgb), 0.08);
    color: var(--fh-text);
}

.fh-sidebar-link.is-active {
    background: rgba(var(--fh-primary-rgb), 0.12);
    color: var(--fh-primary);
    font-weight: 600;
}

.fh-sidebar-link-icon {
    font-size: 1.15rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

/* --- Sidebar bottom text --- */
.fh-sidebar-footer {
    padding: 16px 18px;
    border-top: 1px solid var(--fh-border);
    flex-shrink: 0;
}

.fh-sidebar-footer-text {
    color: var(--fh-text-soft);
    font-size: 0.7rem;
    line-height: 1.5;
}

/* --- Mobile top bar --- */
.fh-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(11, 15, 26, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--fh-border);
    z-index: 150;
    align-items: center;
    padding: 0 14px;
    gap: 10px;
}

.fh-topbar-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--fh-bg-card);
    border-radius: var(--fh-radius-sm);
    border: 1px solid var(--fh-border);
    flex-shrink: 0;
}

.fh-topbar-toggle-icon {
    width: 18px;
    height: 2px;
    background: var(--fh-text);
    position: relative;
    transition: var(--fh-ease);
}

.fh-topbar-toggle-icon::before,
.fh-topbar-toggle-icon::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 2px;
    background: var(--fh-text);
    left: 0;
    transition: var(--fh-ease);
}

.fh-topbar-toggle-icon::before { top: -6px; }
.fh-topbar-toggle-icon::after { top: 6px; }

.fh-topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.fh-topbar-logo {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.fh-topbar-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--fh-text);
    letter-spacing: -0.3px;
}

.fh-topbar-title span {
    background: linear-gradient(135deg, var(--fh-primary), var(--fh-neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --- Main content wrapper (offset by sidebar) --- */
.fh-main-wrapper {
    margin-left: var(--fh-sidebar-w);
    min-height: 100vh;
}

/* --- Page container --- */
.fh-container {
    width: 100%;
    max-width: var(--fh-max-w);
    margin: 0 auto;
    padding: 0 28px;
    overflow: hidden;
}

/* --- Main content area --- */
.fh-main {
    padding: 28px 0 60px;
    min-height: calc(100vh - 200px);
}

.fh-section {
    margin-bottom: 48px;
}

.fh-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.fh-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--fh-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.fh-section-title::before {
    content: "";
    width: 4px;
    height: 22px;
    background: linear-gradient(180deg, var(--fh-primary), var(--fh-neon-purple));
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(var(--fh-primary-rgb), 0.3);
}

.fh-section-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--fh-primary);
    font-size: 0.78rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: var(--fh-radius-full);
    background: rgba(var(--fh-primary-rgb), 0.08);
    border: 1px solid rgba(var(--fh-primary-rgb), 0.15);
    transition: var(--fh-ease);
    text-decoration: none;
}

.fh-section-more:hover {
    background: rgba(var(--fh-primary-rgb), 0.15);
    box-shadow: var(--fh-glow-primary);
}

/* --- Game card grid --- */
.fh-game-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.fh-game-grid--compact {
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
}

/* --- Individual game card --- */
.fh-game-card {
    background: var(--fh-bg-card);
    border-radius: var(--fh-radius);
    overflow: hidden;
    transition: var(--fh-ease);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--fh-border);
    position: relative;
}

.fh-game-card:hover {
    transform: translateY(-6px);
    border-color: rgba(var(--fh-primary-rgb), 0.3);
    box-shadow: var(--fh-shadow-md), 0 0 30px rgba(var(--fh-primary-rgb), 0.08);
}

.fh-game-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--fh-bg);
}

.fh-game-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.fh-game-card:hover .fh-game-thumb img {
    transform: scale(1.08);
}

.fh-game-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 3;
    backdrop-filter: blur(8px);
}

.fh-tag-popular { background: linear-gradient(135deg, var(--fh-primary), var(--fh-neon-purple)); }
.fh-tag-puzzle { background: linear-gradient(135deg, var(--fh-neon-green), #00b894); }
.fh-tag-girls { background: linear-gradient(135deg, var(--fh-accent), #ff6b9d); }
.fh-tag-boys { background: linear-gradient(135deg, #2d7bff, var(--fh-primary)); }
.fh-tag-casual { background: linear-gradient(135deg, var(--fh-neon-purple), #8b5cf6); }
.fh-tag-sport { background: linear-gradient(135deg, var(--fh-neon-yellow), #f59e0b); color: #1a1a2e; }
.fh-tag-strategy { background: linear-gradient(135deg, #ff6b35, var(--fh-accent)); }
.fh-tag-latest { background: linear-gradient(135deg, #00b4d8, var(--fh-neon-green)); }
.fh-tag-motive { background: linear-gradient(135deg, #e040fb, var(--fh-accent)); }

.fh-game-mark {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: var(--fh-neon-yellow);
    font-size: 0.68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
    backdrop-filter: blur(6px);
    z-index: 3;
}

.fh-game-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(11, 15, 26, 0.7) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
}

.fh-game-card:hover::after { opacity: 1; }

.fh-game-body {
    padding: 14px 16px 16px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--fh-bg-card);
    position: relative;
    z-index: 3;
}

.fh-game-name {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 2.2em;
    color: var(--fh-text);
}

.fh-game-desc {
    color: var(--fh-text-soft);
    font-size: 0.7rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fh-game-card--cover .fh-game-body { display: none; }
.fh-game-card--cover .fh-game-thumb { aspect-ratio: 4 / 5; }
.fh-game-card--compact { border-radius: var(--fh-radius-sm); }
.fh-game-card--compact .fh-game-thumb { aspect-ratio: 3 / 4; }
.fh-game-card--compact .fh-game-name {
    font-size: 0.75rem;
    min-height: auto;
    -webkit-line-clamp: 1;
}

/* --- Breadcrumb navigation --- */
.fh-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 0;
    margin-bottom: 18px;
    font-size: 0.8rem;
    color: var(--fh-text-soft);
    flex-wrap: wrap;
}

.fh-breadcrumb a {
    color: var(--fh-primary);
    text-decoration: none;
    transition: var(--fh-ease);
}

.fh-breadcrumb a:hover { color: var(--fh-neon-purple); text-shadow: 0 0 8px rgba(var(--fh-primary-rgb), 0.3); }

.fh-breadcrumb-sep {
    color: var(--fh-text-soft);
    font-size: 0.7rem;
    opacity: 0.5;
}

/* --- Game detail page layout --- */
.fh-game-detail {
    padding: 8px 0 24px;
}

.fh-game-detail-main {
    display: flex;
    gap: 28px;
    background: var(--fh-bg-card);
    border-radius: var(--fh-radius-lg);
    padding: 24px;
    margin-bottom: 28px;
    border: 1px solid var(--fh-border);
    box-shadow: var(--fh-shadow);
    position: relative;
    overflow: hidden;
}

.fh-game-detail-main::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--fh-primary), var(--fh-neon-purple), var(--fh-accent));
    opacity: 0.6;
}

.fh-game-detail-cover {
    width: 230px;
    flex-shrink: 0;
    border-radius: var(--fh-radius);
    overflow: hidden;
    box-shadow: var(--fh-shadow);
    border: 1px solid var(--fh-border);
}

.fh-game-detail-cover img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    display: block;
}

.fh-game-detail-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.fh-game-detail-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--fh-text);
    margin-bottom: 12px;
    line-height: 1.3;
}

.fh-game-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.fh-tag {
    display: inline-block;
    background: rgba(var(--fh-primary-rgb), 0.1);
    color: var(--fh-primary);
    padding: 5px 14px;
    border-radius: var(--fh-radius-full);
    font-size: 0.74rem;
    font-weight: 600;
    border: 1px solid rgba(var(--fh-primary-rgb), 0.15);
}

.fh-tag--date {
    background: rgba(var(--fh-neon-green-rgb), 0.1);
    color: var(--fh-neon-green);
    border-color: rgba(var(--fh-neon-green-rgb), 0.15);
}

.fh-game-detail-desc {
    color: var(--fh-text-mid);
    font-size: 0.9rem;
    line-height: 1.85;
    margin-bottom: 20px;
}

.fh-play-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 36px;
    background: linear-gradient(135deg, var(--fh-primary), var(--fh-neon-purple));
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    border-radius: var(--fh-radius-full);
    transition: var(--fh-ease);
    width: fit-content;
    box-shadow: 0 4px 20px rgba(var(--fh-primary-rgb), 0.3);
    text-decoration: none;
}

.fh-play-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(var(--fh-primary-rgb), 0.45);
}

/* --- Quick info chips below game detail --- */
.fh-detail-info-bar {
    display: flex;
    gap: 14px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.fh-detail-info-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: var(--fh-bg-card);
    border: 1px solid var(--fh-border);
    border-radius: var(--fh-radius);
    font-size: 0.82rem;
    color: var(--fh-text-mid);
    flex: 1;
    min-width: 140px;
    transition: var(--fh-ease);
}

.fh-detail-info-chip:hover {
    border-color: rgba(var(--fh-primary-rgb), 0.2);
}

.fh-detail-info-chip-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.fh-detail-info-chip strong {
    color: var(--fh-text);
    font-weight: 600;
}

/* --- How-to-play and tips sections --- */
.fh-detail-sections {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.fh-detail-section-card {
    background: var(--fh-bg-card);
    border-radius: var(--fh-radius);
    padding: 24px;
    border: 1px solid var(--fh-border);
    transition: var(--fh-ease);
}

.fh-detail-section-card:hover {
    border-color: rgba(var(--fh-primary-rgb), 0.15);
}

.fh-detail-section-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--fh-text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fh-detail-section-card h3 span {
    font-size: 1.1rem;
}

.fh-detail-section-card p {
    color: var(--fh-text-mid);
    font-size: 0.86rem;
    line-height: 1.8;
}

/* --- Related games carousel --- */
.fh-detail-related {
    background: var(--fh-bg-card);
    border-radius: var(--fh-radius-lg);
    padding: 24px;
    border: 1px solid var(--fh-border);
    margin-bottom: 28px;
}

.fh-detail-related-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--fh-text);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.fh-detail-related-title span { font-size: 1.1rem; }

/* --- Content blocks (game sections) --- */
.fh-game-section {
    background: var(--fh-bg-card);
    border-radius: var(--fh-radius);
    padding: 28px;
    margin-bottom: 24px;
    border: 1px solid var(--fh-border);
}

.fh-game-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--fh-text);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--fh-border);
    position: relative;
}

.fh-game-section-title::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, var(--fh-primary), transparent);
}

.fh-game-section-content {
    color: var(--fh-text);
    font-size: 0.9rem;
    line-height: 1.85;
}

.fh-game-section-content p { margin-bottom: 14px; }

.fh-game-section-content ul,
.fh-game-section-content ol {
    padding-left: 22px;
    margin-bottom: 14px;
}

.fh-game-section-content li { margin-bottom: 8px; list-style: disc; }
.fh-game-section-content ol li { list-style: decimal; }
.fh-game-section-content strong { color: var(--fh-primary); }

/* --- Legal / article pages --- */
.fh-article {
    max-width: 860px;
    margin: 0 auto;
    background: var(--fh-bg-card);
    border-radius: var(--fh-radius);
    padding: 38px;
    border: 1px solid var(--fh-border);
    box-shadow: var(--fh-shadow);
}

.fh-article h1 {
    font-size: 1.6rem;
    color: var(--fh-text);
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--fh-border);
    font-weight: 800;
}

.fh-article h1::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--fh-primary), var(--fh-neon-purple));
    margin-top: 10px;
    border-radius: 2px;
}

.fh-article h2 {
    font-size: 1.15rem;
    color: var(--fh-text);
    margin: 28px 0 12px;
    padding-left: 16px;
    border-left: 3px solid var(--fh-primary);
    font-weight: 700;
}

.fh-article h3 {
    font-size: 1rem;
    color: var(--fh-text);
    margin: 20px 0 10px;
    font-weight: 600;
}

.fh-article p {
    color: var(--fh-text-mid);
    font-size: 0.9rem;
    line-height: 1.9;
    margin-bottom: 14px;
}

.fh-article ul, .fh-article ol {
    padding-left: 24px;
    margin-bottom: 14px;
}

.fh-article li {
    font-size: 0.9rem;
    line-height: 1.8;
    margin-bottom: 8px;
    list-style: disc;
    color: var(--fh-text-mid);
}

.fh-article ol li { list-style: decimal; }
.fh-article a { color: var(--fh-primary); text-decoration: underline; }
.fh-article a:hover { color: var(--fh-neon-purple); }
.fh-article strong { color: var(--fh-text); }

.fh-article-date {
    color: var(--fh-text-soft);
    font-size: 0.82rem;
    margin-bottom: 20px;
}

.fh-contact-email {
    display: inline-block;
    background: rgba(var(--fh-primary-rgb), 0.08);
    color: var(--fh-primary);
    padding: 8px 18px;
    border-radius: var(--fh-radius-sm);
    font-weight: 600;
    margin: 8px 0 14px;
    border: 1px solid rgba(var(--fh-primary-rgb), 0.15);
    font-size: 0.88rem;
}

/* --- FAQ accordion --- */
.fh-faq-item {
    border: 1px solid var(--fh-border);
    border-radius: var(--fh-radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
    transition: var(--fh-ease);
    background: var(--fh-bg-card);
}

.fh-faq-item:hover { border-color: rgba(var(--fh-primary-rgb), 0.2); }

.fh-faq-question {
    width: 100%;
    padding: 16px 22px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--fh-text);
    font-size: 0.9rem;
    font-weight: 600;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--fh-ease);
}

.fh-faq-question:hover { background: rgba(var(--fh-primary-rgb), 0.05); }

.fh-faq-question::after {
    content: "+";
    font-size: 1.3rem;
    color: var(--fh-primary);
    transition: transform 0.3s;
    font-weight: 300;
}

.fh-faq-item.is-open .fh-faq-question::after { transform: rotate(45deg); }

.fh-faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.fh-faq-item.is-open .fh-faq-answer { max-height: 600px; }

.fh-faq-answer-inner {
    padding: 18px 22px;
    color: var(--fh-text-mid);
    font-size: 0.88rem;
    line-height: 1.85;
    background: var(--fh-bg-card);
    border-top: 1px solid var(--fh-border);
}

/* --- Site footer --- */
.fh-footer {
    background: rgba(11, 15, 26, 0.9);
    border-top: 1px solid var(--fh-border);
    padding: 48px 0 24px;
    margin-top: 60px;
    backdrop-filter: blur(10px);
}

.fh-footer-inner {
    max-width: var(--fh-max-w);
    margin: 0 auto;
    padding: 0 28px;
}

.fh-footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 36px;
    margin-bottom: 36px;
}

.fh-footer-brand {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.fh-footer-brand-name {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--fh-text);
    font-size: 1.2rem;
    font-weight: 800;
}

.fh-footer-brand-name img {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.fh-footer-brand-desc {
    color: var(--fh-text-soft);
    font-size: 0.84rem;
    line-height: 1.75;
}

.fh-footer-col-title {
    color: var(--fh-text);
    font-size: 0.78rem;
    font-weight: 700;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.fh-footer-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fh-footer-links a {
    color: var(--fh-text-soft);
    font-size: 0.82rem;
    transition: var(--fh-ease);
}

.fh-footer-links a:hover {
    color: var(--fh-primary);
    padding-left: 6px;
}

.fh-footer-bottom {
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid var(--fh-border);
    color: var(--fh-text-soft);
    font-size: 0.78rem;
    line-height: 1.8;
}

.fh-footer-bottom a { color: var(--fh-text-mid); }
.fh-footer-bottom a:hover { color: var(--fh-primary); }

/* --- 404 error page --- */
.fh-error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px;
    min-height: 55vh;
}

.fh-error-code {
    font-size: 7rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--fh-primary), var(--fh-accent), var(--fh-neon-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
    margin-bottom: 16px;
    text-shadow: 0 0 40px rgba(var(--fh-primary-rgb), 0.2);
}

.fh-error-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--fh-text);
    margin-bottom: 12px;
}

.fh-error-desc {
    color: var(--fh-text-mid);
    font-size: 0.92rem;
    margin-bottom: 30px;
    max-width: 460px;
}

.fh-error-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--fh-primary), var(--fh-neon-purple));
    color: #fff;
    font-weight: 600;
    border-radius: var(--fh-radius-full);
    transition: var(--fh-ease);
    font-size: 0.9rem;
    box-shadow: 0 4px 20px rgba(var(--fh-primary-rgb), 0.3);
}

.fh-error-home-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(var(--fh-primary-rgb), 0.45);
}

/* --- Back-to-top button --- */
.fh-back-top {
    position: fixed;
    right: 24px;
    bottom: 74px;
    display: none;
    flex-direction: column;
    gap: 12px;
    z-index: 50;
}

.fh-back-top.is-visible { display: flex; }

.fh-back-btn {
    width: 44px;
    height: 44px;
    background: var(--fh-bg-card);
    border: 1px solid var(--fh-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--fh-ease);
    box-shadow: var(--fh-shadow);
}

.fh-back-btn:hover {
    background: rgba(var(--fh-primary-rgb), 0.1);
    border-color: rgba(var(--fh-primary-rgb), 0.3);
    transform: translateY(-3px);
    box-shadow: var(--fh-glow-primary);
}

.fh-back-btn img {
    width: 20px;
    height: 20px;
    filter: invert(1) brightness(0.8);
}

/* --- Iframe game player --- */
.fh-iframe-wrap {
    position: relative;
    width: 100%;
    height: 100vh;
    background: #000;
}

.fh-iframe-back {
    position: fixed;
    top: 14px;
    left: 14px;
    width: 44px;
    height: 44px;
    background: rgba(19, 24, 41, 0.9);
    border: 1px solid var(--fh-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 999;
    transition: var(--fh-ease);
    box-shadow: var(--fh-shadow);
    backdrop-filter: blur(10px);
}

.fh-iframe-back:hover {
    background: rgba(var(--fh-primary-rgb), 0.15);
    border-color: rgba(var(--fh-primary-rgb), 0.3);
}

.fh-iframe-back img { width: 22px; height: 22px; filter: invert(1) brightness(0.8); }

.fh-game-iframe {
    display: block;
    width: 100%;
    height: 100vh;
    border: 0;
    overflow: hidden;
}

/* --- Animations --- */
@keyframes fh-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.fh-fade-in { animation: fh-fade-in 0.5s ease-out; }

@keyframes fh-glow-pulse {
    0%, 100% { box-shadow: 0 0 15px rgba(var(--fh-primary-rgb), 0.1); }
    50% { box-shadow: 0 0 25px rgba(var(--fh-primary-rgb), 0.2); }
}

/* --- Utility helpers --- */
.fh-text-center { text-align: center; }
.fh-mt-2 { margin-top: 16px; }
.fh-mb-2 { margin-bottom: 16px; }

/* --- Tablet breakpoint --- */
@media (max-width: 1024px) {
    .fh-game-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }

    .fh-game-detail-main {
        flex-direction: column;
        align-items: center;
    }

    .fh-game-detail-cover {
        width: 190px;
    }

    .fh-detail-sections {
        grid-template-columns: 1fr;
    }

    .fh-detail-info-bar {
        flex-wrap: wrap;
    }

    .fh-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 28px;
    }
}

/* --- Mobile breakpoint --- */
@media (max-width: 768px) {
    .fh-topbar { display: flex; }

    .fh-sidebar {
        transform: translateX(-100%);
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }

    .fh-sidebar.is-open {
        transform: translateX(0);
    }

    .fh-main-wrapper {
        margin-left: 0;
        padding-top: 60px;
    }

    .fh-container { padding: 0 14px; }

    .fh-game-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .fh-game-grid--compact {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .fh-game-body { padding: 10px 12px 12px; }
    .fh-game-name { font-size: 0.74rem; min-height: 2em; }
    .fh-game-desc { display: none; }
    .fh-game-tag { font-size: 0.56rem; padding: 3px 7px; }

    .fh-section { margin-bottom: 32px; }
    .fh-section-head { margin-bottom: 16px; }
    .fh-section-title { font-size: 1rem; }
    .fh-section-more { font-size: 0.72rem; padding: 5px 12px; }

    .fh-game-detail-main {
        flex-direction: column;
        align-items: center;
        padding: 18px;
        gap: 18px;
    }

    .fh-game-detail-cover {
        width: 160px;
    }

    .fh-game-detail-cover img { aspect-ratio: 3 / 4; }
    .fh-game-detail-meta { align-items: center; text-align: center; }
    .fh-game-detail-title { font-size: 1.2rem; margin-bottom: 10px; }
    .fh-game-detail-tags { justify-content: center; margin-bottom: 12px; }
    .fh-game-detail-desc { font-size: 0.85rem; line-height: 1.7; margin-bottom: 16px; }
    .fh-play-btn { width: 100%; max-width: none; padding: 13px 28px; font-size: 0.9rem; }

    .fh-detail-info-bar { gap: 10px; flex-wrap: wrap; }
    .fh-detail-info-chip { padding: 10px 14px; font-size: 0.78rem; min-width: 0; flex: 1 1 45%; }
    .fh-detail-sections { grid-template-columns: 1fr; gap: 14px; }
    .fh-detail-section-card { padding: 18px; }
    .fh-detail-related { padding: 18px; }

    .fh-breadcrumb {
        font-size: 0.74rem;
        gap: 6px;
        padding: 10px 0;
        margin-bottom: 14px;
    }

    .fh-footer-brand-desc { font-size: 0.8rem; }
    .fh-footer-col-title { font-size: 0.74rem; }

    .fh-article { padding: 20px; }
    .fh-article h1 { font-size: 1.25rem; }
    .fh-article h2 { font-size: 1rem; }
    .fh-article p { font-size: 0.85rem; line-height: 1.75; }
    .fh-article li { font-size: 0.85rem; }

    .fh-footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .fh-error-code { font-size: 4.5rem; }
    .fh-error-title { font-size: 1.1rem; }
    .fh-back-top { right: 14px; bottom: 64px; }
    .fh-back-btn { width: 42px; height: 42px; }
    .fh-back-btn img { width: 18px; height: 18px; }

    .fh-game-detail-desc,
    .fh-article p,
    .fh-article li {
        overflow-wrap: break-word;
        word-break: break-word;
    }

    /* --- Mobile: Sidebar drawer improvements --- */
    .fh-sidebar-brand {
        padding: 16px 16px;
    }

    .fh-sidebar-link {
        padding: 12px 14px;
        min-height: 44px;
    }

    .fh-sidebar-footer {
        padding: 14px 16px;
    }

    /* --- Mobile: Topbar touch targets --- */
    .fh-topbar-toggle {
        width: 42px;
        height: 42px;
    }
}

/* --- Extra-small screens --- */
@media (max-width: 380px) {
    .fh-container { padding: 0 10px; }
    .fh-footer-grid { grid-template-columns: 1fr; gap: 20px; }
    .fh-game-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .fh-game-grid--compact { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .fh-detail-info-chip { flex: 1 1 100%; }
    .fh-topbar { padding: 0 10px; }
    .fh-topbar-title { font-size: 1rem; }
}
