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

:root {
    --card-bg: rgba(30, 41, 59, 0.6);
    --card-border: rgba(255, 255, 255, 0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
    transition: background 1s ease;
}

/* Pixel font for headings only */
h1, h2 {
    font-family: "Press Start 2P", monospace;
}

#loading {
    font-family: "Press Start 2P", monospace;
    font-size: 0.7rem;
    color: #94a3b8;
    animation: pulse 1.5s ease-in-out infinite;
}

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

.hidden {
    display: none !important;
}

main {
    width: 100%;
    max-width: 680px;
    animation: fadeIn 0.6s ease-out;
}

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

/* City image */
#city-image-container {
    margin-bottom: 1.5rem;
    border: 2px solid var(--card-border);
    overflow: hidden;
}

#city-image {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    display: block;
}

/* Hero */
.hero {
    text-align: center;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 1.1rem;
    color: #f8fafc;
    margin-bottom: 0.5rem;
    letter-spacing: 2px;
}

.hero #region-country {
    font-size: 0.95rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.hero #local-time {
    font-family: "Press Start 2P", monospace;
    font-size: 0.85rem;
    color: #38bdf8;
}

/* Card grid */
.card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.card {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    backdrop-filter: blur(10px);
    padding: 1rem;
}

.card h2 {
    font-size: 0.5rem;
    color: #64748b;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
}

.card p {
    font-size: 0.9rem;
    color: #cbd5e1;
    line-height: 1.6;
}

.card .card-main {
    font-size: 1rem;
    color: #f8fafc;
    margin-bottom: 0.25rem;
}

/* Weather card specifics */
#temperature {
    font-size: 0.85rem;
    color: #94a3b8;
}

#wind {
    font-size: 0.8rem;
    color: #64748b;
}

/* Sun times */
#sunrise, #sunset {
    font-size: 0.9rem;
}

#sunrise {
    color: #fb923c;
}

#sunset {
    color: #f97316;
}

/* Population */
#population {
    font-size: 1.1rem !important;
    color: #f8fafc !important;
}

/* Holiday */
#holiday {
    color: #fbbf24 !important;
}

#holiday-countdown {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Full-width sections */
.full-section {
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    backdrop-filter: blur(10px);
    padding: 1rem;
    margin-bottom: 1rem;
}

.full-section h2 {
    font-size: 0.5rem;
    color: #64748b;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
}

/* Sports teams */
#sports-teams {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

#sports-teams a {
    color: #38bdf8;
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--card-border);
    transition: all 0.2s;
}

#sports-teams a:hover {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
}

/* News */
.news-article {
    display: flex;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--card-border);
    align-items: flex-start;
}

.news-article:last-child {
    border-bottom: none;
}

.news-image {
    width: 80px;
    height: 55px;
    object-fit: cover;
    flex-shrink: 0;
}

.news-text {
    flex: 1;
    min-width: 0;
}

.news-text a {
    color: #e2e8f0;
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.5;
    display: block;
    margin-bottom: 0.15rem;
}

.news-text a:hover {
    color: #38bdf8;
}

.news-source {
    font-size: 0.75rem;
    color: #64748b;
}

/* Footer */
footer {
    margin-top: 1.5rem;
    text-align: center;
    color: #475569;
    font-size: 0.75rem;
    line-height: 1.8;
}

footer .sources {
    margin-top: 0.3rem;
    font-size: 0.65rem;
}

footer .sources a {
    color: #64748b;
    text-decoration: none;
}

footer .sources a:hover {
    color: #94a3b8;
}

footer .built-by {
    margin-top: 0.5rem;
    font-size: 0.7rem;
}

footer .built-by a {
    color: #94a3b8;
    text-decoration: none;
}

footer .built-by a:hover {
    color: #e2e8f0;
}

/* Error */
#error {
    font-family: "Press Start 2P", monospace;
    font-size: 0.6rem;
    color: #f87171;
    text-align: center;
}

/* Responsive */
@media (max-width: 500px) {
    .card-grid {
        grid-template-columns: 1fr;
    }

    .hero h1 {
        font-size: 0.9rem;
    }
}
