/* ============================================================
   Clock Quest - learn to tell time
   Colour code used everywhere:  HOUR = orange   MINUTE = blue
   ============================================================ */

:root {
    --hour: #ff7a29;
    --hour-dark: #d85c0c;
    --min: #2f7dd1;
    --min-dark: #1c5a9e;
    --ink: #33334d;
    --ink-soft: #6b6b85;
    --paper: #fffdf7;
    --gold: #ffc93c;
    --good: #35c26b;
    --bad: #ef6461;
    --shadow: 0 6px 0 rgba(0, 0, 0, .09), 0 12px 26px rgba(70, 60, 120, .14);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    min-height: 100%;
}

body {
    font-family: 'Baloo 2', 'Trebuchet MS', sans-serif;
    color: var(--ink);
    background: linear-gradient(170deg, #bfe7ff 0%, #d9f0ff 40%, #fff3d6 100%);
    padding: 64px 14px 40px;
    overflow-x: hidden;
}

/* drifting clouds */
.sky {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.sky::before,
.sky::after {
    content: '';
    position: absolute;
    width: 110px;
    height: 38px;
    border-radius: 999px;
    background: #fff;
    box-shadow:
        26px -14px 0 4px #fff,
        58px 2px 0 -6px #fff,
        -6px 4px 0 -4px #fff;
    opacity: .6;
    animation: drift 60s linear infinite;
}

.sky::before {
    top: 8%;
    left: -300px;
}

.sky::after {
    top: 42%;
    left: -300px;
    transform: scale(.7);
    animation-duration: 90s;
    animation-delay: -30s;
}

@keyframes drift {
    to {
        transform: translateX(calc(100vw + 340px));
    }
}

.sky::after {
    animation-name: drift2;
}

@keyframes drift2 {
    to {
        transform: translateX(calc(100vw + 340px)) scale(.7);
    }
}

/* ---------------- top bar ---------------- */
.topbar {
    position: fixed;
    top: 10px;
    left: 0;
    right: 0;
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: center;
    z-index: 40;
}

.chip {
    font-family: inherit;
    font-size: .95rem;
    font-weight: 700;
    color: var(--ink);
    background: rgba(255, 255, 255, .86);
    border: 2px solid rgba(255, 255, 255, .95);
    border-radius: 999px;
    padding: .35rem .85rem;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(60, 60, 110, .13);
    transition: transform .12s;
}

.chip:hover {
    transform: translateY(-2px);
}

.chip.starcount {
    cursor: default;
    color: var(--hour-dark);
}

.chip .s {
    color: var(--gold);
    margin-right: .3rem;
}

.chip.off {
    opacity: .45;
}

body.at-start .topbar {
    display: none;
}

body.at-start {
    padding-top: 20px;
}

/* ---------------- screens ---------------- */
.screen {
    display: none;
    position: relative;
    z-index: 1;
    max-width: 1000px;
    margin: 0 auto;
    animation: fadeUp .35s ease both;
}

.screen.active {
    display: block;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
}

.card {
    background: var(--paper);
    border-radius: 28px;
    padding: 1.6rem 1.5rem 1.8rem;
    box-shadow: var(--shadow);
    text-align: center;
}

.start-card {
    max-width: 560px;
    margin: 0 auto;
}

.game-title {
    font-family: 'Fredoka One', cursive;
    font-size: clamp(2.2rem, 8vw, 3.2rem);
    line-height: 1;
    color: var(--min-dark);
    letter-spacing: 1px;
    margin: .2rem 0 .5rem;
}

.game-title span {
    color: var(--hour);
}

.tagline {
    font-size: 1.05rem;
    color: var(--ink-soft);
    margin-bottom: 1.2rem;
    line-height: 1.45;
}

.how-to {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    text-align: left;
    margin-bottom: 1.4rem;
}

.how-step {
    display: flex;
    align-items: center;
    gap: .8rem;
    background: #f4f8ff;
    border-radius: 16px;
    padding: .6rem .8rem;
}

.how-num.star {
    font-size: 1.2rem;
}

.how-num {
    flex: 0 0 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: var(--gold);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
}

.how-step p {
    font-size: .95rem;
    line-height: 1.35;
}

.hand-dot {
    display: block;
    border-radius: 3px;
}

.hand-dot.hour {
    width: 12px;
    height: 7px;
    background: var(--hour);
}

.hand-dot.minute {
    width: 20px;
    height: 4px;
    background: var(--min);
}

.c-hour {
    color: var(--hour-dark);
}

.c-min {
    color: var(--min-dark);
}

.tiny-note {
    font-size: .8rem;
    color: #a9a9bd;
    margin-top: .8rem;
}

/* ---------------- buttons ---------------- */
.btn {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    background: var(--min);
    border: none;
    border-radius: 999px;
    padding: .7rem 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 0 var(--min-dark);
    transition: transform .1s, box-shadow .1s, filter .15s;
}

.btn:hover {
    filter: brightness(1.07);
}

.btn:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 var(--min-dark);
}

.btn-huge {
    font-size: 1.5rem;
    padding: .85rem 2.6rem;
    background: var(--hour);
    box-shadow: 0 5px 0 var(--hour-dark);
}

.btn-huge:active {
    box-shadow: 0 1px 0 var(--hour-dark);
}

.btn-big {
    font-size: 1.15rem;
    padding: .75rem 1.9rem;
}

.btn-small {
    font-size: .85rem;
    padding: .45rem 1rem;
}

.btn-ghost {
    background: #fff;
    color: var(--min-dark);
    box-shadow: 0 4px 0 #cfe0f2;
}

.btn-ghost:active {
    box-shadow: 0 1px 0 #cfe0f2;
}

.btn-row {
    display: flex;
    gap: .7rem;
    align-items: center;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.btn-row.center {
    justify-content: center;
}

/* ---------------- map ---------------- */
.screen-title {
    font-family: 'Fredoka One', cursive;
    text-align: center;
    color: var(--min-dark);
    font-size: 1.8rem;
}

.screen-sub {
    text-align: center;
    color: var(--ink-soft);
    margin-bottom: 1.2rem;
}

.map {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: .9rem;
}

.lvl {
    position: relative;
    display: flex;
    align-items: center;
    gap: .8rem;
    text-align: left;
    background: var(--paper);
    border: 3px solid transparent;
    border-radius: 20px;
    padding: .8rem .9rem 1.7rem;
    cursor: pointer;
    font-family: inherit;
    box-shadow: var(--shadow);
    transition: transform .13s, border-color .13s;
}

.lvl:hover {
    transform: translateY(-3px);
    border-color: var(--gold);
}

.lvl.locked {
    opacity: .5;
    cursor: not-allowed;
    filter: grayscale(.6);
}

.lvl.locked:hover {
    transform: none;
    border-color: transparent;
}

.lvl-badge {
    flex: 0 0 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: #eef5ff;
}

.bsvg {
    width: 38px;
    height: 38px;
    display: block;
}

/* CSS padlock for locked levels - no emoji font needed */
.lock {
    position: relative;
    display: block;
    width: 17px;
    height: 13px;
    border-radius: 3px;
    background: #8a8aa0;
    margin-top: 6px;
}

.lock::before {
    content: '';
    position: absolute;
    left: 3px;
    top: -9px;
    width: 11px;
    height: 11px;
    border: 3px solid #8a8aa0;
    border-bottom: none;
    border-radius: 7px 7px 0 0;
    box-sizing: border-box;
}

.lvl-txt h3 {
    font-size: 1.02rem;
    line-height: 1.15;
}

.lvl-txt p {
    font-size: .8rem;
    color: var(--ink-soft);
    line-height: 1.25;
}

.lvl-stars {
    position: absolute;
    right: .7rem;
    bottom: .4rem;
    font-size: .85rem;
    letter-spacing: 1px;
    color: #ddd;
}

.lvl-stars b {
    color: var(--gold);
}

.lvl.playground {
    background: linear-gradient(135deg, #fff7e0, #ffeecb);
}

/* ---------------- lesson ---------------- */
.lesson-card {
    max-width: 620px;
    margin: 0 auto;
    position: relative;
    padding-top: 2.4rem;
}

.lesson-badge {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--gold);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    box-shadow: 0 4px 0 #dfa71d;
}

.lesson-card h2 {
    font-family: 'Fredoka One', cursive;
    color: var(--min-dark);
    font-size: 1.5rem;
    margin-bottom: .8rem;
}

.lesson-body {
    text-align: left;
    font-size: 1.02rem;
    line-height: 1.5;
    color: #4a4a63;
    margin-bottom: 1.3rem;
}

.lesson-body p {
    margin-bottom: .7rem;
}

.lesson-body .box {
    background: #f4f8ff;
    border-left: 5px solid var(--min);
    border-radius: 12px;
    padding: .7rem .9rem;
    margin: .8rem 0;
}

.lesson-body .box.warn {
    background: #fff4ef;
    border-color: var(--hour);
}

.lesson-body .big-eq {
    text-align: center;
    font-family: 'Fredoka One', cursive;
    font-size: 1.5rem;
    color: var(--ink);
    margin: .5rem 0;
}

.lesson-body .demo {
    display: grid;
    place-items: center;
    margin: .6rem 0;
}

.lesson-body svg.mini {
    width: 170px;
    height: 170px;
}

/* ---------------- game layout ---------------- */
.game-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 960px;
    margin: 0 auto .8rem;
    padding: 0 .3rem;
    flex-wrap: wrap;
}

.lvl-name {
    font-family: 'Fredoka One', cursive;
    color: var(--min-dark);
    font-size: 1.2rem;
}

.dots {
    display: flex;
    gap: .35rem;
}

.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: inset 0 0 0 2px #cfe0f2;
}

.dot.good {
    background: var(--good);
    box-shadow: none;
}

.dot.miss {
    background: var(--gold);
    box-shadow: none;
}

.dot.now {
    box-shadow: inset 0 0 0 3px var(--hour);
    transform: scale(1.2);
}

.play-area {
    display: grid;
    grid-template-columns: minmax(280px, 400px) 1fr;
    gap: 1.4rem;
    align-items: start;
    background: var(--paper);
    border-radius: 28px;
    padding: 1.3rem;
    box-shadow: var(--shadow);
}

.clock-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .7rem;
}

.clock-wrap {
    position: relative;
    width: 100%;
    max-width: 380px;
}

.clock {
    width: 100%;
    height: auto;
    display: block;
    touch-action: none;
}

.chime-ring {
    position: absolute;
    inset: 4%;
    border-radius: 50%;
    border: 5px solid var(--gold);
    opacity: 0;
    pointer-events: none;
}

.chime-ring.go {
    animation: chime .7s ease-out;
}

@keyframes chime {
    0% {
        opacity: .9;
        transform: scale(.9);
    }

    100% {
        opacity: 0;
        transform: scale(1.18);
    }
}

/* digital readout */
.digital {
    font-family: 'Fredoka One', cursive;
    font-size: 2.2rem;
    line-height: 1;
    background: #22243a;
    color: #fff;
    border-radius: 14px;
    padding: .35rem 1rem .45rem;
    letter-spacing: 2px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, .4);
}

.digital.big {
    font-size: 2.8rem;
}

.digital .d-h {
    color: #ffb672;
}

.digital .d-m {
    color: #8fc5ff;
}

.digital .d-c {
    color: #7a7a95;
    margin: 0 2px;
}

.digital.flash {
    animation: dflash .5s;
}

@keyframes dflash {

    0%,
    100% {
        background: #22243a;
    }

    50% {
        background: #3c6c3f;
    }
}

/* minute meter */
.meter {
    width: 100%;
    max-width: 340px;
}

.meter-label {
    font-size: .78rem;
    color: var(--ink-soft);
    text-align: center;
}

.meter-track {
    position: relative;
    height: 22px;
    background: #e9eef7;
    border-radius: 999px;
    overflow: hidden;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, .08);
}

.meter-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #8fc5ff, var(--min));
    border-radius: 999px;
    transition: width .4s ease;
}

.meter-fill.full {
    background: linear-gradient(90deg, #ffd98a, var(--hour));
}

.meter-tick {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, .8);
}

.meter-nums {
    display: flex;
    justify-content: space-between;
    font-size: .7rem;
    color: #a0a0b8;
    padding: 0 1px;
}

/* ask column */
.ask-col {
    display: flex;
    flex-direction: column;
}

.tico-row {
    display: flex;
    align-items: flex-end;
    gap: .6rem;
    margin-bottom: .8rem;
}

.bubble {
    flex: 1;
    position: relative;
    background: #eef5ff;
    border-radius: 16px 16px 16px 4px;
    padding: .6rem .85rem;
    font-size: .98rem;
    line-height: 1.35;
    min-height: 44px;
}

.bubble.pop {
    animation: pop .32s;
}

@keyframes pop {
    0% {
        transform: scale(.9);
    }

    60% {
        transform: scale(1.04);
    }
}

.bubble.good {
    background: #e4f9ec;
}

.bubble.bad {
    background: #fdeceb;
}

.story {
    background: #fffaea;
    border: 2px dashed #f0d79a;
    border-radius: 14px;
    padding: .7rem .9rem;
    font-size: 1rem;
    line-height: 1.45;
    margin-bottom: .8rem;
}

.story b {
    color: var(--hour-dark);
}

.prompt {
    font-family: 'Fredoka One', cursive;
    font-size: 1.25rem;
    line-height: 1.3;
    color: var(--ink);
    margin-bottom: .8rem;
}

.steps-done {
    display: flex;
    flex-direction: column;
    gap: .3rem;
    margin-bottom: .7rem;
}

.steps-done .sd {
    font-size: .9rem;
    color: #5c8f6d;
    background: #eef9f1;
    border-radius: 10px;
    padding: .3rem .6rem;
}

.steps-done .sd b {
    color: #2f7a4a;
}

/* answers */
.answers {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
}

.opt {
    font-family: 'Fredoka One', cursive;
    font-size: 1.4rem;
    letter-spacing: 1px;
    color: var(--ink);
    background: #fff;
    border: 3px solid #dde7f5;
    border-radius: 16px;
    padding: .5rem 1.05rem;
    cursor: pointer;
    transition: transform .12s, border-color .12s, background .12s;
}

.opt:hover {
    transform: translateY(-3px);
    border-color: var(--min);
}

.opt .oh {
    color: var(--hour-dark);
}

.opt .om {
    color: var(--min-dark);
}

.opt .oc {
    color: #bdbdd0;
}

.opt.word {
    font-family: 'Baloo 2', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0;
    line-height: 1.3;
    text-align: left;
    max-width: 100%;
}

.opt.right {
    background: #ddf7e6;
    border-color: var(--good);
    animation: bounce .45s;
}

.opt.wrong {
    background: #fde8e7;
    border-color: var(--bad);
    animation: shake .4s;
}

.opt.dim {
    opacity: .4;
}

.opt[disabled] {
    cursor: default;
}

.opt[disabled]:hover {
    transform: none;
    border-color: #dde7f5;
}

.opt.right[disabled]:hover {
    border-color: var(--good);
}

@keyframes bounce {
    0% {
        transform: scale(1);
    }

    40% {
        transform: scale(1.14);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-6px);
    }

    75% {
        transform: translateX(6px);
    }
}

/* two-row time picker */
.picker {
    width: 100%;
}

.picker .prow {
    margin-bottom: .6rem;
}

.picker .plabel {
    font-size: .85rem;
    font-weight: 700;
    margin-bottom: .25rem;
}

.picker .plabel.h {
    color: var(--hour-dark);
}

.picker .plabel.m {
    color: var(--min-dark);
}

.picker .pgrid {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.pbtn {
    font-family: 'Fredoka One', cursive;
    font-size: 1.05rem;
    min-width: 46px;
    background: #fff;
    border: 3px solid #dde7f5;
    border-radius: 12px;
    padding: .35rem .5rem;
    cursor: pointer;
    color: var(--ink);
    transition: transform .1s, border-color .1s, background .1s;
}

.pbtn:hover {
    transform: translateY(-2px);
}

.pbtn.on {
    color: #fff;
}

.prow.h .pbtn.on {
    background: var(--hour);
    border-color: var(--hour-dark);
}

.prow.m .pbtn.on {
    background: var(--min);
    border-color: var(--min-dark);
}

/* playground panel */
.pg-panel {
    background: #f4f8ff;
    border-radius: 18px;
    padding: .9rem;
}

.pg-hint {
    font-size: .95rem;
    margin-bottom: .7rem;
}

.pg-btns {
    display: flex;
    gap: .4rem;
    flex-wrap: wrap;
    margin-bottom: .5rem;
}

.pg-read {
    font-size: 1.02rem;
    line-height: 1.5;
    background: #fff;
    border-radius: 12px;
    padding: .6rem .8rem;
    margin-top: .4rem;
}

.pg-read .w {
    font-family: 'Fredoka One', cursive;
    color: var(--min-dark);
}

/* ---------------- overlay reward ---------------- */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(30, 30, 60, .55);
    display: none;
    place-items: center;
    z-index: 60;
    padding: 1rem;
}

.overlay.show {
    display: grid;
}

.reward-card {
    background: var(--paper);
    border-radius: 28px;
    padding: 1.8rem 1.6rem;
    text-align: center;
    max-width: 420px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
    animation: rise .4s cubic-bezier(.2, 1.4, .5, 1) both;
}

@keyframes rise {
    from {
        transform: scale(.7) translateY(30px);
        opacity: 0;
    }
}

.reward-stars {
    font-size: 2.6rem;
    letter-spacing: 6px;
    color: #e2e2ec;
    margin-bottom: .3rem;
}

.reward-stars b {
    color: var(--gold);
    display: inline-block;
    animation: starpop .45s both;
}

.reward-stars b:nth-child(2) {
    animation-delay: .16s;
}

.reward-stars b:nth-child(3) {
    animation-delay: .32s;
}

@keyframes starpop {
    from {
        transform: scale(0) rotate(-90deg);
    }

    70% {
        transform: scale(1.3) rotate(10deg);
    }
}

.reward-card h2 {
    font-family: 'Fredoka One', cursive;
    color: var(--min-dark);
    font-size: 1.5rem;
}

.reward-card p {
    color: var(--ink-soft);
    margin: .4rem 0 .3rem;
}

/* ---------------- confetti ---------------- */
.confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 70;
}

.conf {
    position: absolute;
    width: 10px;
    height: 14px;
    border-radius: 2px;
    animation: fall linear forwards;
}

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

/* ---------------- Tico the clock mascot ---------------- */
.tico {
    position: relative;
    width: 66px;
    height: 66px;
    flex: 0 0 66px;
}

.tico.big {
    width: 110px;
    height: 110px;
    margin: 0 auto;
}

.mascot-holder {
    height: 120px;
    display: grid;
    place-items: center;
}

.tico-body {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 28%, #fff, #ffe9c9 70%);
    border: 4px solid #ffb765;
    box-shadow: 0 4px 0 #e89b46, inset 0 -4px 10px rgba(255, 170, 80, .3);
    z-index: 2;
    animation: ticoBob 3s ease-in-out infinite;
}

.tico.big .tico-body {
    border-width: 6px;
}

@keyframes ticoBob {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-4px);
    }
}

.tico-eye {
    position: absolute;
    top: 30%;
    width: 11%;
    height: 15%;
    border-radius: 50%;
    background: #3a3a55;
    animation: blink 5s infinite;
}

.tico-eye.left {
    left: 27%;
}

.tico-eye.right {
    right: 27%;
}

@keyframes blink {

    0%,
    92%,
    100% {
        transform: scaleY(1);
    }

    95% {
        transform: scaleY(.1);
    }
}

.tico-cheek {
    position: absolute;
    top: 48%;
    width: 15%;
    height: 9%;
    border-radius: 50%;
    background: #ffb3b3;
    opacity: .75;
}

.tico-cheek.left {
    left: 12%;
}

.tico-cheek.right {
    right: 12%;
}

.tico-mouth {
    position: absolute;
    top: 55%;
    left: 50%;
    transform: translateX(-50%);
    width: 22%;
    height: 11%;
    border-radius: 0 0 40px 40px;
    background: #d9607a;
    transition: all .2s;
}

.tico.happy .tico-mouth {
    height: 18%;
    width: 30%;
}

.tico.think .tico-mouth {
    height: 5%;
    width: 16%;
    border-radius: 6px;
}

/* little hands drawn on Tico's face */
.tico-hand {
    position: absolute;
    left: 50%;
    bottom: 50%;
    transform-origin: bottom center;
    border-radius: 3px;
    opacity: .85;
}

.tico-hand.hr {
    width: 5px;
    height: 17%;
    margin-left: -2.5px;
    background: var(--hour);
    animation: spinHr 12s linear infinite;
}

.tico-hand.mn {
    width: 3px;
    height: 27%;
    margin-left: -1.5px;
    background: var(--min);
    animation: spinMn 4s linear infinite;
}

.tico.big .tico-hand.hr {
    width: 7px;
    margin-left: -3.5px;
}

.tico.big .tico-hand.mn {
    width: 4px;
    margin-left: -2px;
}

@keyframes spinHr {
    to {
        transform: rotate(360deg);
    }
}

@keyframes spinMn {
    to {
        transform: rotate(360deg);
    }
}

.tico-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 7px;
    height: 7px;
    margin: -3.5px 0 0 -3.5px;
    border-radius: 50%;
    background: #6b4a2a;
}

.tico-ear {
    position: absolute;
    top: -8%;
    width: 22%;
    height: 22%;
    border-radius: 50% 50% 0 0;
    background: #ffb765;
    z-index: 1;
}

.tico-ear.left {
    left: 14%;
    transform: rotate(-22deg);
}

.tico-ear.right {
    right: 14%;
    transform: rotate(22deg);
}

.tico-arm,
.tico-leg {
    position: absolute;
    background: #ffb765;
    border-radius: 999px;
    z-index: 1;
}

.tico-arm {
    width: 30%;
    height: 9%;
    top: 52%;
}

.tico-arm.left {
    left: -20%;
    transform: rotate(18deg);
    animation: wave 2.4s ease-in-out infinite;
    transform-origin: right center;
}

.tico-arm.right {
    right: -20%;
    transform: rotate(-18deg);
    animation: wave 2.4s ease-in-out infinite reverse;
    transform-origin: left center;
}

@keyframes wave {

    0%,
    100% {
        transform: rotate(14deg);
    }

    50% {
        transform: rotate(-16deg);
    }
}

.tico-leg {
    width: 10%;
    height: 24%;
    bottom: -16%;
}

.tico-leg.left {
    left: 30%;
}

.tico-leg.right {
    right: 30%;
}

/* ---------------- SVG clock parts ---------------- */
.clock .face {
    fill: #fffdf7;
    stroke: #3c3c5a;
    stroke-width: 5;
}

.clock .rim {
    fill: none;
    stroke: #ffd98a;
    stroke-width: 9;
}

.clock .tick {
    stroke: #9a9ab0;
    stroke-width: 1.6;
}

.clock .tick.five {
    stroke: #4a4a66;
    stroke-width: 3;
}

.clock .hnum {
    font-family: 'Fredoka One', cursive;
    font-size: 19px;
    fill: var(--hour-dark);
    text-anchor: middle;
    dominant-baseline: central;
    user-select: none;
}

.clock .mnum {
    font-family: 'Baloo 2', sans-serif;
    font-weight: 700;
    font-size: 12px;
    fill: var(--min-dark);
    text-anchor: middle;
    dominant-baseline: central;
    user-select: none;
    opacity: .9;
}

.clock .hand {
    stroke-linecap: round;
    transform-origin: 120px 120px;
}

.clock .hand.hour {
    stroke: var(--hour);
    stroke-width: 11;
}

.clock .hand.min {
    stroke: var(--min);
    stroke-width: 5.5;
}

.clock .hand.smooth {
    transition: transform .55s cubic-bezier(.3, 1.3, .5, 1);
}

.clock .hand.tween {
    transition: transform 1.1s cubic-bezier(.4, .05, .3, 1);
}

.clock .pin {
    fill: #3c3c5a;
}

.clock .hit {
    fill: none;
    stroke: transparent;
    stroke-width: 19;
    cursor: pointer;
    pointer-events: all;
}

.clock.tappable .hand {
    cursor: pointer;
}

.clock.tappable .hit:hover+.hand,
.clock .hand.hov {
    filter: drop-shadow(0 0 7px rgba(255, 201, 60, .95));
}

.clock .hand.chosen-right {
    filter: drop-shadow(0 0 9px var(--good));
}

.clock .hand.chosen-wrong {
    filter: drop-shadow(0 0 9px var(--bad));
}

.clock .mhit {
    fill: none;
    cursor: pointer;
    pointer-events: all;
}

.clock .mhit.on {
    fill: rgba(47, 125, 209, .16);
}

.clock .mnum.lit {
    fill: #fff;
}

.clock .mdisc {
    fill: var(--min);
    opacity: 0;
    transition: opacity .2s;
}

.clock .mdisc.lit {
    opacity: 1;
}

.clock .hdisc {
    fill: var(--gold);
    opacity: 0;
    transition: opacity .25s;
}

.clock .hdisc.lit {
    opacity: .9;
}

.clock .arc {
    fill: none;
    stroke: var(--gold);
    stroke-width: 7;
    stroke-linecap: round;
    opacity: .85;
}

.clock .arc.dash {
    stroke-dasharray: 5 7;
}

.clock .hgrab,
.clock .mgrab {
    cursor: grab;
}

.clock.dragging {
    cursor: grabbing;
}

.clock .halo {
    fill: none;
    stroke: var(--gold);
    stroke-width: 3;
    stroke-dasharray: 4 6;
    opacity: .7;
}

/* ---------------- responsive ---------------- */
@media (max-width: 760px) {
    .play-area {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .clock-wrap {
        max-width: 300px;
        margin: 0 auto;
    }

    .prompt {
        font-size: 1.12rem;
    }

    .opt {
        font-size: 1.2rem;
        padding: .45rem .85rem;
    }

    body {
        padding: 58px 10px 30px;
    }

    .lvl-name {
        font-size: 1.05rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: .01s !important;
        animation-iteration-count: 1 !important;
    }
}
