:root {
    --primary: #2563eb;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --bg: #f8fafc;
    --card-bg: #ffffff;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    line-height: 1.6;
}

/* NAVBAR */
.navbar {
    background: #fff !important;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 0;
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}
.navbar-brand {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--text) !important;
}
.navbar-brand span { color: var(--primary); }
.nav-link {
    color: var(--text-muted) !important;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    padding: 0.4rem 0.7rem !important;
    transition: all 0.15s;
}
.nav-link:hover, .nav-link.active {
    color: var(--primary) !important;
    background: #eff6ff;
}
.navbar-toggler { border: 1px solid var(--border) !important; }

/* HERO */
.hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 60%, #3b82f6 100%);
    padding: 3.5rem 0 3rem;
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 50% 100% at 90% 50%, rgba(255,255,255,0.06) 0%, transparent 70%);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.75rem;
}
.hero h1 span { color: #93c5fd; }
.hero p.lead { color: rgba(255,255,255,0.82); font-size: 1.05rem; margin-bottom: 1.5rem; }
.hero-search {
    display: flex;
    gap: 0;
    max-width: 480px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.hero-search input {
    flex: 1;
    border: none;
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    outline: none;
    color: var(--text);
}
.hero-search button {
    background: var(--primary);
    border: none;
    color: #fff;
    padding: 0 1.25rem;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s;
}
.hero-search button:hover { background: #1d4ed8; }

/* CATEGORY NAV */
.cat-nav {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0;
    position: sticky;
    top: 57px;
    z-index: 100;
    overflow-x: auto;
    scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav .container { padding: 0 12px; }
.cat-nav-inner {
    display: flex;
    gap: 0;
    white-space: nowrap;
}
.cat-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.85rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    white-space: nowrap;
}
.cat-nav-link:hover { color: var(--primary); border-bottom-color: var(--primary); }
.cat-nav-link.active { color: var(--primary); border-bottom-color: var(--primary); }

/* SECTION */
.game-section { padding: 3rem 0; }

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.section-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}
.section-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.section-header .count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-left: auto;
}

/* GAME CARD */
.game-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    display: block;
    color: var(--text);
    transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
    height: 100%;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
    cursor: pointer;
}
.game-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(37,99,235,0.13);
    border-color: var(--primary);
}
/* Full-card clickable overlay (avoids nested <a> tags) */
.game-card-cover {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 14px;
}
/* Made-by link sits above the cover */
.made-by-link {
    position: relative;
    z-index: 2;
    cursor: pointer;
}
.made-by-link:hover { color: var(--primary); }
.game-card-thumb {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    background: #f1f5f9;
}
.game-card-thumb-placeholder {
    width: 100%;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}
.game-card-body {
    padding: 1rem;
}
.game-card-body h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    color: var(--text);
}
.game-card-body p {
    font-size: 0.825rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}
.game-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}
.game-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.55rem;
    border-radius: 50px;
    font-weight: 600;
}
.badge-free { background: #dcfce7; color: #16a34a; }
.badge-new  { background: #dbeafe; color: #2563eb; }
.made-by {
    font-size: 0.7rem;
    color: #94a3b8;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.made-by:hover { color: var(--primary); }

/* ADSENSE PLACEHOLDER */
.ad-slot {
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 0.8rem;
    text-align: center;
}
.ad-slot-banner { height: 90px; margin: 2rem 0; }
.ad-slot-rect { height: 250px; }

/* CTA BANNER */
.cta-banner {
    background: linear-gradient(135deg, #1d4ed8, #2563eb);
    border-radius: 20px;
    padding: 2.5rem;
    text-align: center;
    color: #fff;
    box-shadow: 0 8px 32px rgba(37,99,235,0.2);
}
.cta-banner h2 { font-weight: 700; margin-bottom: 0.5rem; }
.cta-banner p { color: rgba(255,255,255,0.85); margin-bottom: 1.5rem; }
.btn-cta {
    background: #fff;
    color: var(--primary);
    font-weight: 700;
    padding: 0.65rem 1.75rem;
    border-radius: 50px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: transform 0.15s, box-shadow 0.15s;
}
.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    color: #1d4ed8;
    text-decoration: none;
}

/* FOOTER */
footer {
    background: #1e293b;
    color: #94a3b8;
    padding: 2rem 0;
    font-size: 0.875rem;
    border-top: 1px solid #334155;
}
footer a { color: #94a3b8; text-decoration: none; }
footer a:hover { color: #fff; }
footer .brand { color: #fff; font-weight: 700; }

/* GAME CARD FEEDBACK BAR */
.game-card-feedback {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.85rem;
    border-top: 1px solid var(--border);
    background: #f8fafc;
    border-radius: 0 0 14px 14px;
}
.feedback-vote {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.18rem 0.55rem;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-muted);
    line-height: 1;
}
.feedback-vote:hover { border-color: var(--primary); color: var(--primary); background: #eff6ff; }
.feedback-vote.voted-like { background: #dcfce7; border-color: #16a34a; color: #16a34a; }
.feedback-vote.voted-dislike { background: #fee2e2; border-color: #dc2626; color: #dc2626; }
.feedback-share {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 0.18rem 0.55rem;
    font-size: 0.72rem;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text-muted);
    text-decoration: none;
    line-height: 1;
}
.feedback-share:hover { border-color: var(--primary); color: var(--primary); background: #eff6ff; }

/* SUGGEST FAB */
.suggest-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 0.65rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(37,99,235,0.35);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: transform 0.15s, box-shadow 0.15s;
}
.suggest-fab:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(37,99,235,0.4); }

/* TOAST */
.gs-toast {
    position: fixed;
    bottom: 5rem;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: #fff;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.85rem;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    white-space: nowrap;
}
.gs-toast.show { opacity: 1; }

/* HIDDEN by search */
.game-card.hidden { display: none; }

@media (max-width: 768px) {
    .hero { padding: 2.5rem 0 2rem; }
    .hero-search { max-width: 100%; }
    .game-section { padding: 2rem 0; }
    .cat-nav-inner { padding: 0 0.5rem; }
}
