/* CLOCK PAGE ONLY */

.clock-page{
    min-height:100vh;
    background:#050913;
    --clock-accent:#4da3ff;
    --clock-text:#ffffff;
    --clock-bg:#050913;
    --clock-card-color:rgba(255,255,255,.12);
    --clock-size:120px;
    --clock-date-size:32px;
    --clock-glow:35px;
    --clock-blur:24px;
    --clock-speed:8s;
    --clock-roundness:34px;
    --clock-spacing:0px;
}

.clock-app{
    min-height:100vh;
    width:100vw;
    padding:0;
    margin:0;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
    background:var(--clock-bg);
}

.clock-stage{
    min-height:100vh;
    height:100vh;
    width:100vw;
    padding:0;
    margin:0;
    position:relative;
    overflow:hidden;
    display:flex;
    align-items:center;
    justify-content:center;
    background-size:300% 300%;
    animation:clockBackgroundMove var(--clock-speed) ease-in-out infinite alternate;
}

.clock-live-layer{
    position:absolute;
    inset:0;
    pointer-events:none;
    z-index:1;
    opacity:.55;
}

.clock-scanline{
    display:none;
    position:absolute;
    inset:0;
    z-index:2;
    height:22%;
    background:linear-gradient(to bottom,transparent,rgba(255,255,255,.12),transparent);
    animation:clockScan 4s linear infinite;
}

.clock-display-card{
    position:relative;
    z-index:5;
    width:min(1250px,94vw);
    text-align:center;
    padding:60px 34px;
    border:1px solid rgba(255,255,255,.14);
    border-radius:var(--clock-roundness);
    background:var(--clock-card-color);
    backdrop-filter:blur(var(--clock-blur));
    -webkit-backdrop-filter:blur(var(--clock-blur));
    box-shadow:0 30px 90px rgba(0,0,0,.35);
}

.clock-label{
    color:var(--clock-accent);
    font-weight:900;
    text-transform:uppercase;
    letter-spacing:2px;
    margin-bottom:16px;
}

#bigClock{
    color:var(--clock-text);
    font-size:clamp(48px, calc(var(--clock-size) / 10), calc(var(--clock-size) * 1.55));
    letter-spacing:var(--clock-spacing);
    line-height:1.08;
    text-shadow:
        0 0 var(--clock-glow) var(--clock-accent),
        0 0 calc(var(--clock-glow) * 1.8) rgba(255,255,255,.2);
}

.clock-date{
    margin-top:18px;
    font-size:var(--clock-date-size);
    color:rgba(255,255,255,.86);
}

.clock-subtext{
    margin:22px auto 0;
    max-width:760px;
    color:rgba(255,255,255,.68);
    line-height:1.7;
}

/* floating buttons */

.clock-floating-buttons{
    position:fixed;
    top:24px;
    right:24px;
    display:flex;
    flex-direction:row;
    gap:12px;
    z-index:999999;
}

.clock-fab,
.clock-settings-fab,
.clock-fullscreen-fab{
    width:56px;
    height:56px;
    min-width:56px;
    min-height:56px;
    border-radius:50%;
    border:1px solid rgba(255,255,255,.18);
    background:rgba(16,23,37,.88);
    color:white;
    font-size:24px;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
    box-shadow:0 20px 55px rgba(0,0,0,.35);
    appearance:none;
    transition:.25s ease;
}

.clock-fab:hover,
.clock-settings-fab:hover,
.clock-fullscreen-fab:hover{
    transform:scale(1.08);
    border-color:var(--clock-accent);
    box-shadow:
        0 0 20px rgba(255,255,255,.15),
        0 0 35px var(--clock-accent);
}

/* controls */

.clock-controls{
    position:fixed;
    top:96px;
    right:24px;
    width:min(470px,calc(100vw - 32px));
    max-height:calc(100vh - 120px);
    overflow-y:auto;
    display:grid;
    gap:16px;
    z-index:999998;
    transform:translateX(calc(100% + 60px));
    transition:.35s ease;
    padding-bottom:18px;
}

.clock-controls.open{
    transform:translateX(0);
}

.clock-control-card{
    background:rgba(16,23,37,.94);
    border:1px solid rgba(255,255,255,.12);
    border-radius:26px;
    padding:24px;
    backdrop-filter:blur(18px);
    -webkit-backdrop-filter:blur(18px);
    box-shadow:0 20px 55px rgba(0,0,0,.28);
}

.clock-control-header{
    display:flex;
    justify-content:space-between;
    gap:18px;
}

.clock-control-card h2,
.clock-control-card h3{
    color:white;
    margin-bottom:12px;
}

.clock-control-card p{
    color:#c3cada;
    line-height:1.6;
}

.clock-close-btn{
    width:42px;
    height:42px;
    border-radius:14px;
    border:1px solid rgba(255,255,255,.14);
    background:rgba(255,255,255,.06);
    color:white;
    font-size:26px;
    cursor:pointer;
}

.clock-button-grid,
.clock-toggle-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
    margin-top:14px;
}

.clock-button-grid button,
.clock-toggle-grid button{
    appearance:none;
    min-height:52px;
    padding:13px 14px;
    border-radius:16px;
    background:linear-gradient(145deg,rgba(255,255,255,.10),rgba(255,255,255,.025));
    border:1px solid rgba(255,255,255,.12);
    color:white;
    font-size:15px;
    font-weight:900;
    cursor:pointer;
    transition:.22s ease;
}

.clock-button-grid button:hover,
.clock-toggle-grid button:hover,
.clock-button-grid button.active,
.clock-toggle-grid button.active{
    background:linear-gradient(145deg,var(--clock-accent),rgba(255,255,255,.10));
    color:#06101f;
    border-color:var(--clock-accent);
    box-shadow:0 0 24px var(--clock-accent);
}

/* font previews */

.font-preview-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
    margin-top:14px;
}

.font-preview{
    appearance:none;
    min-height:70px;
    border-radius:18px;
    border:1px solid rgba(255,255,255,.12);
    background:linear-gradient(145deg,rgba(255,255,255,.10),rgba(255,255,255,.025));
    color:white;
    cursor:pointer;
    transition:.22s ease;
    font-size:22px;
}

.font-preview:hover,
.font-preview.active{
    border-color:var(--clock-accent);
    box-shadow:
        0 0 20px rgba(255,255,255,.10),
        0 0 32px var(--clock-accent);
    transform:translateY(-3px);
}

.font-preview-poppins{font-family:"Poppins",Arial,sans-serif;font-weight:800;}
.font-preview-eightbit{font-family:"Press Start 2P",monospace;font-size:13px;}
.font-preview-roboto{font-family:"Roboto Mono",monospace;}
.font-preview-poiret{font-family:"Poiret One",cursive;font-size:28px;}
.font-preview-quicksand{font-family:"Quicksand",sans-serif;font-weight:700;}
.font-preview-raleway{font-family:"Raleway",sans-serif;font-weight:900;}
.font-preview-righteous{font-family:"Righteous",cursive;}
.font-preview-serif{font-family:"PT Serif",Georgia,serif;}

.clock-font-poppins #bigClock{font-family:"Poppins",Arial,sans-serif;}
.clock-font-eightbit #bigClock{
    font-family:"Press Start 2P",monospace;
    line-height:1.35;
    font-weight:400;
}
.clock-font-robotoMono #bigClock{font-family:"Roboto Mono",monospace;}
.clock-font-poiret #bigClock{font-family:"Poiret One",cursive;}
.clock-font-quicksand #bigClock{font-family:"Quicksand",sans-serif;}
.clock-font-raleway #bigClock{font-family:"Raleway",sans-serif;}
.clock-font-righteous #bigClock{font-family:"Righteous",cursive;}
.clock-font-serif #bigClock{font-family:"PT Serif",Georgia,serif;}

.clock-bold #bigClock{font-weight:900;}
.clock-italic #bigClock{font-style:italic;}

/* presets */

.clock-preset-grid,
.live-background-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
    margin-top:16px;
}

.preset-button,
.live-bg-button{
    appearance:none;
    min-height:56px;
    padding:14px 16px;
    border-radius:18px;
    background:linear-gradient(145deg,rgba(255,255,255,.10),rgba(255,255,255,.025));
    color:white;
    font-size:15px;
    font-weight:900;
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:10px;
    cursor:pointer;
    border:1px solid rgba(255,255,255,.12);
    box-shadow:0 10px 28px rgba(0,0,0,.22);
    backdrop-filter:blur(12px);
    -webkit-backdrop-filter:blur(12px);
    transition:.22s ease;
}

.preset-button:hover,
.live-bg-button:hover,
.preset-button.active,
.live-bg-button.active{
    transform:translateY(-3px);
    border-color:var(--clock-accent);
    box-shadow:
        0 0 20px rgba(255,255,255,.10),
        0 0 32px var(--clock-accent);
}

.preset-button.active,
.live-bg-button.active{
    background:linear-gradient(145deg,rgba(77,163,255,.35),rgba(255,255,255,.06));
}

.preset-swatch{
    width:18px;
    height:18px;
    border-radius:50%;
    flex:0 0 auto;
    box-shadow:0 0 14px rgba(255,255,255,.28);
}

.live-bg-icon{
    font-size:22px;
}

/* sliders/colors */

.clock-slider-label,
.clock-color-label{
    display:grid;
    gap:10px;
    color:#c3cada;
    font-weight:900;
    margin-top:16px;
}

.clock-slider-label input{
    width:100%;
    accent-color:var(--clock-accent);
}

.clock-color-label input{
    width:100%;
    height:44px;
    border:none;
    border-radius:14px;
    background:transparent;
    cursor:pointer;
}

/* layout */

.clock-align-center .clock-display-card{text-align:center;}
.clock-align-left .clock-display-card{text-align:left;}
.clock-align-right .clock-display-card{text-align:right;}

.clock-no-card .clock-display-card{
    background:transparent;
    border-color:transparent;
    box-shadow:none;
    backdrop-filter:none;
    -webkit-backdrop-filter:none;
}

.clock-no-glass .clock-display-card{
    backdrop-filter:none;
    -webkit-backdrop-filter:none;
}

.clock-compact .clock-display-card{
    padding:24px 18px;
}

/* analog clock */

.analog-clock-wrap{
    display:none;
    align-items:center;
    justify-content:center;
    margin:10px auto 20px;
}

.analog-clock{
    width:min(520px,70vw);
    height:min(520px,70vw);
    border-radius:50%;
    position:relative;
    border:6px solid var(--clock-accent);
    box-shadow:
        0 0 var(--clock-glow) var(--clock-accent),
        inset 0 0 45px rgba(255,255,255,.08);
    background:rgba(255,255,255,.04);
}

.hand{
    position:absolute;
    left:50%;
    bottom:50%;
    transform-origin:bottom center;
    transform:translateX(-50%) rotate(0deg);
    border-radius:999px;
}

.hour-hand{
    width:12px;
    height:28%;
    background:var(--clock-text);
}

.minute-hand{
    width:8px;
    height:38%;
    background:var(--clock-text);
}

.second-hand{
    width:4px;
    height:43%;
    background:var(--clock-accent);
    box-shadow:0 0 14px var(--clock-accent);
}

.analog-center{
    position:absolute;
    left:50%;
    top:50%;
    width:24px;
    height:24px;
    border-radius:50%;
    transform:translate(-50%,-50%);
    background:var(--clock-accent);
    box-shadow:0 0 16px var(--clock-accent);
}

.analog-number{
    position:absolute;
    color:var(--clock-text);
    font-family:"Poppins",Arial,sans-serif;
    font-weight:900;
    font-size:34px;
}

.n12{top:18px;left:50%;transform:translateX(-50%);}
.n3{right:24px;top:50%;transform:translateY(-50%);}
.n6{bottom:18px;left:50%;transform:translateX(-50%);}
.n9{left:24px;top:50%;transform:translateY(-50%);}

/* live backgrounds */

.live-aurora{
    background:radial-gradient(circle at 20% 20%,rgba(77,163,255,.25),transparent 22%),
               radial-gradient(circle at 80% 70%,rgba(168,85,247,.25),transparent 28%);
    animation:floatLive 8s ease-in-out infinite alternate;
}

.live-matrix{
    background:repeating-linear-gradient(90deg,rgba(34,197,94,.16) 0 1px,transparent 1px 70px);
    animation:matrixMove 4s linear infinite;
}

.live-snow{
    background:radial-gradient(circle,rgba(255,255,255,.9) 1px,transparent 2px);
    background-size:45px 45px;
    animation:snowFall 8s linear infinite;
}

.live-stars{
    background:radial-gradient(circle,rgba(255,255,255,.7) 1px,transparent 2px);
    background-size:60px 60px;
    animation:starTwinkle 3s ease-in-out infinite alternate;
}

.live-waves{
    background:repeating-radial-gradient(circle at center,rgba(77,163,255,.18) 0 2px,transparent 2px 55px);
    animation:wavePulse 5s linear infinite;
}

.live-fireflies{
    background:
        radial-gradient(circle at 20% 40%,rgba(250,204,21,.8) 0 2px,transparent 4px),
        radial-gradient(circle at 70% 30%,rgba(250,204,21,.6) 0 2px,transparent 4px),
        radial-gradient(circle at 50% 80%,rgba(250,204,21,.7) 0 2px,transparent 4px);
    animation:fireflyMove 6s ease-in-out infinite alternate;
}

.live-warp{
    background:repeating-radial-gradient(circle at center,rgba(255,255,255,.22) 0 1px,transparent 1px 35px);
    animation:warpMove 3s linear infinite;
}

.live-rain{
    background:repeating-linear-gradient(115deg,rgba(77,163,255,.18) 0 2px,transparent 2px 22px);
    animation:rainFall .9s linear infinite;
}

.live-bokeh{
    background:
        radial-gradient(circle at 25% 25%,rgba(255,255,255,.18),transparent 9%),
        radial-gradient(circle at 75% 55%,rgba(77,163,255,.2),transparent 12%),
        radial-gradient(circle at 45% 75%,rgba(236,72,153,.14),transparent 10%);
    animation:bokehMove 9s ease-in-out infinite alternate;
}

.live-lava{
    background:
        radial-gradient(circle at 30% 70%,rgba(249,115,22,.35),transparent 20%),
        radial-gradient(circle at 80% 20%,rgba(220,38,38,.30),transparent 22%);
    animation:lavaMove 5s ease-in-out infinite alternate;
}

.live-pulse{
    background:radial-gradient(circle at center,rgba(77,163,255,.30),transparent 24%);
    animation:pulseLive 2s ease-in-out infinite;
}

.live-confetti{
    background:
        radial-gradient(circle at 20% 20%,#f43f5e 0 2px,transparent 3px),
        radial-gradient(circle at 50% 40%,#22c55e 0 2px,transparent 3px),
        radial-gradient(circle at 70% 70%,#3b82f6 0 2px,transparent 3px),
        radial-gradient(circle at 35% 80%,#facc15 0 2px,transparent 3px);
    background-size:130px 130px;
    animation:confettiFall 5s linear infinite;
}

.live-fade{
    background:linear-gradient(135deg,rgba(77,163,255,.2),rgba(168,85,247,.2),rgba(236,72,153,.18));
    background-size:300% 300%;
    animation:clockBackgroundMove 8s ease infinite alternate;
}

.live-neon{
    background:linear-gradient(120deg,rgba(236,72,153,.22),transparent 30%,rgba(59,130,246,.22));
    animation:floatLive 6s ease-in-out infinite alternate;
}

/* fullscreen */

.clock-fullscreen .clock-app,
.clock-fullscreen .clock-stage{
    min-height:100vh;
    height:100vh;
    width:100vw;
}

.clock-fullscreen.clock-idle{
    cursor:none;
}

.clock-fullscreen.clock-idle .clock-floating-buttons,
.clock-fullscreen.clock-idle .clock-controls{
    opacity:0;
    pointer-events:none;
}

/* mobile */

@media(max-width:900px){
    .clock-floating-buttons{
        top:18px;
        right:18px;
    }

    .clock-fab,
    .clock-settings-fab,
    .clock-fullscreen-fab{
        width:50px;
        height:50px;
        min-width:50px;
        min-height:50px;
    }

    .clock-controls{
        top:82px;
        right:16px;
        width:calc(100vw - 32px);
    }

    .clock-button-grid,
    .font-preview-grid,
    .clock-preset-grid,
    .live-background-grid{
        grid-template-columns:1fr;
    }

    .clock-display-card{
        padding:38px 18px;
    }

    .analog-clock{
        width:76vw;
        height:76vw;
    }
}

/* animations */

@keyframes clockBackgroundMove{
    0%{background-position:0% 50%}
    100%{background-position:100% 50%}
}

@keyframes floatLive{
    from{transform:translate(-3%,-2%) scale(1)}
    to{transform:translate(3%,2%) scale(1.08)}
}

@keyframes matrixMove{
    from{background-position:0 0}
    to{background-position:120px 0}
}

@keyframes snowFall{
    from{background-position:0 -120px}
    to{background-position:0 120px}
}

@keyframes starTwinkle{
    from{opacity:.25}
    to{opacity:.7}
}

@keyframes wavePulse{
    from{background-size:55px 55px}
    to{background-size:95px 95px}
}

@keyframes fireflyMove{
    from{transform:translate(-3%,2%);opacity:.35}
    to{transform:translate(4%,-3%);opacity:.85}
}

@keyframes warpMove{
    from{background-size:35px 35px}
    to{background-size:90px 90px}
}

@keyframes rainFall{
    from{background-position:0 -100px}
    to{background-position:0 100px}
}

@keyframes bokehMove{
    from{transform:scale(1) translateX(-2%)}
    to{transform:scale(1.08) translateX(2%)}
}

@keyframes lavaMove{
    from{transform:scale(1) rotate(0deg)}
    to{transform:scale(1.12) rotate(4deg)}
}

@keyframes pulseLive{
    0%,100%{transform:scale(.9);opacity:.25}
    50%{transform:scale(1.15);opacity:.65}
}

@keyframes confettiFall{
    from{background-position:0 -130px}
    to{background-position:0 130px}
}

@keyframes clockScan{
    from{transform:translateY(-140%)}
    to{transform:translateY(520%)}
}