@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,500;0,700;1,500&family=Inter:wght@400;600;700&display=swap');

:root {
    /* The NYT / Premium Newspaper Palette */
    --bg-main: #F7F7F5; /* Warm editorial off-white */
    --bg-card: #FFFFFF; /* Crisp white for the cards */
    --text-primary: #121212; /* Deep charcoal, easier on eyes than pure black */
    --text-secondary: #5A5A5A; /* Elegant gray for subtext */
    
    /* Elegant interaction colors */
    --accent: #1A1A1A; /* Stark black for buttons */
    --accent-hover: #404040;
    --link-blue: #326891; /* Classic journalistic blue for links */
    --logo-shadow: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.7));
    
    /* Softened Success/Fail Colors */
    --correct: #2E7D32; /* Deep, classy green */
    --correct-bg: #E8F5E9;
    --wrong: #C62828; /* Deep, classy red */
    --wrong-bg: #FFEBEE;
    
    --border: #D1D1D1;
    
    /* Our new fonts */
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

#app-container {
    width: 100%;
    max-width: 900px; /* Slightly narrower for easier reading */
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* Typography & Header */
header { 
    text-align: center; 
    margin-bottom: 2.5rem; 
    padding-top: 1rem;
    border-bottom: 2px solid var(--text-primary);
    padding-bottom: 2rem;
}

.logo-img { 
    width: 100%;
    max-width: 280px; 
    height: auto;
    display: block;
    margin: 0 auto;
    /* Removed the white glow since we are on a light background now! */
    filter: var(--logo-shadow);
    transition: filter 0.3s ease;
}

.tagline {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-family: var(--font-serif);
    font-style: italic;
}

.tagline strong {
    color: var(--text-primary); 
    font-weight: 700;
    font-style: normal;
}

/* Views Utility */
.view { display: none; animation: fadeIn 0.4s ease; }
.view.active { display: block; }

/* Loading & Error States */
#view-loading, #view-error { 
    text-align: center; 
    margin-top: 3rem; 
}
.spinner {
    width: 40px; 
    height: 40px; 
    border: 3px solid var(--border);
    border-top: 3px solid var(--accent); 
    border-radius: 50%;
    animation: spin 1s linear infinite; 
    margin: 20px auto;
}

/* Game Header (Round & Progress) */
.game-header {
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    text-align: center;
}

.progress-container {
    height: 4px; /* Thinner, more elegant progress bar */
    background: var(--border);
    border-radius: 2px; 
    margin-bottom: 2.5rem; 
    overflow: hidden;
}
.progress-bar {
    height: 100%; 
    background: var(--accent); 
    width: 0%;
    transition: width 0.4s ease;
}

/* --- THE HEADLINE CARDS --- */
.cards-container { 
    display: flex; 
    flex-direction: column; 
    gap: 1.5rem; 
}

.headline-card {
    background: var(--bg-card); 
    border: 1px solid var(--border); /* Thinner border */
    color: var(--text-primary); 
    padding: 2rem 1.5rem; /* More breathing room */
    border-radius: 4px; /* Sharper, newspaper-style corners */
    text-align: center; 
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.headline-card:hover:not(:disabled) { 
    border-color: var(--accent); 
    box-shadow: 0 8px 15px rgba(0,0,0,0.08);
    transform: translateY(-2px); 
}

.headline-card:disabled { 
    cursor: default; 
    transform: none; 
}

.headline-card .text {
    margin: 0;
    font-family: var(--font-serif); /* Uses the beautiful newspaper font! */
    font-size: 1.6rem; 
    font-weight: 700;
    line-height: 1.3;
}

/* 🚨 HIDDEN CATEGORY BADGE 🚨 */
.badge {
    display: none !important;
}

/* Feedback States (Right/Wrong) */
.headline-card.correct { 
    background: var(--correct-bg); 
    border-color: var(--correct); 
    color: var(--correct);
}
.headline-card.wrong { 
    background: var(--wrong-bg); 
    border-color: var(--wrong); 
    color: var(--wrong);
}
.headline-card.dimmed { 
    opacity: 0.35; 
    filter: grayscale(100%);
}

/* --- FEEDBACK AREA --- */
#feedback-area {
    margin-top: 2rem; 
    padding: 1.5rem; 
    background: var(--bg-card);
    border-radius: 4px;
    border-left: 4px solid var(--accent); /* Black editorial line */
    animation: slideUp 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}
#feedback-area.hidden { display: none; }

#feedback-area p {
    margin-bottom: 12px;
    font-size: 1.1rem;
}

#real-headline-text { 
    color: var(--correct); 
    font-family: var(--font-serif);
    font-weight: 700; 
    font-size: 1.3rem;
    display: block;
    margin-top: 0.5rem;
}

/* Article Link */
.read-more-link {
    display: inline-block;
    color: var(--link-blue);
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}
.read-more-link:hover {
    text-decoration: underline;
}

/* Buttons */
.btn {
    padding: 1rem 1.5rem; 
    border: none; 
    border-radius: 4px; /* Sharper corners */
    font-weight: 700; 
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer; 
    font-size: 1rem; 
    transition: background 0.2s;
    width: 100%;
}
.btn.primary { background: var(--accent); color: white; }
.btn.primary:hover { background: var(--accent-hover); }

/* --- RESULTS VIEW --- */
#view-result { text-align: center; }
#result-title { 
    margin-bottom: 1rem; 
    font-family: var(--font-serif);
    font-size: 2.5rem;
}

.score-display { 
    font-size: 4rem; 
    font-weight: 800; 
    color: var(--accent); 
    margin-bottom: 1.5rem; 
    font-family: var(--font-serif);
}
.score-display .total { 
    font-size: 1.8rem; 
    color: var(--text-secondary); 
}

.stats-container { 
    display: flex; 
    justify-content: center; 
    gap: 3rem; 
    margin-bottom: 2rem; 
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}
.stat-box { display: flex; flex-direction: column; }
.stat-value { font-size: 1.8rem; font-weight: 700; font-family: var(--font-serif); }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px;}

.history-grid { 
    display: flex; 
    justify-content: center; 
    gap: 0.5rem; 
    margin-bottom: 2rem; 
    font-size: 1.8rem; 
}

.countdown-container { 
    margin-top: 2rem; 
    color: var(--text-secondary); 
}
#countdown-timer { 
    font-family: monospace; 
    font-size: 1.8rem; 
    color: var(--text-primary); 
    margin-top: 0.5rem; 
}

/* Read the Real Stories Section */
.article-links-container {
    margin-top: 2.5rem;
    text-align: left;
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 4px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.article-links-container h3 {
    margin-top: 0;
    font-family: var(--font-serif);
    color: var(--text-primary);
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 0.8rem;
}

#article-links-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

#article-links-list li {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.article-round-badge {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1px;
}

#article-links-list a {
    color: var(--text-primary);
    font-family: var(--font-serif);
    font-weight: 600;
    text-decoration: none;
    font-size: 1.1rem;
    line-height: 1.4;
    transition: color 0.2s ease;
}

#article-links-list a:hover {
    color: var(--link-blue);
}

/* Animations */
@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}
@keyframes fadeIn { 
    from { opacity: 0; } 
    to { opacity: 1; } 
}
@keyframes slideUp { 
    from { transform: translateY(10px); opacity: 0; } 
    to { transform: translateY(0); opacity: 1; } 
}

/* Responsive Desktop Layout */
@media (min-width: 768px) {
    .cards-container {
        flex-direction: row; 
        align-items: stretch;
    }
    .headline-card {
        flex: 1; 
        padding: 3rem 2rem; /* Even bigger on desktop */
    }
    .headline-card .text {
        font-size: 1.8rem; /* Massive, beautiful typography */
    }
    .logo-img {
        max-width: 350px;
    }
}


/* --- DARK MODE OVERRIDES --- */
[data-theme="dark"] {
    --bg-main: #0f172a;      /* Deep midnight blue */
    --bg-card: #1e293b;      /* Dark slate for cards */
    --text-primary: #f8fafc; /* Crisp off-white text */
    --text-secondary: #94a3b8; /* Soft grey */
    --accent: #3b82f6;       /* Bright blue for contrast */
    --accent-hover: #60a5fa;
    --link-blue: #60a5fa;    
    --border: #334155;
    --logo-shadow: drop-shadow(0px 0px 6px rgba(255, 255, 255, 1));
}

/* Theme Toggle Button */
.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 100;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
}

