/* ── Reset ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --teal:        #0dd3c5;
    --teal-dark:   #09aaa3;
    --accent:      #2563eb;
    --text:        #1e293b;
    --text-muted:  #64748b;
    --border:      #e2e8f0;
    --card:        #ffffff;
    --font:        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --radius:      14px;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: url('/assets/img/new-bg-2.jpg') center center / cover fixed;
    min-height: 100vh;
    color: var(--text);
}


a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ── Nav Card (grid cell) ────────────────────────── */
.pm-nav-card {
    background: #fff !important;
    display: flex !important;
    flex-direction: column;
    padding: 0;
    cursor: default;
    overflow: hidden;
    outline: none;
}

.pm-nav-card::after { display: none; }
.pm-nav-card:hover { transform: none !important; box-shadow: none !important; z-index: auto; }

.pm-nav-top {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    position: relative;
    background:
        linear-gradient(rgba(248,250,252,0.55), rgba(248,250,252,0.55)),
        url('/assets/img/new-bg.jpg') center/cover;
    overflow: hidden;
}

.pm-nav-logo {
    font-size: 1.1rem;
    font-weight: 900;
    color: #1e293b;
    text-decoration: none;
    letter-spacing: -0.02em;
    line-height: 1;
    text-shadow: none;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.pm-nav-pig {
    width: 54px !important;
    height: 54px !important;
    max-width: 54px !important;
    max-height: 54px !important;
    object-fit: contain;
    flex-shrink: 0;
    display: inline-block;
}

.pm-nav-bottom {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex-shrink: 0;
    height: 44px;
    background: #6aaa6a;
    margin-top: auto;
}

.pm-nav-btn {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.05rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.pm-nav-btn:first-child {
    border-right: 1px solid rgba(0,0,0,0.12);
}

.pm-nav-btn:hover { background: rgba(0,0,0,0.1); }

/* ── Search Overlay ──────────────────────────────── */
.pm-search-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    align-items: flex-start;
    justify-content: center;
    padding-top: 80px;
    backdrop-filter: blur(6px);
}

.pm-search-overlay.active { display: flex; }

.pm-search-box {
    width: min(560px, 90vw);
    background: #fff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    padding: 14px 18px;
    gap: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}

.pm-search-box i { color: #94a3b8; font-size: 1rem; flex-shrink: 0; }

.pm-search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.05rem;
    color: #1e293b;
    font-family: var(--font);
}

.pm-search-box input::placeholder { color: #94a3b8; }

#pm-search-close {
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: background 0.15s;
}

#pm-search-close:hover { background: #e2e8f0; }

/* ── Search Overlay ──────────────────────────────── */
.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    display: none;
    flex-direction: column;
    align-items: center;
    padding-top: 80px;
    backdrop-filter: blur(4px);
}

.search-overlay.active { display: flex; }

.search-overlay-box {
    background: #fff;
    border-radius: 16px;
    width: min(640px, 90vw);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.search-overlay-input {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
    border-bottom: 1px solid var(--border);
}

.search-overlay-input i { color: var(--text-muted); font-size: 1.1rem; }

.search-overlay-input input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.05rem;
    color: var(--text);
    font-family: var(--font);
}

.search-overlay-input input::placeholder { color: var(--text-muted); }

.search-close-btn {
    background: #f1f5f9;
    border: none;
    border-radius: 8px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: var(--font);
    transition: background 0.15s;
}

.search-close-btn:hover { background: #e2e8f0; }

.search-results {
    max-height: 420px;
    overflow-y: auto;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 6px;
}

.search-results .sr-card {
    border-radius: 10px;
    overflow: hidden;
    display: block;
    background: #f8fafc;
    transition: transform 0.15s;
}

.search-results .sr-card:hover { transform: scale(1.04); }

.search-results .sr-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.search-results .sr-card span {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.search-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ── Skeleton Loading ────────────────────────────── */
@keyframes skeleton-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

.skeleton {
    background: linear-gradient(90deg,
        rgba(255,255,255,0.12) 25%,
        rgba(255,255,255,0.28) 50%,
        rgba(255,255,255,0.12) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.game-card img {
    opacity: 1;
    transition: opacity 0.35s ease;
}

/* ── Masonry Game Grid ───────────────────────────── */
.masonry-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    grid-auto-rows: 120px;
    gap: 6px;
    padding: 24px 120px;
    grid-auto-flow: dense;
}

@media (max-width: 1200px) {
    .masonry-grid { padding: 6px 60px; }
}

@media (max-width: 900px) {
    .masonry-grid { padding: 6px 24px; }
}

.game-card {
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    display: block;
    background: #ccc;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.22), 0 1px 3px rgba(0,0,0,0.14);
    transition: transform 0.18s, box-shadow 0.18s;
}

.game-card:hover {
    transform: scale(1.04);
    box-shadow: 0 10px 32px rgba(0,0,0,0.32), 0 3px 8px rgba(0,0,0,0.18);
    z-index: 2;
}

.game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Diagonal shine on XL cards ─────────────────── */
@keyframes shine-sweep {
    0%   { left: -70%; opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { left: 130%; opacity: 0; }
}

.game-card-xl.shining::before {
    content: '';
    position: absolute;
    top: 0;
    left: -70%;
    width: 55%;
    height: 100%;
    background: linear-gradient(
        115deg,
        transparent 20%,
        rgba(255,255,255,0.38) 50%,
        transparent 80%
    );
    z-index: 5;
    pointer-events: none;
    border-radius: var(--radius);
    animation: shine-sweep 1.1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Inner vignette on every card */
.game-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.38);
    pointer-events: none;
    z-index: 1;
}

.game-card-xl {
    grid-column: span 2;
    grid-row: span 2;
}

.gc-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: flex-end;
    padding: 8px;
    z-index: 2;
}

.game-card:hover .gc-overlay { opacity: 1; }

.gc-title {
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

.game-card-xl .gc-title { font-size: 0.9rem; }

.gc-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.92);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    transition: opacity 0.2s, transform 0.2s;
    z-index: 3;
}

.game-card:hover .gc-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* Fav button on card */
.gc-rating { display: none; }
.gc-rating-hidden {
    position: absolute;
    top: 6px;
    left: 6px;
    background: rgba(0,0,0,0.28);
    color: #fbbf24;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 3px 6px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 3px;
    z-index: 3;
    backdrop-filter: blur(4px);
    line-height: 1;
}
.gc-rating i { font-size: 0.55rem; }

.gc-fav-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    background: rgba(255,255,255,0.88);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    color: var(--text-muted);
    z-index: 3;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s;
}

.game-card:hover .gc-fav-btn { opacity: 1; }
.gc-fav-btn.is-fav { opacity: 1; color: #ef4444; }
.gc-fav-btn:hover { color: #ef4444; background: #fff; }

/* ── Footer wave transition ──────────────────────── */
.footer-wave {
    display: block;
    line-height: 0;
    margin-top: 8px;
}

.footer-wave svg {
    width: 100%;
    height: 80px;
    display: block;
}

/* ── Footer ─────────────────────────────────────── */
.site-footer {
    background: #fff;
    display: flex;
    align-items: stretch;
    min-height: 280px;
    position: relative;
    overflow: hidden;
}

/* Left panel background (light tint behind diagonal) */
.site-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 46%;
    background: #f0f6ff;
    clip-path: polygon(0 0, 100% 0, 80% 100%, 0 100%);
    z-index: 0;
}

.footer-left {
    position: relative;
    z-index: 1;
    padding: 48px 60px 48px 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    min-width: 360px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo-icon { font-size: 2rem; }

.footer-logo-text {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--text);
}

.footer-tagline {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}

.footer-socials {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.footer-social-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--text);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    text-decoration: none;
    transition: background 0.15s, transform 0.15s;
}

.footer-social-btn:hover {
    background: var(--accent);
    transform: scale(1.08);
}

/* Diagonal separator */
.footer-sep {
    position: relative;
    z-index: 1;
    width: 80px;
    flex-shrink: 0;
}

/* Right: link columns */
.footer-right {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    gap: 64px;
    padding: 48px 80px 48px 60px;
    align-items: flex-start;
}

.footer-col h4 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.footer-col a {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    text-decoration: none;
    transition: color 0.15s;
}

.footer-col a:hover { color: var(--accent); }

@media (max-width: 900px) {
    .site-footer { flex-direction: column; }
    .site-footer::before { display: none; }
    .footer-left { padding: 40px 24px; min-width: unset; }
    .footer-sep  { display: none; }
    .footer-right { padding: 32px 24px 40px; gap: 32px; flex-wrap: wrap; }
}

/* ── Game Player Page ────────────────────────────── */
.gp-page-body {
    background: #fff;
    min-height: 100vh;
}

.gp-page-body .floating-header { position: fixed; }

.gp-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px 20px 48px;
    display: grid;
    grid-template-columns: 150px 1fr 150px;
    gap: 14px;
    align-items: start;
    padding-top: 20px;
}

.gp-sidebar {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 10px;
}

.gp-sidebar-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2px;
}

.gp-side-card {
    display: block;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.15s;
    background: #f1f5f9;
}

.gp-side-card:hover { transform: scale(1.04); }

.gp-side-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.gp-side-card span {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 4px 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
}

.gp-center { display: flex; flex-direction: column; gap: 12px; }

.gp-game-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
}

.gp-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.gp-cat-badge {
    background: #eff6ff;
    color: var(--accent);
    border-radius: 6px;
    padding: 3px 10px;
    font-weight: 700;
    font-size: 0.76rem;
    text-transform: capitalize;
}

.gp-fullscreen-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.gp-fullscreen-btn:hover { background: #0ea5e9; }

.gp-frame-wrap {
    width: 100%;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.gp-frame-wrap iframe {
    width: 100%;
    aspect-ratio: 4/3;
    border: none;
    display: block;
}

.gp-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* ── Favourites / Static Pages ───────────────────── */
.page-body {
    background: #fff;
    min-height: 100vh;
}

.page-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 24px 48px;
}

.page-wrap .section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

.page-wrap .section-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
}

.favs-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.favs-empty .big-icon { font-size: 3.5rem; margin-bottom: 16px; }

/* ── Popup ───────────────────────────────────────── */
.edu-popup-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s;
    backdrop-filter: blur(4px);
}
.edu-popup-overlay.active { opacity: 1; pointer-events: auto; }
.edu-popup-box {
    background: #fff; border-radius: 16px; padding: 28px;
    max-width: 400px; width: 92%; transform: scale(0.9);
    transition: transform 0.3s; box-shadow: 0 16px 50px rgba(0,0,0,0.2); text-align: center;
}
.edu-popup-overlay.active .edu-popup-box { transform: scale(1); }
.edu-popup-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 10px; }
.edu-popup-msg { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 20px; line-height: 1.6; }
.edu-popup-btn {
    background: var(--accent); color: #fff; border: none;
    padding: 10px 28px; border-radius: 8px; font-size: 0.92rem; font-weight: 700; cursor: pointer;
}
.edu-popup-info    { border-top: 4px solid #3b82f6; }
.edu-popup-success { border-top: 4px solid #10b981; }
.edu-popup-warning { border-top: 4px solid #f59e0b; }
.edu-popup-danger  { border-top: 4px solid #ef4444; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 900px) {
    .gp-wrap { grid-template-columns: 1fr; }
    .gp-sidebar { flex-direction: row; flex-wrap: wrap; }
    .gp-sidebar-title { width: 100%; }
    .gp-side-card { width: calc(25% - 5px); min-width: 70px; }
    .footer-top { gap: 32px; }
    .footer-cols { gap: 32px; justify-content: flex-start; }
    .cats-section, .seo-section, .site-footer { padding: 32px 24px; }
}

@media (max-width: 600px) {
    .pm-nav-pig { width: 18px !important; height: 18px !important; max-width: 18px !important; max-height: 18px !important; }
    .pm-nav-logo { font-size: 0.85rem !important; }

    .masonry-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        grid-auto-rows: 90px;
        gap: 4px;
        padding: 14px 14px 4px;
    }
    .floating-header { top: 8px; left: 8px; padding: 8px; border-radius: 14px; }
    .float-logo-text { display: none; }
    .cats-section, .seo-section, .site-footer { padding: 24px 16px; }
    .footer-top { gap: 24px; }
}
