@import url('https://fonts.googleapis.com/css2?family=Anton&family=Inter:wght@400;600;900&display=swap');

:root {
    --f-black: #050505;
    --f-black-light: #121212;
    --f-red: #E32636;
    --f-white: #FFFFFF;
    --f-gray: #888888;
    --font-massive: 'Anton', sans-serif;
    --font-body: 'Inter', sans-serif;
    --grid-gap: 2rem;
    --transition-fast: 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ==========================================================================
   GLOBAL RESET & BASE (Ferrari Design System)
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background-color: var(--f-black);
    color: var(--f-white);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--f-red); color: var(--f-white); }

.text-red { color: var(--f-red) !important; }
.mt-4 { margin-top: 2rem; }
.mt-8 { margin-top: 4rem; }
.pt-4 { padding-top: 2rem; }
.border-top { border-top: 1px solid rgba(255,255,255,0.1); }
.container, .f-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 4%;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-massive);
    text-transform: uppercase;
    font-weight: 400;
    letter-spacing: 1px;
    line-height: 1.1;
    margin-bottom: 1rem;
}

/* ==========================================================================
   GLOBAL COMPONENTS (Index & List Compat)
   ========================================================================== */

/* Header */
.site-header, .f-header {
    background: rgba(5, 5, 5, 0.95);
    border-bottom: 2px solid var(--f-red);
    position: sticky;
    top: 0;
    z-index: 999;
    backdrop-filter: blur(10px);
}
.header-inner {
    display: flex; justify-content: space-between; align-items: center;
    height: 90px;
}
.logo, .f-logo {
    font-family: var(--font-massive);
    font-size: 2.5rem;
    color: var(--f-white);
    text-decoration: none;
    letter-spacing: 2px;
}
.f-red-dot { color: var(--f-red); }

.main-nav a, .f-nav a {
    color: var(--f-white);
    text-decoration: none;
    margin-left: 2.5rem;
    font-family: var(--font-body);
    font-weight: 900;
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    transition: color var(--transition-fast);
}
.main-nav a:hover, .main-nav a.active, .f-nav a:hover, .f-nav a.active {
    color: var(--f-red);
}

/* Buttons */
.btn, .f-btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--f-red);
    color: var(--f-white);
    font-family: var(--font-massive);
    font-size: 1.5rem;
    padding: 1rem 3rem;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: transform var(--transition-fast), background var(--transition-fast);
    border: none;
    cursor: pointer;
    clip-path: polygon(0 0, 100% 0, 95% 100%, 0% 100%);
}
.btn:hover, .f-btn-primary:hover {
    background: var(--f-white);
    color: var(--f-red);
    transform: translateX(5px);
}
.btn-large { font-size: 2rem; padding: 1.5rem 4rem; }
.btn-outline {
    background: transparent;
    border: 2px solid var(--f-red);
    color: var(--f-red);
}
.btn-outline:hover {
    background: var(--f-red);
    color: var(--f-white);
}

/* Index Hero */
.hero-section {
    padding: 10rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: radial-gradient(circle at top left, #2a0505 0%, var(--f-black) 80%);
}
.hero-title {
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 0.9;
    margin-bottom: 1.5rem;
}
.hero-subtitle {
    font-size: 1.5rem;
    max-width: 600px;
    margin-bottom: 3rem;
    color: var(--f-gray);
    font-weight: 400;
}

/* Game Grid (Index & List) */
.section-header {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 3rem; padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    margin-top: 5rem;
}
.section-header h2 { font-size: 3rem; margin: 0; }
.view-all {
    color: var(--f-red); font-family: var(--font-massive);
    font-size: 1.2rem; text-decoration: none;
    letter-spacing: 1px; transition: color var(--transition-fast);
}
.view-all:hover { color: var(--f-white); }

.game-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
    margin-bottom: 5rem;
}
.game-card {
    display: block; text-decoration: none; color: var(--f-white);
    background: var(--f-black-light);
    border: 1px solid rgba(255,255,255,0.05);
    transition: transform var(--transition-fast), border-color var(--transition-fast);
    position: relative;
    overflow: hidden;
}
.game-card:hover {
    transform: translateY(-8px);
    border-color: var(--f-red);
}
.game-card::after {
    content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 4px;
    background: var(--f-red); transform: scaleX(0); transform-origin: left;
    transition: transform 0.4s ease;
}
.game-card:hover::after { transform: scaleX(1); }

.card-image {
    height: 220px; background-size: cover; background-position: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    filter: grayscale(40%); transition: filter var(--transition-fast);
}
.game-card:hover .card-image { filter: grayscale(0%); }

.card-info { padding: 1.5rem; }
.card-cat {
    font-family: var(--font-massive); font-size: 1rem; color: var(--f-red);
    display: block; margin-bottom: 0.5rem; letter-spacing: 1px;
}
.card-title { font-size: 1rem; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card-desc {
    font-size: 0.9rem;
    color: var(--f-gray);
    margin-top: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}
/* Filters */
.list-header { margin: 4rem 0; }
.filters { display: flex; gap: 1rem; margin-top: 2rem; flex-wrap: wrap; }
.filter-btn {
    background: transparent; color: var(--f-gray);
    border: 1px solid var(--f-gray); padding: 0.5rem 2rem;
    font-family: var(--font-massive); font-size: 1.2rem; cursor: pointer;
    transition: all var(--transition-fast); text-transform: uppercase;
}
.filter-btn.active, .filter-btn:hover {
    background: var(--f-red); color: var(--f-white); border-color: var(--f-red);
}

/* Footer */
.site-footer, .f-footer {
    background-color: #020202; border-top: 4px solid var(--f-red);
    padding: 6rem 0 2rem; margin-top: 6rem;
}
.footer-inner, .footer-flex {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 4rem; border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 4rem;
}
.footer-brand p { color: var(--f-gray); font-weight: 900; margin-top: 1rem; }
.footer-links a, .f-footer-links a {
    display: block; color: var(--f-white); text-decoration: none;
    font-family: var(--font-massive); font-size: 1.2rem; margin-bottom: 1rem;
    transition: color var(--transition-fast); text-align: right;
}
.footer-links a:hover, .f-footer-links a:hover { color: var(--f-red); }
.footer-copyright, .f-copyright { text-align: center; color: var(--f-gray); font-size: 0.9rem; font-weight: 600; letter-spacing: 1px; border-top: none; }

/* ==========================================================================
   DETAIL PAGE (Ferrari Design System Specifics)
   ========================================================================== */

/* Hero Grid */
.f-hero-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    min-height: 85vh;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.f-hero-content {
    padding: 10% 8% 10% 12%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--f-black);
    position: relative;
    z-index: 2;
}
.f-meta { display: flex; gap: 1rem; margin-bottom: 2rem; }
.f-tag {
    font-family: var(--font-massive);
    font-size: 1.2rem;
    padding: 0.2rem 1rem;
    letter-spacing: 1px;
}
.f-bg-red { background: var(--f-red); color: var(--f-white); }
.f-outline { border: 2px solid var(--f-red); color: var(--f-red); }

.f-title-icon-wrapper {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}
.f-game-icon {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    object-fit: cover;
    border: 2px solid var(--f-red);
    display: none; /* Hidden until loaded */
}
.f-massive-title {
    font-size: clamp(2rem, 3.5vw, 3.5rem);
    line-height: 0.85;
    margin-bottom: 0;
    text-shadow: 4px 4px 0px rgba(227, 38, 54, 0.4);
    word-break: break-word;
}
.f-desc {
    font-size: 1.25rem;
    color: var(--f-gray);
    margin-bottom: 3rem;
    max-width: 90%;
    line-height: 1.6;
    border-left: 4px solid var(--f-red);
    padding-left: 1.5rem;
}
.f-action-row { margin-top: auto; }
.f-btn-primary .btn-arrow { margin-left: 1rem; transition: transform var(--transition-fast); }
.f-btn-primary:hover .btn-arrow { transform: translateX(10px); }

.f-hero-visual {
    position: relative;
    background: var(--f-black-light);
    overflow: hidden;
    clip-path: polygon(10% 0, 100% 0, 100% 100%, 0 100%);
}
.f-hero-image {
    position: absolute; inset: 0;
    background-size: cover; background-position: center;
    filter: contrast(1.2) saturate(1.2);
    transition: transform 10s linear;
}
.f-hero-visual:hover .f-hero-image { transform: scale(1.1); }
.f-hero-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(90deg, var(--f-black) 0%, rgba(5,5,5,0.2) 50%, transparent 100%);
}

/* Editorial Grid for AdSense Content */
.f-editorial-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 4rem;
    padding-top: 6rem;
    padding-bottom: 6rem;
}

/* Sidebars */
.f-sidebar { display: flex; flex-direction: column; gap: 3rem; }
.f-ad-sticky { position: sticky; top: 120px; }
.f-ad-label {
    font-family: var(--font-body); font-size: 0.7rem; color: var(--f-gray);
    text-transform: uppercase; letter-spacing: 2px; margin-bottom: 0.5rem; text-align: center;
}
.f-ad-slot {
    background: var(--f-black-light);
    border: 1px dashed rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    color: rgba(255,255,255,0.1); font-family: var(--font-massive); text-align: center;
}
.vertical-ad { height: 600px; width: 100%; }
.square-ad { height: 250px; width: 100%; }

.f-widget-title { font-size: 2rem; border-bottom: 2px solid var(--f-red); padding-bottom: 0.5rem; margin-bottom: 1.5rem; }
.f-trending-list { list-style: none; }
.f-trending-list li { margin-bottom: 1.5rem; display: flex; align-items: center; gap: 1rem; }
.f-trend-rank { font-family: var(--font-massive); font-size: 2rem; color: var(--f-red); opacity: 0.5; }
.f-trending-list a { color: var(--f-white); text-decoration: none; font-weight: 900; font-size: 1.1rem; transition: color var(--transition-fast); }
.f-trending-list a:hover { color: var(--f-red); }

/* Article Body */
.f-article-header { border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 2rem; margin-bottom: 3rem; }
.f-article-title { font-size: 1.75rem; line-height: 1; margin-bottom: 1rem; }
.f-author-line { font-family: var(--font-body); font-weight: 900; color: var(--f-red); font-size: 0.9rem; letter-spacing: 2px; }

.f-rich-text { font-size: 1.2rem; color: #cccccc; }
.f-rich-text h2, .f-rich-text h3 { color: var(--f-white); margin: 3rem 0 1.5rem; font-size: 2.5rem; }
.f-rich-text h3 { font-size: 2rem; border-left: 4px solid var(--f-red); padding-left: 1rem; }
.f-rich-text p { margin-bottom: 1.8rem; line-height: 1.8; }
.f-rich-text ul { margin-bottom: 1.8rem; padding-left: 1.5rem; }
.f-rich-text li { margin-bottom: 0.5rem; }
.f-rich-text blockquote {
    font-family: var(--font-massive); font-size: 2rem; line-height: 1.2;
    color: var(--f-white); margin: 3rem 0; padding: 2rem;
    background: var(--f-black-light); border-left: 8px solid var(--f-red);
}
.f-placeholder-text { opacity: 0.7; font-style: italic; }

/* Article Pages Fallback */
.article-header { padding: 4rem 0; border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 3rem; }
.article-title { font-size: 4rem; }
.article-content { max-width: 800px; margin: 0 auto 4rem; font-size: 1.2rem; color: #ccc; }
.article-content p { margin-bottom: 1.5rem; }
.article-content h2 { margin: 3rem 0 1rem; font-size: 2.5rem; color: #fff; }