:root {
    --color-bg: #0c0a09; /* Stone 950 - Deep warm black */
    --color-card: #1c1917; /* Stone 900 */
    --color-primary: #ef4444; /* Red 500 */
    --color-primary-glow: rgba(239, 68, 68, 0.5);
    --color-secondary: #f97316; /* Orange 500 */
    --color-text: #fafaf9; /* Stone 50 */
    --color-text-muted: #a8a29e; /* Stone 400 */
    --color-border: #292524; /* Stone 800 */
    
    --font-head: 'Teko', sans-serif;
    --font-body: 'Outfit', sans-serif;
    
    --radius: 12px;
    --shadow-card: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 20px var(--color-primary-glow);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Noise Texture */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.05'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
}

/* Background Gradient */
.bg-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% -20%, #292524 0%, #0c0a09 60%);
    z-index: -1;
}

.main-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px;
    position: relative;
    z-index: 1;
}

/* Header */
.brand-header {
    text-align: center;
    margin-bottom: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: fadeIn 1s ease-out;
}

.logo-placeholder {
    width: 140px;
    height: 140px;
    background: #000;
    margin-bottom: 2rem;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--color-border);
    box-shadow: var(--shadow-glow);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.logo-placeholder:hover {
    transform: scale(1.05) rotate(2deg);
    border-color: var(--color-primary);
}

.logo-inner {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 2rem;
    color: var(--color-border);
    transform: rotate(-45deg);
}

.brand-title {
    font-family: var(--font-head);
    font-size: 5rem;
    line-height: 0.85;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.brand-title .accent {
    color: var(--color-primary);
    display: block;
    font-size: 6rem;
    background: linear-gradient(to bottom, #ff4500, #991b1b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Toolbar */
.toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
    background: rgba(28, 25, 23, 0.5);
    padding: 10px;
    border-radius: 16px;
    border: 1px solid var(--color-border);
    backdrop-filter: blur(10px);
    animation: slideUp 0.8s ease-out 0.2s backwards;
}

.search-box, .sort-box {
    position: relative;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    transition: all 0.2s;
}

.search-box {
    flex: 1;
}

.sort-box {
    min-width: 200px;
}

.search-box:focus-within, .sort-box:focus-within {
    background: rgba(0,0,0,0.5);
    box-shadow: 0 0 0 2px var(--color-border);
}

input, select {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--color-text);
    padding: 1.2rem 1.2rem 1.2rem 3rem;
    font-family: var(--font-body);
    font-size: 1.1rem;
    font-weight: 500;
    outline: none;
    appearance: none;
}

.sort-box select {
    padding-right: 2.5rem;
    cursor: pointer;
}

.search-box i, .sort-box i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

.search-box i { left: 1.2rem; }
.sort-box i { right: 1.2rem; pointer-events: none; }

/* Feed */
.rank-feed {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.card {
    background: var(--color-card);
    border-radius: var(--radius);
    display: grid;
    grid-template-columns: 140px 1fr 200px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-card);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    animation: slideUp 0.6s ease-out backwards;
    min-height: 140px;
}

.card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: var(--color-secondary);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px rgba(249, 115, 22, 0.2);
}

/* Heat Indicator Strip */
.card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--color-border);
    transition: background 0.3s;
    z-index: 2;
}

.card:hover::before {
    background: var(--color-primary);
}

.img-col {
    position: relative;
    overflow: hidden;
    background: #000;
}

.img-col img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    opacity: 0.8;
}

.card:hover .img-col img {
    transform: scale(1.1);
    opacity: 1;
}

/* Rank Badge Overlay */
.rank-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    background: #f3f4f6; /* Light grey like reference */
    color: #111;
    font-family: var(--font-head);
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    z-index: 10;
    line-height: 1;
}

.info-col {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-title {
    font-family: var(--font-head);
    font-size: 2.2rem;
    text-transform: uppercase;
    line-height: 0.9;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

.card-title a {
    color: var(--color-text);
    text-decoration: none;
    background-image: linear-gradient(var(--color-primary), var(--color-primary));
    background-size: 0% 2px;
    background-repeat: no-repeat;
    background-position: left bottom;
    transition: background-size 0.3s;
}

.card:hover .card-title a {
    background-size: 100% 2px;
}

.card-desc {
    font-size: 1rem;
    color: var(--color-text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Vote Section */
.vote-col {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-left: 1px solid var(--color-border);
    background: rgba(0,0,0,0.2);
}

.vote-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.vote-buttons {
    display: flex;
    gap: 10px;
}

.vote-btn {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.2s;
    color: white;
}

.vote-btn.upvote {
    background-color: #1e3a8a; /* Dark Blue like reference */
}

.vote-btn.downvote {
    background-color: #f3f4f6; /* Light grey */
    color: #9ca3af;
}

.vote-btn:hover {
    transform: scale(1.05);
}

.vote-btn.upvote:hover {
    background-color: #172554;
}

.vote-btn.downvote:hover {
    background-color: #e5e7eb;
    color: #6b7280;
}

/* Vote Stats */
.vote-stats {
    text-align: center;
    min-height: 40px; /* Reserve space */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.total-votes {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--color-text-muted);
    font-weight: 600;
}

.split-votes {
    display: flex;
    justify-content: space-between;
    width: 110px; /* Match buttons width + gap */
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    margin-top: 5px;
    font-weight: 600;
}

.up-count { color: #3b82f6; }
.down-count { color: #9ca3af; }

.percentage-label {
    font-family: var(--font-head);
    font-size: 1.2rem;
    color: #3b82f6; /* Blue text */
    margin-top: 5px;
    opacity: 0;
    transform: translateY(5px);
    transition: all 0.5s ease-out;
}

.percentage-label.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile */
@media (max-width: 700px) {
    .brand-title {
        font-size: 3.5rem;
    }
    .brand-title .accent {
        font-size: 4rem;
    }
    
    .card {
        grid-template-columns: 100px 1fr;
        grid-template-rows: auto auto;
    }
    
    .img-col {
        grid-row: 1 / -1;
    }
    
    .vote-col {
        grid-column: 2;
        border-left: none;
        border-top: 1px solid var(--color-border);
        padding: 1rem;
        flex-direction: row;
        justify-content: space-between;
    }
    
    .vote-container {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .info-col {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1.5rem;
    }
}

footer {
    text-align: center;
    margin-top: 6rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    opacity: 0.6;
}

.loading-simple {
    text-align: center;
    padding: 4rem;
    color: var(--color-text-muted);
    font-family: var(--font-head);
    font-size: 2rem;
    letter-spacing: 2px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}
