/**
 * FreeGame3 — portal theme (Poki-inspired)
 * Light canvas, blue accents, rounded tiles, horizontal game rows
 */
:root {
    --fg3-blue: #009cff;
    --fg3-blue-dark: #0080d4;
    --fg3-blue-soft: #e8f4ff;
    --fg3-ink: #002b50;
    --fg3-muted: #5c6b7a;
    --fg3-surface: #ffffff;
    --fg3-canvas: #f0f4f8;
    --fg3-border: #e2e8f0;
    --fg3-radius: 16px;
    --fg3-radius-sm: 12px;
    --fg3-shadow: 0 4px 14px rgba(0, 43, 80, 0.08);
    --fg3-shadow-hover: 0 8px 24px rgba(0, 156, 255, 0.22);
    --fg3-font: "Nunito", system-ui, -apple-system, sans-serif;
    /* legacy aliases */
    --fg3-primary: var(--fg3-blue);
    --fg3-accent: var(--fg3-blue-dark);
    --fg3-dark: var(--fg3-ink);
    --fg3-light: var(--fg3-canvas);
    --fg3-gradient: linear-gradient(135deg, #009cff 0%, #00c2ff 100%);
    --fg3-gradient-dark: linear-gradient(180deg, #fff 0%, #f0f4f8 100%);
    --spritted-primary: var(--fg3-blue);
    --spritted-accent: var(--fg3-blue-dark);
    --spritted-dark: var(--fg3-ink);
    --spritted-light: var(--fg3-canvas);
    --spritted-gradient: var(--fg3-gradient);
    --spritted-gradient-dark: var(--fg3-gradient-dark);
}

* {
    box-sizing: border-box;
}

body.fg3-poki {
    margin: 0;
    font-family: var(--fg3-font);
    background: var(--fg3-canvas);
    color: var(--fg3-ink);
    padding-top: 72px;
    -webkit-font-smoothing: antialiased;
}

@media (max-width: 991px) {
    body.fg3-poki {
        padding-top: 64px;
    }
}

/* ——— Header ——— */
.fg3-navbar {
    background: var(--fg3-surface) !important;
    border-bottom: 1px solid var(--fg3-border);
    box-shadow: 0 1px 0 rgba(0, 43, 80, 0.04);
    padding: 0.5rem 0;
}

.fg3-navbar .navbar-brand {
    padding: 0;
}

.fg3-navbar .logo-img {
    height: 40px;
    width: auto;
    max-width: 180px;
    filter: none;
}

.fg3-navbar .navbar-toggler {
    border-color: var(--fg3-border);
    padding: 0.35rem 0.55rem;
}

.fg3-navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='%23002b50' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 8h22M4 15h22M4 22h22'/%3E%3C/svg%3E") !important;
}

.fg3-navbar .nav-link {
    color: var(--fg3-ink) !important;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 999px;
    padding: 0.45rem 0.85rem !important;
}

.fg3-navbar .nav-link:hover,
.fg3-navbar .nav-link.active {
    background: var(--fg3-blue-soft);
    color: var(--fg3-blue-dark) !important;
    transform: none;
}

.fg3-search {
    flex: 1;
    max-width: 420px;
    margin: 0 1rem;
}

.fg3-search .form-control {
    border: 2px solid var(--fg3-border);
    border-right: none;
    border-radius: 999px 0 0 999px;
    background: var(--fg3-canvas);
    color: var(--fg3-ink);
    font-weight: 600;
    padding: 0.55rem 1rem;
    font-size: 0.95rem;
}

.fg3-search .form-control:focus {
    border-color: var(--fg3-blue);
    box-shadow: none;
    background: #fff;
}

.fg3-search .form-control::placeholder {
    color: #94a3b8;
}

.fg3-search .btn {
    border: 2px solid var(--fg3-border);
    border-left: none;
    border-radius: 0 999px 999px 0;
    background: var(--fg3-canvas);
    color: var(--fg3-blue);
    padding: 0 1rem;
}

.fg3-search .btn:hover {
    background: var(--fg3-blue);
    color: #fff;
    border-color: var(--fg3-blue);
}

.fg3-btn-ghost {
    border: 2px solid var(--fg3-border);
    color: var(--fg3-ink);
    font-weight: 700;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
    background: #fff;
}

.fg3-btn-ghost:hover {
    border-color: var(--fg3-blue);
    color: var(--fg3-blue);
    background: var(--fg3-blue-soft);
}

.fg3-btn-login {
    background: var(--fg3-blue);
    border: none;
    color: #fff !important;
    font-weight: 800;
    border-radius: 999px;
    padding: 0.45rem 1.1rem;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 156, 255, 0.35);
}

.fg3-btn-login:hover {
    background: var(--fg3-blue-dark);
    transform: translateY(-1px);
}

.dropdown-menu {
    border: 1px solid var(--fg3-border);
    border-radius: var(--fg3-radius-sm);
    box-shadow: var(--fg3-shadow);
}

.dropdown-item {
    font-weight: 600;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: var(--fg3-blue-soft);
    color: var(--fg3-blue-dark);
}

/* ——— Buttons (Bootstrap overrides) ——— */
.btn-primary {
    background: var(--fg3-blue);
    border: none;
    border-radius: 999px;
    font-weight: 800;
    padding: 0.55rem 1.25rem;
    text-transform: none;
    letter-spacing: 0;
    box-shadow: 0 4px 12px rgba(0, 156, 255, 0.3);
}

.btn-primary:hover {
    background: var(--fg3-blue-dark);
    transform: translateY(-1px);
}

.btn-outline-primary {
    border: 2px solid var(--fg3-blue);
    color: var(--fg3-blue);
    border-radius: 999px;
    font-weight: 700;
}

.btn-outline-primary:hover {
    background: var(--fg3-blue);
    border-color: var(--fg3-blue);
}

/* ——— Home & sections ——— */
.fg3-home-lead {
    font-size: 1.05rem;
    color: var(--fg3-muted);
    font-weight: 600;
    margin: 0;
}

.poki-section {
    margin-bottom: 2rem;
}

.poki-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
    padding: 0 0.15rem;
}

.poki-section-head h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--fg3-ink);
    margin: 0;
}

.poki-see-all {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--fg3-blue);
    text-decoration: none;
    white-space: nowrap;
}

.poki-see-all:hover {
    color: var(--fg3-blue-dark);
    text-decoration: underline;
}

.poki-scroll-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 2px 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--fg3-blue) transparent;
}

.poki-scroll-row::-webkit-scrollbar {
    height: 6px;
}

.poki-scroll-row::-webkit-scrollbar-thumb {
    background: var(--fg3-blue);
    border-radius: 999px;
}

.poki-tile {
    flex: 0 0 auto;
    width: 118px;
    scroll-snap-align: start;
    text-decoration: none;
    color: inherit;
}

@media (min-width: 768px) {
    .poki-tile {
        width: 132px;
    }
}

.poki-tile-thumb {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--fg3-radius);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--fg3-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.poki-tile:hover .poki-tile-thumb {
    transform: scale(1.06);
    box-shadow: var(--fg3-shadow-hover);
}

.poki-tile-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.poki-tile-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: linear-gradient(145deg, #b8e6ff, #009cff);
}

.poki-tile-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--fg3-ink);
    margin: 0.45rem 0 0;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: center;
}

/* Legacy grids (category/search) */
.games-landscape,
.games-square {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.game-card,
.card.game-card {
    border: none;
    border-radius: var(--fg3-radius);
    box-shadow: var(--fg3-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: #fff;
    overflow: hidden;
}

.game-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--fg3-shadow-hover);
}

.game-thumbnail,
.card-img-top.game-thumbnail {
    aspect-ratio: 1;
    background: var(--fg3-blue-soft);
    border-radius: var(--fg3-radius) var(--fg3-radius) 0 0;
    position: relative;
    overflow: hidden;
}

.game-thumbnail img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.game-placeholder {
    background: linear-gradient(145deg, #b8e6ff, #009cff) !important;
    color: #fff !important;
}

.section-title {
    font-weight: 800;
    color: var(--fg3-ink);
}

/* Category chips */
.fg3-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.fg3-category-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem 0.75rem;
    background: #fff;
    border-radius: var(--fg3-radius);
    box-shadow: var(--fg3-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: var(--fg3-ink);
}

.fg3-category-chip:hover {
    transform: translateY(-3px);
    box-shadow: var(--fg3-shadow-hover);
    color: var(--fg3-blue-dark);
}

.fg3-category-chip .chip-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.fg3-category-chip h5 {
    font-size: 0.95rem;
    font-weight: 800;
    margin: 0 0 0.25rem;
}

.fg3-category-chip small {
    color: var(--fg3-muted);
    font-weight: 600;
}

/* Page headers (category, etc.) */
.fg3-page-header,
.category-header {
    background: #fff !important;
    color: var(--fg3-ink) !important;
    padding: 1.5rem 0 1rem !important;
    margin-bottom: 0 !important;
    border-bottom: 1px solid var(--fg3-border);
}

.fg3-page-header::before,
.category-header::before {
    display: none !important;
}

.fg3-page-header h1,
.category-header h1 {
    font-weight: 800;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    color: var(--fg3-ink);
}

.fg3-page-header .lead,
.category-header .lead {
    color: var(--fg3-muted);
    font-weight: 600;
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 0.75rem !important;
    box-shadow: none;
}

.breadcrumb-item a {
    color: var(--fg3-blue);
    font-weight: 700;
}

.breadcrumb-item.active {
    color: var(--fg3-muted);
    font-weight: 600;
}

/* Game play page */
.game-container {
    background: #fff;
    border-radius: var(--fg3-radius);
    padding: 1.25rem;
    box-shadow: var(--fg3-shadow);
    margin-bottom: 1.5rem;
}

.game-page-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--fg3-ink);
    text-align: center;
    margin-bottom: 1rem;
}

.game-iframe-container {
    border-radius: var(--fg3-radius-sm);
    overflow: hidden;
    box-shadow: var(--fg3-shadow);
    background: #0a1628;
}

.rating-stars {
    color: #ffb800;
}

.card {
    border-radius: var(--fg3-radius);
    border: none;
    box-shadow: var(--fg3-shadow);
}

/* FAQ */
.faq-section .accordion-item {
    border: 1px solid var(--fg3-border);
    border-radius: var(--fg3-radius-sm) !important;
    margin-bottom: 8px;
    overflow: hidden;
}

.faq-section .accordion-button {
    font-weight: 700;
    color: var(--fg3-ink);
}

.faq-section .accordion-button:not(.collapsed) {
    background: var(--fg3-blue-soft);
    color: var(--fg3-blue-dark);
}

/* Footer */
.fg3-footer {
    background: #fff !important;
    color: var(--fg3-ink) !important;
    border-top: 1px solid var(--fg3-border);
    padding: 2.5rem 0 1.5rem !important;
    margin-top: 3rem !important;
}

.fg3-footer h5 {
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.fg3-footer a {
    color: var(--fg3-muted) !important;
    font-weight: 600;
    text-decoration: none;
}

.fg3-footer a:hover {
    color: var(--fg3-blue) !important;
}

.fg3-footer hr {
    border-color: var(--fg3-border);
    opacity: 1;
}

.fg3-footer .btn-outline-light {
    border-color: var(--fg3-border);
    color: var(--fg3-ink) !important;
}

.fg3-footer .btn-outline-light:hover {
    background: var(--fg3-blue-soft);
    border-color: var(--fg3-blue);
    color: var(--fg3-blue) !important;
}

.fg3-legal h2 {
    color: var(--fg3-ink);
    margin-top: 0.25rem;
}

.fg3-legal-card {
    background: #fff;
    border: 1px solid var(--fg3-border);
    border-radius: 16px;
    padding: 1.75rem;
    box-shadow: 0 4px 24px rgba(0, 43, 80, 0.06);
}

.fg3-link {
    color: var(--fg3-blue);
    font-weight: 700;
    text-decoration: none;
}

.fg3-link:hover {
    text-decoration: underline;
}

.fg3-contact-form .form-control:focus {
    border-color: var(--fg3-blue);
    box-shadow: 0 0 0 0.2rem rgba(0, 156, 255, 0.15);
}

/* Profile account tabs */
.profile-account-nav .nav-link.active {
    background: var(--fg3-blue) !important;
}

.btn-profile-save {
    background: var(--fg3-blue) !important;
}

.profile-panel-header {
    background: var(--fg3-ink) !important;
}

@media (prefers-reduced-motion: reduce) {
    .poki-tile-thumb,
    .game-card,
    .fg3-category-chip {
        transition: none;
    }
}
