:root {
    --bg-color: #0b0f19;
    --card-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    
    /* FIXED: Red and Black Action Tokens Added */
    --action-bg: #111111;
    --action-border: #cc0000;
    --action-text: #ffffff;
    --action-hover: #ee0000;
}

* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; 
}

body { 
    background-color: var(--bg-color); 
    color: var(--text-main); 
    padding-bottom: 60px; 
}

header { 
    background: #0f172a; 
    border-bottom: 1px solid #334155; 
    padding: 15px 20px; 
    position: sticky; 
    top: 0; 
    z-index: 100; 
}

.nav-container { 
    max-width: 1400px; 
    margin: 0 auto; 
    display: flex; 
    flex-direction: column; 
    gap: 15px; 
}

.top-bar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.logo { 
    font-size: 24px; 
    font-weight: 800; 
    letter-spacing: -1px; 
    color: var(--text-main); 
    text-decoration: none; 
}

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

.search-box { 
    width: 400px; 
    position: relative; 
}

.search-box input { 
    width: 100%; 
    padding: 10px 16px; 
    background: #1e293b; 
    border: 1px solid #475569; 
    border-radius: 8px; 
    color: #fff; 
    font-size: 14px; 
}

.search-box input:focus { 
    outline: none; 
    border-color: var(--accent); 
}

.categories-row { 
    display: flex; 
    gap: 10px; 
    overflow-x: auto; 
    padding-bottom: 5px; 
    white-space: nowrap; 
    scrollbar-width: none; 
}

.categories-row::-webkit-scrollbar { 
    display: none; 
}

.cat-tag { 
    background: #1e293b; 
    color: var(--text-muted); 
    padding: 6px 14px; 
    border-radius: 20px; 
    text-decoration: none; 
    font-size: 13px; 
    font-weight: 500; 
    transition: all 0.2s; 
    border: 1px solid transparent; 
}

.cat-tag:hover, .cat-tag.active { 
    background: var(--accent); 
    color: #fff; 
    border-color: var(--accent); 
}

.container { 
    max-width: 1400px; 
    margin: 30px auto; 
    padding: 0 20px; 
}

main { 
    max-width: 1400px; 
    margin: 30px auto; 
    padding: 0 20px; 
}

.grid-header { 
    margin-bottom: 20px; 
    font-size: 20px; 
    font-weight: 700; 
    color: var(--text-main); 
    display: flex; 
    gap: 20px; 
}

.grid-header span { 
    cursor: pointer; 
    color: var(--text-muted); 
}

.grid-header span.active { 
    color: var(--text-main); 
    border-bottom: 2px solid var(--accent); 
    padding-bottom: 4px; 
}

.wallpaper-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); 
    gap: 20px; 
}

.wallpaper-card { 
    background: var(--card-bg); 
    border-radius: 12px; 
    overflow: hidden; 
    position: relative; 
    cursor: pointer; 
    transition: transform 0.2s; 
    border: 1px solid #334155; 
}

.wallpaper-card:hover { 
    transform: translateY(-4px); 
}

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

/* FIXED: Re-added card detail flex layouts and updated view button hooks with deep red and black accents */
.card-details-area {
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-meta-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
}

.direct-download-btn {
    display: block;
    text-align: center;
    background: var(--action-bg);
    border: 1px solid var(--action-border);
    color: var(--action-text);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}

.direct-download-btn:hover {
    background: var(--action-border);
    border-color: var(--action-hover);
}

.card-info { 
    padding: 12px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

.card-title { 
    font-size: 14px; 
    font-weight: 600; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    max-width: 70%; 
}

.card-res { 
    font-size: 11px; 
    background: #334155; 
    padding: 2px 6px; 
    border-radius: 4px; 
    color: var(--text-muted); 
}

.adsense-placement {
    background: #0f172a;
    border: 1px dashed #475569;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    color: #475569;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.ad-leaderboard { width: 100%; height: 90px; }
.ad-multiplex { width: 100%; height: 250px; }

.stage-area { 
    display: flex; 
    gap: 30px; 
    margin-bottom: 30px; 
    background: #0f172a; 
    padding: 25px; 
    border-radius: 16px; 
    border: 1px solid #334155; 
}
.preview-pane { 
    flex: 2; 
    display: flex; 
    justify-content: center; 
    background: #000; 
    border-radius: 8px; 
    overflow: hidden; 
    max-height: 65vh; 
}
.preview-pane img { 
    max-width: 100%; 
    max-height: 100%; 
    object-fit: contain; 
}
.interaction-pane { 
    flex: 1; 
    display: flex; 
    flex-direction: column; 
    gap: 20px; 
}
.asset-title { 
    font-size: 24px; 
    font-weight: 700; 
    line-height: 1.2; 
}
.meta-tag { 
    display: inline-block; 
    padding: 4px 10px; 
    background: #334155; 
    border-radius: 4px; 
    font-size: 12px; 
    color: var(--text-muted); 
    margin-top: 5px; 
}
.seo-description-block {
    background: #1e293b;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--accent);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-muted);
}
.resolution-matrix { 
    display: flex; 
    flex-direction: column; 
    gap: 8px; 
    margin-top: 10px; 
}
.res-row { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 12px 15px; 
    background: var(--card-bg); 
    border: 1px solid #334155; 
    border-radius: 8px; 
    color: #fff; 
    cursor: pointer; 
    text-decoration: none; 
    font-size: 14px; 
    transition: border 0.2s; 
}
.res-row:hover { 
    border-color: var(--accent); 
    background: #24344d; 
}

.related-section { 
    border-top: 1px solid #334155; 
    padding-top: 40px; 
}
.related-tabs { 
    display: flex; 
    gap: 25px; 
    font-size: 18px; 
    font-weight: 700; 
    margin-bottom: 25px; 
    border-bottom: 1px solid #1e293b; 
    padding-bottom: 10px; 
}
.tab-item { 
    cursor: pointer; 
    color: var(--text-muted); 
    padding-bottom: 8px; 
}
.tab-item.active { 
    color: var(--text-main); 
    border-bottom: 3px solid var(--accent); 
}

.pagination-wrap {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}
.page-btn {
    background: var(--card-bg);
    border: 1px solid #334155;
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
}
.page-btn.active, .page-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
}

footer {
    max-width: 1400px;
    margin: 40px auto 0 auto;
    padding: 20px;
    border-top: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
}
footer a { color: var(--text-muted); text-decoration: none; margin-left: 15px; }
footer a:hover { color: var(--text-main); }