/* ============================================================
   SafeBlox — style.css
   Aesthetic: clean gaming platform, inspired by block-building
   culture but distinctly original. Dark navy header, bright
   accent, card-based layout, sharp geometry.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Outfit:wght@400;500;600;700&display=swap');

/* ---- CSS Variables ---- */
:root {
    --bg:           #f4f5f7;
    --surface:      #ffffff;
    --surface2:     #eef0f4;
    --nav-bg:       #0f1923;
    --nav-border:   #1e2d3d;
    --accent:       #00b4d8;
    --accent-dark:  #0096b7;
    --accent2:      #ff6b35;
    --text:         #1a1f2e;
    --text-muted:   #6b7280;
    --border:       #e2e5ea;
    --card-shadow:  0 2px 12px rgba(0,0,0,0.08);
    --card-hover:   0 8px 28px rgba(0,0,0,0.15);
    --radius:       12px;
    --radius-sm:    8px;
    --font-head:    'Nunito', sans-serif;
    --font-body:    'Outfit', sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
a { text-decoration: none; }

/* ---- Base ---- */
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
    font-size: 15px;
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
header {
    background: var(--nav-bg);
    border-bottom: 2px solid var(--nav-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 62px;
    display: flex;
    align-items: center;
    gap: 28px;
}

/* Logo */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 900;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.nav-logo__icon {
    width: 34px;
    height: 34px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    box-shadow: 0 0 0 3px rgba(0,180,216,0.25);
}

.nav-logo span { color: var(--accent); }

/* Nav links */
.nav-links {
    display: flex;
    gap: 4px;
    list-style: none;
    flex-shrink: 0;
}

.nav-links a {
    color: #b0bec5;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.nav-links a.active {
    color: var(--accent);
}

/* Search in nav */
.nav-search {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

/* Hide the nav search — we use hero search instead */
/* We keep the form in PHP but visually use hero */

/* ============================================================
   MAIN
   ============================================================ */
main { flex: 1; }

/* ============================================================
   HERO SEARCH
   ============================================================ */
.hero-search {
    background: linear-gradient(135deg, #0f1923 0%, #1a2d42 60%, #0f2744 100%);
    padding: 52px 24px 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-search::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(0,180,216,0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 30%, rgba(255,107,53,0.08) 0%, transparent 40%);
    pointer-events: none;
}

/* Decorative blocks */
.hero-search::after {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 160px;
    height: 160px;
    border: 2px solid rgba(0,180,216,0.15);
    border-radius: 20px;
    transform: rotate(20deg);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.hero-title {
    font-family: var(--font-head);
    font-size: 36px;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.hero-sub {
    color: rgba(255,255,255,0.55);
    font-size: 15px;
    margin-bottom: 28px;
    font-weight: 400;
}

.search-form {
    display: flex;
    gap: 10px;
    width: 100%;
}

.search-wrap {
    flex: 1;
    position: relative;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-wrap input {
    width: 100%;
    padding: 13px 16px 13px 42px;
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.07);
    color: #fff;
    font-family: var(--font-body);
    font-size: 15px;
    transition: border-color 0.2s, background 0.2s;
    outline: none;
}

.search-wrap input::placeholder { color: rgba(255,255,255,0.35); }

.search-wrap input:focus {
    border-color: var(--accent);
    background: rgba(255,255,255,0.1);
}

.btn-search {
    padding: 13px 24px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.1s;
}

.btn-search:hover { background: var(--accent-dark); }
.btn-search:active { transform: scale(0.97); }

/* ============================================================
   CONTENT WRAPPER
   ============================================================ */
.content-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 36px 24px 48px;
}

/* ============================================================
   SECTION LABELS
   ============================================================ */
.section-label {
    margin-bottom: 20px;
}

.section-label h3 {
    font-family: var(--font-head);
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

.section-label .highlight {
    color: var(--accent);
}

/* ============================================================
   GAME GRID
   ============================================================ */
.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.game-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ============================================================
   GAME CARD
   ============================================================ */
.game-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1.5px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: var(--text);
}

.game-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-hover);
    border-color: var(--accent);
}

.game-card__thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--surface2);
}

.game-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.game-card:hover .game-card__thumb img {
    transform: scale(1.06);
}

.game-card__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.38);
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s;
}

.game-card:hover .game-card__play {
    opacity: 1;
}

.game-card__info {
    padding: 12px 14px 14px;
}

.game-card__info h2 {
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 0 40px;
    flex-wrap: wrap;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.15s;
}

.pagination a:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(0,180,216,0.06);
}

.pagination a.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.pagination .pag-arrow {
    font-size: 16px;
    padding: 0 12px;
}

/* ============================================================
   NO RESULTS
   ============================================================ */
.no-results {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
}

.no-results__icon {
    color: #c8cdd6;
    margin-bottom: 16px;
}

.no-results h3 {
    font-family: var(--font-head);
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
}

.no-results p {
    font-size: 15px;
    line-height: 1.7;
    max-width: 360px;
    margin: 0 auto 24px;
}

.btn-clear {
    display: inline-block;
    padding: 10px 22px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14px;
    transition: background 0.2s;
}

.btn-clear:hover { background: var(--accent-dark); }

/* ============================================================
   FEATURED SECTIONS
   ============================================================ */
.featured-section {
    margin-top: 52px;
}

.featured-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    gap: 12px;
    flex-wrap: wrap;
}

.featured-header__left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.featured-header h3 {
    font-family: var(--font-head);
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
}

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.badge--daily {
    background: rgba(0,180,216,0.12);
    color: var(--accent-dark);
    border: 1.5px solid rgba(0,180,216,0.3);
}

.badge--hourly {
    background: rgba(255,107,53,0.1);
    color: var(--accent2);
    border: 1.5px solid rgba(255,107,53,0.3);
}

.featured-refresh {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    background: var(--nav-bg);
    border-top: 2px solid var(--nav-border);
    padding: 40px 24px 28px;
    font-size: 13px;
    color: #6b7c8d;
    margin-top: auto;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
    flex-wrap: wrap;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 20px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 900;
    color: #fff;
    margin-bottom: 4px;
}

.footer-logo .nav-logo__icon {
    width: 28px;
    height: 28px;
    font-size: 14px;
}

.footer-logo span { color: var(--accent); }

.footer-brand p {
    color: #4d6070;
    font-size: 13px;
    max-width: 280px;
    line-height: 1.6;
}

.footer-links-group {
    display: flex;
    gap: 48px;
    flex-wrap: wrap;
}

.footer-col h4 {
    color: #8fa3b1;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
    font-family: var(--font-body);
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-col a {
    color: #5a7082;
    font-size: 13px;
    transition: color 0.15s;
    font-weight: 500;
}

.footer-col a:hover { color: #fff; }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: flex-start;
}

.footer-disclaimer {
    color: #3d4f5e;
    font-size: 12px;
    max-width: 680px;
    line-height: 1.7;
}

.footer-disclaimer strong { color: #4d6070; }

.footer-copy {
    color: #3d4f5e;
    font-size: 12px;
    flex-shrink: 0;
    padding-top: 2px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
    .game-grid--4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .nav-inner {
        height: auto;
        padding: 14px 16px;
        flex-wrap: wrap;
        gap: 12px;
    }

    .nav-links {
        order: 3;
        width: 100%;
    }

    .hero-title { font-size: 26px; }
    .hero-search { padding: 36px 16px 32px; }

    .search-form { flex-direction: column; }
    .btn-search { width: 100%; }

    .content-wrap { padding: 24px 16px 40px; }

    .footer-top { flex-direction: column; gap: 24px; }
    .footer-links-group { gap: 28px; }
    .footer-bottom { flex-direction: column; }
}

@media (max-width: 540px) {
    .game-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .game-grid--4 { grid-template-columns: repeat(2, 1fr); }
    .hero-title { font-size: 22px; }
    .nav-logo { font-size: 18px; }
}