@font-face {
    font-family: 'joxit';
    src: url('joxit.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: #000;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: pan-x pan-y;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
}

body.no-interaction {
    user-select: none;
}

.container {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 20px solid;
    box-sizing: border-box;
    transition: border-color 0.5s, opacity 0.5s;
    position: relative;
    z-index: 1;
}

.logo {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #fff;
    font-family: 'joxit', sans-serif;
    font-weight: normal;
    font-size: 70px;
    line-height: 1;
    margin: -0.2505em 0 0 0;
    padding: 0;
    cursor: pointer;
    will-change: transform;
}

.view-counter {
    position: absolute;
    bottom: 20px;
    left: 20px;
    margin: 0;
    background-color: #fff;
    color: #000;
    font-family: 'joxit', sans-serif;
    font-size: 24px;
    padding: 10px;
    z-index: 1;
    transition: opacity 0.5s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-counter.unavailable {
    width: 20px;
    height: 20px;
    padding: 0;
    background-color: #fff;
}

.clock {
    position: absolute;
    top: 20px;
    right: 20px;
    margin: 0;
    background-color: #fff;
    color: #000;
    font-family: 'joxit', sans-serif;
    font-weight: normal;
    font-size: 24px;
    line-height: 1;
    padding: 10px;
    z-index: 1;
    transition: color 0.5s, opacity 0.5s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.weather-temp {
    position: absolute;
    right: 20px;
    margin: 0;
    background-color: #fff;
    color: #000;
    font-family: 'joxit', sans-serif;
    font-weight: normal;
    font-size: 24px;
    line-height: 1;
    padding: 10px;
    z-index: 1;
    transition: opacity 0.5s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.weather-temp.unavailable {
    width: 20px;
    height: 20px;
    padding: 0;
    background-color: #fff;
}

.moving-square {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 20px;
    height: 20px;
    background-color: #fff;
    animation: move 0.15s infinite alternate;
    z-index: 2;
    cursor: pointer;
    transition: opacity 0.5s;
}

@keyframes move {
    0% { transform: translateX(0); }
    100% { transform: translateX(-20px); }
}

@media (max-width: 600px) {
    .logo { font-size: 85px; }
}

@media (min-width: 601px) and (max-width: 900px) {
    .logo { font-size: 85px; }
}

@media (min-width: 901px) {
    .logo { font-size: 120px; }
}

.snowflake,
.raindrop,
.hail {
    position: absolute;
    background-color: #fff;
    opacity: 0.8;
    pointer-events: none;
    animation: fall linear infinite;
    z-index: 0;
    top: -15px;
}

@keyframes fall {
    to { transform: translateY(100vh); }
}

.lightning-flash {
    position: fixed;
    inset: 0;
    background-color: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 3;
    transition: opacity 0.08s ease-out;
}

.lightning-flash.flash {
    opacity: 0.25;
}

.cloud {
    position: absolute;
    background-color: #fff;
    opacity: 0.1;
    pointer-events: none;
    animation: drift linear infinite;
    z-index: 0;
    left: 0;
}

@keyframes drift {
    from { transform: translateX(-30vw); }
    to { transform: translateX(130vw); }
}

.fog-overlay {
    position: fixed;
    inset: 0;
    background-color: #fff;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

.fog-overlay.active {
    animation: fogPulse 6s ease-in-out infinite;
}

@keyframes fogPulse {
    0%, 100% { opacity: 0.08; }
    50% { opacity: 0.18; }
}

.confetti {
    position: absolute;
    top: -10px;
    pointer-events: none;
    z-index: 4;
    animation: confettiFall ease-in forwards;
}

@keyframes confettiFall {
    to { transform: translateY(110vh) rotate(720deg); opacity: 0.2; }
}

.cursor-trail {
    position: fixed;
    width: 6px;
    height: 6px;
    background-color: #fff;
    pointer-events: none;
    z-index: 5;
    transform: translate(-50%, -50%);
    animation: trailFade 0.5s ease-out forwards;
}

@keyframes trailFade {
    to { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
}

.fade-out {
    opacity: 0 !important;
}

.screensaver-clock,
.screensaver-temp {
    position: fixed;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'joxit', sans-serif;
    color: #fff;
    opacity: 0;
    transition: opacity 1s;
    pointer-events: none;
    z-index: 0;
}

.screensaver-clock {
    top: 50%;
    font-size: 10vw;
}

.screensaver-temp {
    top: 62%;
    font-size: 3vw;
}

.screensaver-clock.visible,
.screensaver-temp.visible {
    opacity: 0.07;
}

@media (max-aspect-ratio: 1/1) {
    .screensaver-clock {
        transform: translate(-50%, -50%) rotate(90deg);
        font-size: 10vh;
    }
    .screensaver-temp {
        top: 62%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(90deg);
        font-size: 3vh;
    }
}

@media (prefers-reduced-motion: reduce) {
    .moving-square,
    .snowflake,
    .raindrop,
    .hail,
    .cloud,
    .fog-overlay.active,
    .confetti,
    .cursor-trail {
        animation: none !important;
    }
    .lightning-flash {
        display: none;
    }
}
