:root {
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top,0px);
    padding-bottom: env(safe-area-inset-bottom,0px);
    --bg: #eaf6fb;
    --card: #fff;
    --tx: #14284b;
    --mut: #4a6285;
    --pri: #F0BF38;
    --ok: #058a4d;
    --bad: #d64545;
    --bd: #bfe3f2
}

@media (prefers-color-scheme:dark) {
    :root:not([data-theme="light"]) {
        --bg: #0c1f3d;
        --card: #13305c;
        --tx: #e9f3fb;
        --mut: #9dbbd8;
        --bd: #25508a
    }

}

:root[data-theme="dark"] {
    --bg: #0c1f3d;
    --card: #13305c;
    --tx: #e9f3fb;
    --mut: #9dbbd8;
    --bd: #25508a
}

html {
    scroll-padding-top: env(safe-area-inset-top,0px)
}

*,*:before,*:after {
    box-sizing: inherit
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--tx);
    font-family: system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
    line-height: 1.45
}

body: before {
    content: "";
    display: block;
    height: 12px;
    background: linear-gradient(90deg,#e63946 0 25%,#ffc300 25% 50%,#2fbf71 50% 75%,#2f6fdb 75%)
}

main {
    max-width: 560px;
    margin: 0 auto;
    padding: 16px
}

h1 {
    font-size: 1.6rem;
    margin: .2em 0
}

h2 {
    font-size: 1.2rem;
    margin: .2em 0
}

.card {
    background: var(--card);
    border: 3px solid var(--bd);
    border-radius: 16px;
    padding: 18px;
    margin: 12px 0;
    box-shadow: 0 6px 0 var(--bd)
}

.mut {
    color: var(--mut);
    font-size: .92rem
}

button {
    font: inherit;
    font-weight: 700;
    border: 0;
    border-radius: 12px;
    padding: 14px 12px;
    background: var(--pri);
    color: #1b2a4a;
    cursor: pointer;
    width: 100%;
    margin-top: 10px;
    box-shadow: 0 5px 0 rgba(0,0,0,.25);
    transition: transform .08s,opacity .2s
}

button: active {
    transform: translateY(4px);
    box-shadow: 0 1px 0 rgba(0,0,0,.25)
}

button: disabled {
    opacity: .55
}

button.alt {
    background: var(--card);
    color: var(--tx);
    border: 2px solid var(--bd)
}

input {
    font: inherit;
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 2px solid var(--bd);
    background: var(--card);
    color: var(--tx)
}

.hud {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 800
}

.stage {
    text-align: center;
    transition: border-color .25s
}

.win {
    height: 10px;
    background: var(--bd);
    border-radius: 8px;
    overflow: hidden
}

.win i {
    display: block;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg,#F0BF38,#03A160,#29B1DC,#1B53A1)
}

.pr {
    font-weight: 700;
    min-height: 4.4em;
    margin: 10px 0 0
}

.stim {
    font-size: 2.8rem;
    font-weight: 900;
    letter-spacing: 2px;
    min-height: 110px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-shadow: 0 3px 0 rgba(0,0,0,.18)
}

.opts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px
}

.opts button {
    margin: 0
}

#pz {
    background: #1B53A1;
    color: #fff;
    font-size: 1.05rem;
    padding: 18px
}

@keyframes inn {
    from {
        opacity: 0;
        transform: translateY(10px)
    }

    to {
        opacity: 1;
        transform: none
    }

}

.in {
    animation: inn .35s ease
}

@keyframes breathe {
    0% {
        transform: scale(.55)
    }

    40% {
        transform: scale(1.15)
    }

    100% {
        transform: scale(.55)
    }

}

.br {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: radial-gradient(circle,#b8f0d1,#2fbf71);
    animation: breathe 5s ease-in-out infinite
}

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

    30% {
        transform: scale(1.5)
    }

    100% {
        transform: scale(1)
    }

}

.hb {
    display: inline-block
}

.hb.b {
    animation: beat .4s
}

.cover {
    text-align: center;
    padding: 22px 12px 18px;
    margin: 6px 0 4px;
    border-radius: 20px;
    background: var(--card);
    border: 3px solid var(--bd);
    box-shadow: 0 6px 0 var(--bd)
}

.cover .ic {
    font-size: 3rem;
    line-height: 1
}

.kick {
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--mut);
    margin-top: 6px
}

.ttl {
    font-size: 2.4rem;
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: 1px;
    margin: .25em 0 0;
    text-transform: uppercase
}

.ttl span {
    display: block;
    animation: inn .5s both
}

.ttl span:nth-child(1) {
    color: #1B53A1
}

.ttl span:nth-child(2) {
    color: #0598C6;
    animation-delay: .1s
}

.ttl span:nth-child(3) {
    color: #03A160;
    animation-delay: .2s
}

.ttl span:nth-child(4) {
    color: #1B53A1;
    animation-delay: .3s
}

.ttl span:nth-child(5) {
    color: #098F94;
    animation-delay: .4s
}

.tbl {
    width: 100%;
    border-collapse: collapse
}

.tbl td {
    padding: 7px 4px;
    border-bottom: 1px solid var(--bd);
    vertical-align: top
}

.chips {
    display: flex;
    gap: 8px;
    margin: 10px 0
}

.chips i {
    flex: 1;
    height: 22px;
    border-radius: 8px;
    box-shadow: 0 3px 0 rgba(0,0,0,.25)
}

body: before {
    display: none
}

main[hidden] {
    display: none
}

.top {
    background: #1B53A1;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    font-weight: 800;
    letter-spacing: 1px;
    font-size: .8rem
}

.top span {
    font-weight: 700;
    color: #F0BF38;
    letter-spacing: 0
}

.hero {
    background: radial-gradient(circle at 8% 6%,#F0BF38 0,transparent 42%),radial-gradient(circle at 95% 42%,#29B1DC 0,transparent 52%),radial-gradient(circle at 30% 88%,#1B53A1 0,transparent 58%),radial-gradient(circle at 96% 98%,#03A160 0,transparent 40%),#098F94;
    color: #fff;
    border-radius: 20px;
    padding: 26px 16px;
    text-align: center;
    box-shadow: 0 6px 0 #12397a
}

.hero .ic {
    font-size: 3rem;
    line-height: 1
}

.hero p {
    color: #fff
}

.hero .kick {
    color: #cdeeed
}

.hero .ttl span {
    color: #fff
}

.gold {
    background: #F0BF38;
    color: #1b2a4a
}

label {
    display: block;
    margin-top: 10px;
    font-weight: 700;
    font-size: .92rem
}

select {
    font: inherit;
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 2px solid var(--bd);
    background: var(--card);
    color: var(--tx)
}

.act {
    display: grid;
    grid-template-columns: 44px 1fr;
    text-align: left;
    align-items: center;
    column-gap: 10px;
    background: var(--card);
    color: var(--tx);
    border: 2px solid var(--bd)
}

.act span {
    font-size: 1.8rem;
    grid-row: span 2
}

.act small {
    font-weight: 500;
    color: var(--mut)
}

.act.done {
    border-color: var(--ok)
}

.opts3 {
    display: grid;
    gap: 8px
}

.big {
    padding: 18px;
    font-size: 1.1rem
}

.tbar {
    height: 12px;
    background: var(--bd);
    border-radius: 8px;
    overflow: hidden;
    margin: 8px 0
}

.tbar i {
    display: block;
    height: 100%;
    background: #1B53A1;
    transition: width .3s
}

.row {
    padding: 8px 0;
    border-bottom: 1px solid var(--bd);
    font-size: .92rem
}

.cx {
    padding: 12px
}

.gr {
    display: grid;
    gap: 3px;
    margin: 10px 0
}

.lt {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: clamp(.7rem,3.6vw,1.1rem);
    background: var(--bg);
    border: 1px solid var(--bd);
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation
}

.lt.sel {
    background: var(--pri);
    color: #1b2a4a
}

.lt.fd {
    color: #1b2b2a;
    border-color: transparent
}

.wl {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0
}

.wd {
    padding: 4px 10px;
    border-radius: 999px;
    border: 2px solid var(--bd);
    font-weight: 700;
    font-size: .82rem
}

.wd.ok {
    text-decoration: line-through;
    background: var(--ok);
    color: #fff;
    border-color: var(--ok)
}

.hero .sub {
    display: inline-block;
    background: #fff;
    color: #1B53A1;
    font-size: 1.3rem;
    font-weight: 900;
    letter-spacing: 3px;
    border-radius: 999px;
    padding: 6px 20px;
    margin: 14px 0 10px
}

.rd {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.55;
    text-shadow: none
}

.fbk {
    background: var(--bg);
    border: 2px solid var(--bd);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 8px;
    font-weight: 700;
    text-align: left;
    line-height: 1.5
}

.def {
    margin: 10px 0;
    padding: 10px 12px;
    border-left: 4px solid #F0BF38;
    background: var(--bg);
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.55;
    text-align: left
}

.def b {
    display: block;
    margin-bottom: 2px
}

.hc {
    display: grid;
    grid-template-columns: 1fr auto;
    column-gap: 4px;
    align-items: center;
    text-align: left;
    padding: 20px 14px 16px
}

.hc .ttl {
    font-size: 2rem;
    text-align: left
}

.hc .mc {
    height: 235px;
    width: auto;
    filter: drop-shadow(0 4px 0 rgba(0,0,0,.18))
}

.hc #b1 {
    grid-column: 1/-1;
    margin-top: 12px
}

:root {
    --hf: "Outfit","Avenir Next","Segoe UI",system-ui,sans-serif
}

h1,h2,h3,.top,.hud,button {
    font-family: var(--hf)
}

.hc {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 28px 18px 24px
}

.hc .mc {
    height: 190px;
    width: auto;
    margin-bottom: 8px
}

.tt2 {
    margin: 10px 0 0;
    text-transform: uppercase;
    line-height: 1.2;
    font-weight: 300;
    font-size: 1rem;
    letter-spacing: .32em
}

.tt2 span {
    display: block;
    padding-left: .32em
}

.tt2 strong {
    display: block;
    font-weight: 700;
    font-size: clamp(1.9rem,9.5vw,2.7rem);
    letter-spacing: .1em;
    padding-left: .1em;
    margin-top: 6px
}

.hc .sub {
    display: flex;
    align-items: center;
    gap: 12px;
    background: none;
    color: #fff;
    font-family: var(--hf);
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .45em;
    padding: 0 0 0 .45em;
    margin: 18px 0 20px;
    border-radius: 0
}

.hc .sub:before,.hc .sub:after {
    content: "";
    height: 1px;
    width: 26px;
    background: rgba(255,255,255,.75)
}

.hc #b1 {
    width: auto;
    padding: 14px 34px;
    border-radius: 999px;
    margin-top: 0;
    font-weight: 600;
    letter-spacing: .04em
}

.cover {
    box-shadow: none
}

.cover .tt2 {
    color: var(--tx)
}

.cover .tt2 strong {
    color: #0598C6
}

#gamepad-status {
    color: #F0BF38;
    letter-spacing: 0
}

#gamepad-guide {
    display: none;
}

body.has-gamepad {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
}

body.has-gamepad #gamepad-guide {
    position: fixed;
    z-index: 20;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 14px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: var(--card);
    border-top: 2px solid var(--bd);
    color: var(--mut);
    font-size: .8rem;
    text-align: center;
}

:focus-visible {
    outline: 3px solid #098F94;
    outline-offset: 3px;
}

.lt:focus-visible {
    position: relative;
    z-index: 1;
}

.gamepad-toast,
.gamepad-dialog {
    position: fixed;
    z-index: 30;
    right: 16px;
    left: 16px;
    max-width: 520px;
    margin: 0 auto;
    border: 2px solid var(--bd);
    border-radius: 14px;
    background: var(--card);
    color: var(--tx);
    box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
}

.gamepad-toast {
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    padding: 14px 18px;
    font-weight: 700;
}

.gamepad-dialog {
    top: 50%;
    padding: 20px;
    transform: translateY(-50%);
}

.gamepad-dialog p {
    margin-top: 0;
}

.gamepad-dialog-actions {
    display: flex;
    gap: 12px;
}

.gamepad-dialog-actions button {
    margin-top: 4px;
}

@media (max-width: 420px) {
    body.has-gamepad {
        padding-bottom: calc(108px + env(safe-area-inset-bottom, 0px));
    }

    body.has-gamepad #gamepad-guide {
        gap: 4px 10px;
        font-size: .72rem;
    }
}
