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

:root {
    --text-primary: #f0f0f0;
    --text-muted: rgba(255, 255, 255, 0.55);
}

html, body {
    height: 100%;
}

body {
    font-family: 'DM Sans', system-ui, sans-serif;
    display: flex;
    flex-direction: column;
    color: var(--text-primary);
    overflow: hidden;
    transition: background 1.5s ease;
}

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

.rainy-mode {
    background: linear-gradient(170deg, #1a1a2e 0%, #16213e 30%, #1a3a4a 60%, #2d4a5e 100%);
}

.sunny-mode {
    background: linear-gradient(170deg, #2a6dd6 0%, #56b4e8 40%, #87ceeb 70%, #b6e3f4 100%);
}

#phrase-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.weather-phrase {
    position: absolute;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.4);
    white-space: normal;
    max-width: 80vw;
    text-align: center;
    line-height: 1.3;
    animation: floatFizzle 6s linear forwards;
}

@keyframes floatFizzle {
    0% {
        transform: translateY(0);
        opacity: 0;
    }
    10% {
        opacity: 0.6;
    }
    90% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(150px);
        opacity: 0;
    }
}

.page-wrapper {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem 2rem;
}

.top-bar {
    display: flex;
    justify-content: center;
    animation: fadeSlideDown 1s ease 0.2s both;
}

.gauge-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 100px;
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-primary);
    transition: all 0.6s ease-in-out;
    cursor: pointer;
    text-decoration: none;
}

.gauge-badge:hover {
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.5);
    filter: drop-shadow(0 4px 40px rgba(255, 255, 255, 0.4));
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.pin-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
    min-height: 0;
    overflow: visible;
}

.weather-scene {
    position: relative;
    width: 180px;
    height: 70px;
    animation: fadeSlideDown 1s ease 0.4s both;
}

.cloud {
    position: absolute;
}

.cloud-body {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    position: relative;
}

.cloud-body::before,
.cloud-body::after {
    content: '';
    position: absolute;
    background: inherit;
    border-radius: 50%;
}

.cloud-1 {
    top: 20px;
    left: 30px;
    animation: cloudDrift 8s ease-in-out infinite;
}

.cloud-1 .cloud-body {
    width: 120px;
    height: 36px;
}

.cloud-1 .cloud-body::before {
    width: 44px;
    height: 44px;
    top: -22px;
    left: 24px;
}

.cloud-1 .cloud-body::after {
    width: 32px;
    height: 32px;
    top: -14px;
    left: 60px;
}

.cloud-2 {
    top: 10px;
    left: -10px;
    opacity: 0.5;
    animation: cloudDrift 12s ease-in-out infinite reverse;
}

.cloud-2 .cloud-body {
    width: 70px;
    height: 22px;
}

.cloud-2 .cloud-body::before {
    width: 26px;
    height: 26px;
    top: -14px;
    left: 14px;
}

.cloud-2 .cloud-body::after {
    width: 20px;
    height: 20px;
    top: -8px;
    left: 36px;
}

.cloud-3 {
    top: 40px;
    right: -5px;
    opacity: 0.35;
    animation: cloudDrift 10s ease-in-out 2s infinite;
}

.cloud-3 .cloud-body {
    width: 60px;
    height: 18px;
}

.cloud-3 .cloud-body::before {
    width: 22px;
    height: 22px;
    top: -12px;
    left: 10px;
}

.cloud-3 .cloud-body::after {
    width: 16px;
    height: 16px;
    top: -6px;
    left: 30px;
}

.sun-orb {
    display: none;
}

.sunny-mode .sun-orb {
    display: block;
    position: absolute;
    top: -10px;
    right: 0;
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #ffe066 0%, #ffcc00 40%, rgba(255, 200, 0, 0) 70%);
    border-radius: 50%;
    animation: sunPulse 4s ease-in-out infinite;
}

.sunny-mode .cloud-body {
    background: rgba(255, 255, 255, 0.6);
}

@keyframes cloudDrift {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(12px); }
}

@keyframes sunPulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.15); opacity: 1; }
}

.streak-display {
    animation: fadeSlideUp 1s ease 0.6s both;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.streak-display:hover {
    transform: scale(1.05);
}

.streak-intro {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    letter-spacing: 0.5px;
}

.number-wrap {
    position: relative;
    display: inline-block;
}

.streak-number {
    font-family: 'Space Mono', monospace;
    font-size: clamp(5rem, 15vw, 10rem);
    font-weight: 700;
    line-height: 1;
    display: block;
    background: linear-gradient(180deg, rgba(255,255,255,1) 0%, rgba(255,255,255,0.6) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 4px 20px rgba(0,0,0,0.15));
    transition: text-shadow 0.6s ease-in-out, filter 0.6s ease-in-out;
}

.streak-display:hover .streak-number {
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.5);
    filter: drop-shadow(0 4px 40px rgba(255, 255, 255, 0.4));
}

.info-hint {
    position: absolute;
    top: 10%;
    right: -25px;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-muted);
    opacity: 0.6;
    transition: all 0.4s ease;
    animation: pulseHint 3s infinite;
}

.info-serif {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.6rem;
    line-height: 1;
}

.streak-display:hover .info-hint {
    opacity: 1;
    color: var(--text-primary);
    transform: scale(1.2);
}

@keyframes pulseHint {
    0%, 100% { opacity: 0.4; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.streak-unit-new {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    letter-spacing: 0.5px;
}

.details-strip {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 1rem 2rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeSlideUp 1s ease 0.8s both;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.detail-label-new {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 1rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.detail-value {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.detail-sub-new {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.1rem;
    text-transform: lowercase;
}

.detail-divider {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
}

.rainy-mode .status-value::after {
    content: "still raining";
}

.sunny-mode .status-value::after {
    content: "dry at last!";
}

.bottom-bar {
    text-align: center;
    animation: fadeSlideUp 1s ease 1s both;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
}

.source-tag {
    font-size: 0.7rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.made-by {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.5px;
}

.linkedin-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 4px;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.overlay-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    padding: 3rem;
    width: 90%;
    max-width: 800px;
    position: relative;
    transform: translateY(30px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.overlay.active .overlay-content {
    transform: translateY(0);
}

.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 2.5rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-btn:hover {
    color: var(--text-primary);
}

.chart-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.chart-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 700;
}

.total-badge {
    text-align: right;
}

.total-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
}

.total-value {
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
}

.chart-container {
    height: 350px;
    width: 100%;
}

@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@media (max-width: 600px) {
    .page-wrapper {
        padding: 1rem;
    }

    .details-strip {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem 1.5rem;
    }

    .detail-divider {
        width: 40px;
        height: 1px;
    }

    .detail-item {
        align-items: center;
    }

    .streak-unit {
        letter-spacing: 4px;
        font-size: 0.85rem;
    }

    .gauge-badge {
        font-size: 0.75rem;
    }
}
