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

:root {
    --bg: #0d0d0f;
    --surface: #16161a;
    --surface2: #1e1e24;
    --border: rgba(255, 255, 255, 0.08);
    --border2: rgba(255, 255, 255, 0.14);
    --text: #f0eff4;
    --muted: #8a8a9a;
    --accent: #7b6cff;
    --accent-glow: rgba(123, 108, 255, 0.18);
    --success: #22c55e;
    --success-glow: rgba(34, 197, 94, 0.15);
}

body.light {
    --bg: #f3f4f8;
    --surface: #ffffff;
    --surface2: #f0eff6;
    --border: rgba(0, 0, 0, 0.08);
    --border2: rgba(0, 0, 0, 0.14);
    --text: #111118;
    --muted: #666677;
    --accent: #5b4ef5;
    --accent-glow: rgba(91, 78,245, 0.12);
}


body {
    font-family: 'Space Grotesk', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 2rem 1rem 4rem;
    transition: background 0.3s, color 0.3s;
}

.wrapper { 
    max-width: 680px;
    margin: 0 auto;
}

header {
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
}

header h1 {
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 0.95rem;
    color: var(--muted);
}

.theme-toggle {
    position: absolute;
    top: 0; right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px; height: 36px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2;
}

.theme-toggle:hover {
    border-color: var(--border2);
}

.input-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.input-section label {
    font-size: 0.85rem;
    color: var(--muted);
    white-space: nowrap;
}

.input-section input[type="date"] {
    flex: 1;
    min-width: 160px;
    background: var(--surface2);
    border: 1px solid var(--border2);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s; 
}

.input-section input[type="date"]:focus {
    border-color: var(--accent);
}

input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.6);
    cursor: pointer;
}

.planet-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 1.5rem;
}

.planet-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.18s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-family: inherit;
    font-size: 0.72rem;
    position: relative;
    overflow: hidden;
}

.planet-btn:hover {
    border-color: var(--border2);
    color: var(--text);
}

.planet-btn.active {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--text);
}

.planet-icon {
    font-size: 1.4rem;
    line-height: 1;
    display: inline-block;
}

.planet-btn.active .planet-icon {
    animation: spin 8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.bday-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px; height: 8px;
    background: var(--success);
    border-radius: 50%;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    margin-bottom: 1rem;
}

.metric-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    transition: border-color 0.2s;
}

.metric-card.live {
    border-color: var(--accent);
}

.metric-label {
    font-size: 0.72rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.metric-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
    word-break: break-word;
}

.progress-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.progress-title {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.progress-pct {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.progress-bar-bg {
    background: var(--surface2);
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
    transition: width 0.6s ease;
}

.progress-sub {
    font-size: 0.78rem;
    color: var(--muted);
}

.fun-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.fun-title {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 10px;
}

.fun-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

.fun-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: var(--muted);
    line-height: 1.4;
}

.fun-item span:first-child {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.fun-item strong {
    color: var(--text);
    font-weight: 500;
}

.bday-banner {
    background-color: var(--success-glow);
    border: 1px solid var(--success);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--text);
    text-align: center;
    animation: pulse 2s ease-in-out infinite;
}

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

.planet-fact {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.7;
}

.planet-fact strong {
    color: var(--text);
    font-weight: 500;
    display: block;
    margin-bottom: 4px;
}

.action-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.action-btn {
    flex: 1;
    min-width: 120px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.6rem 1rem;
    font-family: inherit;
    font-size: 0.82rem;
    color: var(--muted);
    cursor: pointer;
    transition: all 0.18s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.action-btn:hover {
    border-color: var(--border2);
    color: var(--text);
}

.action-btn.copied {
    border-color: var(--success);
    color: var(--success);
}

#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
    font-size: 0.95rem;
}

@media (max-width: 520px ) {

    .planet-grid { 
        grid-template-columns: repeat(5, 1fr); 
        gap: 5px; 
    }

    .planet-btn { 
        padding : 0.55rem 0.2rem;
        font-size: 0.65rem;
    }

    .planet-icon { 
        font-size: 1.1rem; 
    }

    .results-grid { 
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .metric-value {
        font-size: 1rem;
    }

    .fun-grid {
        grid-template-columns: 1fr;
    }
}