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

* { box-sizing: border-box; }

/* Bootstrap btn-outline-primary contrast fix (#0d6efd on #f8fafc = 4.3:1, below AA) */
.btn-outline-primary {
    --bs-btn-color: #1d4ed8;
    --bs-btn-border-color: #1d4ed8;
    --bs-btn-hover-bg: #1d4ed8;
    --bs-btn-hover-border-color: #1d4ed8;
    --bs-btn-active-bg: #1d4ed8;
    --bs-btn-active-border-color: #1d4ed8;
}

/* Prevent double-tap zoom on mobile */
button, a, input, select, textarea, [role="button"] {
    touch-action: manipulation;
}

/* Game containers: prevent zoom and accidental text selection */
canvas, [id$="Game"], [id$="game"], [id$="Board"], [id$="board"],
[id$="Grid"], [id$="grid"] {
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

html, body {
    overflow-x: hidden;
}
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);
    position: sticky;
    top: 0;
    z-index: 1030;
    transition: transform 0.3s ease;
    overflow: visible;
}
.navbar.nav-hidden { transform: translateY(-100%); }
.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; }

/* Navbar search */
.nav-search {
    max-width: 220px;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.nav-search input {
    border: none !important;
    font-size: 0.8rem !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.nav-search button {
    border: none;
    border-radius: 0 !important;
    font-size: 0.8rem;
    padding: 0 0.6rem;
}
@media (max-width: 575.98px) {
    .nav-search { max-width: none; border: none; overflow: visible; }
    .nav-search input { display: none; }
    .nav-search button { border-radius: 8px !important; border: 1px solid var(--border); }
    .nav-search.open {
        position: absolute;
        left: 0; right: 0; top: 100%;
        max-width: none;
        padding: 0.5rem 1rem;
        background: #fff;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
        z-index: 200;
        display: flex;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }
    .nav-search.open input {
        display: block;
        flex: 1;
        font-size: 0.9rem !important;
        padding: 0.5rem 0.75rem !important;
        border: 1px solid var(--border) !important;
        border-radius: 8px 0 0 8px !important;
    }
    .nav-search.open button {
        border: 1px solid var(--primary);
        border-radius: 0 8px 8px 0 !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-desktop {
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0;
    position: sticky;
    top: 57px;
    z-index: 1025;
    overflow-x: auto;
    scrollbar-width: none;
    transition: top 0.3s ease;
}
.cat-nav-desktop.nav-top { top: 0; }
.cat-nav-desktop::-webkit-scrollbar { display: none; }
.cat-nav-desktop .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); }

/* Mobile category dropdown */
.cat-nav-mobile {
    display: none;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1029;
}
.cat-nav-mobile .form-select {
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: 8px;
    border-color: var(--border);
    color: var(--text);
}

@media (max-width: 575.98px) {
    .cat-nav-desktop { display: none; }
    .cat-nav-mobile { display: block; }
}

/* 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 (Version 6 — polished, visual depth) */
.game-card {
    border-radius: 16px;
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--border);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    height: 100%;
    cursor: pointer;
    text-decoration: none;
    color: var(--text);
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.02);
}
.game-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent, var(--primary)), color-mix(in srgb, var(--accent, var(--primary)) 60%, #fff));
    border-radius: 16px 16px 0 0;
    transition: height 0.2s;
}
.game-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 40px rgba(37,99,235,0.12), 0 4px 12px rgba(0,0,0,0.06);
    border-color: var(--accent, var(--primary));
}
.game-card:hover::before { height: 4px; }
.game-card:hover .gc-emoji {
    transform: scale(1.08);
}
.game-card:hover .gc-play {
    gap: 0.4rem;
}

/* Desktop card parts */
.gc-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 1.1rem 1.1rem 0.6rem;
}
.gc-emoji img, .gc-m-icon img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}
.gc-emoji {
    width: 52px; height: 52px; min-width: 52px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.7rem;
    background: var(--accent-bg, #f1f5f9);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.22s ease;
}
.gc-header-text { flex: 1; min-width: 0; }
.gc-name {
    font-size: 0.95rem; font-weight: 700; margin: 0;
    color: var(--text); line-height: 1.25;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gc-category {
    font-size: 0.7rem; color: #64748b; font-weight: 500;
    margin-top: 0.1rem;
}
.gc-body { padding: 0 1.1rem 0.85rem; flex: 1; }
.gc-body p {
    font-size: 0.8rem; color: var(--text-muted); margin: 0;
    line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2;
    -webkit-box-orient: vertical; overflow: hidden;
}
.gc-footer {
    padding: 0.65rem 1.1rem;
    border-top: 1px solid #f1f5f9;
    display: flex; align-items: center;
    justify-content: space-between;
    font-size: 0.7rem; color: #64748b;
    margin-top: auto;
}
.gc-play {
    color: var(--primary); font-weight: 700;
    display: flex; align-items: center; gap: 0.25rem;
    transition: gap 0.2s ease;
    font-size: 0.75rem;
}
.gc-dev { text-decoration: none; color: #64748b; }

/* Mobile card parts — hidden on desktop */
.gc-m-icon, .gc-m-content, .gc-m-play { display: none; }

/* ===== MOBILE: single-column horizontal layout ===== */
@media (max-width: 767.98px) {
    .game-card {
        display: flex;
        flex-direction: row;
        align-items: center;
    }
    .game-card::before {
        top: 0; bottom: 0; left: 0;
        right: auto; width: 4px; height: auto;
        border-radius: 14px 0 0 14px;
    }
    .game-card:hover::before { width: 5px; height: auto; }

    /* Hide desktop parts */
    .gc-header, .gc-body, .gc-footer { display: none; }

    /* Show mobile parts */
    .gc-m-icon {
        flex-shrink: 0;
        margin-left: 12px;
        width: 46px; height: 46px; min-width: 46px;
        border-radius: 12px;
        display: flex; align-items: center; justify-content: center;
        font-size: 1.6rem;
        background: var(--accent-bg, #f1f5f9);
        box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    }
    .gc-m-content {
        flex: 1; padding: 0.75rem 0.85rem;
        display: flex; flex-direction: column; justify-content: center;
        min-width: 0;
    }
    .gc-m-content .gc-name {
        font-size: 0.95rem; font-weight: 700;
        margin: 0 0 0.15rem; color: var(--text);
    }
    .gc-m-content p {
        font-size: 0.75rem; color: var(--text-muted);
        margin: 0 0 0.25rem; line-height: 1.35;
        display: -webkit-box; -webkit-line-clamp: 2;
        -webkit-box-orient: vertical; overflow: hidden;
    }
    .gc-m-meta {
        display: flex; align-items: center; gap: 0.5rem;
        font-size: 0.65rem; color: #64748b;
    }
    .gc-m-cat {
        background: #f1f5f9; padding: 0.1rem 0.4rem;
        border-radius: 4px; font-weight: 600;
    }
    .gc-m-play {
        width: 40px; min-width: 40px;
        display: flex; align-items: center; justify-content: center;
        color: var(--primary); font-size: 1rem;
        border-left: 1px solid #f1f5f9;
    }
}

/* Legacy badge classes (used elsewhere) */
.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; }

/* ADSENSE PLACEHOLDER */
.ad-slot { display: none; }
.ad-slot-visible {
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    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; }

/* LIVE ACTIVITY WIDGET */
.live-activity {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.1);
    z-index: 1050;
    max-width: 300px;
    font-size: 0.8125rem;
    line-height: 1.4;
    animation: liveSlideIn 0.4s ease-out;
}
@keyframes liveSlideIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.live-activity-close {
    position: absolute;
    top: 4px;
    right: 8px;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
}
.live-activity-close:hover { color: var(--text); }
.live-activity-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.live-activity-content {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}
.live-activity-content:hover { color: var(--primary); }
.live-activity-online {
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
}
@media (max-width: 576px) {
    .live-activity {
        bottom: 0.75rem;
        right: 0.75rem;
        left: 0.75rem;
        max-width: none;
    }
}

/* 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-desktop .cat-nav-inner { padding: 0 0.5rem; }
}

/* Small phones */
@media (max-width: 420px) {
    .section-header h2 { font-size: 1.15rem; }
    .section-icon { width: 32px; height: 32px; font-size: 1rem; border-radius: 8px; }
    .game-section { padding: 1.25rem 0; }
    .section-header { margin-bottom: 1rem; }
    .hero { padding: 1.5rem 0 1.25rem; }
    .hero p.lead { font-size: 0.85rem; margin-bottom: 1rem; }
    .row.g-3 { --bs-gutter-x: 0.5rem; --bs-gutter-y: 0.5rem; }
    .ad-slot-banner { height: 60px; margin: 1rem 0; }
}

/* Very small phones (330px+) */
@media (max-width: 359px) {
    .gc-m-icon { width: 56px; min-width: 56px; font-size: 1.6rem; }
    .gc-m-content { padding: 0.6rem 0.65rem; }
    .gc-m-content .gc-name { font-size: 0.85rem; }
    .gc-m-content p { font-size: 0.7rem; -webkit-line-clamp: 1; }
    .gc-m-meta { font-size: 0.6rem; }
    .gc-m-play { width: 32px; min-width: 32px; font-size: 0.85rem; }
    .hero h1 { font-size: 1.4rem; }
    .hero-search input { padding: 0.7rem 0.85rem; font-size: 0.85rem; }
    .hero-search button { padding: 0 0.85rem; font-size: 0.8rem; }
    .navbar-brand { font-size: 1rem; }
    .container { padding-left: 10px; padding-right: 10px; }
    .game-section { padding: 1rem 0; }
    .section-header { gap: 0.5rem; margin-bottom: 0.75rem; }
    .section-header h2 { font-size: 1.05rem; }
    .game-page-section { padding: 1rem 0 !important; }
    .game-page-section .container { padding-left: 6px; padding-right: 6px; }
    .game-page-title { font-size: 1.2rem !important; }
}

/* Game container overflow fix */
.game-container-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Fullscreen game mode */
.game-container-wrap:fullscreen {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

/* Game containers: reduce padding on small screens */
@media (max-width: 420px) {
    .game-container-wrap > div {
        padding: 0.5rem !important;
        border-radius: 10px !important;
    }
    .game-container-wrap canvas {
        max-width: 100% !important;
    }
}
@media (max-width: 359px) {
    .game-container-wrap > div {
        padding: 0.35rem !important;
    }
}

/* =====================================================
   CATEGORY PAGE (Magazine v3 style)
   ===================================================== */

.cat-page-header {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 2rem 0 1.75rem;
}
.cat-breadcrumb {
    font-size: 0.78rem;
    color: #666;
    margin-bottom: 0.75rem;
    font-family: -apple-system, 'Helvetica Neue', system-ui, sans-serif;
}
.cat-breadcrumb a { color: #666; text-decoration: none; }
.cat-breadcrumb a:hover { color: #2563eb; }
.cat-breadcrumb span { margin: 0 0.3rem; }
.cat-page-title {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    color: #111;
    line-height: 1.1;
    margin: 0 0 0.5rem;
}
.cat-page-meta {
    font-size: 0.85rem;
    color: #666;
    font-family: -apple-system, 'Helvetica Neue', system-ui, sans-serif;
}
.cat-games-section {
    background: #fff;
    padding: 2rem 0 1.5rem;
}

/* SEO text section — editorial style */
.cat-seo-section {
    background: #fff;
    padding: 2rem 0 3rem;
    border-top: 1px solid #e5e5e5;
}
.cat-seo-inner {
    max-width: 760px;
}
.cat-seo-inner h2 {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    color: #111 !important;
    border-top: 1px solid #e5e5e5;
    padding-top: 1.25rem !important;
    margin: 1.5rem 0 0.5rem !important;
}
.cat-seo-inner h2:first-child {
    border-top: 3px solid #111;
    padding-top: 0.75rem !important;
    margin-top: 0 !important;
}
.cat-seo-inner p {
    color: #444 !important;
    line-height: 1.7 !important;
    margin-bottom: 0.75rem !important;
    font-size: 0.95rem !important;
}
.cat-seo-inner ul {
    color: #444 !important;
    line-height: 1.8 !important;
    font-size: 0.95rem !important;
    padding-left: 1.4rem !important;
}
.cat-seo-inner a { color: #2563eb; font-weight: 600; }
.cat-seo-inner figure {
    float: right;
    margin: 0 0 1rem 1.5rem;
    width: 200px;
}
.cat-seo-inner figure img {
    width: 100%;
    border-radius: 12px;
    display: block;
    border: 1px solid #e5e5e5;
}
.cat-seo-inner figcaption {
    font-size: 0.68rem;
    color: #777;
    margin-top: 4px;
    font-family: -apple-system, system-ui, sans-serif;
}
@media (max-width: 575.98px) {
    .cat-page-title { font-size: 1.6rem; }
    .cat-seo-inner figure { float: none; width: 100%; margin: 0 0 1rem; }
}

/* =====================================================
   MAGAZINE HEADER (Homepage)
   ===================================================== */

/* Topbar */
.mh-topbar {
    background: #111;
    color: rgba(255,255,255,0.75);
    font-size: 0.78rem;
    padding: 0.5rem 0;
    text-align: center;
}
.mh-topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.mh-topbar-cta {
    color: #fbbf24;
    font-weight: 700;
    text-decoration: none;
}
.mh-topbar-cta:hover { color: #fde68a; }

/* Editorial Header */
.mh-header {
    background: #fff;
    border-bottom: 3px solid #111;
    padding: 1.1rem 0 1rem;
    position: relative;
    z-index: 1031;
}
.mh-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
}
.mh-header-left {
    display: flex;
    align-items: flex-start;
}
.mh-date {
    font-size: 0.78rem;
    color: #666;
    font-weight: 400;
    white-space: nowrap;
}
.mh-header-center {
    text-align: center;
}
.mh-logo {
    display: block;
    font-size: 2.6rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    text-transform: uppercase;
    color: #111;
    text-decoration: none;
    line-height: 1;
    font-family: 'Georgia', 'Times New Roman', system-ui, sans-serif;
}
.mh-logo span { color: #2563eb; }
.mh-logo:hover { color: #111; text-decoration: none; }
.mh-logo-sub {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #666;
    margin-top: 0.15rem;
}
.mh-header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
}
.mh-search {
    display: flex;
    overflow: hidden;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
}
.mh-search input {
    border: none;
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    outline: none;
    color: #111;
    width: 170px;
    font-family: 'Inter', sans-serif;
}
.mh-search button {
    background: #111;
    color: #fff;
    border: none;
    padding: 0.45rem 0.9rem;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
    font-family: 'Inter', sans-serif;
}
.mh-search button:hover { background: #2563eb; }
.mh-login {
    font-size: 0.82rem;
    font-weight: 600;
    color: #111;
    text-decoration: none;
    white-space: nowrap;
}
.mh-login:hover { color: #2563eb; }
.mh-user-btn {
    font-size: 0.82rem;
    font-weight: 600;
    color: #111;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Magazine Category Nav */
.mh-catnav {
    background: #fff;
    border-bottom: 1px solid #e5e5e5;
    position: sticky;
    top: 0;
    z-index: 1020;
    overflow-x: auto;
    scrollbar-width: none;
}
.mh-catnav::-webkit-scrollbar { display: none; }
.mh-catnav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    white-space: nowrap;
}
.mh-catlink {
    display: inline-flex;
    align-items: center;
    padding: 0.65rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #111;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
    font-family: -apple-system, 'Helvetica Neue', system-ui, sans-serif;
}
.mh-catlink:hover { color: #2563eb; border-bottom-color: #2563eb; }
.mh-catlink-active { color: #2563eb; border-bottom-color: #2563eb; }

/* Mobile: hide magazine header parts, show select */
@media (max-width: 767.98px) {
    .mh-header-inner { grid-template-columns: 1fr; text-align: center; gap: 0.4rem; }
    .mh-header-left { justify-content: center; }
    .mh-header-right { justify-content: center; flex-wrap: wrap; }
    .mh-logo { font-size: 1.8rem; }
    .mh-catnav { display: none; }
    .mh-search input { width: 140px; }
    .mh-logo-sub { display: none; }
    .mh-topbar-inner { flex-wrap: wrap; gap: 0.2rem; font-size: 0.72rem; }
}
@media (max-width: 479px) {
    .mh-logo { font-size: 1.4rem; }
    .mh-search input { width: 100px; font-size: 0.75rem; }
    .mh-search button { padding: 0.4rem 0.6rem; font-size: 0.75rem; }
    .mh-date { display: none; }
}

/* =====================================================
   MAGAZINE HOMEPAGE LAYOUT
   ===================================================== */

/* Main 2-column grid */
.mag-container {
    padding-top: 1.75rem;
    padding-bottom: 1.75rem;
}
.mag-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* Sidebar: sticky so it stays visible while scrolling categories */
.mag-sidebar {
    position: sticky;
    top: 46px; /* below sticky mh-catnav (~46px) */
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    scrollbar-width: none;
}
.mag-sidebar::-webkit-scrollbar { display: none; }

/* ---- FEATURE GAME (Tipp des Tages) ---- */
.mag-feature {
    display: block;
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.25rem;
    transition: box-shadow 0.2s, transform 0.2s;
    color: var(--text);
}
.mag-feature:hover {
    box-shadow: 0 8px 32px rgba(37,99,235,0.13);
    transform: translateY(-2px);
    color: var(--text);
}
.mag-feature-img {
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, #1e3a8a 0%, #2563eb 55%, #60a5fa 100%);
}
.mag-feature-emoji {
    font-size: 7rem;
    line-height: 1;
    transition: transform 0.3s;
    filter: drop-shadow(0 4px 24px rgba(0,0,0,0.3));
}
.mag-feature:hover .mag-feature-emoji { transform: scale(1.08); }
.mag-feature-label {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #2563eb;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
}
.mag-feature-body {
    padding: 1.25rem 1.4rem 1.5rem;
    background: #fff;
    border-top: 1px solid var(--border);
}
.mag-feature-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #2563eb;
    margin-bottom: 0.3rem;
}
.mag-feature-title {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0 0 0.5rem;
    color: #111;
}
.mag-feature-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.55;
    margin: 0 0 1rem;
}
.mag-feature-cta {
    display: inline-block;
    background: #2563eb;
    color: #fff;
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.875rem;
    transition: background 0.15s;
}
.mag-feature:hover .mag-feature-cta { background: #1d4ed8; }

/* Section title label */
.mag-section-title {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #666;
    border-top: 3px solid #111;
    padding-top: 0.6rem;
    margin-bottom: 0.9rem;
    font-family: -apple-system, 'Helvetica Neue', system-ui, sans-serif;
}

/* ---- NEWS GRID (4 cards) ---- */
.mag-news-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
    margin-bottom: 1.5rem;
}
.mag-news-card {
    display: block;
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    color: var(--text);
    transition: box-shadow 0.18s, transform 0.18s;
}
.mag-news-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    color: var(--text);
}
.mag-news-img {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
}
.mag-badge-pill {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.18rem 0.5rem;
    border-radius: 20px;
    color: #fff;
}
.mag-badge-new    { background: #047857; }
.mag-badge-daily  { background: #b45309; }
.mag-badge-retro  { background: #7c3aed; }
.mag-news-body {
    padding: 0.6rem 0.75rem 0.75rem;
    background: #fff;
}
.mag-news-cat {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #2563eb;
    margin-bottom: 0.2rem;
}
.mag-news-title {
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}

/* ---- CATEGORY SECTIONS (in main column) ---- */
.mag-cat-section {
    padding: 1.5rem 0 0.5rem;
    border-top: 1px solid var(--border);
}
.mag-cat-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1rem;
}
.mag-cat-header h2 {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0;
    flex: 1;
}
.mag-cat-link {
    font-size: 0.8rem;
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}
.mag-cat-link:hover { text-decoration: underline; }

/* ---- SIDEBAR ELEMENTS ---- */

/* Daily box */
.mag-daily-box {
    background: #fef3c7;
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}
.mag-daily-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.mag-daily-emoji { font-size: 2rem; line-height: 1; }
.mag-daily-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: #b45309;
    color: #fff;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
}
.mag-daily-title {
    font-size: 1.1rem;
    font-weight: 900;
    margin: 0 0 0.3rem;
    color: #78350f;
}
.mag-daily-desc {
    font-size: 0.8rem;
    color: #92400e;
    line-height: 1.45;
    margin: 0 0 0.875rem;
}
.mag-daily-cta {
    display: inline-block;
    background: #b45309;
    color: #fff;
    padding: 0.45rem 1.1rem;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.15s;
}
.mag-daily-cta:hover { background: #92400e; color: #fff; }

/* Aside section with title */
.mag-aside-section {
    margin-bottom: 1.5rem;
}
.mag-aside-title {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #666;
    border-top: 3px solid #111;
    padding-top: 0.6rem;
    margin-bottom: 0.75rem;
    font-family: -apple-system, 'Helvetica Neue', system-ui, sans-serif;
}

/* Ranked list */
.mag-ranked-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.mag-ranked-list li {
    border-bottom: 1px solid var(--border);
}
.mag-ranked-list li:last-child { border-bottom: none; }
.mag-ranked-list a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0;
    text-decoration: none;
    color: var(--text);
    transition: color 0.15s;
}
.mag-ranked-list a:hover { color: #2563eb; }
.mag-rank {
    font-size: 1rem;
    font-weight: 900;
    color: #e2e8f0;
    width: 22px;
    text-align: right;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
.mag-rank-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.mag-rank-info { flex: 1; min-width: 0; }
.mag-rank-name {
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mag-rank-cat {
    font-size: 0.7rem;
    color: var(--text-muted);
}
.mag-new-pill {
    font-size: 0.62rem;
    font-weight: 700;
    background: #dcfce7;
    color: #14532d;
    padding: 0.15rem 0.45rem;
    border-radius: 20px;
    flex-shrink: 0;
}

/* Category tiles in sidebar */
.mag-cat-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
}
.mag-cat-tile {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.6rem;
    border-radius: 8px;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.15s;
    border: 1px solid rgba(0,0,0,0.04);
}
.mag-cat-tile:hover { opacity: 0.82; transform: scale(1.02); }
.mag-cat-tile-emoji { font-size: 1.1rem; flex-shrink: 0; }
.mag-cat-tile-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.mag-cat-tile-count {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* ---- BOTTOM CATEGORIES (full-width, v3-style) ---- */
.mag-bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}
.mag-bottom-title {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #666;
    border-top: 3px solid #111;
    padding-top: 0.75rem;
    margin-bottom: 1.25rem;
    font-family: -apple-system, 'Helvetica Neue', system-ui, sans-serif;
}
.mag-cat-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}
.mag-cat-item {
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    text-decoration: none;
    transition: border-color 0.15s, background 0.15s;
    display: block;
    font-family: -apple-system, 'Helvetica Neue', system-ui, sans-serif;
}
.mag-cat-item:hover { border-color: #2563eb; background: #eff6ff; }
.mag-cat-item-emoji { font-size: 2rem; display: block; margin-bottom: 0.3rem; }
.mag-cat-item-name { font-size: 0.78rem; font-weight: 700; color: #111; }
.mag-cat-item-count { font-size: 0.68rem; color: #666; }
@media (max-width: 768px) { .mag-cat-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 480px) { .mag-cat-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---- RESPONSIVE ---- */
@media (max-width: 991.98px) {
    .mag-layout {
        grid-template-columns: 1fr;
    }
    .mag-sidebar {
        position: static;
        max-height: none;
        overflow: visible;
        /* Show sidebar compact on mobile: hide cat tiles + ad */
        border-top: 3px solid var(--text);
        padding-top: 1.5rem;
        margin-top: 0.5rem;
    }
    .mag-cat-tiles { display: none; }
    .mag-ranked-list li:nth-child(n+4) { display: none; } /* show only top 3 on mobile */
    .mag-feature-img { height: 180px; }
    .mag-feature-emoji { font-size: 5rem; }
    .mag-feature-title { font-size: 1.25rem; }
    .mag-topbar-tagline { display: none; }
}
@media (max-width: 575.98px) {
    .mag-news-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
    .mag-news-img { height: 80px; font-size: 2rem; }
    .mag-feature-img { height: 130px; }
    .mag-feature-emoji { font-size: 3.5rem; }
    .mag-feature-body { padding: 0.9rem 1rem 1rem; }
    .mag-feature-title { font-size: 1.1rem; }
    .mag-container { padding-top: 1rem; }
    .mag-aside-section { display: none; }
    .mag-daily-box { display: none; }
    .mag-sidebar { display: none; } /* hide entire sidebar on small mobile */
    .mag-bottom { padding: 0 1rem 2rem; }
    .mag-cat-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .mag-cat-item { padding: 0.75rem 0.5rem; }
    .mag-cat-item-emoji { font-size: 1.5rem; }
}

/* =====================================================
   CHALLENGE BANNER (sidebar)
   ===================================================== */
.challenge-banner {
    display: block;
    padding: 1.5rem;
    border-radius: 20px;
    background: #1e293b;
    color: #fff;
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: transform 0.15s, box-shadow 0.15s;
}
.challenge-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(30,41,59,0.35);
    color: #fff;
}
.challenge-banner-icon { font-size: 2.5rem; margin-bottom: 1rem; }
.challenge-banner-label {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: #93c5fd;
    margin-bottom: 0.4rem;
}
.challenge-banner h3 {
    font-size: 1.4rem;
    line-height: 1.15;
    font-weight: 800;
    margin: 0 0 0.65rem;
    color: #fff;
}
.challenge-banner p {
    color: #cbd5e1;
    font-size: 0.82rem;
    line-height: 1.5;
    margin-bottom: 1.1rem;
}
.challenge-banner-button {
    display: inline-block;
    background: #fff;
    color: #1e293b;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    transition: background 0.15s;
}
.challenge-banner:hover .challenge-banner-button { background: #e0f2fe; }
