:root {
    --bg: #0b0f14;
    --fg: #e9eef5;
    --muted: rgba(233, 238, 245, 0.75);
    --card: rgba(20, 28, 40, 0.65);
    --stroke: rgba(233, 238, 245, 0.12);
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Fullscreen canvas */
#gfx {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    display: block;
}

/* Overlay content */
.overlay {
    position: relative;
    min-height: 100vh;
    display: grid;
    /* Strictly 2 columns as requested */
    grid-template-columns: 1fr 1fr;
    align-content: center;
    justify-content: center;
    gap: 24px;
    padding: 24px;
    pointer-events: none;
    max-width: 900px;
    /* Keep them reasonably sized */
    margin: 0 auto;
}

@media (max-width: 700px) {
    .overlay {
        grid-template-columns: 1fr;
    }
}

.card {
    pointer-events: auto;
    width: 100%;
    /* Let grid control width */
    padding: 22px 22px 18px;
    border: 1px solid var(--stroke);
    background: var(--card);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    /* Optional: subtle hover lift */
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    border-color: rgba(233, 238, 245, 0.2);
}

h1 {
    margin: 0 0 6px 0;
    font-size: 32px;
    letter-spacing: -0.02em;
}

.muted {
    margin: 0 0 16px 0;
    color: var(--muted);
}

.links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 12px 0;
}

.links a {
    color: var(--fg);
    text-decoration: none;
    border: 1px solid var(--stroke);
    padding: 8px 10px;
    border-radius: 10px;
}

.links a:hover {
    border-color: rgba(233, 238, 245, 0.28);
}

.small {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

/* Spotify Widget */
/* Spotify Widget */
.spotify-widget {
    /* Full card takeover */
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    justify-content: center;
}

.spotify-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1db954;
    /* Spotify Green */
    font-weight: 700;
}

/* New Progress Bar Styles */
.spotify-progress-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.spotify-progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(233, 238, 245, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

#spotify-progress-fill {
    height: 100%;
    background: #e9eef5;
    width: 0%;
    transition: width 0.5s linear;
}

.mono {
    font-family: monospace;
    font-size: 11px;
    color: var(--muted);
    min-width: 32px;
    /* Prevent jitter */
    text-align: center;
}

.spotify-content {
    display: flex;
    gap: 12px;
    align-items: center;
    overflow: hidden;
}

#spotify-art {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.spotify-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    /* needed for flex truncation */
    flex: 1;
    gap: 2px;
}

#spotify-song {
    color: var(--fg);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#spotify-song:hover {
    text-decoration: underline;
}

#spotify-artist {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#spotify-album {
    color: rgba(233, 238, 245, 0.45);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}