/* ==========================================================
   MOBILE — centred buttons, labels under the buttons,
   clock scaled to fit the screen (all themes)
   ========================================================== */
.label::after {
    content: attr(data-name);
    display: none;
}

@media only screen and (max-width: 600px) {
    /* centred row of buttons */
    .radiogroup {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 auto;
        padding: 18px 8px 34px !important;
        display: flex;
        justify-content: center !important;
        align-items: flex-start;
    }
    .wrapper { margin: 0 7px !important; }
    .indicator { width: 46px; height: 46px; }

    /* keep only the first letter inside the button */
    .text,
    .text.start,
    .state:hover ~ .label .text,
    .state:focus ~ .label .text,
    .state:focus:hover ~ .label .text {
        left: 0 !important;
        right: 0 !important;
        width: auto !important;
        text-align: center !important;
        font-size: 0 !important;
    }

    /* full name under the button */
    .label::after {
        display: block;
        position: absolute;
        top: calc(100% + 6px);
        left: 50%;
        transform: translateX(-50%);
        font-size: .8rem;
        line-height: 1;
        white-space: nowrap;
        color: inherit;
        opacity: 0;
        pointer-events: none;
        animation: lblIntro 3.6s ease forwards;
        transition: opacity .25s ease;
    }
    .state:checked ~ .label::after,
    .state:hover ~ .label::after {
        opacity: 1;
        animation: none;
    }
    @keyframes lblIntro {
        0%, 85% { opacity: 1; }
        100%    { opacity: 0; }
    }

    /* fonts and colours of the labels per theme */
    .doom  .label::after { font-family: 'Orbitron', sans-serif; font-size: .62rem; letter-spacing: .08em; }
    .goose .label::after { font-family: 'Rubik', sans-serif; font-size: .72rem; font-weight: 500; }
    .goose.night .label::after { color: #fff3c4; }
    .comic .label::after { font-family: 'Bangers', sans-serif; font-size: .9rem; letter-spacing: .05em; -webkit-text-stroke: .5px #120103; }
    .space .label::after { font-family: 'Exo 2', sans-serif; font-size: .68rem; letter-spacing: .1em; text-shadow: 0 0 8px rgba(170, 150, 255, .8); }
    /* doom button is "on" while the comic look is active */
    .comic #doom ~ .label::after { opacity: 1; animation: none; content: 'comic'; }

    /* clock scaled to fit */
    /* transform makes the box its own layer, so lift it above the floating dots */
    section .box { transform: scale(.86); z-index: 1; }
    .goose-peek.tl { left: 24px; margin-left: 0; }
}
@media only screen and (max-width: 480px) { section .box { transform: scale(.76); } }
@media only screen and (max-width: 420px) { .wrapper { margin: 0 5px !important; } .indicator { width: 44px; height: 44px; } }
@media only screen and (max-width: 400px) { section .box { transform: scale(.72); } }
@media only screen and (max-width: 360px) { section .box { transform: scale(.66); } .indicator { width: 40px; height: 40px; } .wrapper { margin: 0 4px !important; } }
@media only screen and (max-width: 330px) { section .box { transform: scale(.6); } .wrapper { margin: 0 3px !important; } .indicator { width: 38px; height: 38px; } }

/* The page has a global "* { font-family: Satisfy }" rule that hits every
   element directly, so the inner parts of these widgets must set their font too. */
.hg-time, .hg-time *, .hg-grains, .hg-grains * { font-family: 'Times New Roman', Times, serif !important; font-style: normal !important; }
.dm-count, .dm-count *          { font-family: 'Orbitron', 'Arial Black', sans-serif !important; }
.al-core, .al-core *            { font-family: 'Exo 2', sans-serif !important; }

/* ---------- keep the page exactly one screen wide (no sideways zoom/scroll) ---------- */
html, body {
    width: 100%;
    max-width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}
section {
    position: relative;
    overflow: hidden;
    width: 100%;
}
/* no double-tap zoom: taps on the clock switch screens instantly */
html, body, section, .circle, .label, #gooseSky, .goose-peek {
    touch-action: manipulation;
}

/* ---------- the "tap me" hand on the Happy New Year bubble, in every theme ---------- */
#touch {
    display: block !important;
    position: absolute;
    left: 0; right: 0;
    margin: auto;
    width: 32px;
    height: 32px;
    max-width: none;
    bottom: 65px;
    z-index: 3;
    color: #ff2a2a;
    pointer-events: none;
    animation: pulsing 1.5s ease-in-out 0s infinite;
}
.circle:hover #touch { opacity: 0; transition: opacity .3s; }
.red #touch       { color: #ffffff; }
.green #touch     { color: #F8B229; }
.violet #touch    { color: #e4e3e8; }
.doom #touch      { color: #9dff7a; filter: drop-shadow(0 0 6px rgba(157, 255, 122, .8)); }
.goose #touch     { color: #2b2d42; bottom: 80px; }
.comic #touch     { color: #120103; }
.space #touch     { color: #ecebff; filter: drop-shadow(0 0 6px rgba(185, 168, 255, .9)); }
.hourglass #touch { color: #3b2a1e; }
