* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none
}

html,
body {
    height: 100%;
    margin: 0;
    background:
    linear-gradient(rgba(28, 19, 82, 0.10), rgba(28, 19, 82, 0.10)),
    url('bg.png') center center / cover no-repeat;
    overflow: hidden;
    font-family: Bangers, Impact, sans-serif;
    color: #fff;
    letter-spacing: 1px;
    touch-action: none;
    -webkit-touch-callout: none;
    overscroll-behavior: none
}

canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%
}

.scr,
.mod {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: safe center;
    flex-direction: column;
    gap: 12px;
    text-align: center;
    padding: env(safe-area-inset-top) 12px env(safe-area-inset-bottom);
    overflow-y: auto;
    touch-action: pan-y
}

.scr>* {
    flex-shrink: 0
}

.scr.on,
.mod.on {
    display: flex;
    animation: fi .4s
}

.scr {
    background: linear-gradient(rgba(0, 0, 20, .05), rgba(0, 0, 20, .5))
}

#pre {
    background: radial-gradient(#5a4a10, #0a0a24);
    z-index: 9
}

.mod {
    background: rgba(0, 0, 8, .72);
    z-index: 6
}

.box {
    background: linear-gradient(#0a2a24, #0a0a24);
    border: 4px solid #ffd23a;
    border-radius: 18px;
    padding: 20px 26px;
    max-width: 620px;
    width: 100%;
    box-shadow: 0 0 40px #ffd23a55, 0 20px 60px #000;
    animation: pop .45s;
    max-height: 94%;
    overflow: auto;
    touch-action: pan-y
}

h1 {
    font-size: clamp(46px, 11vw, 108px);
    margin: 0;
    line-height: .9;
    color: #ffd23a;
    -webkit-text-stroke: 3px #0a0a24;
    paint-order: stroke fill;
    text-shadow: 0 6px 0 #a87a00, 0 12px 0 #0a0a24, 0 0 40px #ffd23a88;
    transform: rotate(-2deg);
    animation: bob 2.5s ease-in-out infinite
}

h1 span {
    color: #fff
}

.sub {
    font: clamp(18px, 4vw, 32px) Anton, Impact;
    background: #0a0a24;
    padding: 6px 36px;
    letter-spacing: 6px;
    color: #ffd23a;
    clip-path: polygon(0 20%, 5% 0, 30% 12%, 60% 0, 95% 10%, 100% 40%, 96% 100%, 60% 88%, 30% 100%, 4% 90%)
}

h2 {
    margin: 0 0 8px;
    font-size: 34px;
    color: #ffd23a
}

.btn {
    font: inherit;
    font-size: 26px;
    letter-spacing: 2px;
    color: #fff;
    background: linear-gradient(#ffd23a, #d8a000 55%, #7a5a00);
    border: 3px solid #0a0a24;
    border-radius: 12px;
    padding: 8px 34px;
    min-width: 240px;
    cursor: pointer;
    box-shadow: inset 0 3px 0 #fff7, 0 6px 0 #4a3400, 0 12px 18px #0007;
    text-shadow: 0 2px 0 #0006;
    transition: .12s
}

.btn:hover {
    transform: translateY(-3px) scale(1.04)
}

.btn:active {
    transform: translateY(3px)
}

.btn.g {
    background: linear-gradient(#5b6575, #2a303a 60%, #1a1e25);
    box-shadow: inset 0 3px 0 #fff3, 0 6px 0 #000, 0 12px 18px #0007
}

.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center
}

p {
    margin: 6px 0;
    font: 19px/1.35 Arial, sans-serif;
    letter-spacing: 0
}

kbd {
    background: #333;
    border: 2px solid #fff;
    border-radius: 4px;
    padding: 0 7px;
    font-family: Bangers
}

.bar {
    width: min(420px, 80vw);
    height: 22px;
    border: 3px solid #fff;
    border-radius: 12px;
    position: relative;
    background: #000
}

#bf {
    height: 100%;
    width: 0;
    background: repeating-linear-gradient(45deg, #d8a000, #d8a000 10px, #ffd23a 10px, #ffd23a 20px);
    border-radius: 8px
}

#bi {
    position: absolute;
    top: -38px;
    left: 0;
    font-size: 34px;
    transform: translateX(-50%) rotate(-45deg)
}

.lg {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
    gap: 10px;
    max-width: 560px;
    width: 100%
}

.lt {
    font: inherit;
    font-size: 30px;
    color: #fff;
    background: linear-gradient(#1f2a48, #0b1020);
    border: 3px solid #ffd23a;
    border-radius: 12px;
    padding: 8px 0;
    cursor: pointer;
    animation: pop .4s both;
    box-shadow: inset 0 2px 0 #fff3, 0 4px 0 #000
}

.lt small {
    display: block;
    font-size: 16px;
    color: #555
}

.lt small b {
    color: #ffc928;
    font-weight: 400
}

.lt:hover:not(.lk) {
    transform: scale(1.1) rotate(-3deg);
    background: #d8a000
}

.lt.lk {
    opacity: .4;
    cursor: not-allowed
}

.gl {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center
}

.gk {
    border: 3px solid #333a55;
    border-radius: 14px;
    padding: 10px;
    width: clamp(130px, 30vw, 180px);
    background: #0b1020;
    cursor: pointer;
    font-size: 24px;
    transition: .15s
}

.gk:hover {
    transform: translateY(-3px)
}

.gk.sel {
    border-color: #ffd23a;
    box-shadow: 0 0 20px #ffd23a
}

.gk canvas {
    position: static;
    width: 100%;
    height: auto;
    display: block
}

.gk small {
    display: block;
    font: 16px Anton;
    color: #ffc928
}

.st {
    height: 6px;
    background: #333;
    border-radius: 3px;
    margin: 3px 0
}

.st i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #d8a000, #ffd23a);
    border-radius: 3px
}

.sr {
    font: 14px Anton;
    text-align: left
}

.tg {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    margin: 8px 0
}

.tg button {
    min-width: 90px;
    font: inherit;
    font-size: 22px;
    padding: 4px 14px;
    border-radius: 8px;
    border: 3px solid #0a0a24;
    color: #fff;
    background: #2a303a;
    cursor: pointer
}

.tg button.on {
    background: linear-gradient(#5be06a, #1f9a34)
}

#hud {
    position: fixed;
    inset: 0;
    pointer-events: none;
    display: none;
    z-index: 3
}

#hud.on {
    display: block
}

.t {
    background: #0a0a24;
    font: max(15px, calc(min(1vw, 1.7vh)*2.8)) Anton, Impact;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 24px 5px 16px;
    filter: drop-shadow(0 4px 0 #0006);
    border-bottom: 2px solid #ffd23a;
    clip-path: polygon(0 20%, 5% 2%, 18% 10%, 36% 0, 57% 9%, 78% 0, 94% 8%, 100% 24%, 97% 55%, 100% 82%, 90% 100%, 66% 90%, 45% 100%, 24% 88%, 8% 100%, 2% 78%, 4% 50%);
    width: max-content
}

.t small {
    font: inherit;
    color: #ffd23a
}

.t b {
    color: #ffd23a
}

#hl {
    position: absolute;
    left: calc(6px + env(safe-area-inset-left));
    top: calc(8px + env(safe-area-inset-top));
    display: flex;
    flex-direction: column;
    gap: 5px
}

#hr {
    position: absolute;
    right: calc(6px + env(safe-area-inset-right));
    top: calc(8px + env(safe-area-inset-top));
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end
}

.rw {
    display: flex;
    gap: 8px
}

.hb {
    pointer-events: auto;
    font: max(16px, calc(min(1vw, 1.7vh)*2.6)) Anton;
    color: #fff;
    border: 0;
    cursor: pointer;
    padding: 6px 18px;
    background: linear-gradient(#5a667c, #2b3340);
    clip-path: polygon(12% 0, 100% 0, 88% 100%, 0 100%)
}

.hb:hover {
    background: linear-gradient(#ffd23a, #7a5a00)
}

#bw {
    position: absolute;
    left: 50%;
    top: calc(10px + env(safe-area-inset-top));
    transform: translateX(-50%);
    width: min(34vw, 300px);
    height: 14px;
    border: 3px solid #fff;
    border-radius: 8px;
    background: #000;
    display: none;
    overflow: hidden
}

#bw i {
    display: block;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ff2a4a, #ffd23a)
}

#cb {
    position: absolute;
    left: 50%;
    top: 14%;
    transform: translateX(-50%);
    font: clamp(26px, 6vh, 54px) Anton;
    color: #ffd23a;
    text-shadow: 3px 3px 0 #000;
    opacity: 0
}

#cb.go {
    animation: pp .8s
}

#wl {
    position: absolute;
    left: calc(10px + env(safe-area-inset-left));
    bottom: calc(12px + env(safe-area-inset-bottom));
    font: max(15px, calc(min(1vw, 1.7vh)*2.4)) Anton;
    color: #ffd23a;
    text-shadow: 2px 2px 0 #000
}

#bomb {
    position: fixed;
    right: calc(14px + env(safe-area-inset-right));
    bottom: calc(14px + env(safe-area-inset-bottom));
    width: clamp(60px, 14vmin, 92px);
    height: clamp(60px, 14vmin, 92px);
    border-radius: 50%;
    border: 3px solid #ffd23a;
    background: rgba(255, 90, 30, .5);
    color: #fff;
    font: clamp(24px, 6vmin, 38px) Anton;
    display: none;
    z-index: 4;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    backdrop-filter: blur(4px);
    padding: 0;
    line-height: 1;
    touch-action: none
}

#bomb.on {
    display: flex
}

#bomb b {
    font-size: .5em
}

#bomb:active {
    transform: scale(.92)
}

#pop {
    position: fixed;
    left: 0;
    right: 0;
    top: 30%;
    text-align: center;
    pointer-events: none;
    z-index: 4;
    font-size: clamp(34px, 9vh, 78px);
    color: #ffd23a;
    text-shadow: 4px 4px 0 #000;
    -webkit-text-stroke: 3px #0a0a24;
    paint-order: stroke fill;
    opacity: 0
}

#pop.go {
    animation: pp 1.6s
}

.star {
    font-size: 62px;
    color: #333;
    display: inline-block
}

.star.on {
    color: #ffc928;
    text-shadow: 0 0 20px #ff9a00;
    animation: pop .6s both
}

#rot {
    display: none
}

@media(max-height:430px) {
    h1 {
        font-size: 44px;
        animation: none
    }

    .scr {
        gap: 6px
    }

    .btn {
        font-size: 20px;
        padding: 5px 22px;
        min-width: 170px
    }

    .box {
        padding: 12px 18px
    }

    p {
        font-size: 15px
    }

    h2 {
        font-size: 26px
    }

    .star {
        font-size: 40px
    }

    #menu {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        align-content: center
    }

    #menu>h1,
    #menu>.sub,
    #menu>p {
        flex-basis: 100%
    }

    .gk {
        width: 120px
    }
}

@keyframes fi {
    from {
        opacity: 0
    }
}

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

    70% {
        transform: scale(1.12)
    }

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

@keyframes bob {
    50% {
        transform: rotate(-1deg) translateY(-8px)
    }
}

@keyframes pp {
    0% {
        transform: translateX(-50%) scale(.4);
        opacity: 0
    }

    20% {
        transform: translateX(-50%) scale(1.1);
        opacity: 1
    }

    80% {
        opacity: 1
    }

    100% {
        transform: translateX(-50%) translateY(-30px);
        opacity: 0
    }
}

#pop.go {
    animation-name: pp2
}

@keyframes pp2 {
    0% {
        transform: scale(.4);
        opacity: 0
    }

    20% {
        transform: scale(1.1);
        opacity: 1
    }

    80% {
        opacity: 1
    }

    100% {
        transform: translateY(-40px);
        opacity: 0
    }
}

#hc {
    position: absolute;
    left: 50%;
    top: calc(8px + env(safe-area-inset-top));
    transform: translateX(-50%)
}

.mc {
    font: inherit;
    color: #fff;
    border: 3px solid #ffd23a;
    border-radius: 16px;
    padding: 16px 14px;
    width: clamp(150px, 40vw, 260px);
    background: linear-gradient(#0a2a24, #0a0a24);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 6px 0 #000;
    transition: .15s;
    animation: pop .4s both
}

.mc:hover {
    transform: translateY(-4px) rotate(-1deg);
    background: linear-gradient(#5a3418, #251208)
}

.mc b {
    font-size: 30px;
    color: #ffd23a
}

.mc span {
    font: 15px/1.3 Arial;
    letter-spacing: 0
}

.mc small {
    font: 18px Anton;
    color: #9aff6a
}

.gk canvas {
    background: #0a0a24;
    border-radius: 8px
}

#lv {
    letter-spacing: 4px
}

#hc {
    position: absolute;
    left: 50%;
    top: calc(8px + env(safe-area-inset-top));
    transform: translateX(-50%)
}

#dp {
    position: fixed;
    right: calc(14px + env(safe-area-inset-right));
    bottom: calc(14px + env(safe-area-inset-bottom));
    display: none;
    z-index: 3;
    width: clamp(150px, 34vmin, 210px);
    height: clamp(150px, 34vmin, 210px);
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 6px;
    touch-action: none
}

.touch #hud.on~#dp {
    display: grid
}

#dp button {
    border-radius: 14px;
    border: 3px solid #fff;
    background: rgba(0, 0, 0, .45);
    color: #fff;
    font: clamp(22px, 6vmin, 34px) Anton;
    backdrop-filter: blur(4px);
    touch-action: none;
    padding: 0
}

#dp button.p {
    background: rgba(255, 200, 60, .8)
}